From nobody Mon Feb 19 02:55:44 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdRxD3Zfsz5452G; Mon, 19 Feb 2024 02:55:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdRxD30jnz4lh4; Mon, 19 Feb 2024 02:55:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708311344; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=++YOmCAuDCYAZx0ZvR97DVmN29F/GPStyvGwPfjefN8=; b=u76L+oTmOwhuOU04XonKciQz6bQWxxaHz9Ukr37D1nvgmSG5k8XOP2XSXiw8dHEEfMX8Lp o3nAG/8s2Giae4Rxvh9RuFEjlJykDfVGiQfAIyuY4mIzLWc8qSPgp+Vay9pcC+cK+dawMu 8sq4lAC7DYk7IhjYWDGyFwUOspXcrup9Obf9U0iKKlDhJ+Ldmah4evDpDnzCBOn/SlplQQ SJgB4MudIq9da9uXLmeUkLr3+gp+EnkIAzulq/sGzuEnxuLl8GrH5e3BpIAuNyeuFjqFST 7XNu/ZnPebdhas7gwWc7xUF4bWvAWsuEOJafBm663/iOu7D6dHfe9lPg6PGD5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708311344; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=++YOmCAuDCYAZx0ZvR97DVmN29F/GPStyvGwPfjefN8=; b=ox79JZV2Q2J7yUxKwts97ofazqB18XqoDzI+drFxmRYZDFEkfrWXkwUXfG6/Rl0Q2GN6al +tAtgyrhila63RVzwCXTVxkyFWowehbuTJtZE2+y8EYwWaEzlsOcLD4AdlygCDwgqR57Rf +baehZtnq65cj7ZhUh8vtv9xjjwJpNxj+aLKuicjZz4CdkI8BlZ4OtsP0VwPt2/HyJvjAN vNwbXkaOium9O8YqAJixz57d/nAet4fpvX+t0zXCCsjJhEWltXZ/Pflr04RX3FmdhVMePc qIJADLVV6dFc9lSYDlbL2JUaxWj4gNxhFGAnuzkIjm2pfZZzMlnDjxmtoUZbcA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708311344; a=rsa-sha256; cv=none; b=gc3yLOO6zXIYo/159QD5xGPwdtTZ+TIFk7zC4Mmyvhntqb8uKH2m6ys+sdYNm7Or0VzZZj esmT1OAPoee6qBObCu/hmZIM7EHIGruu2H8Ye50ChThh6sLyd8UTeJnoDU7M4a9E5VHKSc O3F/E5qCnP3YGGYXiVlEAYNGl3qFOdJ0Ozx1Q3XFeMXOEg3cXJ0Dllbvzmw9v47pbZYJCL Gmj2dnOqA2+WBOi7OPcmRRZ2yPN+vvg/P2B0Ou9isePjcg9MTr3DjrImKtFMQmUxAS0JWB yMBho/JuZz+Q9jOGUbyxWaJWMBFXvlnjBNW6uh8DqCPll78t8FhPaUgfo+i6PQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdRxD22J2zH4b; Mon, 19 Feb 2024 02:55:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41J2ti9d089572; Mon, 19 Feb 2024 02:55:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J2ti42089569; Mon, 19 Feb 2024 02:55:44 GMT (envelope-from git) Date: Mon, 19 Feb 2024 02:55:44 GMT Message-Id: <202402190255.41J2ti42089569@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: fcb6cac22397 - stable/13 - if_re: Generate an address if there is none in the EEPROM List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: fcb6cac22397ecfc3fa9eaa9957a86a2fb639c8f Auto-Submitted: auto-generated The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=fcb6cac22397ecfc3fa9eaa9957a86a2fb639c8f commit fcb6cac22397ecfc3fa9eaa9957a86a2fb639c8f Author: Evgeni Golov AuthorDate: 2023-02-27 22:50:56 +0000 Commit: Warner Losh CommitDate: 2024-02-19 02:52:41 +0000 if_re: Generate an address if there is none in the EEPROM There exists hardware that has no ethernet address burned into the EEPROM. Loading if_re on such a HW brings the device up with '00:00:00:00:00:00' as the address, and that doesn't get you too far in a real network. PR: 262406 Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/670 Signed-off-by: Evgeni Golov Differential Revision: https://reviews.freebsd.org/D34485 (cherry picked from commit 55747938b5c4c913f742fd03189f0c660ced7bef) --- sys/dev/re/if_re.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/dev/re/if_re.c b/sys/dev/re/if_re.c index 0570f2574d37..95b43b5718cb 100644 --- a/sys/dev/re/if_re.c +++ b/sys/dev/re/if_re.c @@ -1678,6 +1678,11 @@ re_attach(device_t dev) goto fail; } + /* If address was not found, create one based on the hostid and name. */ + if (ETHER_IS_ZERO(eaddr)) { + ether_gen_addr(ifp, (struct ether_addr *)eaddr); + } + /* * Call MI attach routine. */ From nobody Mon Feb 19 03:41:48 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdSyN6PMbz58sxT; Mon, 19 Feb 2024 03:41:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdSyN4dVjz4s9C; Mon, 19 Feb 2024 03:41:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708314108; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YnCdkaJn+4vdsHgLmIC8bZW1+YQ6QSfA1srS6XO03gk=; b=PtVLUh3rQvlBvlBMgS8kaVa9M5NOgvg2CzSWjPrtxrqOySzG9HlkXLQBFZUZHO4Lgg06tJ NUCgfbY4vDuAMO/IkWXss3o+0FpEsacuh3Jkmxw3YbQdK9FuNI5wDRaoB1QN+FqDCBaiO4 5yPF2wc17Tj/wB8efRhoreEtJYmY96DAGQ/rOl5ScvB+CuHZ0yNsdmlyWccSCIBqryveyd YeNW9a7vMrNVjtq3aijY8SRMI9v2QhtS3zb6SwkoVNXM1rVfBp3+CPehHMvgcaXicOo3lV EEGf/s3yBn10v12608pA9EHHvFvB+Mm28NUHMz3IDF4RNNv4qtPKyclBD/7TXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708314108; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YnCdkaJn+4vdsHgLmIC8bZW1+YQ6QSfA1srS6XO03gk=; b=sAKY6jYOBvAhTsJw7BZ46Mx/7l6f9rxKHEDFk3wSMTgNHSt0acYnYfLR7zOjeQkeNeMCpq wxCQ0eiiz8r3/szIilaDGyETs3zUL4b2jC8oHNKe7lb7g7pHx2bLtCGP0ZunEv/7XnR9vZ 2wzmRy24mpgu60cK5cEExGQXJuV8wloYwkeBM3aWAgWJcL1AbrXaXNmrBhDVrTQECXSrbJ XNl1Vy5ZwAOsAlvFte5QffCJT0UNXn7JeyNuBBetrp4khCVzc/Zp1EVTqhnLwd6tUkC4Xw 6K/H+w8/8FyFGrvnFoFDSHnS8HHIfQzFm63D7UHljfnfGmpluC5ARmT7FA5JLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708314108; a=rsa-sha256; cv=none; b=yVBIXo1PYN5BfV0ziQHWmB4lVT+VWW7meNWLLzEd3MbLGYiizaFoFxyBra60ND/+TVAw0s kUXdrwANr22bqFiCfX8a2/t3IVlrnnmamfHB130GEMOnMovGxOYkRj07l/LddD6EpsYjuJ T/ss76q/g67mzPGRcxQKO3FC7Tfrxoc5TCPA+JjJfypsuYF1mGtE8jesJnzSu1xWOanQIM s3Sxi8lDqDoa9dALB8uNJn+ygNcbLHhuWiu8Vy+FTNNKrzQqpcsSDFl26uOC8AjwdJM2vn R9QduQG+U5INvo6lmkUg5DB1UNqcwMdzXLWnKaifxNdjZdz90pn68mIfkv7MoQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdSyN3MJ5zJVK; Mon, 19 Feb 2024 03:41:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41J3fmOA070983; Mon, 19 Feb 2024 03:41:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J3fmVE070980; Mon, 19 Feb 2024 03:41:48 GMT (envelope-from git) Date: Mon, 19 Feb 2024 03:41:48 GMT Message-Id: <202402190341.41J3fmVE070980@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: ddf5bf4319f6 - stable/13 - libbe: Avoid double printing cloning errors. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: ddf5bf4319f61ccbb7f9e843965df86ac60253df Auto-Submitted: auto-generated The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=ddf5bf4319f61ccbb7f9e843965df86ac60253df commit ddf5bf4319f61ccbb7f9e843965df86ac60253df Author: John Grafton AuthorDate: 2023-03-15 03:14:14 +0000 Commit: Warner Losh CommitDate: 2024-02-19 03:02:58 +0000 libbe: Avoid double printing cloning errors. be_clone calls be_clone_cb and both call set_error on the return error path. set_error prints the error resulting in a double print. be_clone_cb should just return the error code and allow be_clone to print it. PR: 265248 Reported by: Graham Perrin Reviewed by: imp, kevans Pull Request: https://github.com/freebsd/freebsd-src/pull/685 (cherry picked from commit 8e933d9c598ec847081c322e7ae9a46bf7897886) --- lib/libbe/be.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/libbe/be.c b/lib/libbe/be.c index cb8ff95c4e07..21dd168b2557 100644 --- a/lib/libbe/be.c +++ b/lib/libbe/be.c @@ -754,11 +754,11 @@ be_clone_cb(zfs_handle_t *ds, void *data) /* construct the boot environment path from the dataset we're cloning */ if (be_get_path(ldc, dspath, be_path, sizeof(be_path)) != BE_ERR_SUCCESS) - return (set_error(ldc->lbh, BE_ERR_UNKNOWN)); + return (BE_ERR_UNKNOWN); /* the dataset to be created (i.e. the boot environment) already exists */ if (zfs_dataset_exists(ldc->lbh->lzh, be_path, ZFS_TYPE_DATASET)) - return (set_error(ldc->lbh, BE_ERR_EXISTS)); + return (BE_ERR_EXISTS); /* no snapshot found for this dataset, silently skip it */ if (!zfs_dataset_exists(ldc->lbh->lzh, snap_path, ZFS_TYPE_SNAPSHOT)) @@ -766,7 +766,7 @@ be_clone_cb(zfs_handle_t *ds, void *data) if ((snap_hdl = zfs_open(ldc->lbh->lzh, snap_path, ZFS_TYPE_SNAPSHOT)) == NULL) - return (set_error(ldc->lbh, BE_ERR_ZFSOPEN)); + return (BE_ERR_ZFSOPEN); nvlist_alloc(&props, NV_UNIQUE_NAME, KM_SLEEP); nvlist_add_string(props, "canmount", "noauto"); @@ -779,7 +779,7 @@ be_clone_cb(zfs_handle_t *ds, void *data) return (-1); if ((err = zfs_clone(snap_hdl, be_path, props)) != 0) - return (set_error(ldc->lbh, BE_ERR_ZFSCLONE)); + return (BE_ERR_ZFSCLONE); nvlist_free(props); zfs_close(snap_hdl); @@ -790,7 +790,7 @@ be_clone_cb(zfs_handle_t *ds, void *data) ldc->depth--; } - return (set_error(ldc->lbh, err)); + return (err); } /* From nobody Mon Feb 19 03:45:56 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdT3851cXz58t3R; Mon, 19 Feb 2024 03:45:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdT384Zktz4sVZ; Mon, 19 Feb 2024 03:45:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708314356; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2tmWryoIB9XZze270LqIWce2oOf9C2gjOrACpvPxw5I=; b=PRtjt2EMzAbTQMvAsN49YP6+dSXnWKtRZRPe2e16JzKj+ry6OBT/+c7G3OSon6pQlgAXAh tsuSryK6zIaKKKtTVTJ8ybasDl4ew0PsfP38ODvPTDNm+bRXrHKXhF1sI6COgZfsqCF1Dg EaFzeuK5pYRBHdOmAgqpWGvdM1eH2G5AlPzbzor9CUCE60vpuB4lk4uwYQ9CgFYYe3LWsI ONgR/0VCTpqoczUfGmuVAfVyNG2+yGEgY8VbqM6fHspYxwHmQG1G6TDsRnMVyDJBhYBLio wvfzBDjgGZaP8SvDTkLu72/c/O1R9uqGr+nLaMSh2utP5z+1PuyM9wwTkCvFpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708314356; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2tmWryoIB9XZze270LqIWce2oOf9C2gjOrACpvPxw5I=; b=DbSlys0Bmr/NlR+9XwljaaOcb7vzgX7Zu0UO8RbuMn1ZUMdBYuzqUjSXpm/+Xeau9wtcSw xM4QAAR4aVpXdpclnT+VtJGXDNmv/VEigIw4DGY0VF3WU6MGny41AEz2HnFcOnvX47Ay6d tsDA1+d9yjvSK6qCQc94oORu01A+KgWw0GWsyPeI5UsOComqZo00g+UuDIkwhMYYFzy2pT tlU9ObRyJlzWRxkiKSVCvomiGeJPlyJstiO0VfuUOmSdtn9p06S/BIt9KmgFYSaXFq93Je MX+5ottdSW7jCIhFTtVJXA0TLvMncXJOpm7xyAMro+cnn+eyQ5UINzpnjdJF1Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708314356; a=rsa-sha256; cv=none; b=JM4qCX+h5paUCFoXfT5l8RwGivqPbhz1UikWgYiklRw2nJP8q3i+Sf2VtxAxh6wIvdTvmS fdz45rGUi7VAYYcmAD0HlNHkFoL5m4A3gyaMx4wUgm/sy7SxXGmgq4PbYXp6kS8j73wwqV E6Scz+ZTZqbkCn3Ykt1KfmFHDRo8ZPXBchKnmmBnkzOPbwvYRv1gYMCDaq49AItQ6Lc+ZI Ut3LJOTyVPrOqpRTrpBhbLZPsiMIhMa+KFAcWfOWISqfRhC5RWPD5ufNRhnt8AGK5Xkgre dVWQosazEfJ8+kfxnq5AtIrQEKxkOaZiRUKoqdzmLSNEUuzLL+/NRO9m/XZy5A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdT383fZQzJhR; Mon, 19 Feb 2024 03:45:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41J3juAQ076639; Mon, 19 Feb 2024 03:45:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J3ju6O076636; Mon, 19 Feb 2024 03:45:56 GMT (envelope-from git) Date: Mon, 19 Feb 2024 03:45:56 GMT Message-Id: <202402190345.41J3ju6O076636@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: d9b466296bdd - stable/13 - mvs: Eliminate unused variable. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: d9b466296bdd1aa3b25b0cb6f0f546af21e55c62 Auto-Submitted: auto-generated The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d9b466296bdd1aa3b25b0cb6f0f546af21e55c62 commit d9b466296bdd1aa3b25b0cb6f0f546af21e55c62 Author: Warner Losh AuthorDate: 2023-06-09 23:18:54 +0000 Commit: Warner Losh CommitDate: 2024-02-19 03:43:00 +0000 mvs: Eliminate unused variable. ccim is unused. Just remove it. PR: 271920 Sponsored by: Netflix (cherry picked from commit 17dce737e305891c88e2410469cd23d8cfad1ca3) --- sys/dev/mvs/mvs_soc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/dev/mvs/mvs_soc.c b/sys/dev/mvs/mvs_soc.c index 9ffc56911404..f499d241adfa 100644 --- a/sys/dev/mvs/mvs_soc.c +++ b/sys/dev/mvs/mvs_soc.c @@ -205,7 +205,7 @@ static int mvs_ctlr_setup(device_t dev) { struct mvs_controller *ctlr = device_get_softc(dev); - int ccc = ctlr->ccc, cccc = ctlr->cccc, ccim = 0; + int ccc = ctlr->ccc, cccc = ctlr->cccc; /* Mask chip interrupts */ ATA_OUTL(ctlr->r_mem, CHIP_SOC_MIM, 0x00000000); @@ -222,8 +222,6 @@ mvs_ctlr_setup(device_t dev) ccc *= 150; ATA_OUTL(ctlr->r_mem, HC_ICT, cccc); ATA_OUTL(ctlr->r_mem, HC_ITT, ccc); - if (ccc) - ccim |= IC_HC0_COAL_DONE; /* Enable chip interrupts */ ctlr->gmim = ((ccc ? IC_HC0_COAL_DONE : (IC_DONE_HC0 & CHIP_SOC_HC0_MASK(ctlr->channels))) | From nobody Mon Feb 19 04:48:49 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdVRj3xD4z59328; Mon, 19 Feb 2024 04:48:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdVRj2Sd7z50j3; Mon, 19 Feb 2024 04:48:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708318129; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qx28GCSWl9ZgY+CDBopJ2hmNR+vsv/+MjkzXOw2ZYQk=; b=v6l9mlrBkZ0it1DI057sTdwHri407C1eXy/SoWlHeoMOKutL8hrcbV3FZZH257bGn23k8p svfpuG+/7LPtNNdk92D+preATiHBfZBvhbQjM6nbcZwCXisgDoTnKcBp8Ba218c2W3w5bW W1Zthv15VqLuB9liCI+jpiQhxWsgynqPkPZIu3/xAxc32nBTlEbmP9mLJk7NG/Fiulfr1O jX5HtlJ7rCufM+YejU8CGe6CxOlEECKxfqZlI1TotoVnN6HZ1TD3AmT0ItVvnD4/UV7le/ Q1YgpairqkAinWbQnIw4RcxWNZqE+FMFCW+PWHdjfPwXWUV6m7ho0mhah1a9Mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708318129; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qx28GCSWl9ZgY+CDBopJ2hmNR+vsv/+MjkzXOw2ZYQk=; b=v18b33AyFmUN7nwlODhD16Wb+byFePSENAVCKBoLcjOyeguyTu4hfsWzVW2FEnx/EdApaP V8W3edxpPJDbzbOa0EtkkFBjuoYmDQKk0qekF6Ubi9J6XPMn5gQuzl/RD5yAh7kVgw1T3Y T+w/z8cwF6ve/FDT5nRJR9ZUkQW/+2kZBIY+tfqDkv1Rg+9aJvQ+GhI7iKlIiHcQJTGrrm wn39Wt03bBlN9aA8x+TiT6uLlpuNTLY0s7yCOq5Ru4Ft8q1awk3WPdycQqFayZD4JK53Ze 9jEerMLRfPw+IbrkQpw/lX8XNPuwPTU5k7cjpWI6DDU9BmxZi6n/whxOszzfHg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708318129; a=rsa-sha256; cv=none; b=YI+FHIigmp1ANpmW+uvK/jQTUdbOhREnC/sYmQtntkPD5NBTVsEamDUlvKjRj26WMXcyZh ASZzUWvd6ifBQfRynls24nuDB2BPCkjsoNz+4GRONyo3sg4iqBrMEShSAdyHuLqgVRSiI9 Ls67xrnroQhZBW+D+I8x4PeO4qL99qndBEg2Tr1W9rVN8WzfDxkKPm93g/XOoelqpgnqSY 0jIumzXLltThY5GCErMGdbOOYeQSwAXSAkRL1uE1ZdoVuiXV8KxR75NZBK6e7ZBscPxmLs oam/n7rlecRVjItsgkJ2yN4eXxAa3X0DvqBocEhThyRGgcnxRY66uSfJZai2fg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdVRj1Sg3zKqm; Mon, 19 Feb 2024 04:48:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41J4mnq6076856; Mon, 19 Feb 2024 04:48:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J4mnxS076853; Mon, 19 Feb 2024 04:48:49 GMT (envelope-from git) Date: Mon, 19 Feb 2024 04:48:49 GMT Message-Id: <202402190448.41J4mnxS076853@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: a51aee0a9828 - stable/14 - vtnet: Adjust for ethernet alignment. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: a51aee0a9828238ebdf2f55448d97f1f00acc5d4 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=a51aee0a9828238ebdf2f55448d97f1f00acc5d4 commit a51aee0a9828238ebdf2f55448d97f1f00acc5d4 Author: Warner Losh AuthorDate: 2024-01-29 05:08:55 +0000 Commit: Warner Losh CommitDate: 2024-02-19 04:47:16 +0000 vtnet: Adjust for ethernet alignment. If the header that we add to the packet's size is 0 % 4 and we're strictly aligning, then we need to adjust where we store the header so the packet that follows will have it's struct ip header properly aligned. We do this on allocation (and when we check the length of the mbufs in the lro_nomrg case). We can't just adjust the clustersz in the softc, because it's also used to allocate the mbufs and it needs to be the proper size for that. Since we otherwise use the size of the mbuf (or sometimes the smaller size of the received packet) to compute how much we can buffer, this ensures no overflows. The 2 byte adjustment also does not affect how many packets we can receive in the lro_nomrg case. PR: 271288 Sponsored by: Netflix Reviewed by: bryanv Differential Revision: https://reviews.freebsd.org/D43224 (cherry picked from commit 3be59adbb5a2ae7600d46432d3bc82286e507e95) --- sys/dev/virtio/network/if_vtnet.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c index f7ad385b3955..ab77205000d5 100644 --- a/sys/dev/virtio/network/if_vtnet.c +++ b/sys/dev/virtio/network/if_vtnet.c @@ -1543,6 +1543,15 @@ vtnet_rx_alloc_buf(struct vtnet_softc *sc, int nbufs, struct mbuf **m_tailp) } m->m_len = size; +#ifndef __NO_STRICT_ALIGNMENT + /* + * Need to offset the mbuf if the header we're going to add + * will misalign. + */ + if (sc->vtnet_hdr_size % 4 == 0) { + m_adj(m, ETHER_ALIGN); + } +#endif if (m_head != NULL) { m_tail->m_next = m; m_tail = m; @@ -1569,6 +1578,14 @@ vtnet_rxq_replace_lro_nomrg_buf(struct vtnet_rxq *rxq, struct mbuf *m0, sc = rxq->vtnrx_sc; clustersz = sc->vtnet_rx_clustersz; +#ifndef __NO_STRICT_ALIGNMENT + /* + * Need to offset the mbuf if the header we're going to add will + * misalign, account for that here. + */ + if (sc->vtnet_hdr_size % 4 == 0) + clustersz -= ETHER_ALIGN; +#endif m_prev = NULL; m_tail = NULL; @@ -1692,6 +1709,10 @@ vtnet_rxq_enqueue_buf(struct vtnet_rxq *rxq, struct mbuf *m) header_inlined = vtnet_modern(sc) || (sc->vtnet_flags & VTNET_FLAG_MRG_RXBUFS) != 0; /* TODO: ANY_LAYOUT */ + /* + * Note: The mbuf has been already adjusted when we allocate it if we + * have to do strict alignment. + */ if (header_inlined) error = sglist_append_mbuf(sg, m); else { From nobody Mon Feb 19 04:48:50 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdVRk56xVz5938W; Mon, 19 Feb 2024 04:48:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdVRk3BB9z50j4; Mon, 19 Feb 2024 04:48:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708318130; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aeodTCcglibBGb/Kdd3D6qgSbd++1KgMskWr+0/xHuM=; b=qCWoqUHO0W3Fim8enjBf5hmgV87ZceQ0S9gb0Eh7WqKW6pNrAnusKBCz0VrGsTcy+vfQyY rrJuVu3RhDJIJPa7/9uaeiir7qLAPmAMe8oLwt/j4d1/fIPyGlm+RVzOXAuF6cDY2JCOtz mac0e/i4PZPSUpnrJ7MQfd5AXcfTYsjorqokfifCbfpTQzNRo+n+vZAbZ7bxiljjLjwWAd 7Icwh8XAJi8cH0AoYn6NGH6SHS/TunP7f/HRVQxoNLrZU2uw1WcD6EdMXeiICI80yEDlzp vxjP7Q4bVTSEUdn+l2fPKxO0XYvW9Z5dyJ32+SOuiscWptI9vXRyDG6f1LmD/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708318130; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aeodTCcglibBGb/Kdd3D6qgSbd++1KgMskWr+0/xHuM=; b=Cl9Wk9xvMv51/NGEcrmFAq9qKJbizoebq8DzsP0LLMbyvVOaa1h7aVhw9Ayxi2LzptpYC4 Tyh3tF28noe+aX56bs8PlHjgzM8J5qOT1RvzTaDG/CJAezUzOXKKft5Ak9pxKAJKuqdyWn daOj8SGBweKCjXRFxSJPlkB/UM2m6F8JC2q0MtMbkqHm6Mi+s6TXM32PXhwBMUJJKr3qCR rydRDpMQ8FxBkkB8rbY3Jhore0qg1whooVU3McC8Cu/PPdjrRK8uVBOr3PGiuU7rXeKR/3 CR6ywVkMqQhMobuhtSXtvz20W0KnMaA3m2xuzBiEeYFy8hNrMWHCFXhKdPVEdg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708318130; a=rsa-sha256; cv=none; b=Q9awMX+Sf3ZMjM/YkqhopC8D1YcE0Hr9NujQdHbAdzyRJf0AZnGhbqJi/cj+3e1d5vS9uV kEGDhFpOrfZcyLa2upWTu0yT5zznxXmivClZSDM/DdkFYqm3MxvPoi89Z8djCgfUIa978N tLjPHzhIsR4N3EDoRV9iULc1CHXbbUjUwEaj+uPXErZio2LELegEqBF8NCHfavInvibfRU 84/IhTJQgWXbgq9sKm65hto7Yg6v8dJIr+Ni7hkiq2GTqC9G81BaoB+PjZIMt9TosgXEsX YHqTNNsVGEnzfDz3SpOBLFCzMnfJNeXjg2mf15QcvNtF6wa3hGyfxZGKjI2J6g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdVRk2F7DzLCG; Mon, 19 Feb 2024 04:48:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41J4moev076910; Mon, 19 Feb 2024 04:48:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J4moic076907; Mon, 19 Feb 2024 04:48:50 GMT (envelope-from git) Date: Mon, 19 Feb 2024 04:48:50 GMT Message-Id: <202402190448.41J4moic076907@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: 96e37f693694 - stable/14 - vtnet: Account for the padding when selecting allocation size List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 96e37f6936949c03cd4ab7c42fcefccae4001d9d Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=96e37f6936949c03cd4ab7c42fcefccae4001d9d commit 96e37f6936949c03cd4ab7c42fcefccae4001d9d Author: Warner Losh AuthorDate: 2024-02-05 05:43:39 +0000 Commit: Warner Losh CommitDate: 2024-02-19 04:47:16 +0000 vtnet: Account for the padding when selecting allocation size While we account for the padding in the length of the mbuf we use, we do not account for it when we 'guess' the size of the mbuf to allocate based in the MTU of the device. This leads to a situation where we might fail if the mtu is close to a bucket size (say 2018) such that the added padding would push us over the edge for a full-sized packet. mtu of 2018 is super rare (2016 and 2020 would both work), but fix it none-the-less. It's a shame we can't just set VTNET_RX_HEADER_PAD to 2 in this case. The 4 seems hard-coded somewhere I've not found documented (I think it's in the protocol given the comments about VIRTIO_F_ANY_LAYOUT). Sponsored by: Netflix Reviewed by: bz Differential Revision: https://reviews.freebsd.org/D43656 (cherry picked from commit d9e0e42627613b56abf0f8fa1ad601e5690d775c) --- sys/dev/virtio/network/if_vtnet.c | 9 +++++++++ sys/dev/virtio/network/if_vtnetvar.h | 8 +++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c index ab77205000d5..6694c655f3af 100644 --- a/sys/dev/virtio/network/if_vtnet.c +++ b/sys/dev/virtio/network/if_vtnet.c @@ -1232,6 +1232,15 @@ vtnet_rx_cluster_size(struct vtnet_softc *sc, int mtu) } else framesz = sizeof(struct vtnet_rx_header); framesz += sizeof(struct ether_vlan_header) + mtu; +#ifndef __NO_STRICT_ALIGNMENT + /* + * Account for the offsetting we'll do elsewhere so we allocate the + * right size for the mtu. + */ + if (sc->vtnet_hdr_size % 4 == 0) { + framesz += ETHER_ALIGN; + } +#endif if (framesz <= MCLBYTES) return (MCLBYTES); diff --git a/sys/dev/virtio/network/if_vtnetvar.h b/sys/dev/virtio/network/if_vtnetvar.h index 6c2e6e90107a..d690ad3bf63c 100644 --- a/sys/dev/virtio/network/if_vtnetvar.h +++ b/sys/dev/virtio/network/if_vtnetvar.h @@ -232,7 +232,13 @@ vtnet_software_lro(struct vtnet_softc *sc) */ #define VTNET_VLAN_FILTER_NWORDS (4096 / 32) -/* We depend on these being the same size (and same layout). */ +/* + * We depend on all of the hdr structures being even, and matching the standard + * length. As well, we depend on two being identally sized (with the same + * layout). + */ +CTASSERT(sizeof(struct virtio_net_hdr_v1) == 12); +CTASSERT(sizeof(struct virtio_net_hdr) == 10); CTASSERT(sizeof(struct virtio_net_hdr_mrg_rxbuf) == sizeof(struct virtio_net_hdr_v1)); From nobody Mon Feb 19 04:48:51 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdVRl6mkFz592r6; Mon, 19 Feb 2024 04:48:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdVRl47w4z50gP; Mon, 19 Feb 2024 04:48:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708318131; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rSt1qKTK682TzGjU9TUSpXfVefa0xT+ccWipXVdMqQM=; b=kvmnbq4u5GZsWNoRHog/HV53BcFbxxoeecMfbybr2PzyAT+fsUi3y9aLGfg7USBsmJyjSd 53xAJt7zBUAcEwo30FOlvt6YTSUV2sPAAqmSD2qGEdyUmvirfLGq0rtb6uiH4+r+o+dD/D IUpWStK0F6dqllUd+MTEjKXkxxh+0hKLSmEmbfr8IwFzYbGzo5e5ScXn7mtbVpacDWtYsU ynTiBQzWJwbNJE6AyOtuA2YL7aAMF0P3nk8BA48vx4dwpLRmisxRy8Hco8GF6pzxLfi2CK yp0gv38PmbUgmPgVfBwNg7wJo3kWOpVn6YdTatnv/XdsG1FWOL2axopHX7yXnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708318131; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rSt1qKTK682TzGjU9TUSpXfVefa0xT+ccWipXVdMqQM=; b=uTO6U/ppvJ1o7OX5EYm3IexpiakESe6LFuyyNYB5brzr3+OIlrlQeSFo1kpMRyxFvr/pIV mffLMigg4W6dH6C9Djiqulrk1WJOf0Xz4kQgxiOXDn3TxJDgEEURHv2JQxd+DISiAeab9i LTgRuDIahr0wFZWoD4xwBwY5DR+5ynI4wo9674MDyXnlmWDAhCNC6PC/AtiXnDgCFiiz0L tnlP6TzaQtwaR8Kpae8xBGVAkrWPUyENzF7WF6l+B92hi8RZEPiyhTYsv1iw5s+3ePWqdB t88p2on76BUJ60BNoo+YMUL9wN1I1YjSmRzzqJcm4rozmqYpiTLVfk6l6yqjmA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708318131; a=rsa-sha256; cv=none; b=SiHUoggN1OPx+YO5/iDCSoKjpYtpyprHbBzioFIbNggbr3G8vhWVW+xnKsraUYP9bkdBNo alFG95BeRrjpEJ+0QxvZV6SFe2aMftH+3pL8TNqm9PO+BqCUg1bZ3rfZmUXp9R0MypO31P I7fTL2gjxzu9sFLFsNeIhw/bgZrq8i12mPav4pcusexNzAkaUFyI/pO4Eo2yKJtqmNrzil oxhEe3HxaD7A6wUjrosEnSk3ca1Gpk2EaBc9PBB7TxucqAoGTW1wGTpMyRGCf9UOhDpvsd 8M5u/lRsZEBV1VlnQ4s0mg27UMewkLchyKMqfR1x4oJ1L2c4O8ECMA8p5JFepQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdVRl3DKFzKnK; Mon, 19 Feb 2024 04:48:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41J4mpEi076962; Mon, 19 Feb 2024 04:48:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J4mpXg076959; Mon, 19 Feb 2024 04:48:51 GMT (envelope-from git) Date: Mon, 19 Feb 2024 04:48:51 GMT Message-Id: <202402190448.41J4mpXg076959@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: a9600913b4db - stable/14 - vtnet: Avoid ifdefs based on __NO_STRICT_ALIGNMENT List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: a9600913b4dbf66fb257ea90702ea4705fb40362 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=a9600913b4dbf66fb257ea90702ea4705fb40362 commit a9600913b4dbf66fb257ea90702ea4705fb40362 Author: Warner Losh AuthorDate: 2024-02-05 05:43:49 +0000 Commit: Warner Losh CommitDate: 2024-02-19 04:47:16 +0000 vtnet: Avoid ifdefs based on __NO_STRICT_ALIGNMENT Some platforms require an adjustment of the ethernet hearders. Rather than make this be on __NO_STRICT_ALIGNMENT being defined, define VTNET_ETHER_ALIGN to be either 0 or ETHER_ALIGN (aka 2). Add a test to the if statements to only do them when != 0. This eliminates the #ifdef sprinkled in the code, still communicates the intent and gives the same compiled results. Sponsored by: Netflix Reviewed by: bz, bryanv Differential Revision: https://reviews.freebsd.org/D43654 (cherry picked from commit 0ea4b4084845bfeedc8c692e4d34252023b78cb3) --- sys/dev/virtio/network/if_vtnet.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c index 6694c655f3af..7d6411876b3d 100644 --- a/sys/dev/virtio/network/if_vtnet.c +++ b/sys/dev/virtio/network/if_vtnet.c @@ -90,6 +90,12 @@ #include #endif +#ifdef __NO_STRICT_ALIGNMENT +#define VTNET_ETHER_ALIGN 0 +#else /* Strict alignment */ +#define VTNET_ETHER_ALIGN ETHER_ALIGN +#endif + static int vtnet_modevent(module_t, int, void *); static int vtnet_probe(device_t); @@ -1232,15 +1238,13 @@ vtnet_rx_cluster_size(struct vtnet_softc *sc, int mtu) } else framesz = sizeof(struct vtnet_rx_header); framesz += sizeof(struct ether_vlan_header) + mtu; -#ifndef __NO_STRICT_ALIGNMENT /* * Account for the offsetting we'll do elsewhere so we allocate the * right size for the mtu. */ - if (sc->vtnet_hdr_size % 4 == 0) { - framesz += ETHER_ALIGN; + if (VTNET_ETHER_ALIGN != 0 && sc->vtnet_hdr_size % 4 == 0) { + framesz += VTNET_ETHER_ALIGN; } -#endif if (framesz <= MCLBYTES) return (MCLBYTES); @@ -1552,15 +1556,13 @@ vtnet_rx_alloc_buf(struct vtnet_softc *sc, int nbufs, struct mbuf **m_tailp) } m->m_len = size; -#ifndef __NO_STRICT_ALIGNMENT /* * Need to offset the mbuf if the header we're going to add * will misalign. */ - if (sc->vtnet_hdr_size % 4 == 0) { - m_adj(m, ETHER_ALIGN); + if (VTNET_ETHER_ALIGN != 0 && sc->vtnet_hdr_size % 4 == 0) { + m_adj(m, VTNET_ETHER_ALIGN); } -#endif if (m_head != NULL) { m_tail->m_next = m; m_tail = m; @@ -1587,14 +1589,12 @@ vtnet_rxq_replace_lro_nomrg_buf(struct vtnet_rxq *rxq, struct mbuf *m0, sc = rxq->vtnrx_sc; clustersz = sc->vtnet_rx_clustersz; -#ifndef __NO_STRICT_ALIGNMENT /* * Need to offset the mbuf if the header we're going to add will * misalign, account for that here. */ - if (sc->vtnet_hdr_size % 4 == 0) - clustersz -= ETHER_ALIGN; -#endif + if (VTNET_ETHER_ALIGN != 0 && sc->vtnet_hdr_size % 4 == 0) + clustersz -= VTNET_ETHER_ALIGN; m_prev = NULL; m_tail = NULL; From nobody Mon Feb 19 04:50:02 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdVT71K60z592tw; Mon, 19 Feb 2024 04:50:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdVT70bTbz51gB; Mon, 19 Feb 2024 04:50:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708318203; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y25yIVRSQbt3dpGHXW2y5zRwIXHU8owIpRbRSFY3YWc=; b=uPpLRuGkFBo82dBgBTCUA+oRZvJBI/VMzYeCge47iqNPovs7tTT6UnGXj2Im4eoy4+n8dw 7LxOfUT5UbgPGafJ9WTPbZUd9PAxhWa4Gt8/Z6aMF3k4Sn75sC4wTr77GlTyFqu7ZpG+QJ ZxgiyTK42W0XOLFgAX/2rp2MUxjfuOSWmnLbdf07Ha0LrL0ythzbIZ1ywGrjNjjuBpge/+ f8qXDEZZPu3tTiRNzmQj726ShPoT1ai+w3+9VeaAPFlHSl0xLXNK0Z2z3WZd/bG4bGC3h7 nzTpCGc4aIfwc5dcDutU6KMmAqLJf8YzNWQmtRxl9ZNnMOybpe3Hi8isMDBuYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708318203; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y25yIVRSQbt3dpGHXW2y5zRwIXHU8owIpRbRSFY3YWc=; b=nlpUTlzonlonroXKb3i6BEt+8YGvjYr7QGudX1KUQ1TmsP4b9w+pQthWKFisSceDUkTe+5 yrDK5nLHg8EbA+hnhgsDru6ITBXR0MUCPUOFYh2grNapRFJKqW0p/THd6kL/yT4MHsxO30 FF8gSbFFZBUbpTD7mv4Ydg4IPgXm+SLiYNBLQCFyZANOTQ2uchwzmmQbgA9grpscz5U4ue cE2AEka6Y3vxJWr+rB79mHpJcAsnsq2onyIN+TIEqN51zzr5uZDQZBJbILrgkMZmF28wM6 uiz/JZn0E2LxIZtYvOBAUVniALtsgMgDJjUnXZW4nmo0JLL1EQZuJsgPge3VUQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708318203; a=rsa-sha256; cv=none; b=SoNIIpnbhuxDKKOrRN8zWphWf4QAcjpeT+FvCYfM+aNu9zirdcD/5j0Iv0ysotR738oGgF EsKWslX9oanm2lb+TVdtlEA2JJvLgngYbVpNxt5tjyU4CRsYyHhS3ZNBIEHtQPtdjKgf/K yZ3ptekZMJYM7b7+Yoo5eT+ygaZ7h6GVado5XGhTeZ6QTlO8BrFNyQZNo7am8gKBZ81QF4 btI1uTcm/uaLTeNHrikAISD1JoC1xF+1lvpXzQhRs2PO30ro8Wr4N3cJyLr0u7p/GKuRun Pq7lINuLv7qQc8cCb05dhYpZe69dXlJ2a2+t7eQy85pzAOHsVTkSpSgAtf4BmA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdVT66mXlzKgn; Mon, 19 Feb 2024 04:50:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41J4o2k4079435; Mon, 19 Feb 2024 04:50:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J4o2Qi079431; Mon, 19 Feb 2024 04:50:02 GMT (envelope-from git) Date: Mon, 19 Feb 2024 04:50:02 GMT Message-Id: <202402190450.41J4o2Qi079431@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: 898e02d74074 - stable/13 - smartpqi: Drop spinlock before freeing memory List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 898e02d740741d13a8948cbad4e0d969a768fd30 Auto-Submitted: auto-generated The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=898e02d740741d13a8948cbad4e0d969a768fd30 commit 898e02d740741d13a8948cbad4e0d969a768fd30 Author: John F. Carr AuthorDate: 2023-10-19 03:02:42 +0000 Commit: Warner Losh CommitDate: 2024-02-19 04:07:04 +0000 smartpqi: Drop spinlock before freeing memory pqisrc_free_device frees the device softc with the os spinlock held. This causes crashes when devices are removed because the memory free might sleep (which is prohibited with spin locks held). Drop the spinlock before releasing the memory. MFC After: 2 days PR: 273289 Reviewed by: imp This is the alternate fix from the box. (this is not a cherry pick of b064a4c9eed5b1dd2a40fc4fd2cb7e738b681547) --- sys/dev/smartpqi/smartpqi_discovery.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/dev/smartpqi/smartpqi_discovery.c b/sys/dev/smartpqi/smartpqi_discovery.c index 48243d8fc882..08722a35b707 100644 --- a/sys/dev/smartpqi/smartpqi_discovery.c +++ b/sys/dev/smartpqi/smartpqi_discovery.c @@ -1460,10 +1460,9 @@ pqisrc_free_device(pqisrc_softstate_t * softs,pqi_scsi_dev_t *device) softs->device_list[device->target][device->lun] = NULL; - pqisrc_device_mem_free(softs, device); - OS_RELEASE_SPINLOCK(&softs->devlist_lock); + pqisrc_device_mem_free(softs, device); } /* Update the newly added devices to the device list */ From nobody Mon Feb 19 04:50:03 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdVT81qWTz59392; Mon, 19 Feb 2024 04:50:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdVT81PBsz51Xl; Mon, 19 Feb 2024 04:50:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708318204; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Drq4MoSuWuVGK9mzaVllbASm5nfNbTVa1Qr9E9T1f+0=; b=jDzKDi9bW7HChfdIADoXhil7wrsTYSWyNfwA1U9jD24Nhc/vf23PzLK8EYVAyr3LmD+dP/ BoDT8VF9gjlMWyt5Eky6aBbQBsu4FJH5PQvjv2ZW0DoFJqSLP36tQ9MWuk4qtvn5LRPASt xXaKjA7JYIBN2AlcfcVQP/qG+isX33yIJmTe8HVnnDZtrer3NXHMQG/pmW2rINS0J2Lly5 4Be/uGGO0osEnjvXgIPHRp2IsFEkt10N1P9KSy5AXVmNgrXercOAqG4qW09LE80AYkX4Qa 5/Y9l/tt96TngE6mmF3zl2P5bm5gFWU90/dG7efdsV/pA96Y+b2Y3Rq2nbLToQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708318204; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Drq4MoSuWuVGK9mzaVllbASm5nfNbTVa1Qr9E9T1f+0=; b=mCzw0fBcDGetAttEpQwSJ7/oyLlGT4oSQI4YORhRlIf7pIEozOl5yCCLZcborx9T3KsAl5 mwUkwgXueOwlBKnb/hiWpI+EbBRd5ouwESrcWAZMPYdkzmbOfhSiQntNQiF0r/EJ22AWRq NbtozCT3KVPawhxpZsDXxInLE58sfq6gI4NmvfmQIny+4f2ZlD2v8oTCBaTtH+XaLh4aeV ULz7o22fURBmgmIK4cOEEP6eQW4suTy3v2MicgbB2hLTxU4nR06Z/Ms/FGSQDNAEEYIsjA hf5xr844j2Y4qP1WICRrVdNbb8/qDlpNWrqvxZfHOzCu9EI/qHlCUN9NvbNeyw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708318204; a=rsa-sha256; cv=none; b=ydvNCnMWNtLPn3HuvQBJ82OFyCxNGoDdQ8hwSG1O4tSjgyU9C1elzOjka64Lz6yQ1JZOod fuEYRaCv0jwaWNhShzWecS9/4yTNDtWDJt9UfrSiRFNRJHeCDxeG4ct/VMorgv329+3/yO FIl2aKyzflt8N/B1BMEAdpfgBU5mc16TGrheO/maMAf0/kpQ29MRqaj6Xjk6FopHbjifcp KwR/J3xOISektSjO43ByeYKS9gYms7XM8MUxKSyeLgwZD5Sp/fJjN95GZME5mbUzLebLiL 0FLsEUv8YqSrGgpmcnLoVCC2eVMe7OGDG39A28D267BaCFIxR9U1kHW0hyltow== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdVT809hrzKnM; Mon, 19 Feb 2024 04:50:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41J4o3vt079710; Mon, 19 Feb 2024 04:50:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J4o36B079706; Mon, 19 Feb 2024 04:50:03 GMT (envelope-from git) Date: Mon, 19 Feb 2024 04:50:03 GMT Message-Id: <202402190450.41J4o36B079706@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: 778eb6e1f666 - stable/13 - vtnet: Adjust for ethernet alignment. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 778eb6e1f6668864a6eddd2f6f9bcc2aa26344f3 Auto-Submitted: auto-generated The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=778eb6e1f6668864a6eddd2f6f9bcc2aa26344f3 commit 778eb6e1f6668864a6eddd2f6f9bcc2aa26344f3 Author: Warner Losh AuthorDate: 2024-01-29 05:08:55 +0000 Commit: Warner Losh CommitDate: 2024-02-19 04:46:43 +0000 vtnet: Adjust for ethernet alignment. If the header that we add to the packet's size is 0 % 4 and we're strictly aligning, then we need to adjust where we store the header so the packet that follows will have it's struct ip header properly aligned. We do this on allocation (and when we check the length of the mbufs in the lro_nomrg case). We can't just adjust the clustersz in the softc, because it's also used to allocate the mbufs and it needs to be the proper size for that. Since we otherwise use the size of the mbuf (or sometimes the smaller size of the received packet) to compute how much we can buffer, this ensures no overflows. The 2 byte adjustment also does not affect how many packets we can receive in the lro_nomrg case. PR: 271288 Sponsored by: Netflix Reviewed by: bryanv Differential Revision: https://reviews.freebsd.org/D43224 (cherry picked from commit 3be59adbb5a2ae7600d46432d3bc82286e507e95) --- sys/dev/virtio/network/if_vtnet.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c index 9737e964a591..3945826f91a0 100644 --- a/sys/dev/virtio/network/if_vtnet.c +++ b/sys/dev/virtio/network/if_vtnet.c @@ -1545,6 +1545,15 @@ vtnet_rx_alloc_buf(struct vtnet_softc *sc, int nbufs, struct mbuf **m_tailp) } m->m_len = size; +#ifndef __NO_STRICT_ALIGNMENT + /* + * Need to offset the mbuf if the header we're going to add + * will misalign. + */ + if (sc->vtnet_hdr_size % 4 == 0) { + m_adj(m, ETHER_ALIGN); + } +#endif if (m_head != NULL) { m_tail->m_next = m; m_tail = m; @@ -1571,6 +1580,14 @@ vtnet_rxq_replace_lro_nomrg_buf(struct vtnet_rxq *rxq, struct mbuf *m0, sc = rxq->vtnrx_sc; clustersz = sc->vtnet_rx_clustersz; +#ifndef __NO_STRICT_ALIGNMENT + /* + * Need to offset the mbuf if the header we're going to add will + * misalign, account for that here. + */ + if (sc->vtnet_hdr_size % 4 == 0) + clustersz -= ETHER_ALIGN; +#endif m_prev = NULL; m_tail = NULL; @@ -1694,6 +1711,10 @@ vtnet_rxq_enqueue_buf(struct vtnet_rxq *rxq, struct mbuf *m) header_inlined = vtnet_modern(sc) || (sc->vtnet_flags & VTNET_FLAG_MRG_RXBUFS) != 0; /* TODO: ANY_LAYOUT */ + /* + * Note: The mbuf has been already adjusted when we allocate it if we + * have to do strict alignment. + */ if (header_inlined) error = sglist_append_mbuf(sg, m); else { From nobody Mon Feb 19 04:50:05 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdVT93b4zz592ty; Mon, 19 Feb 2024 04:50:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdVT91xZFz51b7; Mon, 19 Feb 2024 04:50:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708318205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RpDdJz2oJOvq6rS2WX+1zKveE/GgKpRSsF06O4aS2YY=; b=MAnlHc3POaM6+zVsXdgRhzpDTE7TJ/HzIWSxi8nbv40S11O7JtU0qLtMkftX37fhGZjWyV YrpTOz6n44uAHIDTLCQOlTr+pRmvDD/1Duyoa6mFAJx/fD73M0o3Ld/c5QZbCo6vo474LL Kbza/GHHFkcCB4CXlbK2s7OIBLv4EHLF8+8G8MagE2ipB0exEtMdcU7iHshHaXN+0+Z7ub l53cmRwKLM75XmjdGOl2GDjpTIsT9VazgEZYhJ6CUXvp/X0JFpSRQqjMOv8Bw9xq3gAbR9 xIBk+6wgGzNSzn8ivb52zvSSn+Ibl4tX3S43Fqr4J2dxwUJF88Q+jqMj5d2QQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708318205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RpDdJz2oJOvq6rS2WX+1zKveE/GgKpRSsF06O4aS2YY=; b=K33y5aPtCZtDknInAVlEK4skxJzbBDxOFF0R0UX0DsOzdJ1gdT1ChkXytz89s+J+RXp3TL vJi0CTClGk1BFBc00PzbK8UizC2AZk4eOut8qqMl2y5OuAelPayhmuoo9OZ7C4Y/sjPFlx c+t/qYT1FlWxSqSQ5UmTVMsuFvD6EQk0XJIf+wqeU/eLU6iIHPy8ZnkzcClHn6g6gm+o+H L/sEbqSK9/czM8B1LEBu8Wt1llGJOGYJl0M4y1aqKZRsnuBlTazSDP4ZFoClnyOdMso/H0 MxYnovhRzQfK/vEzezGYrIkqMhuDFG6B63AXH1YFxI+Qb+iC/plgFW7PaY3gDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708318205; a=rsa-sha256; cv=none; b=LRYiw9pctSotaeliJwDMSTBHDuk0XqdZ6HOgDaulZ7EoTxlsfjF5tpJeKv9CTVz9P+oUgb UTenXXdcM59GOpu8wEjYod+uG+VzmQBcLc3EmldiLuhKiXJPNPau/8hu5B+YWUZQalpIRQ eIsiNeiMCFgl/siZv5azMWa0T3nvi2s/Kfg/dgUqms/u5KnKPuNtiO97Oo1F0jMz2cAPcK B/8/XCWGHJuI5kdQOUb6sQW4z7YJ91sID73/EHPtbekhr6Ygxnqml5sahMceeRTv8nBBEi ZlO6+GIbVhfnZR4P6g2FBiwTX80D4Tj5u1mScgMFWjtWdiAIitiU3MtI0qNCvQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdVT90mbCzL8Y; Mon, 19 Feb 2024 04:50:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41J4o5QW080006; Mon, 19 Feb 2024 04:50:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J4o5YJ080002; Mon, 19 Feb 2024 04:50:05 GMT (envelope-from git) Date: Mon, 19 Feb 2024 04:50:05 GMT Message-Id: <202402190450.41J4o5YJ080002@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: 1dc264a126b1 - stable/13 - vtnet: Account for the padding when selecting allocation size List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 1dc264a126b13e0e20b13bbcd69451c5d4b63f7c Auto-Submitted: auto-generated The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=1dc264a126b13e0e20b13bbcd69451c5d4b63f7c commit 1dc264a126b13e0e20b13bbcd69451c5d4b63f7c Author: Warner Losh AuthorDate: 2024-02-05 05:43:39 +0000 Commit: Warner Losh CommitDate: 2024-02-19 04:46:43 +0000 vtnet: Account for the padding when selecting allocation size While we account for the padding in the length of the mbuf we use, we do not account for it when we 'guess' the size of the mbuf to allocate based in the MTU of the device. This leads to a situation where we might fail if the mtu is close to a bucket size (say 2018) such that the added padding would push us over the edge for a full-sized packet. mtu of 2018 is super rare (2016 and 2020 would both work), but fix it none-the-less. It's a shame we can't just set VTNET_RX_HEADER_PAD to 2 in this case. The 4 seems hard-coded somewhere I've not found documented (I think it's in the protocol given the comments about VIRTIO_F_ANY_LAYOUT). Sponsored by: Netflix Reviewed by: bz Differential Revision: https://reviews.freebsd.org/D43656 (cherry picked from commit d9e0e42627613b56abf0f8fa1ad601e5690d775c) --- sys/dev/virtio/network/if_vtnet.c | 9 +++++++++ sys/dev/virtio/network/if_vtnetvar.h | 8 +++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c index 3945826f91a0..ae35d658e1bb 100644 --- a/sys/dev/virtio/network/if_vtnet.c +++ b/sys/dev/virtio/network/if_vtnet.c @@ -1237,6 +1237,15 @@ vtnet_rx_cluster_size(struct vtnet_softc *sc, int mtu) } else framesz = sizeof(struct vtnet_rx_header); framesz += sizeof(struct ether_vlan_header) + mtu; +#ifndef __NO_STRICT_ALIGNMENT + /* + * Account for the offsetting we'll do elsewhere so we allocate the + * right size for the mtu. + */ + if (sc->vtnet_hdr_size % 4 == 0) { + framesz += ETHER_ALIGN; + } +#endif if (framesz <= MCLBYTES) return (MCLBYTES); diff --git a/sys/dev/virtio/network/if_vtnetvar.h b/sys/dev/virtio/network/if_vtnetvar.h index 318066421072..e4c1934dfc81 100644 --- a/sys/dev/virtio/network/if_vtnetvar.h +++ b/sys/dev/virtio/network/if_vtnetvar.h @@ -232,7 +232,13 @@ vtnet_software_lro(struct vtnet_softc *sc) */ #define VTNET_VLAN_FILTER_NWORDS (4096 / 32) -/* We depend on these being the same size (and same layout). */ +/* + * We depend on all of the hdr structures being even, and matching the standard + * length. As well, we depend on two being identally sized (with the same + * layout). + */ +CTASSERT(sizeof(struct virtio_net_hdr_v1) == 12); +CTASSERT(sizeof(struct virtio_net_hdr) == 10); CTASSERT(sizeof(struct virtio_net_hdr_mrg_rxbuf) == sizeof(struct virtio_net_hdr_v1)); From nobody Mon Feb 19 04:50:06 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdVTB3NPSz59394; Mon, 19 Feb 2024 04:50:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdVTB2Ggkz51bH; Mon, 19 Feb 2024 04:50:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708318206; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZGu8vupY8cSUrT6/S6ZfuRJwMhf2C0+Xr9ZXSe4adpY=; b=qe3A2Tk9rnwNoUpG2MQS4W64b7TyRuYx4mhjEtzndonAQ77kwLRdkNFoxqVkEg1DC6Hb12 UwJc34c81HiUQwKqXAbf1Ic1rI6gNcRFSn0nDHfoLvYimmJ14/kAvH/OX2FIK+NB2mTpBI F+vksgXRBc10FpsGsdviReUxkVoKqPWgju1zYwtX3WgEFNEhghI06a3d2NtXwLUH585F5O 2THkxiNkn8aQVx3wVtTeFZxGxG2BJ7m81M4yFN45XL1+u1f1LAJzlPjOVbaFe8xZ9Lgz8p aeb7cZ+XozsWtr3W+8/n2ofS7HE48IrcbMSTmjUdxoru6x4ggmrvSodMgJ6y4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708318206; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZGu8vupY8cSUrT6/S6ZfuRJwMhf2C0+Xr9ZXSe4adpY=; b=kqiyV9UMrVHZiXKyp28VUEZEWiLVdGGJnivIHvRyVxScFNHNcFRcr/2Ao++yQfqR0LIrwp l1PrLVlb6+HZ06Qqi+khKo9jenua+qex+VxcNHbCFiuUEdFAPWvMyCbQG3ehnhIDpE3MPs cRfT0NYaA/X5o1h/+btyczW32pIi7OZKDfe4b8Vxm0OHT+IJXSu6Flm0prvB5GMJJexqaw /gaOJeNZbbZmPytkIu8+v+X9DxOS9/5aroMlRISZ6k+q/06YVNk2HkxgLANTuWlkB8soMb cZzYoLWNzmu/rvDkO38rkdVpJuxPgNSU1Zqvbke4z/WHHIJUmE9PgwvBR+QynQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708318206; a=rsa-sha256; cv=none; b=BaX3L7NwYOMkOoYCjKx9H1+cyUOrIneFVUm5otOlWspjhSlO0QU2bXGTa45sI/4Hg+BcM9 B/tcW0XTKqATz520dnRKKDj311P9s9cp7lH69Uxz/vfnc7KefFt1ibV4Z+Y+vwLqhbeoyK W4Ro/A9YB3S5GFkvdyZcxRtBnAsI7prvVT/m/4AgXGBJA1X7U98Nf28LHhF+ystWhszUx7 wsHTpKT+kStTHr7TYXeqz4cN+UueiMQQ0/6/btSNSKi+SO6v7uh765jbIey344hJ5nembJ WA5Re/dmgh0mnn1AHKAxjvBuqZyWKbJBoBGGcyWZNbDcTjmfFoyCvUZ9D1lwPA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdVTB1MF7zLNk; Mon, 19 Feb 2024 04:50:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41J4o6og080288; Mon, 19 Feb 2024 04:50:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J4o6jD080283; Mon, 19 Feb 2024 04:50:06 GMT (envelope-from git) Date: Mon, 19 Feb 2024 04:50:06 GMT Message-Id: <202402190450.41J4o6jD080283@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: 9ae56ea964c8 - stable/13 - vtnet: Avoid ifdefs based on __NO_STRICT_ALIGNMENT List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 9ae56ea964c89284a998a501e6cf1b57d000d968 Auto-Submitted: auto-generated The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=9ae56ea964c89284a998a501e6cf1b57d000d968 commit 9ae56ea964c89284a998a501e6cf1b57d000d968 Author: Warner Losh AuthorDate: 2024-02-05 05:43:49 +0000 Commit: Warner Losh CommitDate: 2024-02-19 04:46:43 +0000 vtnet: Avoid ifdefs based on __NO_STRICT_ALIGNMENT Some platforms require an adjustment of the ethernet hearders. Rather than make this be on __NO_STRICT_ALIGNMENT being defined, define VTNET_ETHER_ALIGN to be either 0 or ETHER_ALIGN (aka 2). Add a test to the if statements to only do them when != 0. This eliminates the #ifdef sprinkled in the code, still communicates the intent and gives the same compiled results. Sponsored by: Netflix Reviewed by: bz, bryanv Differential Revision: https://reviews.freebsd.org/D43654 (cherry picked from commit 0ea4b4084845bfeedc8c692e4d34252023b78cb3) --- sys/dev/virtio/network/if_vtnet.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c index ae35d658e1bb..bd3816457cc2 100644 --- a/sys/dev/virtio/network/if_vtnet.c +++ b/sys/dev/virtio/network/if_vtnet.c @@ -89,6 +89,12 @@ #include #endif +#ifdef __NO_STRICT_ALIGNMENT +#define VTNET_ETHER_ALIGN 0 +#else /* Strict alignment */ +#define VTNET_ETHER_ALIGN ETHER_ALIGN +#endif + static int vtnet_modevent(module_t, int, void *); static int vtnet_probe(device_t); @@ -1237,15 +1243,13 @@ vtnet_rx_cluster_size(struct vtnet_softc *sc, int mtu) } else framesz = sizeof(struct vtnet_rx_header); framesz += sizeof(struct ether_vlan_header) + mtu; -#ifndef __NO_STRICT_ALIGNMENT /* * Account for the offsetting we'll do elsewhere so we allocate the * right size for the mtu. */ - if (sc->vtnet_hdr_size % 4 == 0) { - framesz += ETHER_ALIGN; + if (VTNET_ETHER_ALIGN != 0 && sc->vtnet_hdr_size % 4 == 0) { + framesz += VTNET_ETHER_ALIGN; } -#endif if (framesz <= MCLBYTES) return (MCLBYTES); @@ -1554,15 +1558,13 @@ vtnet_rx_alloc_buf(struct vtnet_softc *sc, int nbufs, struct mbuf **m_tailp) } m->m_len = size; -#ifndef __NO_STRICT_ALIGNMENT /* * Need to offset the mbuf if the header we're going to add * will misalign. */ - if (sc->vtnet_hdr_size % 4 == 0) { - m_adj(m, ETHER_ALIGN); + if (VTNET_ETHER_ALIGN != 0 && sc->vtnet_hdr_size % 4 == 0) { + m_adj(m, VTNET_ETHER_ALIGN); } -#endif if (m_head != NULL) { m_tail->m_next = m; m_tail = m; @@ -1589,14 +1591,12 @@ vtnet_rxq_replace_lro_nomrg_buf(struct vtnet_rxq *rxq, struct mbuf *m0, sc = rxq->vtnrx_sc; clustersz = sc->vtnet_rx_clustersz; -#ifndef __NO_STRICT_ALIGNMENT /* * Need to offset the mbuf if the header we're going to add will * misalign, account for that here. */ - if (sc->vtnet_hdr_size % 4 == 0) - clustersz -= ETHER_ALIGN; -#endif + if (VTNET_ETHER_ALIGN != 0 && sc->vtnet_hdr_size % 4 == 0) + clustersz -= VTNET_ETHER_ALIGN; m_prev = NULL; m_tail = NULL; From nobody Mon Feb 19 07:00:26 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdYMZ3gqqz59qR3; Mon, 19 Feb 2024 07:00:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdYMZ2sjhz43Pv; Mon, 19 Feb 2024 07:00:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708326026; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ws6iuvVlZAChpusuXfhIfTkJ4YQt4kHGOv06FG9CWeY=; b=kLrlhZAiWyKtNcqT13H9nyO4EID3s0jtSBnQ6NjVIte6h8DTbIYy5MioaCVhx1dEuoiw/B 5rUM9Makfun5TMDF8QJV4j/lDtasy+puhwT6GRF9a4P1rY8YJ+NfBxXaHenvBdrazxlnsP uj/uy5KuC/H5Ud2JTYLsDUtvAlKaaRmumxET1k2fRJHyYYexgmhR/wPSv39HyKVq0Ukf9b B1uPyqI//6uwbcqzcwczwWyhp6IDoH47SXqQ3iM+p3ZxoF7wFJnou87HpPzkTArU1nxx0v vCIrAh1rgNXGSdPRX4wjzLNTvbh2CqJ3p+N8/ndMIvvXi336YA1NxVMi9LNaUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708326026; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ws6iuvVlZAChpusuXfhIfTkJ4YQt4kHGOv06FG9CWeY=; b=FdHmE269khtOVGlC//V4Ffuo20+hiEJFy5Bc+KH3u9lpAf9HrI81Wxrl9rAkA8+CsrH+b2 ofbeAKqpznXG+wntdo5tErRnuvb2E/wv5CV/n1rZtI1YeelFy3iEtRiZAF3I7yXt21oxEe UxYF/xFIzglUTA88JByHU7VJ9lVBQJ4V+TiR5QYlosQ1c2EF08p2TsUK5BaX4sLGX+GGG6 qIaOCZkebZ6V8itwpznao+Wqm3jOhR/1gDq+evot7o9vGacpJmVVQZnZeoJkujI61iztnv Af+OCHAaDdWSgqwOSrb2bB5dChn86moGVE9u1eWIjLYGBFdoiO+GQGnajEEQKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708326026; a=rsa-sha256; cv=none; b=U+J6PzvFxePnXCmkRCaAmjOOhl48jcwGcsRs8o1V/MK9uB9lIQAoHhPOz6zddHk7vyCAut EANy2InW9cVikzjsTTHlUpA0cQeJq/4CtBkT/9sLoEq+FmQwDZZf2c44VIk82n6g28FvgX jS7y8VUEpiPIHLe21IhiZNOK+sSfdmDyGV5zB21ut3BLaEh0AZLu96TnCe5xxHYGRRSTiA D8CMjg42JhQhrviH6WiP+2MACrnlZZN6QYa+Qa9ZQKETOffM9MXMDuQN7Jj1SAcR3qsIdY lvDS8XgQDwldCGqY2uMa8j3amotXd4oKGrwlMEMP85+qTemYWV7rNS5lWTYs+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 4TdYMZ1wSmzPQl; Mon, 19 Feb 2024 07:00:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41J70Q0t006512; Mon, 19 Feb 2024 07:00:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J70QaH006509; Mon, 19 Feb 2024 07:00:26 GMT (envelope-from git) Date: Mon, 19 Feb 2024 07:00:26 GMT Message-Id: <202402190700.41J70QaH006509@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: da2e35b0ec99 - releng/13.3 - smartpqi: Drop spinlock before freeing memory List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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.3 X-Git-Reftype: branch X-Git-Commit: da2e35b0ec99e979963923ed6392b3e883f40eb2 Auto-Submitted: auto-generated The branch releng/13.3 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=da2e35b0ec99e979963923ed6392b3e883f40eb2 commit da2e35b0ec99e979963923ed6392b3e883f40eb2 Author: John F. Carr AuthorDate: 2023-10-19 03:02:42 +0000 Commit: Warner Losh CommitDate: 2024-02-19 06:59:36 +0000 smartpqi: Drop spinlock before freeing memory pqisrc_free_device frees the device softc with the os spinlock held. This causes crashes when devices are removed because the memory free might sleep (which is prohibited with spin locks held). Drop the spinlock before releasing the memory. MFC After: 2 days PR: 273289 Reviewed by: imp This is the alternate fix from the box. (this is not a cherry pick of b064a4c9eed5b1dd2a40fc4fd2cb7e738b681547) (cherry picked from commit 898e02d740741d13a8948cbad4e0d969a768fd30) Approved-by: re (cperciva) --- sys/dev/smartpqi/smartpqi_discovery.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/dev/smartpqi/smartpqi_discovery.c b/sys/dev/smartpqi/smartpqi_discovery.c index 48243d8fc882..08722a35b707 100644 --- a/sys/dev/smartpqi/smartpqi_discovery.c +++ b/sys/dev/smartpqi/smartpqi_discovery.c @@ -1460,10 +1460,9 @@ pqisrc_free_device(pqisrc_softstate_t * softs,pqi_scsi_dev_t *device) softs->device_list[device->target][device->lun] = NULL; - pqisrc_device_mem_free(softs, device); - OS_RELEASE_SPINLOCK(&softs->devlist_lock); + pqisrc_device_mem_free(softs, device); } /* Update the newly added devices to the device list */ From nobody Mon Feb 19 07:00:27 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdYMb43yvz59qR8; Mon, 19 Feb 2024 07:00:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdYMb3TY9z43Pw; Mon, 19 Feb 2024 07:00:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708326027; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=81eATZNTZn4tGaYz4Xb6754t/95rwCI2x/y7lwdhgpk=; b=Iwe7fTy7R8n/qugQ3BphH7PxWeeUne6sUjXIoBcyitbETW6m79Kol9IPpbE9AILYHaWDFG jCJR45fz8pQtMyebHb+sF8doQmmxh65URXVrmBZr6XBW4GUor7FrB+9bUWc+8YNVQk96LQ Jql/5aGLrxgqYrtVVrbxGTZ7VRugtvtemZvZX+ogFc6GZ+VfsDUQwd3ScOMCqZKWncdY7V xlTQuljWuhCxpC6ebnNg3r0HqvHkwMOSoF1GzHa3n4InUespKt6ZS+2lXbcStmWHQt8nSy AjALjTNr4WkLbALqIMjlKEUsAbBSBaONgyEMk5RybHYi8Foidc3KYK9TkLsZsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708326027; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=81eATZNTZn4tGaYz4Xb6754t/95rwCI2x/y7lwdhgpk=; b=FLH5ad+l+eneMbvGYyBrA9Jzs0JAP3mzqZWTHjKnR1gWHRgTw3+Ond2EDow63e/TQJSdqC Mh9h7O1hHSO3IrrRzGvj+L7YEA1tqHhULj7fiGWB6nZKRPMaLku6FdoPp/L3uK9VPLVryb kMuxqvdxdonPkgwg4PD9yqiYW79BiauOi47WrJp9THAduI/xpEy5j36Dewd6wUlpOqCtRv px/1OPLP94JdYtIBG3/M6PTNlz5TT8TnwSR+iUfNupshvwd27KNr3P3ueVHvkuHPlZ3iyR 53B2Jnqy0oJQzqdGVsri0VOk7MLeyvJYac8tLdrg0xkmw6i4XyUltGaNP7OGCg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708326027; a=rsa-sha256; cv=none; b=fZIxOOGk+Vxwm7wo8Dz11PlL9WcOGeLF6zJnF7+5aYqrBMh87zs73vtyd4hIJTpwu4dfE4 Eia/OBozta/8req/9kmtZ4yrJgzvUSW2rCbUhahSXppl3vS2l6HnFIbkxHEubsq4xvpAYF +8VLSZIIbJvE52Aa997U1bOY1WaWhhoc2wPsu0LywDDQ4x9IpdpymNiSmEna/7QhNmVKWN UpyDkzpPn0G8k03M47Tf1MFX9WGFKSD9CoMX/XqqfRnZjRy+BDomcdo/4KXRVGisEtFIxS smbNwZM4vsO5u/Oie0dwzy6CiPeTrEoIqy9qbZ8iwlgqWCp2E03TQCHTitKPpw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdYMb2YdpzPQm; Mon, 19 Feb 2024 07:00:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41J70Reo006554; Mon, 19 Feb 2024 07:00:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J70R7o006551; Mon, 19 Feb 2024 07:00:27 GMT (envelope-from git) Date: Mon, 19 Feb 2024 07:00:27 GMT Message-Id: <202402190700.41J70R7o006551@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: fbbfcab6b850 - releng/13.3 - vtnet: Adjust for ethernet alignment. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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.3 X-Git-Reftype: branch X-Git-Commit: fbbfcab6b850fd0125633cc87575b54f0929c1a8 Auto-Submitted: auto-generated The branch releng/13.3 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=fbbfcab6b850fd0125633cc87575b54f0929c1a8 commit fbbfcab6b850fd0125633cc87575b54f0929c1a8 Author: Warner Losh AuthorDate: 2024-01-29 05:08:55 +0000 Commit: Warner Losh CommitDate: 2024-02-19 06:59:40 +0000 vtnet: Adjust for ethernet alignment. If the header that we add to the packet's size is 0 % 4 and we're strictly aligning, then we need to adjust where we store the header so the packet that follows will have it's struct ip header properly aligned. We do this on allocation (and when we check the length of the mbufs in the lro_nomrg case). We can't just adjust the clustersz in the softc, because it's also used to allocate the mbufs and it needs to be the proper size for that. Since we otherwise use the size of the mbuf (or sometimes the smaller size of the received packet) to compute how much we can buffer, this ensures no overflows. The 2 byte adjustment also does not affect how many packets we can receive in the lro_nomrg case. PR: 271288 Sponsored by: Netflix Reviewed by: bryanv Differential Revision: https://reviews.freebsd.org/D43224 (cherry picked from commit 3be59adbb5a2ae7600d46432d3bc82286e507e95) (cherry picked from commit 778eb6e1f6668864a6eddd2f6f9bcc2aa26344f3) Approved-by: re (cperciva) --- sys/dev/virtio/network/if_vtnet.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c index 9737e964a591..3945826f91a0 100644 --- a/sys/dev/virtio/network/if_vtnet.c +++ b/sys/dev/virtio/network/if_vtnet.c @@ -1545,6 +1545,15 @@ vtnet_rx_alloc_buf(struct vtnet_softc *sc, int nbufs, struct mbuf **m_tailp) } m->m_len = size; +#ifndef __NO_STRICT_ALIGNMENT + /* + * Need to offset the mbuf if the header we're going to add + * will misalign. + */ + if (sc->vtnet_hdr_size % 4 == 0) { + m_adj(m, ETHER_ALIGN); + } +#endif if (m_head != NULL) { m_tail->m_next = m; m_tail = m; @@ -1571,6 +1580,14 @@ vtnet_rxq_replace_lro_nomrg_buf(struct vtnet_rxq *rxq, struct mbuf *m0, sc = rxq->vtnrx_sc; clustersz = sc->vtnet_rx_clustersz; +#ifndef __NO_STRICT_ALIGNMENT + /* + * Need to offset the mbuf if the header we're going to add will + * misalign, account for that here. + */ + if (sc->vtnet_hdr_size % 4 == 0) + clustersz -= ETHER_ALIGN; +#endif m_prev = NULL; m_tail = NULL; @@ -1694,6 +1711,10 @@ vtnet_rxq_enqueue_buf(struct vtnet_rxq *rxq, struct mbuf *m) header_inlined = vtnet_modern(sc) || (sc->vtnet_flags & VTNET_FLAG_MRG_RXBUFS) != 0; /* TODO: ANY_LAYOUT */ + /* + * Note: The mbuf has been already adjusted when we allocate it if we + * have to do strict alignment. + */ if (header_inlined) error = sglist_append_mbuf(sg, m); else { From nobody Mon Feb 19 07:00:28 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdYMc6KKzz59qSV; Mon, 19 Feb 2024 07:00:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdYMc4Xhxz43Q6; Mon, 19 Feb 2024 07:00:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708326028; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cgZHsEYClGwcTcEHN8iZhbYynWSzpEy7aLKt+dOMNpU=; b=k5KjodTJu6pz8iJIz1FHC3LNMJ/jAuQzw9AQVI/2jqA9m/qZ8z8t0rzDZmh/nXsn0Ew87F ZSkl7+5/zNrqe5PSGbEQg9kvjZLoTttu6IIAU5za3GKpZ6MG49n1Lq1hKMRlgkwqy7v1s0 1wDBUe5ci31Id5DsAPm6RrTo01rhoZTo8x15vReK8PiD5OdVhtLt+rIw1QU+h2HH1U8VkB 5E4VBsPNsqikVTqwYqgxb6a/ix8a+xxqnCuyHtMaFyAXSk77i9DNlu83/iZf09FUJ09Kag NVZMHAZQlheZnUsG9G84fcmc+hx8oZL7v2QZTmmMphvLRI6AqY99TjpnCT+32g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708326028; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cgZHsEYClGwcTcEHN8iZhbYynWSzpEy7aLKt+dOMNpU=; b=IzkmHcbeE2XmbyM+5mX/hraf+hFLUONj0O0Na6e5ZDRhB95slomaSnl7KE5iyNUv5b1bR0 V8M+W39yfhOq81YrsGGxbTfR9lJNIMN/fap1TlGb2nEj5rXcYYk4tFThws6mNz60GoQkvk mZGKMQub3sOikyZlUEWuuNZnxhBlqfh6caM8Yn2voOQH72nOraWsf9l4Hep+F7w5bJse+f 9Tvgr/XXRghiu7Ft5t7JwSIoPDxei6r6qildG67sjg0cwZmDGqtkQAIf2opJEzJKH3lyTG KOE39ckNjxLpK0gi1QwAneq3Ob/V9a9yDcWbYJ4mILdZDVmlJKpBMID87P2gjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708326028; a=rsa-sha256; cv=none; b=iDvPEcmJHpzTp6k/4k2rKndIx4mNle3CT/cdaLQlARWF5iaR9uXLiAHGybwM/A2qNmmwtx GJ2v+ZYzjbLnzscq1boqV3i5XMoQEHc5q1EkqMOOqJKRG86Hp5Khfi2KNqpm3rFxXaTMcW L+4ZLmB5/mYThvBBZL7Djxt89znfeU0f1uQewV7znyxaMsSDQ1NEoMNpSTTDy1Dz+1JbUY 4X/SSWPb7k4+QMVD+JuO2J59x1jU50jj50632L7IB3cWZBF8d9BCmyRUpf+LCQoXc4TXSM rD3DINzRUpJEwXeYSXm9a8ru4hElIWIkHaJmoqEzziEtaXkrlLxQvYLNHCboaw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdYMc3bcVzPSN; Mon, 19 Feb 2024 07:00:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41J70SB0006608; Mon, 19 Feb 2024 07:00:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J70S62006605; Mon, 19 Feb 2024 07:00:28 GMT (envelope-from git) Date: Mon, 19 Feb 2024 07:00:28 GMT Message-Id: <202402190700.41J70S62006605@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: 67aff34d9ad0 - releng/13.3 - vtnet: Account for the padding when selecting allocation size List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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.3 X-Git-Reftype: branch X-Git-Commit: 67aff34d9ad00761b2e2b1197c4bc1e856bb6959 Auto-Submitted: auto-generated The branch releng/13.3 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=67aff34d9ad00761b2e2b1197c4bc1e856bb6959 commit 67aff34d9ad00761b2e2b1197c4bc1e856bb6959 Author: Warner Losh AuthorDate: 2024-02-05 05:43:39 +0000 Commit: Warner Losh CommitDate: 2024-02-19 06:59:46 +0000 vtnet: Account for the padding when selecting allocation size While we account for the padding in the length of the mbuf we use, we do not account for it when we 'guess' the size of the mbuf to allocate based in the MTU of the device. This leads to a situation where we might fail if the mtu is close to a bucket size (say 2018) such that the added padding would push us over the edge for a full-sized packet. mtu of 2018 is super rare (2016 and 2020 would both work), but fix it none-the-less. It's a shame we can't just set VTNET_RX_HEADER_PAD to 2 in this case. The 4 seems hard-coded somewhere I've not found documented (I think it's in the protocol given the comments about VIRTIO_F_ANY_LAYOUT). Sponsored by: Netflix Reviewed by: bz Differential Revision: https://reviews.freebsd.org/D43656 (cherry picked from commit d9e0e42627613b56abf0f8fa1ad601e5690d775c) (cherry picked from commit 1dc264a126b13e0e20b13bbcd69451c5d4b63f7c) Approved-by: re (cperciva) --- sys/dev/virtio/network/if_vtnet.c | 9 +++++++++ sys/dev/virtio/network/if_vtnetvar.h | 8 +++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c index 3945826f91a0..ae35d658e1bb 100644 --- a/sys/dev/virtio/network/if_vtnet.c +++ b/sys/dev/virtio/network/if_vtnet.c @@ -1237,6 +1237,15 @@ vtnet_rx_cluster_size(struct vtnet_softc *sc, int mtu) } else framesz = sizeof(struct vtnet_rx_header); framesz += sizeof(struct ether_vlan_header) + mtu; +#ifndef __NO_STRICT_ALIGNMENT + /* + * Account for the offsetting we'll do elsewhere so we allocate the + * right size for the mtu. + */ + if (sc->vtnet_hdr_size % 4 == 0) { + framesz += ETHER_ALIGN; + } +#endif if (framesz <= MCLBYTES) return (MCLBYTES); diff --git a/sys/dev/virtio/network/if_vtnetvar.h b/sys/dev/virtio/network/if_vtnetvar.h index 318066421072..e4c1934dfc81 100644 --- a/sys/dev/virtio/network/if_vtnetvar.h +++ b/sys/dev/virtio/network/if_vtnetvar.h @@ -232,7 +232,13 @@ vtnet_software_lro(struct vtnet_softc *sc) */ #define VTNET_VLAN_FILTER_NWORDS (4096 / 32) -/* We depend on these being the same size (and same layout). */ +/* + * We depend on all of the hdr structures being even, and matching the standard + * length. As well, we depend on two being identally sized (with the same + * layout). + */ +CTASSERT(sizeof(struct virtio_net_hdr_v1) == 12); +CTASSERT(sizeof(struct virtio_net_hdr) == 10); CTASSERT(sizeof(struct virtio_net_hdr_mrg_rxbuf) == sizeof(struct virtio_net_hdr_v1)); From nobody Mon Feb 19 07:00:29 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdYMf0g81z59qYf; Mon, 19 Feb 2024 07:00:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdYMd5Y1Pz43JJ; Mon, 19 Feb 2024 07:00:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708326029; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cP9JQTfMijvm+rgY3JB1WfB2TGeA6gzw8VMOAbUZqZs=; b=L38QCJ+uioHAzkbml6RV1S9H8qK75bGuXQEm+gfjWedFIGcrxB8aXZGtvYFiCHKNCqhA+0 1J7bG3eSpvcaestbfwlKxrZx3m+vJRsUk/dbWoDvVdV0xaeR+wtLpVIkhc8Qf+ZK4WMcAo L0D1HW5+q15PGah8HmepQayOLqztkSpYRA5fjtnwBnALYP9fx8kD1pVYMLbzRwQ1MA4hmT qnDjhMwcDRF7artVDr9rNXoj3TgGualkb2d+pnmpHNNiKH6SRmQp7ufDPLB1AlDD1rBt7K 0sDZNqnioCXv5kS8pLc3Aroo3J7zIAED0oF6O02sFp8aFJjio5U7l5ptDWAZTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708326029; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cP9JQTfMijvm+rgY3JB1WfB2TGeA6gzw8VMOAbUZqZs=; b=DmJx67mDKHOmZ70UVqlV5LqQFFYPjTjNsOjujYWqSZwTFih6VAXqEPvni2BkWEd9jXr+Zp w4nXq4pEkEi9hvpoBzr5QAge27918aynAlKGAbYLI+xaXpOR1VdJimeRVWx/PfW501k8Su aFET57l5dk6ZSJ0SuEawAHx/Hl15e1gqGjB98M7vYuFT/3zRNiXsZloumWgXlrOFHLpnLU 2udt70hMzJzOLV8juYUK3jFdEFYOrDTmAZBoO9m/eweXXXPXSUO/3+BQdlyh3Ebn0lEFfR 2yUdl5AMSDA9ERBmo6dVUbTpYKCi31aPtcCVnjPwyqpdRpBHGccuB854z9YZTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708326029; a=rsa-sha256; cv=none; b=qzOWS/TWyaqrOMeqlPLgjmsfEZjldiqfJPt20dg6N/UPbaCdjlnE5GdRqgxQWnOcFMqg7Q n45ixJtspNBcsiCNdoo+07lG3FztjQ2gHGs9xobTCyTIeoxhsNpOJxaT4ReYA5XR6Tqjw/ 9vqKCb8XhcJke4DLRrlhOpfnRRIVzDmbquEI+ROmSWpKoxnYtYMkN9JU5qLUl3XVBDSo5H W9zEn7Yzt3sQuRe4M1f0OCqxWkhqrS17YmWQJefL9wN5GjXO3OvXS+agTyiqImBIZAFSf7 4Do5it+W2RGtjL3ZMwWtrgl7cM+cxs9hb6p+oLR90kYht5U6yn1geIfRapgq4w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdYMd4bWVzPjb; Mon, 19 Feb 2024 07:00:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41J70TW7006660; Mon, 19 Feb 2024 07:00:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J70TFJ006658; Mon, 19 Feb 2024 07:00:29 GMT (envelope-from git) Date: Mon, 19 Feb 2024 07:00:29 GMT Message-Id: <202402190700.41J70TFJ006658@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: 7c51748a443f - releng/13.3 - vtnet: Avoid ifdefs based on __NO_STRICT_ALIGNMENT List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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.3 X-Git-Reftype: branch X-Git-Commit: 7c51748a443fb1259f68ac2df134b294441b2add Auto-Submitted: auto-generated The branch releng/13.3 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=7c51748a443fb1259f68ac2df134b294441b2add commit 7c51748a443fb1259f68ac2df134b294441b2add Author: Warner Losh AuthorDate: 2024-02-05 05:43:49 +0000 Commit: Warner Losh CommitDate: 2024-02-19 06:59:51 +0000 vtnet: Avoid ifdefs based on __NO_STRICT_ALIGNMENT Some platforms require an adjustment of the ethernet hearders. Rather than make this be on __NO_STRICT_ALIGNMENT being defined, define VTNET_ETHER_ALIGN to be either 0 or ETHER_ALIGN (aka 2). Add a test to the if statements to only do them when != 0. This eliminates the #ifdef sprinkled in the code, still communicates the intent and gives the same compiled results. Sponsored by: Netflix Reviewed by: bz, bryanv Differential Revision: https://reviews.freebsd.org/D43654 (cherry picked from commit 0ea4b4084845bfeedc8c692e4d34252023b78cb3) (cherry picked from commit 9ae56ea964c89284a998a501e6cf1b57d000d968) Approved-by: re (cperciva) --- sys/dev/virtio/network/if_vtnet.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c index ae35d658e1bb..bd3816457cc2 100644 --- a/sys/dev/virtio/network/if_vtnet.c +++ b/sys/dev/virtio/network/if_vtnet.c @@ -89,6 +89,12 @@ #include #endif +#ifdef __NO_STRICT_ALIGNMENT +#define VTNET_ETHER_ALIGN 0 +#else /* Strict alignment */ +#define VTNET_ETHER_ALIGN ETHER_ALIGN +#endif + static int vtnet_modevent(module_t, int, void *); static int vtnet_probe(device_t); @@ -1237,15 +1243,13 @@ vtnet_rx_cluster_size(struct vtnet_softc *sc, int mtu) } else framesz = sizeof(struct vtnet_rx_header); framesz += sizeof(struct ether_vlan_header) + mtu; -#ifndef __NO_STRICT_ALIGNMENT /* * Account for the offsetting we'll do elsewhere so we allocate the * right size for the mtu. */ - if (sc->vtnet_hdr_size % 4 == 0) { - framesz += ETHER_ALIGN; + if (VTNET_ETHER_ALIGN != 0 && sc->vtnet_hdr_size % 4 == 0) { + framesz += VTNET_ETHER_ALIGN; } -#endif if (framesz <= MCLBYTES) return (MCLBYTES); @@ -1554,15 +1558,13 @@ vtnet_rx_alloc_buf(struct vtnet_softc *sc, int nbufs, struct mbuf **m_tailp) } m->m_len = size; -#ifndef __NO_STRICT_ALIGNMENT /* * Need to offset the mbuf if the header we're going to add * will misalign. */ - if (sc->vtnet_hdr_size % 4 == 0) { - m_adj(m, ETHER_ALIGN); + if (VTNET_ETHER_ALIGN != 0 && sc->vtnet_hdr_size % 4 == 0) { + m_adj(m, VTNET_ETHER_ALIGN); } -#endif if (m_head != NULL) { m_tail->m_next = m; m_tail = m; @@ -1589,14 +1591,12 @@ vtnet_rxq_replace_lro_nomrg_buf(struct vtnet_rxq *rxq, struct mbuf *m0, sc = rxq->vtnrx_sc; clustersz = sc->vtnet_rx_clustersz; -#ifndef __NO_STRICT_ALIGNMENT /* * Need to offset the mbuf if the header we're going to add will * misalign, account for that here. */ - if (sc->vtnet_hdr_size % 4 == 0) - clustersz -= ETHER_ALIGN; -#endif + if (VTNET_ETHER_ALIGN != 0 && sc->vtnet_hdr_size % 4 == 0) + clustersz -= VTNET_ETHER_ALIGN; m_prev = NULL; m_tail = NULL; From nobody Mon Feb 19 08:07:36 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdZs469kNz5B2jw; Mon, 19 Feb 2024 08: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdZs45dSkz4Jvd; Mon, 19 Feb 2024 08: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=1708330056; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s3ifLoErAtBZf9C5WGnUCiUYuvpRwgkAMF1ScUcgCoE=; b=FChA3vFjSFMqrcH8MNa8JKZZBMsLSpL8dHRy2ayKAsUt7JUKFZrTLQzHUmv6zDmCw/dNLd GadW/MiUQO9LdwwmNc37d4FYuqzEm8Wt7rUsLxgspEmJaI/YMxR9/m7iNr5RDNJE6pDxFC wAwlYngYMLFguUTYPA/80DpvMVI/nkOPSdT4tur+n9m7tWVpeuFQ2NoM+4P6HOcqM2VAOa wSzoDPlF17h/tWvCcuCTvai5Wp/lBmUH42TmGmFLYHqZziX6GA9leOeEdrJ6lOXnao5x6t hmzHuWTQoKeftSEcE3Jk1OvL9cQ5Ul+V7XeIeJwaGCxyjrUN2tnmJEHAyxCvtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330056; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s3ifLoErAtBZf9C5WGnUCiUYuvpRwgkAMF1ScUcgCoE=; b=SUfqF6hBmFSxXbYTgIrS+I6llrhXyS0As7wkCwMtIpte4QcVyn+bPD00EFai5ZtbUQQbaE 1VJ2Qxe9CU8ftAIZAW940p4Tdc9zUccNKps6mdPIjSxNwYcDAyDAH8/1f4y8hC1/J6N55I O8tZf6TLtWLU/vOs5OGdq+5XXqiSbVzSPHTZ98KTwsPG5Z3MO4OT6r2K6Fyal3pwl0xSRH F+xrCglqbuIiMW0u2W2fXwEq7BBqEkbP+G9q0uPMvCNbPmzqk+sc8C0dkZwPB+aHkuOORB DfMr279s9uNyX8SaOMx7htS3zF58J1gahfSDrqDJr54tKGz211IUvbX54+PRSg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708330056; a=rsa-sha256; cv=none; b=ZkMpTfLSAkQUTg9+pCeGD4CYCayl39ZJYWZEEJfLlZn9qdQTQv8QMpTw8nNgf8sdcx30lO ms29jqEF9PObB8EERCFONAZsvulj6IVKSn33c1FWXBVlOiPWIdmgMjoJfaTSXrxfNITh+P CPI9NWN3o6SyUw412DwLSg2CPRtsqXfAw5Io319NWpm+5s1wSpdq4tcV7ApTw2ph7BYIvm eydUwOqk5/SBAM6BWxectJT0nIC9+iJ0Jn2YqcCJRJ3YcdFfzR9hf+G7zvK3VzTYop9L2f 604bUK1X14SCxSMIiArVH1trMBlZNkXnQQcFxeZ15gWjYWKR5shMCOV4LD4wJg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdZs44hP1zRW0; Mon, 19 Feb 2024 08:07:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41J87a4u015286; Mon, 19 Feb 2024 08:07:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J87aHd015283; Mon, 19 Feb 2024 08:07:36 GMT (envelope-from git) Date: Mon, 19 Feb 2024 08:07:36 GMT Message-Id: <202402190807.41J87aHd015283@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 2477106d5d0f - stable/13 - LinuxKPI: sort dev_() functions List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2477106d5d0ff77d545b7d012df48287f9e3acd8 Auto-Submitted: auto-generated The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=2477106d5d0ff77d545b7d012df48287f9e3acd8 commit 2477106d5d0ff77d545b7d012df48287f9e3acd8 Author: Bjoern A. Zeeb AuthorDate: 2024-02-01 23:56:45 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-02-19 08:01:58 +0000 LinuxKPI: sort dev_() functions Sort the dev_ functions by loglevel order, add the dev_alert() version and an indentation change. No functional changes. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D43719 (cherry picked from commit 70617458676eb0b0076aa19657d21f2a9f3b704a) --- sys/compat/linuxkpi/common/include/linux/device.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/device.h b/sys/compat/linuxkpi/common/include/linux/device.h index ef8f72645c56..7742750339d9 100644 --- a/sys/compat/linuxkpi/common/include/linux/device.h +++ b/sys/compat/linuxkpi/common/include/linux/device.h @@ -185,15 +185,17 @@ show_class_attr_string(struct class *class, struct class_attribute_string class_attr_##_name = \ _CLASS_ATTR_STRING(_name, _mode, _str) -#define dev_err(dev, fmt, ...) device_printf((dev)->bsddev, fmt, ##__VA_ARGS__) -#define dev_crit(dev, fmt, ...) device_printf((dev)->bsddev, fmt, ##__VA_ARGS__) -#define dev_warn(dev, fmt, ...) device_printf((dev)->bsddev, fmt, ##__VA_ARGS__) -#define dev_info(dev, fmt, ...) device_printf((dev)->bsddev, fmt, ##__VA_ARGS__) -#define dev_notice(dev, fmt, ...) device_printf((dev)->bsddev, fmt, ##__VA_ARGS__) -#define dev_emerg(dev, fmt, ...) device_printf((dev)->bsddev, fmt, ##__VA_ARGS__) -#define dev_dbg(dev, fmt, ...) do { } while (0) #define dev_printk(lvl, dev, fmt, ...) \ - device_printf((dev)->bsddev, fmt, ##__VA_ARGS__) + device_printf((dev)->bsddev, fmt, ##__VA_ARGS__) + +#define dev_emerg(dev, fmt, ...) device_printf((dev)->bsddev, fmt, ##__VA_ARGS__) +#define dev_alert(dev, fmt, ...) device_printf((dev)->bsddev, fmt, ##__VA_ARGS__) +#define dev_crit(dev, fmt, ...) device_printf((dev)->bsddev, fmt, ##__VA_ARGS__) +#define dev_err(dev, fmt, ...) device_printf((dev)->bsddev, fmt, ##__VA_ARGS__) +#define dev_warn(dev, fmt, ...) device_printf((dev)->bsddev, fmt, ##__VA_ARGS__) +#define dev_notice(dev, fmt, ...) device_printf((dev)->bsddev, fmt, ##__VA_ARGS__) +#define dev_info(dev, fmt, ...) device_printf((dev)->bsddev, fmt, ##__VA_ARGS__) +#define dev_dbg(dev, fmt, ...) do { } while (0) #define dev_info_once(dev, ...) do { \ static bool __dev_info_once; \ From nobody Mon Feb 19 08:07:37 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdZs602Szz5B2rg; Mon, 19 Feb 2024 08:07:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdZs56X4Pz4Jss; Mon, 19 Feb 2024 08:07:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330057; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2A5rK464FtPwsBhOkG0uXDzoCsC+2CTiKTMYasy9NN8=; b=X/qW1WF2oldT35hEHVwz5jJdNNVNlWXQ5oOsTRpXOApWWl3FkfmjPcgt6qIoUYOvaecVh8 APCWjHODj8lla9rRvqweSdJIonHxOgDqxhjHiYmxkKgSB0Ee28MtdbcvYtEHxFSFST8eVZ Bpx+UvLf/lXYha25DNqobeLr1lh1QUi1uZq4xqVC9VJeHc+tWS/YrybjpnK7ATU1WWvzMI FW7ih9th1AUaS9Rp4o9/doYsW9sOsIHHdC+cN21lDXVjxOMYUybLj+jlFbNyeW7gGiAE35 Dp9Kk3DiidruBtS7YHukFI34+tjoNPyquUbP2RtZLj1RCBxyxS5riIa+HlZM3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330057; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2A5rK464FtPwsBhOkG0uXDzoCsC+2CTiKTMYasy9NN8=; b=ZpNrDfI21mEeZFpgP6KUtwEp2QRv4ZBh2Dq7YQ1oGf/wUfBZj/Oo/brGK+h0Dfcf1PB5k4 1ViD+5FRTfQgFO1x9yeLApR8dfQ0o2gnXwLWEGayQoFwandMvpI7mrEaZYQW+jQOyt4Xtb UcUg1HjhPMalQliBYZ6YzK4IpkhBz/iL3KErlZGuNgBa9zOen5ovtaXroAqxhR+mkjZfTz Q6KdrIthryRFH1kCiZ89soPAlklU0Njq6a5Nu6WO7lN62c4F68AtbG1dpcPDTSgMm851Iw /CIyPOtZk4uLxU3kUmJk44tBV4jqoe8z0bh9K1IhTtM7h2v+qhgzEn1XNlAepg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708330057; a=rsa-sha256; cv=none; b=bnhztRxIW3a3tioQMokEmZ3b9I7ayTH/sKE7zIwteDoyMwN1E67dbwoJ1l9ltgwOWotMiC FKGgBEm++RWBthhWjNv0t+siuhFFgDPevR22VFMXGQ9DhoNudmVR0zN3NOfEr7vmeIOHy/ PN3LQuDk4xwufMP7QmaYSG42vJzwmmCPxD3pW1/glo2yH7GnvMJOolVQbe4bVbYzFtBn6m sSKurmJehv3U+zC5AM4vnKWeDUaltyQu5PPi7YZw81tde7VF8DBTgd+ym4vd085U7MZpVm rFS0H7HjGHXV94IXx7dLVO/b5dACAGp4WtnEvEWueGzq9UhjIvMjQtkrzw1oOw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdZs55ZZdzRDk; Mon, 19 Feb 2024 08:07:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41J87bZZ015332; Mon, 19 Feb 2024 08:07:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J87bm4015329; Mon, 19 Feb 2024 08:07:37 GMT (envelope-from git) Date: Mon, 19 Feb 2024 08:07:37 GMT Message-Id: <202402190807.41J87bm4015329@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 1bd05bae9252 - stable/13 - LinuxKPI: implement memset_after() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1bd05bae9252fb21a65da19504c144349b0c6577 Auto-Submitted: auto-generated The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=1bd05bae9252fb21a65da19504c144349b0c6577 commit 1bd05bae9252fb21a65da19504c144349b0c6577 Author: Bjoern A. Zeeb AuthorDate: 2024-01-29 14:19:59 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-02-19 08:01:58 +0000 LinuxKPI: implement memset_after() memset_after() is needed by iwlwifi d3.c. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D43644 (cherry picked from commit 2d9d35837d8ea3ee7d7447d63a8755d45ec2fd96) --- sys/compat/linuxkpi/common/include/linux/string.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/string.h b/sys/compat/linuxkpi/common/include/linux/string.h index 1d9b7af5d9d5..f745c2f6d343 100644 --- a/sys/compat/linuxkpi/common/include/linux/string.h +++ b/sys/compat/linuxkpi/common/include/linux/string.h @@ -265,4 +265,12 @@ memcpy_and_pad(void *dst, size_t dstlen, const void *src, size_t len, int ch) memset(_ptr + _o, _c, sizeof(*(ptr)) - _o); \ }) +#define memset_after(ptr, bytepat, smember) \ +({ \ + uint8_t *_ptr = (uint8_t *)(ptr); \ + int _c = (int)(bytepat); \ + size_t _o = offsetofend(typeof(*(ptr)), smember); \ + memset(_ptr + _o, _c, sizeof(*(ptr)) - _o); \ +}) + #endif /* _LINUXKPI_LINUX_STRING_H_ */ From nobody Mon Feb 19 08:07:38 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdZs71HQyz5B2x2; Mon, 19 Feb 2024 08:07:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdZs70NHjz4Jt9; Mon, 19 Feb 2024 08:07:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330059; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fOdjIrA5jZdNDg9iHC4U8/E6Xnfj6s+y7n7qkNB4Ut0=; b=A18LGjTgm+EkUY9YxfhntLGxzMwOQkLLcSsJ2EnnnucV6LQOL7ODunmjtqC9efaFnc6iYX SfI/AnWrLTxUP+c+FpyWW9KtVWIgGQDtXZbph+bwgq7OpwhjGUhxOm5UrN0or5eauC7QRZ SrQCh3qZ7RVcjgX3rX0aiP2kvKeTH1lsueSKeq1zcCSGd3rtHJyhtWOXR1koVQVOWcAzJY NzmaeKnRVHzk0xJmWHqwSaGqjgCnmsDNFrVc0Ccp8gKEjoVc0Q6PR+w2XAdKGnfWqtUNcG LlO4hh9MsCsbBm/YEYr1IIxPxJTvf//aRStBQpmAcNFzE/NQTeDSLFsn7C9QCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330059; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fOdjIrA5jZdNDg9iHC4U8/E6Xnfj6s+y7n7qkNB4Ut0=; b=wKPsmyaAJi12BYS0VMOKCWsuZs/ATRCJ90jAo5W2d6hYtFfXdEphm4wy5XLxSPVJ3Dfvou T5bDDT5JHqQzqgA0cmKD3C6fjIRK3Mays7gLbwD9FJWRcayZ1SLxshQ76vn5VUJpLuH1ov 6bG5/WG+TckToW9ny9rfgPBgOFVYwozMpYDKo2ZpFNfMW64ykqFi5/7unWh64DwC9NuPoL joYAsT91/gRTx8JEPOBf/BariUze1Mx0vbXBr3bgaLx3Urr79uFmJgrpeMsISN14LsUrSC 4V0gArlhLRxJovWqNWASPkaou0ixG+kLliLjwN2+e+Vpcrrww5n5Gh2E4mUPeA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708330059; a=rsa-sha256; cv=none; b=kStfqHCBU6kR6iZksMa7PeDjO72rsM9cRkokrbOTPfsOkvUoPKZX8cPXO2d9RoOJv/cyc8 wTwa9dpkxbFEWsLv4d0uJ0KkKUIjPjFJMq3EtsfpFC4xqbyPPp/QFogFSn0ZyPAyeA53Fo /HvDTFhPHJ8IwE4YmoCQrJQGcdBfpnY8+dX3yrdJtnhXijv7acXxxmKgTmlLtmIu4NHM9A 4vzBx0uXudQSk9T9PH5qRQnc+tvaeBAvUHqdgkvraB8/Do6hTSjUF6lTpwCYxlT0coN79F /jOUX1rWksmxjjAvdfEm3suAnofqlbL/uIWL7spyZkF6gm6n9ouLTVjbjuk22w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdZs66LCzzR82; Mon, 19 Feb 2024 08:07:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41J87c0a015380; Mon, 19 Feb 2024 08:07:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J87c7l015377; Mon, 19 Feb 2024 08:07:38 GMT (envelope-from git) Date: Mon, 19 Feb 2024 08:07:38 GMT Message-Id: <202402190807.41J87c7l015377@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 90aaf46d5208 - stable/13 - LinuxKPI: reduce impact of large MAXCPU List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 90aaf46d520816e7a92d88fc159fe8694a5e1e32 Auto-Submitted: auto-generated The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=90aaf46d520816e7a92d88fc159fe8694a5e1e32 commit 90aaf46d520816e7a92d88fc159fe8694a5e1e32 Author: Bjoern A. Zeeb AuthorDate: 2023-10-23 23:14:35 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-02-19 08:01:58 +0000 LinuxKPI: reduce impact of large MAXCPU Start scaling arrays dynamically instead of using MAXCPU, resulting in extra allocations on startup but reducing the overall memory footprint. For the static single CPU mask we provide two versions to further save memory depending on a low or high CPU count system. The threshold to switch is currently at 128 CPUs on 64bit platforms. More detailed comments on the implementations can be found in the code. If I am not wrong on a MAXCPU=65536 system the memory footprint should roughly go down from 512M to 1.5M for the static single CPU mask. Submitted by: olce (most of this final version) Sponsored by: The FreeBSD Foundation PR: 274316 Differential Revision: https://reviews.freebsd.org/D42345 (cherry picked from commit 488e8a7faca51a71987fbf00cd36cfcd19269db7) --- sys/compat/linuxkpi/common/include/asm/processor.h | 2 +- sys/compat/linuxkpi/common/src/linux_compat.c | 106 +++++++++++++++++++-- 2 files changed, 99 insertions(+), 9 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/asm/processor.h b/sys/compat/linuxkpi/common/include/asm/processor.h index 9e784396c63a..c55238d33505 100644 --- a/sys/compat/linuxkpi/common/include/asm/processor.h +++ b/sys/compat/linuxkpi/common/include/asm/processor.h @@ -41,7 +41,7 @@ struct cpuinfo_x86 { }; extern struct cpuinfo_x86 boot_cpu_data; -extern struct cpuinfo_x86 __cpu_data[]; +extern struct cpuinfo_x86 *__cpu_data; #define cpu_data(cpu) __cpu_data[cpu] #endif diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index 85fb072b9943..d3804e9ecf05 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -131,7 +131,8 @@ static void linux_cdev_deref(struct linux_cdev *ldev); static struct vm_area_struct *linux_cdev_handle_find(void *handle); cpumask_t cpu_online_mask; -static cpumask_t static_single_cpu_mask[MAXCPU]; +static cpumask_t **static_single_cpu_mask; +static cpumask_t *static_single_cpu_mask_lcs; struct kobject linux_class_root; struct device linux_root_device; struct class linux_class_misc; @@ -2775,17 +2776,19 @@ io_mapping_create_wc(resource_size_t base, unsigned long size) #if defined(__i386__) || defined(__amd64__) bool linux_cpu_has_clflush; struct cpuinfo_x86 boot_cpu_data; -struct cpuinfo_x86 __cpu_data[MAXCPU]; +struct cpuinfo_x86 *__cpu_data; #endif cpumask_t * lkpi_get_static_single_cpu_mask(int cpuid) { - KASSERT((cpuid >= 0 && cpuid < MAXCPU), ("%s: invalid cpuid %d\n", + KASSERT((cpuid >= 0 && cpuid <= mp_maxid), ("%s: invalid cpuid %d\n", + __func__, cpuid)); + KASSERT(!CPU_ABSENT(cpuid), ("%s: cpu with cpuid %d is absent\n", __func__, cpuid)); - return (&static_single_cpu_mask[cpuid]); + return (static_single_cpu_mask[cpuid]); } static void @@ -2801,7 +2804,9 @@ linux_compat_init(void *arg) boot_cpu_data.x86 = CPUID_TO_FAMILY(cpu_id); boot_cpu_data.x86_model = CPUID_TO_MODEL(cpu_id); - for (i = 0; i < MAXCPU; i++) { + __cpu_data = mallocarray(mp_maxid + 1, + sizeof(*__cpu_data), M_KMALLOC, M_WAITOK | M_ZERO); + CPU_FOREACH(i) { __cpu_data[i].x86_clflush_size = cpu_clflush_line_size; __cpu_data[i].x86_max_cores = mp_ncpus; __cpu_data[i].x86 = CPUID_TO_FAMILY(cpu_id); @@ -2836,13 +2841,92 @@ linux_compat_init(void *arg) CPU_COPY(&all_cpus, &cpu_online_mask); /* * Generate a single-CPU cpumask_t for each CPU (possibly) in the system. - * CPUs are indexed from 0..(MAXCPU-1). The entry for cpuid 0 will only + * CPUs are indexed from 0..(mp_maxid). The entry for cpuid 0 will only * have itself in the cpumask, cupid 1 only itself on entry 1, and so on. * This is used by cpumask_of() (and possibly others in the future) for, * e.g., drivers to pass hints to irq_set_affinity_hint(). */ - for (i = 0; i < MAXCPU; i++) - CPU_SET(i, &static_single_cpu_mask[i]); + static_single_cpu_mask = mallocarray(mp_maxid + 1, + sizeof(static_single_cpu_mask), M_KMALLOC, M_WAITOK | M_ZERO); + + /* + * When the number of CPUs reach a threshold, we start to save memory + * given the sets are static by overlapping those having their single + * bit set at same position in a bitset word. Asymptotically, this + * regular scheme is in O(n²) whereas the overlapping one is in O(n) + * only with n being the maximum number of CPUs, so the gain will become + * huge quite quickly. The threshold for 64-bit architectures is 128 + * CPUs. + */ + if (mp_ncpus < (2 * _BITSET_BITS)) { + cpumask_t *sscm_ptr; + + /* + * This represents 'mp_ncpus * __bitset_words(CPU_SETSIZE) * + * (_BITSET_BITS / 8)' bytes (for comparison with the + * overlapping scheme). + */ + static_single_cpu_mask_lcs = mallocarray(mp_ncpus, + sizeof(*static_single_cpu_mask_lcs), + M_KMALLOC, M_WAITOK | M_ZERO); + + sscm_ptr = static_single_cpu_mask_lcs; + CPU_FOREACH(i) { + static_single_cpu_mask[i] = sscm_ptr++; + CPU_SET(i, static_single_cpu_mask[i]); + } + } else { + /* Pointer to a bitset word. */ + __typeof(((cpuset_t *)NULL)->__bits[0]) *bwp; + + /* + * Allocate memory for (static) spans of 'cpumask_t' ('cpuset_t' + * really) with a single bit set that can be reused for all + * single CPU masks by making them start at different offsets. + * We need '__bitset_words(CPU_SETSIZE) - 1' bitset words before + * the word having its single bit set, and the same amount + * after. + */ + static_single_cpu_mask_lcs = mallocarray(_BITSET_BITS, + (2 * __bitset_words(CPU_SETSIZE) - 1) * (_BITSET_BITS / 8), + M_KMALLOC, M_WAITOK | M_ZERO); + + /* + * We rely below on cpuset_t and the bitset generic + * implementation assigning words in the '__bits' array in the + * same order of bits (i.e., little-endian ordering, not to be + * confused with machine endianness, which concerns bits in + * words and other integers). This is an imperfect test, but it + * will detect a change to big-endian ordering. + */ + _Static_assert( + __bitset_word(_BITSET_BITS + 1, _BITSET_BITS) == 1, + "Assumes a bitset implementation that is little-endian " + "on its words"); + + /* Initialize the single bit of each static span. */ + bwp = (__typeof(bwp))static_single_cpu_mask_lcs + + (__bitset_words(CPU_SETSIZE) - 1); + for (i = 0; i < _BITSET_BITS; i++) { + CPU_SET(i, (cpuset_t *)bwp); + bwp += (2 * __bitset_words(CPU_SETSIZE) - 1); + } + + /* + * Finally set all CPU masks to the proper word in their + * relevant span. + */ + CPU_FOREACH(i) { + bwp = (__typeof(bwp))static_single_cpu_mask_lcs; + /* Find the non-zero word of the relevant span. */ + bwp += (2 * __bitset_words(CPU_SETSIZE) - 1) * + (i % _BITSET_BITS) + + __bitset_words(CPU_SETSIZE) - 1; + /* Shift to find the CPU mask start. */ + bwp -= (i / _BITSET_BITS); + static_single_cpu_mask[i] = (cpuset_t *)bwp; + } + } strlcpy(init_uts_ns.name.release, osrelease, sizeof(init_uts_ns.name.release)); } @@ -2855,6 +2939,12 @@ linux_compat_uninit(void *arg) linux_kobject_kfree_name(&linux_root_device.kobj); linux_kobject_kfree_name(&linux_class_misc.kobj); + free(static_single_cpu_mask_lcs, M_KMALLOC); + free(static_single_cpu_mask, M_KMALLOC); +#if defined(__i386__) || defined(__amd64__) + free(__cpu_data, M_KMALLOC); +#endif + mtx_destroy(&vmmaplock); spin_lock_destroy(&pci_lock); rw_destroy(&linux_vma_lock); From nobody Mon Feb 19 08:07:39 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdZs83Ccjz5B2jx; Mon, 19 Feb 2024 08:07:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdZs81C1vz4K8J; Mon, 19 Feb 2024 08:07:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330060; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OV4MXWZpoaJ672opbu3AWuI+0w8O2iSCtR2F8rTEeDQ=; b=AOqeWFmr+B6gwVfwHq6Tvwdmbe2UFbOs/ENbCdUkAvYrIMzcMliM0rG+agvHD2DDIRWm9H K83c91LUia/Mcafe7B5HghpC/mye4SKPmS1+Qa8Q46ncfgYX7xsPna9SgmuApzQ4jAuN5J VXTVAeVyHWW2dDObGYoFqy2vSMvLJtnr/qolZQuyrWDr0RjaQRyyiW1lqJ3xKsh7nt/xuB EpSQ1tV0LsIOKB339DOhLrZEzXReGwLbpm7iVu8ku1xJ8wafv7RyI/WB4BIHaDLufBPkYx tbKyvYcMUFdjtrrpp17j9BxxIbfx+EKZ5+mcHIYSgjgvH0O5oaSKFmR9J1MCHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330060; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OV4MXWZpoaJ672opbu3AWuI+0w8O2iSCtR2F8rTEeDQ=; b=RQ5+hvUltbP4xQFVAs4gyGp0unaNwgUO9jZWfomDHsXtkM/3osIHTzsiS5fETo96Y/0B88 PkyBzObiCk8Y9jrSU+GDvM4HB6ZPD6XSNPcbUOlmqWspaQl8QU/tNDsWIPA+lDl0Z3r/uB 2vmAS4AQpGd1imZ8pn0py3Q8JZZ+Cr74JHnZnKsRetBNjwjXZtbUmmu5xvO6anhk5tS5Sk Iupd51f7V2biasq2sJWS+um46W11oJFs5/LUgDuvCfUs36SrScq0QPtNQPjjtuJ5EFCvvt EkwINgk8zND3xi3E4HDfkiEsVnznURvrSIzneksnFn6CRNpaQZOG9/2ZcJL+gQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708330060; a=rsa-sha256; cv=none; b=UGQdblCHBRlauGfbKM2OOqTNpM7Fd2SIUIvWrvT31nWxzEvszIOjZ9NUtGYc9C07VwmSXz EaKEUbKMkgV3XvFot7moEJEloL/yBede2kTrYt/+byfu4kofDrz8Gm9QJKZ4uPGIsJikhs 1aEsoMG/LBWG/oihK8M9snIISMggsUZB0pQsKQFhyKytHgEEjnLLD54vh684brZxpYQBZq FL4tXtCQ3fhzA/UUVC4wesrjaE5goyLk+5lB8C2blCbCCBIixzeD1ErumpOdgVD54ci2y+ Hx8LiAA1Aw2TbrJFJ1AiBR/zUtCMitz6WDXaJOJcGAnAef5EmOTcVoKGrWiFBg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdZs80HXkzRKj; Mon, 19 Feb 2024 08:07:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41J87dfG015434; Mon, 19 Feb 2024 08:07:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J87dO4015431; Mon, 19 Feb 2024 08:07:39 GMT (envelope-from git) Date: Mon, 19 Feb 2024 08:07:39 GMT Message-Id: <202402190807.41J87dO4015431@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 1ff23eeab2ef - stable/13 - rtw89: improve debugging and fix a sleep issue List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1ff23eeab2ef83075532c5d4870480062daa837a Auto-Submitted: auto-generated The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=1ff23eeab2ef83075532c5d4870480062daa837a commit 1ff23eeab2ef83075532c5d4870480062daa837a Author: Bjoern A. Zeeb AuthorDate: 2023-09-06 16:47:45 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-02-19 08:01:58 +0000 rtw89: improve debugging and fix a sleep issue Improve log messages to be more helpful in error cases. Change one LinuxKPI sleep function as we cannot call the original one from a context we cannot sleep. Both cases were hit during testing. (cherry picked from commit 118d0ff54d4f7cffe6a13a1e0cdb2fe23fbfce74) --- sys/contrib/dev/rtw89/fw.c | 9 +++++++++ sys/contrib/dev/rtw89/phy.c | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/sys/contrib/dev/rtw89/fw.c b/sys/contrib/dev/rtw89/fw.c index 3a9b7868b069..2035e600b471 100644 --- a/sys/contrib/dev/rtw89/fw.c +++ b/sys/contrib/dev/rtw89/fw.c @@ -481,7 +481,12 @@ static void rtw89_fw_prog_cnt_dump(struct rtw89_dev *rtwdev) for (index = 0; index < 15; index++) { val32 = rtw89_read32(rtwdev, R_AX_DBG_PORT_SEL); rtw89_err(rtwdev, "[ERR]fw PC = 0x%x\n", val32); +#if defined(__linux__) fsleep(10); +#elif defined(__FreeBSD__) + /* Seems we are called from a context we cannot sleep. */ + udelay(10); +#endif } } @@ -2473,7 +2478,11 @@ static int rtw89_hw_scan_prehandle(struct rtw89_dev *rtwdev, ret = rtw89_hw_scan_update_probe_req(rtwdev, rtwvif); if (ret) { +#if defined(__linux__) rtw89_err(rtwdev, "Update probe request failed\n"); +#elif defined(__FreeBSD__) + rtw89_err(rtwdev, "Update probe request failed: ret %d\n", ret); +#endif goto out; } ret = rtw89_hw_scan_add_chan_list(rtwdev, rtwvif); diff --git a/sys/contrib/dev/rtw89/phy.c b/sys/contrib/dev/rtw89/phy.c index c4dfb192035a..60698f3b5e01 100644 --- a/sys/contrib/dev/rtw89/phy.c +++ b/sys/contrib/dev/rtw89/phy.c @@ -1340,7 +1340,11 @@ static void rtw89_phy_init_rf_nctl(struct rtw89_dev *rtwdev) ret = read_poll_timeout(rtw89_phy_nctl_poll, val, val == 0x4, 10, 1000, false, rtwdev); if (ret) +#if defined(__linux__) rtw89_err(rtwdev, "failed to poll nctl block\n"); +#elif defined(__FreeBSD__) + rtw89_err(rtwdev, "failed to poll nctl block: ret %d val %#06x\n", ret, val); +#endif nctl_table = chip->nctl_table; rtw89_phy_init_reg(rtwdev, nctl_table, rtw89_phy_config_bb_reg, NULL); From nobody Mon Feb 19 08:07:41 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdZs939T0z5B2dL; Mon, 19 Feb 2024 08:07:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdZs92Lp9z4Jql; Mon, 19 Feb 2024 08:07:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330061; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+PF7T5h+mortM+cEPv+svMYvCC17GU1euVTTVbJi+c8=; b=yKURnRmWcNxY9+2guhzrBdAhNJkO0kubkQHVy8O1ECHcgf+OvzCuB68QdEJVa5x1JMjglw awu2Luhan53XH3OcZC9dvPOvwjcORagEeu40ckLSlq8qDQyvzpzzKQ0DDSXffb4tKnMivX jJ+QzfnYqo4D3VtAnDCAYN3/nPYPXI0Qh5ONWdwWiuGfiHOUiKrVFSpYuE1AnDwCpmsNBx NwYgRZCu+CneqM0h9NTYT1bKjXp0e+04DFbtECr+W7ck0Xv1zmSM+4k939Rpy6Uu28Zdnv /OqqZrHRoOtNvZ1EJ0YhyyeTsymMdqGf+Lw1FQQyM+8pO5CNUvOXGbFVv9kCiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330061; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+PF7T5h+mortM+cEPv+svMYvCC17GU1euVTTVbJi+c8=; b=ZfJUfO4k3oDf/eezGim8cflEMm3z2RMI6JxvyZdGrpExE2MNIGWaighTuX77Xlm/h3mkq3 hSPbRYb033fE9f04sbHkD24PHaP10F4E+XdGTBlzZqtNU5/sgOm/uwDGlrf91N4W964VM0 WiZCi7SQa1OvQq1KlvcxWF8wEGL2ExEvvRf0a6diEaLYMNLeedI74a6GVH1duzV4F3tXJM l+/BRHfwD4hmw04q5bcf8zZm/qffOPCRnnC86plQSRyRbNtshcepG0sGGjmzQYUAHfwRWZ 8sCVjuRVsf6p/3Mh7Qxu7B2FQ51GCPUWnx4XL5SaAITB4Ysj3DGzwvwXrk3bUQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708330061; a=rsa-sha256; cv=none; b=NuYN8yfWu32Fgx+ZZfCrqyuOcPHDsi7BwNvQ8OKtR8Bz6aYkkzo43x/sD/1AIe5qO3LMq7 TaY2zfu6bf25DfPFuh6xYfJV6qnT1IaPDx2vl+huWe46RtBDyaOdpaEXpb4n0EO/cEXUtz 7ycw2HMKGfTr++RANpz5tU3DftHSfp+FKGz9ori1RdK8ygdo9DUGAZgS8UWdWqRMt/ZHAS S6OgsSC/M2GaaC6Ro4ej4D2gw5+sGkmmuY52c6tQ0DbCeAM9OJeSrbnSAveZF+F83X88bw j5Sp609WSX2rkBfaXX8pReCXjgZiKxswtJZm3Sitzx4ddvL6JwVSmAXWaPhxdA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdZs91S1vzRKk; Mon, 19 Feb 2024 08:07:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41J87fr9015485; Mon, 19 Feb 2024 08:07:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J87fxB015482; Mon, 19 Feb 2024 08:07:41 GMT (envelope-from git) Date: Mon, 19 Feb 2024 08:07:41 GMT Message-Id: <202402190807.41J87fxB015482@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: d1d5dbcf2539 - stable/13 - iwlwififw: add firmware for the Bz/B200 chipset List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d1d5dbcf2539d708d36cd4239ea428914a63321d Auto-Submitted: auto-generated The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=d1d5dbcf2539d708d36cd4239ea428914a63321d commit d1d5dbcf2539d708d36cd4239ea428914a63321d Author: Bjoern A. Zeeb AuthorDate: 2023-11-29 21:33:23 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-02-19 08:01:59 +0000 iwlwififw: add firmware for the Bz/B200 chipset The iwlwifi driver already supports the chipset as "Bz TBD" (also in 14.0). Add the firmware for it. Successfully tested for 0x8086/0x272b/0x8086/0x00f4 on arm64 thanks to donated hardware [1]. Firmware was obtained from linux-firmware at 9552083a783e5e48b90de674d4e3bf23bb855ab0 . Sponsored by: The FreeBSD Foundation Sponsored by: Martin Hoehne / minipci.biz (B200 card) [1] (cherry picked from commit b647615ede46af66cd0c8bd5a321d4a2cccdabe0) --- .../dev/iwlwififw/iwlwifi-gl-c0-fm-c0-83.ucode | Bin 0 -> 1799504 bytes sys/contrib/dev/iwlwififw/iwlwifi-gl-c0-fm-c0.pnvm | Bin 0 -> 226668 bytes sys/modules/iwlwififw/Makefile | 3 +++ sys/modules/iwlwififw/iwlwifi-gl-c0-fm-c0-fw/Makefile | 5 +++++ .../iwlwififw/iwlwifi-gl-c0-fm-c0-pnvm/Makefile | 7 +++++++ 5 files changed, 15 insertions(+) diff --git a/sys/contrib/dev/iwlwififw/iwlwifi-gl-c0-fm-c0-83.ucode b/sys/contrib/dev/iwlwififw/iwlwifi-gl-c0-fm-c0-83.ucode new file mode 100644 index 000000000000..a1444bab2622 Binary files /dev/null and b/sys/contrib/dev/iwlwififw/iwlwifi-gl-c0-fm-c0-83.ucode differ diff --git a/sys/contrib/dev/iwlwififw/iwlwifi-gl-c0-fm-c0.pnvm b/sys/contrib/dev/iwlwififw/iwlwifi-gl-c0-fm-c0.pnvm new file mode 100644 index 000000000000..3cdb0b522b22 Binary files /dev/null and b/sys/contrib/dev/iwlwififw/iwlwifi-gl-c0-fm-c0.pnvm differ diff --git a/sys/modules/iwlwififw/Makefile b/sys/modules/iwlwififw/Makefile index aa3873880b19..756fb2f73af7 100644 --- a/sys/modules/iwlwififw/Makefile +++ b/sys/modules/iwlwififw/Makefile @@ -16,6 +16,8 @@ SUBDIR= \ iwlwifi-QuZ-a0-hr-b0-fw \ iwlwifi-QuZ-a0-jf-b0-fw \ iwlwifi-cc-a0-fw \ + iwlwifi-gl-c0-fm-c0-fw \ + iwlwifi-gl-c0-fm-c0-pnvm \ iwlwifi-so-a0-gf-a0-fw \ iwlwifi-so-a0-gf4-a0-fw \ iwlwifi-so-a0-hr-b0-fw \ @@ -25,4 +27,5 @@ SUBDIR= \ iwlwifi-so-a0-gf4-a0-pnvm \ iwlwifi-ty-a0-gf-a0-pnvm + .include diff --git a/sys/modules/iwlwififw/iwlwifi-gl-c0-fm-c0-fw/Makefile b/sys/modules/iwlwififw/iwlwifi-gl-c0-fm-c0-fw/Makefile new file mode 100644 index 000000000000..4a078a28c3b2 --- /dev/null +++ b/sys/modules/iwlwififw/iwlwifi-gl-c0-fm-c0-fw/Makefile @@ -0,0 +1,5 @@ + +FWVERSION= 83 +NAME= gl-c0-fm-c0 + +.include diff --git a/sys/modules/iwlwififw/iwlwifi-gl-c0-fm-c0-pnvm/Makefile b/sys/modules/iwlwififw/iwlwifi-gl-c0-fm-c0-pnvm/Makefile new file mode 100644 index 000000000000..8b1f4692271b --- /dev/null +++ b/sys/modules/iwlwififw/iwlwifi-gl-c0-fm-c0-pnvm/Makefile @@ -0,0 +1,7 @@ + +FWVERSION= 83 +NAME= gl-c0-fm-c0 +EXT= pnvm +_NAME= iwlwifi-${NAME}.${EXT} + +.include From nobody Mon Feb 19 08:07:42 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdZsB53z5z5B2rr; Mon, 19 Feb 2024 08:07:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdZsB3ZQgz4JyR; Mon, 19 Feb 2024 08:07:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330062; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+FVj7+P+816pJRu3Six/+VCGOybRemETCfBod/YdgMw=; b=Y/S3YecOthsFU3vZOQEsoaJ9KiXidtPqfzf4FoDtX6/JseMKkA/gtM8tcTyGBUOPiMVGOv UTBSkFDuh2qTSDHFAfrH5hIcXSgrojk2UqvuRviXEHGLd+u5ilT7FM5ILclY3a9Eh6lRE1 N2TL+sL+H4qPvAVTlb7LiRqs9cMej2T+d+g8OoFaSykbE5mmV5/iCdldUAjnzA8Q5Mf6fa V7VaxL91ik5SQBFFaE5htKaKDDnpMFzialxVU8gfY5tsxlJ3+lArrDDqLbYLWp+Vhf0LJn WiKrdBdQvYeg22+IwslfALSABCz6iWs5nnKkg8mzFa78aXQqFeQiJdaJSacyKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330062; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+FVj7+P+816pJRu3Six/+VCGOybRemETCfBod/YdgMw=; b=W7S99QLnL63g7XTzWK3fO9RazwByOzlNpsnipVVlTKCWn0mBcX200l/0I6bJOhALvvFtbf Drhy3F4hfpDAX1pf9iK/EC599Jsola7aTWVrWjj27pNVx0DXNzUTIJAlRTYR2BWH9CU33J 3i+6bWnM73Ba7aNdSKpoNE/W8JbD8H16J+hBDsN/iz5Y4EfpVSksY5wxvs+spsp9laQv1U SN186AC3U5RWtdLllWzgpKARZKfE8Ky74H6i+EegzyaYmN/SWKuBKj5JoT0j57eNR1cmJx bhhtUESeIkXJVGRExbt+VugkfAyPCqbb6GBYqKy3wCwnkwS/qI+zxOO2ceoITw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708330062; a=rsa-sha256; cv=none; b=wrFRkeNB4LBKxuymcbj5dr/x4M8n51TxBq3WR+RHHBPQa31D1fRECoaTg55tC9JRDbgnUF VIv8S3fje6dufa3rz67t2b2BYEyDZIdsCwh7DDQOUow31p9WqKNu8dWklp4xOgb8EgmGmh Hk/XAwGDA72XfwQK/pTrQJP9J6P3G/hfZYpjxJdpwVSsNuQk8evTokbs44mlO8PrnmaVn0 1xnWNfaOxqApMKdVzc6HwrXXHseAGY3+WFBURZSo28fI+qkFlb8m9w9l5QoYH3BFHzeuXb tgcjE5RAeYiFEnP6WtatyViH3LRX+q+nwb/+NnHLaRjeewSPHJKfAkobMAJlxQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdZsB2TFfzRTg; Mon, 19 Feb 2024 08:07:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41J87gho015539; Mon, 19 Feb 2024 08:07:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J87g7w015536; Mon, 19 Feb 2024 08:07:42 GMT (envelope-from git) Date: Mon, 19 Feb 2024 08:07:42 GMT Message-Id: <202402190807.41J87g7w015536@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 71383e75eae9 - stable/13 - net80211: ieee80211_dump_node() check for channel to be set List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 71383e75eae9fa481f725afc8c1e625e7571940a Auto-Submitted: auto-generated The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=71383e75eae9fa481f725afc8c1e625e7571940a commit 71383e75eae9fa481f725afc8c1e625e7571940a Author: Bjoern A. Zeeb AuthorDate: 2023-11-30 18:20:22 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-02-19 08:01:59 +0000 net80211: ieee80211_dump_node() check for channel to be set Avoid panics in case ieee80211_dump_node() gets called before a channel context is set. Sponsored by: The FreeBSD Foundation (cherry picked from commit c93be3079be5f07fe3596ec389826e45f5dc82bd) --- sys/net80211/ieee80211_node.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index a70edfa3acc4..75795342f4b4 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -2669,7 +2669,8 @@ ieee80211_dump_node(struct ieee80211_node_table *nt __unused, printf("\tbssid %s essid \"%.*s\" channel %u:0x%x\n", ether_sprintf(ni->ni_bssid), ni->ni_esslen, ni->ni_essid, - ni->ni_chan->ic_freq, ni->ni_chan->ic_flags); + (ni->ni_chan != IEEE80211_CHAN_ANYC) ? ni->ni_chan->ic_freq : 0, + (ni->ni_chan != IEEE80211_CHAN_ANYC) ? ni->ni_chan->ic_flags : 0); printf("\tinact %u inact_reload %u txrate %u\n", ni->ni_inact, ni->ni_inact_reload, ni->ni_txrate); printf("\thtcap %x htparam %x htctlchan %u ht2ndchan %u\n", From nobody Mon Feb 19 08:07:43 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdZsC64xvz5B2k2; Mon, 19 Feb 2024 08:07:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdZsC40gQz4KC7; Mon, 19 Feb 2024 08:07:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330063; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0+DJguCVfmZjAwEbovEXuw3yrs7fmh+x9ge+aWROq2Q=; b=g3v2lXQ8vRSLTDZFm5DgwKuetXnd7kLtukP0M5C+gdIv0t/oy67nEu62IU/IkED6riPH8z EKiPxqaIp3qFV9L+K2e+OfE5B/X2mFgKROg2upDMLRlUA/F2pcmeypvKNM0VYUChHDneCW SWVEaOBHuKyWTo7M4jZ+CBrYuJoOsRLfmGSdPbyyhGiWGf7G4kDyh9U+tRiBG21gpWH9SH qD3ds9bEfLhcpz2pMch6FrGlf3G0IVsvtdPytbFRm1uEk1Mrz8j+djbSO82rHE4VruR4KW vPPnHuqld6n6IixU5MSh22FVyUWTDtXaiqrjpGuGIcv8aJbomLIyJrpTDidtWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330063; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0+DJguCVfmZjAwEbovEXuw3yrs7fmh+x9ge+aWROq2Q=; b=oydazwWOeKx8kSgacH5E2cCNWoYuWhMGv81mDEgnoWP+Bvt5LGJhjut/4G29CKCpRarnwj xdXP3h+ovRHaVyi5Hv9QzlggeDPANweWwqkzyV4gKbAPWObLBgYJWJQp/xfi5Pa1BLERRi l6ZG7fz6KPfshunFiwMT2DMoLQ6AcG0CtEohPdeGBY6GX6ydvy7jahZ0+xZBugnqr4KBxJ IDkIo4bxRF4kLprOs3bn0NsEi2OuWYSwyWLu4V6EdGGbwiLrQuzjyTgLrFpSM544QCny4n pSAb+/nvF4wFKR+D01B0nKk/96URC5Z83Ad2Iqb0Vk7oAdv3SKn64MBP1qMAAA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708330063; a=rsa-sha256; cv=none; b=FKqT0AiZ+Fh/lByQplo5Nl2jQDSNvHJdBmbfwgxFwSIda3R9jrwRDwUlrMVVgfPUktYEVy gkMDr/hoQ0o/St218nF+GA9qgrq+JABpE+za2BT5psLCPU9PNIwcMBqRQvdkHAMICiv1Zp 5Y2c7diKNFiwFVfl0aQyuMbdRuInoahTNpP4vGceqHaz6LatQNjDObRq6Wy2sgDEMDxAXb j8g1Qjh+WyP5jeceg6RGIyI1w+xnztVB4vNw/IYhAWlslGBaXErg8/5E0kPJtU77aZxq3k 4antHXap4jmg74LeHabyl3okd73t1RK2XtTVHWf358YH8aRiqiEIn9UsNq67zw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdZsC34d4zRKl; Mon, 19 Feb 2024 08:07:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41J87hwW015578; Mon, 19 Feb 2024 08:07:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J87hMX015575; Mon, 19 Feb 2024 08:07:43 GMT (envelope-from git) Date: Mon, 19 Feb 2024 08:07:43 GMT Message-Id: <202402190807.41J87hMX015575@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 135f22ad82f6 - stable/13 - tools/net80211: add mlme_assoc List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 135f22ad82f6b5179f40123a8b0b743428146729 Auto-Submitted: auto-generated The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=135f22ad82f6b5179f40123a8b0b743428146729 commit 135f22ad82f6b5179f40123a8b0b743428146729 Author: Bjoern A. Zeeb AuthorDate: 2023-12-01 01:37:25 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-02-19 08:01:59 +0000 tools/net80211: add mlme_assoc mlme_assoc is a tool to trigger net80211::ieee80211_sta_join1() calls which in certain conditions cause problems to the LinuxKPI 802.11 compat code (but also believed to possibly cause problems in case of race to other firmware based drivers). This has proven to be a good reproducer for the problem even on setups which otherwise could run for days without hitting it. Sponsored by: The FreeBSD Foundation PR: 271979 (cherry picked from commit 643d6dce6c1e39f067f8d0feea8615913b324891) --- tools/tools/net80211/mlme_assoc/Makefile | 7 + tools/tools/net80211/mlme_assoc/README | 51 +++++++ tools/tools/net80211/mlme_assoc/mlme_assoc.c | 200 +++++++++++++++++++++++++++ 3 files changed, 258 insertions(+) diff --git a/tools/tools/net80211/mlme_assoc/Makefile b/tools/tools/net80211/mlme_assoc/Makefile new file mode 100644 index 000000000000..580fb045ac52 --- /dev/null +++ b/tools/tools/net80211/mlme_assoc/Makefile @@ -0,0 +1,7 @@ +PROG= mlme_assoc +BINDIR= /usr/bin +MAN= + +SRCS= mlme_assoc.c + +.include diff --git a/tools/tools/net80211/mlme_assoc/README b/tools/tools/net80211/mlme_assoc/README new file mode 100644 index 000000000000..fc5e754a58d6 --- /dev/null +++ b/tools/tools/net80211/mlme_assoc/README @@ -0,0 +1,51 @@ +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2023 The FreeBSD Foundation +# +# This documentation was written by Björn Zeeb 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. +# + +This is a simple program to drive net80211::ieee80211_sta_join1() calls from +user space. + +The program optionally accepts an interface name (e.g., wlan42), or an +interface name, an SSID and a BSSID. + +In the former case of no SSID/BSSID passed it will query the scan results and +then try to join each entry from the scan with a short delay. + +In the lastter case giving the SSID/BSSID one can trigger the "canreassoc" case +in ieee80211_sta_join1() or not depending on whether one passes the currently +associated SSID/BSSID or not. + +The tool is useful to trigger net80211::newstate() changes while other +newstate() changes are pending or being executed. + +I was specifically developed to show a problem with the LinuxKPI 802.11 compat +code. The reason is that ieee80211_sta_join1() also calls in (*iv_update_bss)() +swapping nodes before initiating the state changes and in LinuxKPI state is on +the sta and not the vif causing all kinds of troubles, especially if we lose +a state transition before the taskq is run or if the iv_bss node gets swapped +before a task is executed. diff --git a/tools/tools/net80211/mlme_assoc/mlme_assoc.c b/tools/tools/net80211/mlme_assoc/mlme_assoc.c new file mode 100644 index 000000000000..c26aaa03fe87 --- /dev/null +++ b/tools/tools/net80211/mlme_assoc/mlme_assoc.c @@ -0,0 +1,200 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2023 The FreeBSD Foundation + * + * This software was developed by Björn Zeeb 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. + */ + +/* + * First get scan results in a hurry. + * Pick a random BSSID and try to assoc. + * Hopefully this is enough to trigger the newstate race along with the + * (*iv_update_bss)() logic. + * + * Alternatively pass IF SSID BSSID in and just try that. + */ + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include + +static int +if_up(int sd, const char *ifnam) +{ + struct ifreq ifr; + int error; + + memset(&ifr, 0, sizeof(ifr)); + strlcpy(ifr.ifr_name, ifnam, sizeof(ifr.ifr_name)); + + error = ioctl(sd, SIOCGIFFLAGS, &ifr); + if (error == -1) { + warn("SIOCGIFFLAGS"); + return (error); + } + + if (ifr.ifr_flags & IFF_UP) + return (0); + + ifr.ifr_flags |= IFF_UP; + + error = ioctl(sd, SIOCSIFFLAGS, &ifr); + if (error == -1) { + warn("SIOCSIFFLAGS"); + return (error); + } + + return (0); +} + +static int +try_mlme_assoc(int sd, const char *ifnam, uint8_t *ssid, uint8_t ssid_len, uint8_t *bssid) +{ + struct ieee80211req ireq; + struct ieee80211req_mlme mlme; + int error; + + memset(&mlme, 0, sizeof(mlme)); + mlme.im_op = IEEE80211_MLME_ASSOC; + if (ssid != NULL) + memcpy(mlme.im_ssid, ssid, ssid_len); + mlme.im_ssid_len = ssid_len; + if (bssid != NULL) + memcpy(mlme.im_macaddr, bssid, IEEE80211_ADDR_LEN); + + memset(&ireq, 0, sizeof(ireq)); + strlcpy(ireq.i_name, ifnam, sizeof(ireq.i_name)); + ireq.i_type = IEEE80211_IOC_MLME; + ireq.i_val = 0; + ireq.i_data = (void *)&mlme; + ireq.i_len = sizeof(mlme); + + error = ioctl(sd, SIOCS80211, &ireq); + if (error == -1) { + warn("SIOCS80211, %#x", ireq.i_type); + return (error); + } + + return (0); +} + +static int +mlme_assoc_scan_results(int sd, const char *ifnam) +{ + struct ieee80211req ireq; + struct ieee80211req_scan_result *sr; + uint8_t buf[32 * 1024], *p; + ssize_t len; + int error; + + memset(&ireq, 0, sizeof(ireq)); + strlcpy(ireq.i_name, ifnam, sizeof(ireq.i_name)); + ireq.i_type = IEEE80211_IOC_SCAN_RESULTS; + ireq.i_data = (void *)buf; + ireq.i_len = sizeof(buf); + + error = ioctl(sd, SIOCG80211, &ireq); + if (error == -1 || ireq.i_len < 0) { + warn("SIOCG80211, %#x", ireq.i_type); + return (error); + } + + p = buf; + len = ireq.i_len; + while (len > (ssize_t)sizeof(*sr)) { + sr = (struct ieee80211req_scan_result *)(void *)p; + p += sr->isr_len; + len -= sr->isr_len; + + error = try_mlme_assoc(sd, ifnam, (void *)(sr + 1), sr->isr_ssid_len, + sr->isr_bssid); + if (error != 0) { + warnx("try_mlme_assoc"); + return (error); + } + + usleep(100000); + } + + return (0); +} + +int +main(int argc, char *argv[]) +{ + const char *ifnam; + uint8_t *ssid, *bssid; + struct ether_addr ea; + int error, sd; + + ifnam = "wlan0"; + ssid = NULL; + bssid = NULL; + + if (argc == 4) { + ifnam = argv[1]; + ssid = (uint8_t *)argv[2]; + bssid = (uint8_t *)ether_aton_r(argv[3], &ea); + if (bssid == NULL) + warnx("ether_aton_r, ignoring BSSID"); + } else if (argc == 2) { + ifnam = argv[1]; + } + + sd = socket(AF_LOCAL, SOCK_DGRAM, 0); + if (sd == -1) + errx(EX_UNAVAILABLE, "socket"); + + error = if_up(sd, ifnam); + if (error != 0) + errx(EX_UNAVAILABLE, "if_up"); + + if (argc == 4) { + error = try_mlme_assoc(sd, ifnam, ssid, strlen((const char *)ssid), bssid); + if (error != 0) + errx(EX_UNAVAILABLE, "try_mlme_assoc"); + + } else { + error = mlme_assoc_scan_results(sd, ifnam); + if (error != 0) + errx(EX_UNAVAILABLE, "mlme_assoc_scan_results"); + } + + close(sd); + + return (0); +} From nobody Mon Feb 19 08:07:44 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdZsF0D33z5B2rw; Mon, 19 Feb 2024 08:07:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdZsD4w2kz4K99; Mon, 19 Feb 2024 08:07:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330064; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jOfHhBUm7y6Qiof8Rkv72ABsQhiYkxskxyHWMVoGISs=; b=f0sBseGJNgRaZ6v0XyP4Cqu3EeaRiFUpvDPqAqw9Ho/CUCXjefoHoVriZL5dZ0zlumCKuY ttUP/iYhDH55aRO5vvmZkPfjg7Tm0rY/tZB1TGLl57W0etk38TF3NdvvAAEEWHa8lFZk8V 3hEyftTz3gMX0Vlii/5E54WpGuVT2h9T+5l22ys/0AcF9wETzRkB7yQgWRKBuGAB/ZqpQv qid5Cdd8xape/88puewmOJX+Bx1NjweMVr50OT2A7XdElr7Bw6zLYnb7s5WiarVKuPAYr7 ZWZBxSI2a8Ijg4rZOGbFvZFGR+k9Tz5BmmSI0O7Jm3P4TVuz8tJrRUWFI4u/FA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330064; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jOfHhBUm7y6Qiof8Rkv72ABsQhiYkxskxyHWMVoGISs=; b=kl96e7pkSJsIyVPFNxQb/GYhjSHIeLY39zcM05f+NO8gAjLk/MDvsVnR5nDN3Y2OZ7VTMa T9ByCudhb1Fj/fA7DT9lXEp7wUEROm5J6ILI+1GH1u+ehLlbUutliSAZQSwDrqKY+PoMFM +e/f8i5u5cpVIUpaiRjUfuNZ2xJUbtDABidzLye5RkCDRUotUXbRCmUwmVBrBCYpswr8YS M/hFOGPs8oFIJ9V8iNAzfISf69c23IMto7GcXCYgvVeZBSI1grSlFgyNYCFmpu2vJ26GBT LUnFXEqnNTW+v9LKbgxweqs7SoAZkV4P5jwRyvNrtiUkkDB4OJYLppXzfcFm+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708330064; a=rsa-sha256; cv=none; b=CILxYhxCHk+Ccx367MIB9rllXLxOhVCLwVe72zJ3qZtsovZFujHp6wX1oBaEmFHZwyxGCV 9lknU5urMXuK4lcRo8xCDcFJ9NPB9BeIF4Q+uTyJSUmz7N3paWRzCGMTPs6wZw1GXTjCIU hRCnq1FDhmDr0q0kJUHqRxBQns+CdXwKcQJ8ETpcebK4jDEm37lJqqaFyAMFDAZg84vwui +u53A9oyH4wWqOKxB0/W3gR89JzY4E9WuLfn8HbSKSRhj4cDnWrHr9W1PBpEySfxW3hYV9 MInc1SfUweSL7d7LBLHkzqx5vgGu0GaJFsJY3N/2e2Tgi4funP8WyIvpAgHJQg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdZsD40W1zRDl; Mon, 19 Feb 2024 08:07:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41J87iPR015629; Mon, 19 Feb 2024 08:07:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J87iNq015626; Mon, 19 Feb 2024 08:07:44 GMT (envelope-from git) Date: Mon, 19 Feb 2024 08:07:44 GMT Message-Id: <202402190807.41J87iNq015626@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 3fe19437797b - stable/13 - LinuxKPI: 802.11: bring in some HT code List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3fe19437797b1459e26c11bcc343da7f1daf52e9 Auto-Submitted: auto-generated The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=3fe19437797b1459e26c11bcc343da7f1daf52e9 commit 3fe19437797b1459e26c11bcc343da7f1daf52e9 Author: Bjoern A. Zeeb AuthorDate: 2023-10-26 21:14:44 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-02-19 08:01:59 +0000 LinuxKPI: 802.11: bring in some HT code Fix defines and structures to use proper types. Bring in basic ni->sta synchronization, some channel width handling, and overload the net80211 functions so that we can talk to driver/firmware to setup parameters. We will likely not need one or two of those but it is good for tracing currently. Cover HT and bits of VHT code in LinuxKPI behind apropriate #ifdef which are currently not enabled (like LKPI_80211_HW_CRYPTO) until confirmed to work. Last, IEEE80211_AMPDU_RX_START made some firmware unhappy. This will allow others to work on it and test as well. Sponsored by: The FreeBSD Foundation (cherry picked from commit 9fb914634eff85b3b36bcbf39c1faf2967b0aa9e) --- .../linuxkpi/common/include/linux/ieee80211.h | 3 +- sys/compat/linuxkpi/common/include/net/mac80211.h | 11 +- sys/compat/linuxkpi/common/src/linux_80211.c | 513 +++++++++++++++++++-- sys/compat/linuxkpi/common/src/linux_80211.h | 35 ++ .../linuxkpi/common/src/linux_80211_macops.c | 22 + 5 files changed, 550 insertions(+), 34 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/ieee80211.h b/sys/compat/linuxkpi/common/include/linux/ieee80211.h index 4648a12ec889..5c18bb9fe3d9 100644 --- a/sys/compat/linuxkpi/common/include/linux/ieee80211.h +++ b/sys/compat/linuxkpi/common/include/linux/ieee80211.h @@ -60,8 +60,7 @@ struct ieee80211_mmie_16 { #define IEEE80211_INVAL_HW_QUEUE ((uint8_t)-1) -#define IEEE80211_MAX_AMPDU_BUF 256 /* for HE? */ -#define IEEE80211_MAX_AMPDU_BUF_HT 64 +#define IEEE80211_MAX_AMPDU_BUF_HT IEEE80211_AGGR_BAWMAX #define IEEE80211_MAX_AMPDU_BUF_HE 256 #define IEEE80211_MAX_AMPDU_BUF_EHT 1024 diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index 7e6fb1bce16e..fa36bd84ac6e 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -175,11 +175,13 @@ struct ieee80211_sta; #define IEEE80211_HT_AMPDU_PARM_DENSITY (0x7 << IEEE80211_HT_AMPDU_PARM_DENSITY_SHIFT) struct ieee80211_ampdu_params { - /* TODO FIXME */ struct ieee80211_sta *sta; - uint8_t tid; + enum ieee80211_ampdu_mlme_action action; + uint16_t buf_size; + uint16_t timeout; uint16_t ssn; - int action, amsdu, buf_size, timeout; + uint8_t tid; + bool amsdu; }; struct ieee80211_bar { @@ -452,7 +454,6 @@ struct ieee80211_hw { struct wiphy *wiphy; /* TODO FIXME */ - int max_rx_aggregation_subframes, max_tx_aggregation_subframes; int extra_tx_headroom, weight_multiplier; int max_rate_tries, max_rates, max_report_rates; struct ieee80211_cipher_scheme *cipher_schemes; @@ -472,6 +473,8 @@ struct ieee80211_hw { uint16_t offchannel_tx_hw_queue; uint16_t uapsd_max_sp_len; uint16_t uapsd_queues; + uint16_t max_rx_aggregation_subframes; + uint16_t max_tx_aggregation_subframes; uint16_t max_tx_fragments; uint16_t max_listen_interval; uint32_t extra_beacon_tailroom; diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 340503307c97..5a60380d15aa 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -62,6 +62,7 @@ #include #include #include +#include #define LINUXKPI_NET80211 #include @@ -71,6 +72,11 @@ #define LKPI_80211_WME /* #define LKPI_80211_HW_CRYPTO */ +/* #define LKPI_80211_VHT */ +/* #define LKPI_80211_HT */ +#if defined(LKPI_80211_VHT) && !defined(LKPI_80211_HT) +#define LKPI_80211_HT +#endif static MALLOC_DEFINE(M_LKPI80211, "lkpi80211", "LinuxKPI 80211 compat"); @@ -144,6 +150,79 @@ static void lkpi_ieee80211_free_skb_mbuf(void *); static int lkpi_wme_update(struct lkpi_hw *, struct ieee80211vap *, bool); #endif +#if defined(LKPI_80211_HT) +static void +lkpi_sta_sync_ht_from_ni(struct ieee80211_sta *sta, struct ieee80211_node *ni, int *ht_rx_nss) +{ + struct ieee80211vap *vap; + uint8_t *ie; + struct ieee80211_ht_cap *htcap; + int i, rx_nss; + + if ((ni->ni_flags & IEEE80211_NODE_HT) == 0) + return; + + if (IEEE80211_IS_CHAN_HT(ni->ni_chan) && + IEEE80211_IS_CHAN_HT40(ni->ni_chan)) + sta->deflink.bandwidth = IEEE80211_STA_RX_BW_40; + + sta->deflink.ht_cap.ht_supported = true; + + /* htcap->ampdu_params_info */ + vap = ni->ni_vap; + sta->deflink.ht_cap.ampdu_density = _IEEE80211_MASKSHIFT(ni->ni_htparam, IEEE80211_HTCAP_MPDUDENSITY); + if (sta->deflink.ht_cap.ampdu_density > vap->iv_ampdu_density) + sta->deflink.ht_cap.ampdu_density = vap->iv_ampdu_density; + sta->deflink.ht_cap.ampdu_factor = _IEEE80211_MASKSHIFT(ni->ni_htparam, IEEE80211_HTCAP_MAXRXAMPDU); + if (sta->deflink.ht_cap.ampdu_factor > vap->iv_ampdu_rxmax) + sta->deflink.ht_cap.ampdu_factor = vap->iv_ampdu_rxmax; + + ie = ni->ni_ies.htcap_ie; + KASSERT(ie != NULL, ("%s: HT but no htcap_ie on ni %p\n", __func__, ni)); + if (ie[0] == IEEE80211_ELEMID_VENDOR) + ie += 4; + ie += 2; + htcap = (struct ieee80211_ht_cap *)ie; + sta->deflink.ht_cap.cap = htcap->cap_info; + sta->deflink.ht_cap.mcs = htcap->mcs; + + rx_nss = 0; + for (i = 0; i < nitems(htcap->mcs.rx_mask); i++) { + if (htcap->mcs.rx_mask[i]) + rx_nss++; + } + if (ht_rx_nss != NULL) + *ht_rx_nss = rx_nss; + + IMPROVE("sta->wme, sta->deflink.agg.max*"); +} +#endif + +#if defined(LKPI_80211_VHT) +static void +lkpi_sta_sync_vht_from_ni(struct ieee80211_sta *sta, struct ieee80211_node *ni, int *vht_rx_nss) +{ + + if ((ni->ni_flags & IEEE80211_NODE_VHT) == 0) + return; + + if (IEEE80211_IS_CHAN_VHT(ni->ni_chan)) { +#ifdef __notyet__ + if (IEEE80211_IS_CHAN_VHT80P80(ni->ni_chan)) { + sta->deflink.bandwidth = IEEE80211_STA_RX_BW_160; /* XXX? */ + } else +#endif + if (IEEE80211_IS_CHAN_VHT160(ni->ni_chan)) + sta->deflink.bandwidth = IEEE80211_STA_RX_BW_160; + else if (IEEE80211_IS_CHAN_VHT80(ni->ni_chan)) + sta->deflink.bandwidth = IEEE80211_STA_RX_BW_80; + } + + IMPROVE("VHT sync ni to sta"); + return; +} +#endif + static void lkpi_lsta_dump(struct lkpi_sta *lsta, struct ieee80211_node *ni, const char *_f, int _l) @@ -198,6 +277,8 @@ lkpi_lsta_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN], struct ieee80211_vif *vif; struct ieee80211_sta *sta; int band, i, tid; + int ht_rx_nss; + int vht_rx_nss; lsta = malloc(sizeof(*lsta) + hw->sta_data_size, M_LKPI80211, M_NOWAIT | M_ZERO); @@ -267,9 +348,23 @@ lkpi_lsta_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN], sta->deflink.supp_rates[band] |= BIT(i); } } + sta->deflink.smps_mode = IEEE80211_SMPS_OFF; - IMPROVE("ht, vht, he, ... bandwidth, smps_mode, .."); - /* bandwidth = IEEE80211_STA_RX_... */ + sta->deflink.bandwidth = IEEE80211_STA_RX_BW_20; + sta->deflink.rx_nss = 0; + + ht_rx_nss = 0; +#if defined(LKPI_80211_HT) + lkpi_sta_sync_ht_from_ni(sta, ni, &ht_rx_nss); +#endif + vht_rx_nss = 0; +#if defined(LKPI_80211_VHT) + lkpi_sta_sync_vht_from_ni(sta, ni, &vht_rx_nss); +#endif + + sta->deflink.rx_nss = MAX(ht_rx_nss, sta->deflink.rx_nss); + sta->deflink.rx_nss = MAX(vht_rx_nss, sta->deflink.rx_nss); + IMPROVE("he, ... smps_mode, .."); /* Link configuration. */ IEEE80211_ADDR_COPY(sta->deflink.addr, sta->addr); @@ -971,12 +1066,35 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int conf->def.width = NL80211_CHAN_WIDTH_20_NOHT; conf->def.center_freq1 = chan->center_freq; conf->def.center_freq2 = 0; + IMPROVE("Check vht_cap from band not just chan?"); +#ifdef LKPI_80211_HT + if (IEEE80211_IS_CHAN_HT(ni->ni_chan)) { + if (IEEE80211_IS_CHAN_HT40(ni->ni_chan)) { + conf->def.width = NL80211_CHAN_WIDTH_40; + } else + conf->def.width = NL80211_CHAN_WIDTH_20; + } +#endif +#ifdef LKPI_80211_VHT + if (IEEE80211_IS_CHAN_VHT(ni->ni_chan)) { +#ifdef __notyet__ + if (IEEE80211_IS_CHAN_VHT80P80(ni->ni_chan)) { + conf->def.width = NL80211_CHAN_WIDTH_80P80; + conf->def.center_freq2 = 0; /* XXX */ + } else +#endif + if (IEEE80211_IS_CHAN_VHT160(ni->ni_chan)) + conf->def.width = NL80211_CHAN_WIDTH_160; + else if (IEEE80211_IS_CHAN_VHT80(ni->ni_chan)) + conf->def.width = NL80211_CHAN_WIDTH_80; + } +#endif /* Responder ... */ conf->min_def.chan = chan; conf->min_def.width = NL80211_CHAN_WIDTH_20_NOHT; conf->min_def.center_freq1 = chan->center_freq; conf->min_def.center_freq2 = 0; - IMPROVE("currently 20_NOHT only"); + IMPROVE("currently 20_NOHT min_def only"); /* Set bss info (bss_info_changed). */ bss_changed = 0; @@ -1009,6 +1127,15 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int vif->bss_conf.chandef.width = conf->def.width; vif->bss_conf.chandef.center_freq1 = conf->def.center_freq1; +#ifdef LKPI_80211_HT + if (vif->bss_conf.chandef.width == NL80211_CHAN_WIDTH_40) { + /* Note: it is 10 not 20. */ + if (IEEE80211_IS_CHAN_HT40U(ni->ni_chan)) + vif->bss_conf.chandef.center_freq1 += 10; + else if (IEEE80211_IS_CHAN_HT40D(ni->ni_chan)) + vif->bss_conf.chandef.center_freq1 -= 10; + } +#endif vif->bss_conf.chandef.center_freq2 = conf->def.center_freq2; } else { @@ -1651,6 +1778,11 @@ lkpi_sta_assoc_to_run(struct ieee80211vap *vap, enum ieee80211_state nstate, int IMPROVE("net80211 does not consider node authorized"); } +#if defined(LKPI_80211_HT) + IMPROVE("Is this the right spot, has net80211 done all updates already?"); + lkpi_sta_sync_ht_from_ni(sta, ni, NULL); +#endif + /* Update sta_state (ASSOC to AUTHORIZED). */ KASSERT(lsta != NULL, ("%s: ni %p lsta is NULL\n", __func__, ni)); KASSERT(lsta->state == IEEE80211_STA_ASSOC, ("%s: lsta %p state not " @@ -2464,6 +2596,10 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], #endif } +#ifdef LKPI_80211_HT + /* Stay with the iv_ampdu_rxmax,limit / iv_ampdu_density defaults until later. */ +#endif + ieee80211_ratectl_init(vap); /* Complete setup. */ @@ -3075,6 +3211,9 @@ lkpi_ic_set_channel(struct ieee80211com *ic) hw = LHW_TO_HW(lhw); cfg80211_chandef_create(&hw->conf.chandef, chan, +#ifdef LKPI_80211_HT + (ic->ic_htcaps & IEEE80211_HTC_HT) ? 0 : +#endif NL80211_CHAN_NO_HT); error = lkpi_80211_mo_config(hw, IEEE80211_CONF_CHANGE_CHANNEL); @@ -3363,6 +3502,13 @@ lkpi_80211_txq_tx_one(struct lkpi_sta *lsta, struct mbuf *m) info->control.flags |= IEEE80211_TX_CTRL_PORT_CTRL_PROTO; info->control.vif = vif; /* XXX-BZ info->control.rates */ +#ifdef __notyet__ +#ifdef LKPI_80211_HT + info->control.rts_cts_rate_idx= + info->control.use_rts= /* RTS */ + info->control.use_cts_prot= /* RTS/CTS*/ +#endif +#endif lsta = lkpi_find_lsta_by_ni(lvif, ni); if (lsta != NULL) { @@ -3469,6 +3615,291 @@ lkpi_ic_transmit(struct ieee80211com *ic, struct mbuf *m) return (lkpi_ic_raw_xmit(ni, m, NULL)); } +#ifdef LKPI_80211_HT +static int +lkpi_ic_recv_action(struct ieee80211_node *ni, const struct ieee80211_frame *wh, + const uint8_t *frm, const uint8_t *efrm) +{ + struct ieee80211com *ic; + struct lkpi_hw *lhw; + + ic = ni->ni_ic; + lhw = ic->ic_softc; + + IMPROVE_HT(); + + return (lhw->ic_recv_action(ni, wh, frm, efrm)); +} + +static int +lkpi_ic_send_action(struct ieee80211_node *ni, int category, int action, void *sa) +{ + struct ieee80211com *ic; + struct lkpi_hw *lhw; + + ic = ni->ni_ic; + lhw = ic->ic_softc; + + IMPROVE_HT(); + + return (lhw->ic_send_action(ni, category, action, sa)); +} + + +static int +lkpi_ic_ampdu_enable(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap) +{ + struct ieee80211com *ic; + struct lkpi_hw *lhw; + + ic = ni->ni_ic; + lhw = ic->ic_softc; + + IMPROVE_HT(); + + return (lhw->ic_ampdu_enable(ni, tap)); +} + +static int +lkpi_ic_addba_request(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap, + int dialogtoken, int baparamset, int batimeout) +{ + struct ieee80211com *ic; + struct lkpi_hw *lhw; + + ic = ni->ni_ic; + lhw = ic->ic_softc; + + IMPROVE_HT(); + + return (lhw->ic_addba_request(ni, tap, dialogtoken, baparamset, batimeout)); +} + +static int +lkpi_ic_addba_response(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap, + int status, int baparamset, int batimeout) +{ + struct ieee80211com *ic; + struct lkpi_hw *lhw; + + ic = ni->ni_ic; + lhw = ic->ic_softc; + + IMPROVE_HT(); + + return (lhw->ic_addba_response(ni, tap, status, baparamset, batimeout)); +} + +static void +lkpi_ic_addba_stop(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap) +{ + struct ieee80211com *ic; + struct lkpi_hw *lhw; + + ic = ni->ni_ic; + lhw = ic->ic_softc; + + IMPROVE_HT(); + + lhw->ic_addba_stop(ni, tap); +} + +static void +lkpi_ic_addba_response_timeout(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap) +{ + struct ieee80211com *ic; + struct lkpi_hw *lhw; + + ic = ni->ni_ic; + lhw = ic->ic_softc; + + IMPROVE_HT(); + + lhw->ic_addba_response_timeout(ni, tap); +} + +static void +lkpi_ic_bar_response(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap, + int status) +{ + struct ieee80211com *ic; + struct lkpi_hw *lhw; + + ic = ni->ni_ic; + lhw = ic->ic_softc; + + IMPROVE_HT(); + + lhw->ic_bar_response(ni, tap, status); +} + +static int +lkpi_ic_ampdu_rx_start(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap, + int baparamset, int batimeout, int baseqctl) +{ + struct ieee80211com *ic; + struct lkpi_hw *lhw; + struct ieee80211_hw *hw; + struct ieee80211vap *vap; + struct lkpi_vif *lvif; + struct ieee80211_vif *vif; + struct lkpi_sta *lsta; + struct ieee80211_sta *sta; + struct ieee80211_ampdu_params params; + int error; + + ic = ni->ni_ic; + lhw = ic->ic_softc; + hw = LHW_TO_HW(lhw); + vap = ni->ni_vap; + lvif = VAP_TO_LVIF(vap); + vif = LVIF_TO_VIF(lvif); + lsta = ni->ni_drv_data; + sta = LSTA_TO_STA(lsta); + + params.sta = sta; + params.action = IEEE80211_AMPDU_RX_START; + params.buf_size = _IEEE80211_MASKSHIFT(le16toh(baparamset), IEEE80211_BAPS_BUFSIZ); + if (params.buf_size == 0) + params.buf_size = IEEE80211_MAX_AMPDU_BUF_HT; + else + params.buf_size = min(params.buf_size, IEEE80211_MAX_AMPDU_BUF_HT); + if (params.buf_size > hw->max_rx_aggregation_subframes) + params.buf_size = hw->max_rx_aggregation_subframes; + params.timeout = le16toh(batimeout); + params.ssn = _IEEE80211_MASKSHIFT(le16toh(baseqctl), IEEE80211_BASEQ_START); + params.tid = _IEEE80211_MASKSHIFT(le16toh(baparamset), IEEE80211_BAPS_TID); + params.amsdu = false; + + IMPROVE_HT("Do we need to distinguish based on SUPPORTS_REORDERING_BUFFER?"); + + /* This may call kalloc. Make sure we can sleep. */ + error = lkpi_80211_mo_ampdu_action(hw, vif, ¶ms); + if (error != 0) { + ic_printf(ic, "%s: mo_ampdu_action returned %d. ni %p rap %p\n", + __func__, error, ni, rap); + return (error); + } + IMPROVE_HT("net80211 is missing the error check on return and assumes success"); + + error = lhw->ic_ampdu_rx_start(ni, rap, baparamset, batimeout, baseqctl); + return (error); +} + +static void +lkpi_ic_ampdu_rx_stop(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap) +{ + struct ieee80211com *ic; + struct lkpi_hw *lhw; + struct ieee80211_hw *hw; + struct ieee80211vap *vap; + struct lkpi_vif *lvif; + struct ieee80211_vif *vif; + struct lkpi_sta *lsta; + struct ieee80211_sta *sta; + struct ieee80211_ampdu_params params; + int error; + uint8_t tid; + + ic = ni->ni_ic; + lhw = ic->ic_softc; + + /* + * We should not (cannot) call into mac80211 ops with AMPDU_RX_STOP if + * we did not START. Some drivers pass it down to firmware which will + * simply barf and net80211 calls ieee80211_ht_node_cleanup() from + * ieee80211_ht_node_init() amongst others which will iterate over all + * tid and call ic_ampdu_rx_stop() unconditionally. + * XXX net80211 should probably be more "gentle" in these cases and + * track some state itself. + */ + if ((rap->rxa_flags & IEEE80211_AGGR_RUNNING) == 0) + goto net80211_only; + + hw = LHW_TO_HW(lhw); + vap = ni->ni_vap; + lvif = VAP_TO_LVIF(vap); + vif = LVIF_TO_VIF(lvif); + lsta = ni->ni_drv_data; + sta = LSTA_TO_STA(lsta); + + IMPROVE_HT("This really should be passed from ht_recv_action_ba_delba."); + for (tid = 0; tid < WME_NUM_TID; tid++) { + if (&ni->ni_rx_ampdu[tid] == rap) + break; + } + + params.sta = sta; + params.action = IEEE80211_AMPDU_RX_STOP; + params.buf_size = 0; + params.timeout = 0; + params.ssn = 0; + params.tid = tid; + params.amsdu = false; + + error = lkpi_80211_mo_ampdu_action(hw, vif, ¶ms); + if (error != 0) + ic_printf(ic, "%s: mo_ampdu_action returned %d. ni %p rap %p\n", + __func__, error, ni, rap); + +net80211_only: + lhw->ic_ampdu_rx_stop(ni, rap); +} +#endif + +static void +lkpi_ic_getradiocaps_ht(struct ieee80211com *ic, struct ieee80211_hw *hw, + uint8_t *bands, int *chan_flags, enum nl80211_band band) +{ +#ifdef LKPI_80211_HT + struct ieee80211_sta_ht_cap *ht_cap; + + ht_cap = &hw->wiphy->bands[band]->ht_cap; + if (!ht_cap->ht_supported) + return; + + switch (band) { + case NL80211_BAND_2GHZ: + setbit(bands, IEEE80211_MODE_11NG); + break; + case NL80211_BAND_5GHZ: + setbit(bands, IEEE80211_MODE_11NA); + break; + default: + IMPROVE("Unsupported band %d", band); + return; + } + + ic->ic_htcaps = IEEE80211_HTC_HT; /* HT operation */ + + /* + * Rather than manually checking each flag and + * translating IEEE80211_HT_CAP_ to IEEE80211_HTCAP_, + * simply copy the 16bits. + */ + ic->ic_htcaps |= ht_cap->cap; + + /* Then deal with the other flags. */ + if (ieee80211_hw_check(hw, AMPDU_AGGREGATION)) + ic->ic_htcaps |= IEEE80211_HTC_AMPDU; +#ifdef __notyet__ + if (ieee80211_hw_check(hw, TX_AMSDU)) + ic->ic_htcaps |= IEEE80211_HTC_AMSDU; + if (ieee80211_hw_check(hw, SUPPORTS_AMSDU_IN_AMPDU)) + ic->ic_htcaps |= (IEEE80211_HTC_RX_AMSDU_AMPDU | + IEEE80211_HTC_TX_AMSDU_AMPDU); +#endif + + IMPROVE("PS, ampdu_*, ht_cap.mcs.tx_params, ..."); + ic->ic_htcaps |= IEEE80211_HTCAP_SMPS_OFF; + + /* Only add HT40 channels if supported. */ + if ((ic->ic_htcaps & IEEE80211_HTCAP_CHWIDTH40) != 0 && + chan_flags != NULL) + *chan_flags |= NET80211_CBW_FLAG_HT40; +#endif +} + static void lkpi_ic_getradiocaps(struct ieee80211com *ic, int maxchan, int *n, struct ieee80211_channel *c) @@ -3492,13 +3923,12 @@ lkpi_ic_getradiocaps(struct ieee80211com *ic, int maxchan, chan_flags = 0; setbit(bands, IEEE80211_MODE_11B); /* XXX-BZ unclear how to check for 11g. */ + + IMPROVE("the bitrates may have flags?"); setbit(bands, IEEE80211_MODE_11G); -#ifdef __notyet__ - if (hw->wiphy->bands[NL80211_BAND_2GHZ]->ht_cap.ht_supported) { - setbit(bands, IEEE80211_MODE_11NG); - chan_flags |= NET80211_CBW_FLAG_HT40; - } -#endif + + lkpi_ic_getradiocaps_ht(ic, hw, bands, &chan_flags, + NL80211_BAND_2GHZ); channels = hw->wiphy->bands[NL80211_BAND_2GHZ]->channels; for (i = 0; i < nchans && *n < maxchan; i++) { @@ -3548,11 +3978,11 @@ lkpi_ic_getradiocaps(struct ieee80211com *ic, int maxchan, memset(bands, 0, sizeof(bands)); chan_flags = 0; setbit(bands, IEEE80211_MODE_11A); -#ifdef __not_yet__ - if (hw->wiphy->bands[NL80211_BAND_5GHZ]->ht_cap.ht_supported) { - setbit(bands, IEEE80211_MODE_11NA); - chan_flags |= NET80211_CBW_FLAG_HT40; - } + + lkpi_ic_getradiocaps_ht(ic, hw, bands, &chan_flags, + NL80211_BAND_5GHZ); + +#ifdef LKPI_80211_VHT if (hw->wiphy->bands[NL80211_BAND_5GHZ]->vht_cap.vht_supported){ ic->ic_flags_ext |= IEEE80211_FEXT_VHT; @@ -3793,18 +4223,6 @@ linuxkpi_ieee80211_ifattach(struct ieee80211_hw *hw) lhw->scan_flags |= LKPI_LHW_SCAN_HW; } -#ifdef __notyet__ - ic->ic_htcaps = IEEE80211_HTC_HT /* HT operation */ - | IEEE80211_HTC_AMPDU /* A-MPDU tx/rx */ - | IEEE80211_HTC_AMSDU /* A-MSDU tx/rx */ - | IEEE80211_HTCAP_MAXAMSDU_3839 - /* max A-MSDU length */ - | IEEE80211_HTCAP_SMPS_OFF; /* SM power save off */ - ic->ic_htcaps |= IEEE80211_HTCAP_SHORTGI20; - ic->ic_htcaps |= IEEE80211_HTCAP_CHWIDTH40 | IEEE80211_HTCAP_SHORTGI40; - ic->ic_htcaps |= IEEE80211_HTCAP_TXSTBC; -#endif - /* * The wiphy variables report bitmasks of avail antennas. * (*get_antenna) get the current bitmask sets which can be @@ -3863,6 +4281,33 @@ linuxkpi_ieee80211_ifattach(struct ieee80211_hw *hw) lhw->ic_node_free = ic->ic_node_free; ic->ic_node_free = lkpi_ic_node_free; +#ifdef LKPI_80211_HT + lhw->ic_recv_action = ic->ic_recv_action; + ic->ic_recv_action = lkpi_ic_recv_action; + lhw->ic_send_action = ic->ic_send_action; + ic->ic_send_action = lkpi_ic_send_action; + + lhw->ic_ampdu_enable = ic->ic_ampdu_enable; + ic->ic_ampdu_enable = lkpi_ic_ampdu_enable; + + lhw->ic_addba_request = ic->ic_addba_request; + ic->ic_addba_request = lkpi_ic_addba_request; + lhw->ic_addba_response = ic->ic_addba_response; + ic->ic_addba_response = lkpi_ic_addba_response; + lhw->ic_addba_stop = ic->ic_addba_stop; + ic->ic_addba_stop = lkpi_ic_addba_stop; + lhw->ic_addba_response_timeout = ic->ic_addba_response_timeout; + ic->ic_addba_response_timeout = lkpi_ic_addba_response_timeout; + + lhw->ic_bar_response = ic->ic_bar_response; + ic->ic_bar_response = lkpi_ic_bar_response; + + lhw->ic_ampdu_rx_start = ic->ic_ampdu_rx_start; + ic->ic_ampdu_rx_start = lkpi_ic_ampdu_rx_start; + lhw->ic_ampdu_rx_stop = ic->ic_ampdu_rx_stop; + ic->ic_ampdu_rx_stop = lkpi_ic_ampdu_rx_stop; +#endif + lkpi_radiotap_attach(lhw); /* @@ -3894,6 +4339,9 @@ linuxkpi_ieee80211_ifattach(struct ieee80211_hw *hw) continue; cfg80211_chandef_create(&hw->conf.chandef, &channels[i], +#ifdef LKPI_80211_HT + (ic->ic_htcaps & IEEE80211_HTC_HT) ? 0 : +#endif NL80211_CHAN_NO_HT); break; } @@ -3911,7 +4359,6 @@ linuxkpi_ieee80211_ifattach(struct ieee80211_hw *hw) /* * The maximum supported bitrates on any band + size for * DSSS Parameter Set give our per-band IE size. - * XXX-BZ FIXME add HT VHT ... later * SSID is the responsibility of the driver and goes on the side. * The user specified bits coming from the vap go into the * "common ies" fields. @@ -3929,6 +4376,15 @@ linuxkpi_ieee80211_ifattach(struct ieee80211_hw *hw) lhw->scan_ie_len += 2 + 1; } +#if defined(LKPI_80211_HT) + if ((ic->ic_htcaps & IEEE80211_HTC_HT) != 0) + lhw->scan_ie_len += sizeof(struct ieee80211_ie_htcap); +#endif +#if defined(LKPI_80211_VHT) + if ((ic->ic_flags_ext & IEEE80211_FEXT_VHT) != 0) + lhw->scan_ie_len += 2 + sizeof(struct ieee80211_vht_cap); +#endif + /* Reduce the max_scan_ie_len "left" by the amount we consume already. */ if (hw->wiphy->max_scan_ie_len > 0) { if (lhw->scan_ie_len > hw->wiphy->max_scan_ie_len) @@ -4328,8 +4784,9 @@ no_trace_beacons: * net80211 should take care of the other information (sync_tsf, * sync_dtim_count) as otherwise we need to parse the beacon. */ - } skip_device_ts: + ; + } if (vap != NULL && vap->iv_state > IEEE80211_S_INIT && ieee80211_radiotap_active_vap(vap)) { diff --git a/sys/compat/linuxkpi/common/src/linux_80211.h b/sys/compat/linuxkpi/common/src/linux_80211.h index 74dc3c9f9dee..ef1f841e4f22 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.h +++ b/sys/compat/linuxkpi/common/src/linux_80211.h @@ -62,11 +62,20 @@ #define D80211_TRACEX_DUMP (D80211_TRACE_TX_DUMP|D80211_TRACE_RX_DUMP) #define D80211_TRACE_STA 0x00010000 #define D80211_TRACE_MO 0x00100000 +#define D80211_TRACE_MODE 0x0f000000 +#define D80211_TRACE_MODE_HT 0x01000000 +#define D80211_TRACE_MODE_VHT 0x02000000 +#define D80211_TRACE_MODE_HE 0x04000000 +#define D80211_TRACE_MODE_EHT 0x08000000 #define IMPROVE_TXQ(...) \ if (linuxkpi_debug_80211 & D80211_IMPROVE_TXQ) \ printf("%s:%d: XXX LKPI80211 IMPROVE_TXQ\n", __func__, __LINE__) +#define IMPROVE_HT(...) \ + if (linuxkpi_debug_80211 & D80211_TRACE_MODE_HT) \ + printf("%s:%d: XXX LKPI80211 IMPROVE_HT\n", __func__, __LINE__) + struct lkpi_radiotap_tx_hdr { struct ieee80211_radiotap_header wt_ihdr; uint8_t wt_flags; @@ -190,6 +199,29 @@ struct lkpi_hw { /* name it mac80211_sc? */ void (*ic_node_cleanup)(struct ieee80211_node *); void (*ic_node_free)(struct ieee80211_node *); + /* HT and later functions. */ + int (*ic_recv_action)(struct ieee80211_node *, + const struct ieee80211_frame *, + const uint8_t *, const uint8_t *); + int (*ic_send_action)(struct ieee80211_node *, + int, int, void *); + int (*ic_ampdu_enable)(struct ieee80211_node *, + struct ieee80211_tx_ampdu *); + int (*ic_addba_request)(struct ieee80211_node *, + struct ieee80211_tx_ampdu *, int, int, int); + int (*ic_addba_response)(struct ieee80211_node *, + struct ieee80211_tx_ampdu *, int, int, int); + void (*ic_addba_stop)(struct ieee80211_node *, + struct ieee80211_tx_ampdu *); + void (*ic_addba_response_timeout)(struct ieee80211_node *, + struct ieee80211_tx_ampdu *); + void (*ic_bar_response)(struct ieee80211_node *, + struct ieee80211_tx_ampdu *, int); + int (*ic_ampdu_rx_start)(struct ieee80211_node *, + struct ieee80211_rx_ampdu *, int, int, int); + void (*ic_ampdu_rx_stop)(struct ieee80211_node *, + struct ieee80211_rx_ampdu *); + #define LKPI_MAC80211_DRV_STARTED 0x00000001 uint32_t sc_flags; #define LKPI_LHW_SCAN_RUNNING 0x00000001 @@ -312,5 +344,8 @@ void lkpi_80211_mo_sta_pre_rcu_remove(struct ieee80211_hw *, int lkpi_80211_mo_set_key(struct ieee80211_hw *, enum set_key_cmd, struct ieee80211_vif *, struct ieee80211_sta *, struct ieee80211_key_conf *); +int lkpi_80211_mo_ampdu_action(struct ieee80211_hw *, struct ieee80211_vif *, + struct ieee80211_ampdu_params *); + #endif /* _LKPI_SRC_LINUX_80211_H */ diff --git a/sys/compat/linuxkpi/common/src/linux_80211_macops.c b/sys/compat/linuxkpi/common/src/linux_80211_macops.c index 8f75b1bdf8b1..06bf1a58fef1 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211_macops.c +++ b/sys/compat/linuxkpi/common/src/linux_80211_macops.c @@ -696,3 +696,25 @@ lkpi_80211_mo_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, out: return (error); } + +int +lkpi_80211_mo_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif, + struct ieee80211_ampdu_params *params) +{ + struct lkpi_hw *lhw; + int error; + + lhw = HW_TO_LHW(hw); + if (lhw->ops->ampdu_action == NULL) { + error = EOPNOTSUPP; + goto out; + } + + LKPI_80211_TRACE_MO("hw %p vif %p params %p { %p, %d, %u, %u, %u, %u, %d }", + hw, vif, params, params->sta, params->action, params->buf_size, + params->timeout, params->ssn, params->tid, params->amsdu); + error = lhw->ops->ampdu_action(hw, vif, params); + +out: + return (error); +} From nobody Mon Feb 19 08:07:45 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdZsG1LQgz5B2pH; Mon, 19 Feb 2024 08:07:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdZsF6GXfz4KHc; Mon, 19 Feb 2024 08:07:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330065; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7MrIM17flnfbSg84KsL8UzeUtK+Mp92o5FoKmQLwuYk=; b=PB79kRJjvet5UyUBAqDBwhptvIRIzicIkl1XN1fS6ha6boGYpY/6lK5Bss9CldSmlnOnZw pul3lsABz5KSKfmt4GMjGyQpNtOY9+LlbmBWNvJKRFtlQVMsp5bywIekrP0kV25jouHeIb a1rndEr96bPNhRQwc8LXjZv8J/bIl3Y7XYB9WSRDw7URNi2BdG5XYY9Q2hW2M593WszWjX iQF2byMaxC0arnuKY8VnoHfNKeRGUA1i9CqO207bZOtjqWOP6m3P4haMMn8VXRvZ0MOrfL PToZ7YKUurSW8KZVQ+ZxVqYCoY8v8XhGl6dESq/Pg6nbSCB/kM7bRpizFPl+xA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330065; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7MrIM17flnfbSg84KsL8UzeUtK+Mp92o5FoKmQLwuYk=; b=eJ6Jx//9YlhZvl1CzCu/qlCy8mHex9BgZzmmqg7Pp1fdtOGAdRAJjSgE8nqrYCuJcHSF1Q Z90m0PtawsOpo870zKZHIYexwbizC+uCUw5xWRBIGkw37joTIpoibZz1J6+IiL1mytJSFh YC5L1sWqZpzfH7K1tZT2685EWrtRhzep9pnonRwT5tqTC4IdsyZxytj8eItEBXGybaHWkg OkRPy1seLHeG8+TwIvZJAqWP+DqafBWSnGGDen8IvEi64BrmrCMF+orhMBJfGaxi5/isIW xEd8+i3w0m23kcNgDtVu425L7ZQ4Cb0Hpb1jECvFCqKWgQuJNCp75+vJfXBWHA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708330065; a=rsa-sha256; cv=none; b=wsPoVBV5tlzGMtHa6a1WeP1QDuQD0owlBySLoTS2VPuL8wg08OhDkm/hv862fTIEePXwCN Hus9PlAue3ZZ3319aLhd/go1KwEYHamA0Di9Cg6bcQ/KpXyoMUGINcNaGKjxQeJ8oI/N89 atIKXOf/VnXMtNVzEVtpCec7dEGnIzT25qyz/ZOrZPnYWMvSGSJIjMdiob99rfdLFbk4Wu 9CUWE1z1vvZI3UiIETvIBMz4KpgGdctTY0YhBulShvkxXsk2WM8JJXmug4ELFLQt1RbE1T bnoestyvSgq8b/2qtZm/Ldy45HQBmlgOevjQFjNhENWdoUf+M4iwbuxJLwJQog== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdZsF55kSzRKm; Mon, 19 Feb 2024 08:07:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41J87ja7015674; Mon, 19 Feb 2024 08:07:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J87jpX015671; Mon, 19 Feb 2024 08:07:45 GMT (envelope-from git) Date: Mon, 19 Feb 2024 08:07:45 GMT Message-Id: <202402190807.41J87jpX015671@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 97186b5cf5aa - stable/13 - wpa: ctrl_iface set sendbuf size List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 97186b5cf5aa1d97f1a4e8e1b811315a39fb163d Auto-Submitted: auto-generated The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=97186b5cf5aa1d97f1a4e8e1b811315a39fb163d commit 97186b5cf5aa1d97f1a4e8e1b811315a39fb163d Author: Bjoern A. Zeeb AuthorDate: 2023-11-12 20:33:41 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-02-19 08:01:59 +0000 wpa: ctrl_iface set sendbuf size In order to avoid running into the default net.local.dgram.maxdgram of 2K currently when calling sendto(2) try to set the sndbuf size to the maximum ctrl message size. While on 14 and 15 this does not actually raise the limit anymore (and be7c095ac99ad29fd72b780c7d58949a38656c66 raised it for syslogd and this), FreeBSD 13 still requires this change and it will work as expected there. In addition we always ensure a large enough send buffer this way independent of kernel defaults. The problem occured, e.g., when the scan_list result had enough BSSIDs so the text output would exceed 2048 bytes. Sponsored by: The FreeBSD Foundation PR: 274990 Reviewed by: cy, adrian (with previous comment) Differential Revision: https://reviews.freebsd.org/D42558 (cherry picked from commit 1edc20b76953d9ef571b0bcf89b206b98ed13d9b) --- contrib/wpa/wpa_supplicant/ctrl_iface_unix.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/contrib/wpa/wpa_supplicant/ctrl_iface_unix.c b/contrib/wpa/wpa_supplicant/ctrl_iface_unix.c index 639573dae75e..deeed2b11833 100644 --- a/contrib/wpa/wpa_supplicant/ctrl_iface_unix.c +++ b/contrib/wpa/wpa_supplicant/ctrl_iface_unix.c @@ -506,6 +506,10 @@ static int wpas_ctrl_iface_open_sock(struct wpa_supplicant *wpa_s, struct group *grp; char *endp; int flags; +#if defined(__FreeBSD__) + int optval, rc; + socklen_t optlen; +#endif buf = os_strdup(wpa_s->conf->ctrl_interface); if (buf == NULL) @@ -679,6 +683,22 @@ havesock: } } +#if defined(__FreeBSD__) + /* Ensure we can send a full length message atomically. */ + optval = 0; + optlen = sizeof(optval); + if (getsockopt(priv->sock, SOL_SOCKET, SO_SNDBUF, &optval, &optlen) == -1) { + wpa_printf(MSG_INFO, "failed to get sndbuf for sock=%d: %s", + priv->sock, strerror(errno)); + } else if (optval < CTRL_IFACE_MAX_LEN) { + optval = CTRL_IFACE_MAX_LEN; + if (setsockopt(priv->sock, SOL_SOCKET, SO_SNDBUF, &optval, + sizeof(optval)) == -1) + wpa_printf(MSG_ERROR, "failed to set sndbuf for " + "sock=%d: %s", priv->sock, strerror(errno)); + } +#endif + eloop_register_read_sock(priv->sock, wpa_supplicant_ctrl_iface_receive, wpa_s, priv); wpa_msg_register_cb(wpa_supplicant_ctrl_iface_msg_cb); From nobody Mon Feb 19 08:07:47 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdZsJ4Blgz5B2s0; Mon, 19 Feb 2024 08:07:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdZsJ0ws2z4K4x; Mon, 19 Feb 2024 08:07:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330068; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NuyHHmnvfAAJUaPUhrCTDrsKSj+9zVzd0BNjYqFRDgU=; b=kZe+w8zuQvaVtfqyWbgZgEd6k/0Tpfz5zEMp/bcPUcKkTQz3lDpzk2wlAqMzblKc8zVlKI YhlbFmzFIGJp/ry1uo53sRuV2ocYYq/RBOK7ZEhePEaJXb6K/2g6AelIvonl64qo59AYoo eq7GbMy17SG7C+6KexV+lCckNYc22ZF//NCt+F5Gf/0z4dlnYskltKm7bE5nlFOpar4o+M 7cTPwPCYfEZVatvI8kLVSHgMwEmrEcCl9/93SYPH+vOFrv2UuOt3ASveQeDrTp/PWAmKty yiP5DJZhOBaAj233OABTnktCgKqORi9aalhK1h98MEr1D4vjiz+1OchwVJSVlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330068; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NuyHHmnvfAAJUaPUhrCTDrsKSj+9zVzd0BNjYqFRDgU=; b=HXeWodGk2GFRV+4Owf5zOUDzn+s2GUlaXoukl3AdKMp60A505eBH+EIRzGO9j+QHHu0w/Q Uosra8JIlejYYMz+HDDupXtsC+cp4ttTZblH2cfsq78KiQ9GUIkc4I9nRc3C/qiFQ+3hIb cpkX8sUe5hdXu+fah375wqoU55jgd/cLy/bV466prjUy6l8a01EgsTvbB+tVZpBc3xqqpM WsGOUpGE00VRSyh6KI8MR1vixrQURmVKFXJCy8O7dirJlh+ejJatzrT0gfS+KSqUwYyUR4 0y8VRzMhOCb0ICk46NLmGXII3QcoPCaemBmL67qI3ZHMw/+ytxv3Bobw84jHMw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708330068; a=rsa-sha256; cv=none; b=RQrIXq9bLarSaMmAgwv17KIyFBGjL7nstJh79HchpMzjS6n65rgct+AQsnnXjhUpbNXzaP PAE3mDsdjmCGhIEHw0+XsROO4Xai1NWvb4LTTtSPYKpq60WVfOIfc8b9Y1KdfPnCoqsJRl foQFfszyX7/mQ2TRIv0iDQJ+nB+unFdASAc4bdvYNHPMOu0ZzDzityz3BntUCpJ0zghBcq UnjoXPOl5XjVvuhFbtbGMuFZz/3XXo2qiZbtpe2TvoDdZ6thYHi/NthEmeC1tNWj3oQqEI C2WHcX5P9tMMu8e5o+dVM8xz/7XXOUEsD1yzCOoLeC6h/dXLRThnj8d2O5NpoQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdZsJ02FSzR84; Mon, 19 Feb 2024 08:07:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41J87lfX015768; Mon, 19 Feb 2024 08:07:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J87lht015765; Mon, 19 Feb 2024 08:07:47 GMT (envelope-from git) Date: Mon, 19 Feb 2024 08:07:47 GMT Message-Id: <202402190807.41J87lht015765@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 3df959638baa - stable/13 - LinuxKPI: 802.11: more TXQ implementation and locking List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3df959638baa60c1c88e9ac66289502f99ad8418 Auto-Submitted: auto-generated The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=3df959638baa60c1c88e9ac66289502f99ad8418 commit 3df959638baa60c1c88e9ac66289502f99ad8418 Author: Bjoern A. Zeeb AuthorDate: 2023-12-12 01:59:17 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-02-19 08:02:00 +0000 LinuxKPI: 802.11: more TXQ implementation and locking Implement ieee80211_handle_wake_tx_queue() and ieee80211_tx_dequeue_ni() while looking at the code. They are needed by various wireless drivers. Introduce an ltxq lock and protect the skbq by that. This prevents panics due to a race between a driver upcall and the net80211 tx downcall. While the former should be rcu protected we cannot rely on that. It remains questionable if we need to protect further fields there (with a different lock?). Also introduce a txq_mtx on the lhw which needs to be further deployed but we need to come up with a good strategy to not end up with 7 different locks. Sponsored by: The FreeBSD Foundation PR: 274178, 275710 Tested by: cc (cherry picked from commit eac3646fcdd445297cade756630335e23e92ea13) --- sys/compat/linuxkpi/common/include/net/mac80211.h | 27 +++++---- sys/compat/linuxkpi/common/src/linux_80211.c | 67 +++++++++++++++++++++-- sys/compat/linuxkpi/common/src/linux_80211.h | 29 +++++++++- 3 files changed, 107 insertions(+), 16 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index fa36bd84ac6e..c4d001b3a7e8 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -1117,6 +1117,8 @@ void linuxkpi_ieee80211_txq_schedule_start(struct ieee80211_hw *, uint8_t); struct ieee80211_txq *linuxkpi_ieee80211_next_txq(struct ieee80211_hw *, uint8_t); void linuxkpi_ieee80211_schedule_txq(struct ieee80211_hw *, struct ieee80211_txq *, bool); +void linuxkpi_ieee80211_handle_wake_tx_queue(struct ieee80211_hw *, + struct ieee80211_txq *); /* -------------------------------------------------------------------------- */ @@ -1681,7 +1683,7 @@ static inline void ieee80211_return_txq(struct ieee80211_hw *hw, struct ieee80211_txq *txq, bool withoutpkts) { - linuxkpi_ieee80211_schedule_txq(hw, txq, true); + linuxkpi_ieee80211_schedule_txq(hw, txq, withoutpkts); } static inline void @@ -1706,7 +1708,7 @@ static inline void ieee80211_handle_wake_tx_queue(struct ieee80211_hw *hw, struct ieee80211_txq *txq) { - TODO(); + linuxkpi_ieee80211_handle_wake_tx_queue(hw, txq); } /* -------------------------------------------------------------------------- */ @@ -2197,13 +2199,25 @@ ieee80211_tkip_add_iv(u8 *crypto_hdr, struct ieee80211_key_conf *keyconf, TODO(); } -static __inline struct sk_buff * +static inline struct sk_buff * ieee80211_tx_dequeue(struct ieee80211_hw *hw, struct ieee80211_txq *txq) { return (linuxkpi_ieee80211_tx_dequeue(hw, txq)); } +static inline struct sk_buff * +ieee80211_tx_dequeue_ni(struct ieee80211_hw *hw, struct ieee80211_txq *txq) +{ + struct sk_buff *skb; + + local_bh_disable(); + skb = linuxkpi_ieee80211_tx_dequeue(hw, txq); + local_bh_enable(); + + return (skb); +} + static __inline void ieee80211_update_mu_groups(struct ieee80211_vif *vif, u_int _i, uint8_t *ms, uint8_t *up) @@ -2456,13 +2470,6 @@ ieee80211_stop_rx_ba_session_offl(struct ieee80211_vif *vif, uint8_t *addr, TODO(); } -static __inline struct sk_buff * -ieee80211_tx_dequeue_ni(struct ieee80211_hw *hw, struct ieee80211_txq *txq) -{ - TODO(); - return (NULL); -} - static __inline void ieee80211_tx_rate_update(struct ieee80211_hw *hw, struct ieee80211_sta *sta, struct ieee80211_tx_info *info) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 5a60380d15aa..b71deedb12b8 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -330,6 +330,7 @@ lkpi_lsta_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN], ltxq->txq.sta = sta; TAILQ_ELEM_INIT(ltxq, txq_entry); skb_queue_head_init(<xq->skbq); + LKPI_80211_LTXQ_LOCK_INIT(ltxq); sta->txq[tid] = <xq->txq; } @@ -381,8 +382,13 @@ lkpi_lsta_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN], return (lsta); cleanup: - for (; tid >= 0; tid--) + for (; tid >= 0; tid--) { + struct lkpi_txq *ltxq; + + ltxq = TXQ_TO_LTXQ(sta->txq[tid]); + LKPI_80211_LTXQ_LOCK_DESTROY(ltxq); free(sta->txq[tid], M_LKPI80211); + } free(lsta, M_LKPI80211); return (NULL); } @@ -976,6 +982,7 @@ lkpi_wake_tx_queues(struct ieee80211_hw *hw, struct ieee80211_sta *sta, { struct lkpi_txq *ltxq; int tid; + bool ltxq_empty; /* Wake up all queues to know they are allocated in the driver. */ for (tid = 0; tid < nitems(sta->txq); tid++) { @@ -994,7 +1001,10 @@ lkpi_wake_tx_queues(struct ieee80211_hw *hw, struct ieee80211_sta *sta, if (dequeue_seen && !ltxq->seen_dequeue) continue; - if (no_emptyq && skb_queue_empty(<xq->skbq)) + LKPI_80211_LTXQ_LOCK(ltxq); + ltxq_empty = skb_queue_empty(<xq->skbq); + LKPI_80211_LTXQ_UNLOCK(ltxq); + if (no_emptyq && ltxq_empty) continue; lkpi_80211_mo_wake_tx_queue(hw, sta->txq[tid]); @@ -3541,6 +3551,7 @@ lkpi_80211_txq_tx_one(struct lkpi_sta *lsta, struct mbuf *m) KASSERT(ltxq != NULL, ("%s: lsta %p sta %p m %p skb %p " "ltxq %p != NULL\n", __func__, lsta, sta, m, skb, ltxq)); + LKPI_80211_LTXQ_LOCK(ltxq); skb_queue_tail(<xq->skbq, skb); #ifdef LINUXKPI_DEBUG_80211 if (linuxkpi_debug_80211 & D80211_TRACE_TX) @@ -3553,6 +3564,7 @@ lkpi_80211_txq_tx_one(struct lkpi_sta *lsta, struct mbuf *m) skb_queue_len(<xq->skbq), ltxq->txq.ac, ltxq->txq.tid, ac, skb->priority, skb->qmap); #endif + LKPI_80211_LTXQ_UNLOCK(ltxq); lkpi_80211_mo_wake_tx_queue(hw, <xq->txq); return; } @@ -4075,6 +4087,7 @@ linuxkpi_ieee80211_alloc_hw(size_t priv_len, const struct ieee80211_ops *ops) LKPI_80211_LHW_LOCK_INIT(lhw); LKPI_80211_LHW_SCAN_LOCK_INIT(lhw); + LKPI_80211_LHW_TXQ_LOCK_INIT(lhw); sx_init_flags(&lhw->lvif_sx, "lhw-lvif", SX_RECURSE | SX_DUPOK); TAILQ_INIT(&lhw->lvif_head); for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) { @@ -4113,9 +4126,10 @@ linuxkpi_ieee80211_iffree(struct ieee80211_hw *hw) lhw->ic = NULL; /* Cleanup more of lhw here or in wiphy_free()? */ - sx_destroy(&lhw->lvif_sx); - LKPI_80211_LHW_LOCK_DESTROY(lhw); + LKPI_80211_LHW_TXQ_LOCK_DESTROY(lhw); LKPI_80211_LHW_SCAN_LOCK_DESTROY(lhw); + LKPI_80211_LHW_LOCK_DESTROY(lhw); + sx_destroy(&lhw->lvif_sx); IMPROVE(); } @@ -5021,7 +5035,11 @@ linuxkpi_ieee80211_tx_dequeue(struct ieee80211_hw *hw, goto stopped; } + IMPROVE("hw(TX_FRAG_LIST)"); + + LKPI_80211_LTXQ_LOCK(ltxq); skb = skb_dequeue(<xq->skbq); + LKPI_80211_LTXQ_UNLOCK(ltxq); stopped: return (skb); @@ -5038,10 +5056,12 @@ linuxkpi_ieee80211_txq_get_depth(struct ieee80211_txq *txq, ltxq = TXQ_TO_LTXQ(txq); fc = bc = 0; + LKPI_80211_LTXQ_LOCK(ltxq); skb_queue_walk(<xq->skbq, skb) { fc++; bc += skb->len; } + LKPI_80211_LTXQ_UNLOCK(ltxq); if (frame_cnt) *frame_cnt = fc; if (byte_cnt) @@ -5594,13 +5614,17 @@ void linuxkpi_ieee80211_schedule_txq(struct ieee80211_hw *hw, { struct lkpi_hw *lhw; struct lkpi_txq *ltxq; + bool ltxq_empty; ltxq = TXQ_TO_LTXQ(txq); IMPROVE_TXQ("LOCKING"); /* Only schedule if work to do or asked to anyway. */ - if (!withoutpkts && skb_queue_empty(<xq->skbq)) + LKPI_80211_LTXQ_LOCK(ltxq); + ltxq_empty = skb_queue_empty(<xq->skbq); + LKPI_80211_LTXQ_UNLOCK(ltxq); + if (!withoutpkts && ltxq_empty) goto out; /* Make sure we do not double-schedule. */ @@ -5613,6 +5637,39 @@ out: return; } +void +linuxkpi_ieee80211_handle_wake_tx_queue(struct ieee80211_hw *hw, + struct ieee80211_txq *txq) +{ + struct lkpi_hw *lhw; + struct ieee80211_txq *ntxq; + struct ieee80211_tx_control control; + struct sk_buff *skb; + + lhw = HW_TO_LHW(hw); + + LKPI_80211_LHW_TXQ_LOCK(lhw); + ieee80211_txq_schedule_start(hw, txq->ac); + do { + ntxq = ieee80211_next_txq(hw, txq->ac); + if (ntxq == NULL) + break; + + memset(&control, 0, sizeof(control)); + control.sta = ntxq->sta; + do { + skb = linuxkpi_ieee80211_tx_dequeue(hw, ntxq); + if (skb == NULL) + break; + lkpi_80211_mo_tx(hw, &control, skb); + } while(1); + + ieee80211_return_txq(hw, ntxq, false); + } while (1); + ieee80211_txq_schedule_end(hw, txq->ac); + LKPI_80211_LHW_TXQ_UNLOCK(lhw); +} + /* -------------------------------------------------------------------------- */ struct lkpi_cfg80211_bss { diff --git a/sys/compat/linuxkpi/common/src/linux_80211.h b/sys/compat/linuxkpi/common/src/linux_80211.h index ef1f841e4f22..c9ac19321ab3 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.h +++ b/sys/compat/linuxkpi/common/src/linux_80211.h @@ -109,6 +109,7 @@ struct lkpi_radiotap_rx_hdr { struct lkpi_txq { TAILQ_ENTRY(lkpi_txq) txq_entry; + struct mtx ltxq_mtx; bool seen_dequeue; bool stopped; uint32_t txq_generation; @@ -184,6 +185,7 @@ struct lkpi_hw { /* name it mac80211_sc? */ struct sx sx; + struct mtx txq_mtx; uint32_t txq_generation[IEEE80211_NUM_ACS]; TAILQ_HEAD(, lkpi_txq) scheduled_txqs[IEEE80211_NUM_ACS]; @@ -279,13 +281,26 @@ struct lkpi_wiphy { mtx_destroy(&(_lhw)->scan_mtx); #define LKPI_80211_LHW_SCAN_LOCK(_lhw) \ mtx_lock(&(_lhw)->scan_mtx) -#define LKPI_80211_LHW_SCAN_UNLOCK(_lhw) \ +#define LKPI_80211_LHW_SCAN_UNLOCK(_lhw) \ mtx_unlock(&(_lhw)->scan_mtx) #define LKPI_80211_LHW_SCAN_LOCK_ASSERT(_lhw) \ mtx_assert(&(_lhw)->scan_mtx, MA_OWNED) #define LKPI_80211_LHW_SCAN_UNLOCK_ASSERT(_lhw) \ mtx_assert(&(_lhw)->scan_mtx, MA_NOTOWNED) +#define LKPI_80211_LHW_TXQ_LOCK_INIT(_lhw) \ + mtx_init(&(_lhw)->txq_mtx, "lhw-txq", NULL, MTX_DEF | MTX_RECURSE); +#define LKPI_80211_LHW_TXQ_LOCK_DESTROY(_lhw) \ + mtx_destroy(&(_lhw)->txq_mtx); +#define LKPI_80211_LHW_TXQ_LOCK(_lhw) \ + mtx_lock(&(_lhw)->txq_mtx) +#define LKPI_80211_LHW_TXQ_UNLOCK(_lhw) \ + mtx_unlock(&(_lhw)->txq_mtx) +#define LKPI_80211_LHW_TXQ_LOCK_ASSERT(_lhw) \ + mtx_assert(&(_lhw)->txq_mtx, MA_OWNED) +#define LKPI_80211_LHW_TXQ_UNLOCK_ASSERT(_lhw) \ + mtx_assert(&(_lhw)->txq_mtx, MA_NOTOWNED) + #define LKPI_80211_LHW_LVIF_LOCK(_lhw) sx_xlock(&(_lhw)->lvif_sx) #define LKPI_80211_LHW_LVIF_UNLOCK(_lhw) sx_xunlock(&(_lhw)->lvif_sx) @@ -295,6 +310,18 @@ struct lkpi_wiphy { #define LKPI_80211_LSTA_LOCK(_lsta) mtx_lock(&(_lsta)->txq_mtx) #define LKPI_80211_LSTA_UNLOCK(_lsta) mtx_unlock(&(_lsta)->txq_mtx) +#define LKPI_80211_LTXQ_LOCK_INIT(_ltxq) \ + mtx_init(&(_ltxq)->ltxq_mtx, "ltxq", NULL, MTX_DEF); +#define LKPI_80211_LTXQ_LOCK_DESTROY(_ltxq) \ + mtx_destroy(&(_ltxq)->ltxq_mtx); +#define LKPI_80211_LTXQ_LOCK(_ltxq) \ + mtx_lock(&(_ltxq)->ltxq_mtx) +#define LKPI_80211_LTXQ_UNLOCK(_ltxq) \ + mtx_unlock(&(_ltxq)->ltxq_mtx) +#define LKPI_80211_LTXQ_LOCK_ASSERT(_ltxq) \ + mtx_assert(&(_ltxq)->ltxq_mtx, MA_OWNED) +#define LKPI_80211_LTXQ_UNLOCK_ASSERT(_ltxq) \ + mtx_assert(&(_ltxq)->ltxq_mtx, MA_NOTOWNED) int lkpi_80211_mo_start(struct ieee80211_hw *); void lkpi_80211_mo_stop(struct ieee80211_hw *); From nobody Mon Feb 19 08:07:49 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdZsK4c4jz5B2mh; Mon, 19 Feb 2024 08:07:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdZsK27HGz4KDF; Mon, 19 Feb 2024 08:07:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330069; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5plwleapRWprJnJY/HoajrzYwgbIXeQtQTKbYewmC2s=; b=ZZAK+4SKRUpkH5rah0PCM1iQMYJ+3YrB3bPmYFWhkH130uQOwWyhXahPUW+8kGhdGdyDWB 6iPJtDbtBh3ut7sYTXN02SF78lUE+jhJcyIHel82oMdSJhAUgwj07OZi2qqZlAz3foMRk1 yvub4qS4L9vHHoZDc0AWssJMp+wn2FKY6jE+eBsezShlTh50cvxwSKY4220vAI3jfAlQOs PpigCzgzMkIdc+PJPD4xhLudxPOp1EBuWOY/iD7zD8mAEr6hwQ+s5LdIYuEZC3AQbfqtqf u6jBfAaCgBKkG2vtbvBF4z1F61Rn6c/vgHf30h1fFgaNhcYRK9DfgJOlGIsxkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330069; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5plwleapRWprJnJY/HoajrzYwgbIXeQtQTKbYewmC2s=; b=S0fSKKz91OgCstrgiZhBU1iqMVEzS1j5J706rWJjqC7MKVEgEePhVnOGVnGp6i9sg/Gske pMqzDz3Y2RXOxFigx1lLhZILF+9mWYBT1R+2sSQG4lbr0HYFyoS+GZ3o9vD+tluEwpEyBb yFxpipfITO7hIZbJHg5FqBLrQJRWsYWG8r0vv4z9QcChVgf687dt73pS/ggK/igtqC1xwt t1v5td+ukMpzeCKDd/7TEDjYIktVIPHd7oVrILd2IMFCGltD4Iv4wMg83IVYKsSx6aPYpe ZnePVg715/MnTdBL2zxtVMtNQC+hFD3MtzBGMuU8z0umkCj+X4QGBtURWv5GpQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708330069; a=rsa-sha256; cv=none; b=GL+IjuC2xwhyxFdRnwWWPXt4Is0Q5rewEY0UiDmY6aTSEhszIHklCtlXJYUSsSY3laIjCC Vks8aqv03tIjsQKJG0ANqjGOwIhwkETx4XvLou/5UBsA5xMcSyJ6ruYnc/NN+Ywo2N80NT JNoqZ6qKwe1gbwebctIxehxIXG9c0f0A/Swv5iFP9QAchBoK7NuR3mqwvSonivX83RIWDG IZu0rwcEBB9mBGpCwqrIuf7b6/Fd/YnXIicVtjbvrCHePQSPMCiSBK9BElEWNw2R8Ly4ZC qbBACKjwN6V+7dRI5ryAhCFL9fVT/oUOZoE5ajgpEAu7dUfkdr+z5GVmOJImCg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdZsK1F5yzRW1; Mon, 19 Feb 2024 08:07:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41J87nsv015819; Mon, 19 Feb 2024 08:07:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J87nqK015816; Mon, 19 Feb 2024 08:07:49 GMT (envelope-from git) Date: Mon, 19 Feb 2024 08:07:49 GMT Message-Id: <202402190807.41J87nqK015816@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: a2764047702d - stable/13 - net80211: improve logging about state transitions lost List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a2764047702db519aca9e1b3cf6b475e5a723c65 Auto-Submitted: auto-generated The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=a2764047702db519aca9e1b3cf6b475e5a723c65 commit a2764047702db519aca9e1b3cf6b475e5a723c65 Author: Bjoern A. Zeeb AuthorDate: 2023-11-12 23:51:14 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-02-19 08:02:00 +0000 net80211: improve logging about state transitions lost It is possible that we call ieee80211_new_state_locked() again before a previous task finished to completion (not run yet or unlocked in between) since 5efea30f039c4 (and follow-up). In either case we would overwrite the new state and argument in the vap. While most drivers somehow deal with that (or not), LinuxKPI 802.11 compat code has KASSERTs to keep net80211, LinuxKPI and driver/firmware state in sync and they may trigger due to a missing transition or more likely a changed ni/lsta. Enhance the wlandebug +state logging for these cases so they are easier to debug. While here remove the unconditional logging to the message buffer; it has been here for a good decade but not helped to actually identify and sort the problem. Sponsored by: The FreeBSD Foundation Reviewed by: cc Differential Revision: https://reviews.freebsd.org/D42560 (cherry picked from commit 72bb33a36b62fa30f69f01d3f6ae372be2c95b59) --- sys/net80211/ieee80211_proto.c | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c index f6d144169c48..cf467c08462c 100644 --- a/sys/net80211/ieee80211_proto.c +++ b/sys/net80211/ieee80211_proto.c @@ -2510,6 +2510,13 @@ ieee80211_newstate_cb(void *xvap, int npending) nstate = vap->iv_nstate; arg = vap->iv_nstate_arg; + IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, + "%s:%d: running state update %s -> %s (%d)\n", + __func__, __LINE__, + ieee80211_state_name[vap->iv_state], + ieee80211_state_name[vap->iv_nstate], + npending); + if (vap->iv_flags_ext & IEEE80211_FEXT_REINIT) { /* * We have been requested to drop back to the INIT before @@ -2677,29 +2684,30 @@ ieee80211_new_state_locked(struct ieee80211vap *vap, * until this is completed. */ IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, - "%s: %s -> %s (%s) transition discarded\n", - __func__, + "%s:%d: %s -> %s (%s) transition discarded\n", + __func__, __LINE__, ieee80211_state_name[vap->iv_state], ieee80211_state_name[nstate], ieee80211_state_name[vap->iv_nstate]); return -1; } else if (vap->iv_state != vap->iv_nstate) { -#if 0 /* Warn if the previous state hasn't completed. */ IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, - "%s: pending %s -> %s transition lost\n", __func__, + "%s:%d: pending %s -> %s (now to %s) transition lost\n", + __func__, __LINE__, ieee80211_state_name[vap->iv_state], - ieee80211_state_name[vap->iv_nstate]); -#else - /* XXX temporarily enable to identify issues */ - if_printf(vap->iv_ifp, - "%s: pending %s -> %s transition lost\n", - __func__, ieee80211_state_name[vap->iv_state], - ieee80211_state_name[vap->iv_nstate]); -#endif + ieee80211_state_name[vap->iv_nstate], + ieee80211_state_name[nstate]); } } + IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, + "%s:%d: starting state update %s -> %s (%s)\n", + __func__, __LINE__, + ieee80211_state_name[vap->iv_state], + ieee80211_state_name[vap->iv_nstate], + ieee80211_state_name[nstate]); + nrunning = nscanning = 0; /* XXX can track this state instead of calculating */ TAILQ_FOREACH(vp, &ic->ic_vaps, iv_next) { From nobody Mon Feb 19 08:07:50 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdZsL4lQVz5B2s5; Mon, 19 Feb 2024 08:07:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdZsL3Tczz4K80; Mon, 19 Feb 2024 08:07:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330070; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wof61PzbTtoyrZ84qMYmRSMOugP82pTgO0Mbh2wPJvg=; b=F8LFRbxOG4mrzL88Ywzq817XynN4RO5BSAFg3f5FF3Ks1zJPcdCIlFR5YSaTrVNbiWFMq+ MKC/j2bm4tjLXCnUZmPspWfUb0ncrO7yw+ysOPKygerxP1Pq2DKNc7FBmM4Z5FIjoyn82l COAR71ekfsq8NkbfBe7RWFWqvBo7sxeN6nw68KnEkjnN7mw6+empa8mr/iqS5ozKdGwx4p ko8yAnAaQkG2tcMx4MVdVoEpJvwsRXMVOTWd22k5yEIi+baIqluCBzvLUz+7Npuc5+e7XN 3p3Ng0cajV73DrPI95lR4jQIUOEjbOh8XiwtJ2qi/oLyP9x9RFBvKtylSjt6IA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330070; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wof61PzbTtoyrZ84qMYmRSMOugP82pTgO0Mbh2wPJvg=; b=abOcKCffUjIME+iRvkKzjgSEBcSwBkqIE5x1Yk9yfo+W81iOSdtVjmYdjK4FAII/nYShXa Ed+6a2vDD73i0Bwnho4et4EmY7BnNAyhcbRJB5Q1EVdnWFbqkWToUPsDz4B4A9MpdZrb2G Z+Qn44/VyE4TOkbIxSyUU558zMWSbaPaQvvWoR+RrGNomGNZ8VnbyQodrU7ZnYqFfODQm3 dSKIscIR3LA7m8ujcyg6gA0tnLNTpx5OxDra00lUV4KTt23f3dMvgWrPGHfSvUmSS4pA0Q CtxXZjMPWZP8gdPAEV3/ritdi5oPRlWlL5A+KbrPSNDIwxgXqzwzochM/3c2YQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708330070; a=rsa-sha256; cv=none; b=MrIY2RPfL/goHTB082Eo4N72Di5lBl6tLHYhVH2E533SvD69MJZpSPlH14tB48QJujzyOP 86VQ96fCqVq1iMlxrjUHxXithqsx/wUTDZROf2eIPVOIZcuB/txzGf6c0bSjJt97PcDb09 dT7Zkbi+pUTn3wwTnUE7b0cU25jz4ZbRVD3SIU43/cvx6uantruhOPXGdehoiO7SYHPqEf o8cZML7UGFQaTOfQEM5sheWnk41onWElFg1hSoRRDTUYtnTQ9wjrx9moR32T8dkvAGUyvc mozLUYSnqfNLN5k0eF5T1wKPvg6Yc8xxUDB6xsUSNAifeUTRYGFC9fT39QwEmg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdZsL2ZtCzRGf; Mon, 19 Feb 2024 08:07:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41J87ofn015873; Mon, 19 Feb 2024 08:07:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J87oJp015870; Mon, 19 Feb 2024 08:07:50 GMT (envelope-from git) Date: Mon, 19 Feb 2024 08:07:50 GMT Message-Id: <202402190807.41J87oJp015870@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 9d5aef293d90 - stable/13 - net80211: adjust more VHT structures/fields List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9d5aef293d90de29adffed908ce391d799b1dae4 Auto-Submitted: auto-generated The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=9d5aef293d90de29adffed908ce391d799b1dae4 commit 9d5aef293d90de29adffed908ce391d799b1dae4 Author: Bjoern A. Zeeb AuthorDate: 2023-12-02 20:40:51 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-02-19 08:02:00 +0000 net80211: adjust more VHT structures/fields Replace ieee80211_ie_vhtcap with ieee80211_vht_cap and ieee80211_ie_vht_operation with ieee80211_vht_operation. The "ie" version has the two bytes type/length at the beginning which we did not actually use as such (the one place doing did just as unused extra work). Using the non-"ie" versions allows us to re-use them on shared code. Using an enum helps us to not accidentally get unsuppored or unhandled values tough we cannot use it in the struct as we need to ensure the field width. ieee80211_vht_operation is guarded by _KERNEL/WANT_NET80211. While the header is supposed to be exported to user land historically, software such as wpa bring their own structure definitions. For in-tree usage it is only ifconfig which really cares (at least for now). Sponsored by: The FreeBSD Foundation Reviewed by: adrian (earlier), cc Differential Revision: https://reviews.freebsd.org/D42901 (cherry picked from commit e85eb4c8d7bd8051c351a6fc6982a8b3bcfdbb2d) --- sbin/ifconfig/ifieee80211.c | 32 ++++++++++++++++++++++++-------- sys/net80211/ieee80211.h | 38 +++++++++++++++++--------------------- sys/net80211/ieee80211_hostap.c | 4 ++-- sys/net80211/ieee80211_input.c | 4 ++-- sys/net80211/ieee80211_output.c | 16 ++++++++-------- sys/net80211/ieee80211_vht.c | 23 ++++++----------------- sys/net80211/ieee80211_vht.h | 4 ++-- 7 files changed, 61 insertions(+), 60 deletions(-) diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c index bf54e7b6de70..0271fded95ba 100644 --- a/sbin/ifconfig/ifieee80211.c +++ b/sbin/ifconfig/ifieee80211.c @@ -70,6 +70,7 @@ #include #include +#define WANT_NET80211 1 #include #include #include @@ -2780,10 +2781,18 @@ printvhtcap(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen) { printf("%s", tag); if (verbose) { - const struct ieee80211_ie_vhtcap *vhtcap = - (const struct ieee80211_ie_vhtcap *) ie; - uint32_t vhtcap_info = LE_READ_4(&vhtcap->vht_cap_info); + const struct ieee80211_vht_cap *vhtcap; + uint32_t vhtcap_info; + /* Check that the the right size. */ + if (ie[1] != sizeof(*vhtcap)) { + printf(""); + return; + } + /* Skip Element ID and Length. */ + vhtcap = (const struct ieee80211_vht_cap *)(ie + 2); + + vhtcap_info = LE_READ_4(&vhtcap->vht_cap_info); printf("supp_mcs.rx_mcs_map)); @@ -2803,13 +2812,20 @@ printvhtinfo(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen) { printf("%s", tag); if (verbose) { - const struct ieee80211_ie_vht_operation *vhtinfo = - (const struct ieee80211_ie_vht_operation *) ie; + const struct ieee80211_vht_operation *vhtinfo; + + /* Check that the the right size. */ + if (ie[1] != sizeof(*vhtinfo)) { + printf(""); + return; + } + /* Skip Element ID and Length. */ + vhtinfo = (const struct ieee80211_vht_operation *)(ie + 2); - printf("", + printf("", vhtinfo->chan_width, - vhtinfo->center_freq_seg1_idx, - vhtinfo->center_freq_seg2_idx, + vhtinfo->center_freq_seq0_idx, + vhtinfo->center_freq_seq1_idx, LE_READ_2(&vhtinfo->basic_mcs_set)); } } diff --git a/sys/net80211/ieee80211.h b/sys/net80211/ieee80211.h index cd69f72f5c51..e6533705811e 100644 --- a/sys/net80211/ieee80211.h +++ b/sys/net80211/ieee80211.h @@ -866,29 +866,25 @@ struct ieee80211_vht_cap { struct ieee80211_vht_mcs_info supp_mcs; } __packed; -/* VHT capabilities element: 802.11ac-2013 8.4.2.160 */ -struct ieee80211_ie_vhtcap { - uint8_t ie; - uint8_t len; - uint32_t vht_cap_info; - struct ieee80211_vht_mcs_info supp_mcs; -} __packed; - -/* VHT operation mode subfields - 802.11ac-2013 Table 8.183x */ -#define IEEE80211_VHT_CHANWIDTH_USE_HT 0 /* Use HT IE for chw */ -#define IEEE80211_VHT_CHANWIDTH_80MHZ 1 /* 80MHz */ -#define IEEE80211_VHT_CHANWIDTH_160MHZ 2 /* 160MHz */ -#define IEEE80211_VHT_CHANWIDTH_80P80MHZ 3 /* 80+80MHz */ +/* 802.11ac-2013, Table 8-183x-VHT Operation Information subfields */ +enum ieee80211_vht_chanwidth { + IEEE80211_VHT_CHANWIDTH_USE_HT = 0, /* 20 MHz or 40 MHz */ + IEEE80211_VHT_CHANWIDTH_80MHZ = 1, /* 80MHz */ + IEEE80211_VHT_CHANWIDTH_160MHZ = 2, /* 160MHz */ + IEEE80211_VHT_CHANWIDTH_80P80MHZ = 3, /* 80+80MHz */ + /* 4..255 reserved. */ +}; -/* VHT operation IE - 802.11ac-2013 8.4.2.161 */ -struct ieee80211_ie_vht_operation { - uint8_t ie; - uint8_t len; - uint8_t chan_width; - uint8_t center_freq_seg1_idx; - uint8_t center_freq_seg2_idx; - uint16_t basic_mcs_set; +/* The name conflicts with the same structure in wpa. Only ifconfig needs this. */ +#if defined(_KERNEL) || defined(WANT_NET80211) +/* 802.11ac-2013 8.4.2.161 VHT Operation element */ +struct ieee80211_vht_operation { + uint8_t chan_width; /* enum ieee80211_vht_chanwidth */ + uint8_t center_freq_seq0_idx; /* 20/40/80/160 - VHT chan1 */ + uint8_t center_freq_seq1_idx; /* 80+80 - VHT chan2 */ + uint16_t basic_mcs_set; /* Basic VHT-MCS and NSS Set */ } __packed; +#endif /* 802.11ac VHT Capabilities */ #define IEEE80211_VHTCAP_MAX_MPDU_LENGTH_3895 0x00000000 diff --git a/sys/net80211/ieee80211_hostap.c b/sys/net80211/ieee80211_hostap.c index d80d658317ed..2f6317d9d8de 100644 --- a/sys/net80211/ieee80211_hostap.c +++ b/sys/net80211/ieee80211_hostap.c @@ -2124,12 +2124,12 @@ hostap_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0, /* Validate VHT IEs */ if (vhtcap != NULL) { IEEE80211_VERIFY_LENGTH(vhtcap[1], - sizeof(struct ieee80211_ie_vhtcap) - 2, + sizeof(struct ieee80211_vht_cap), return); } if (vhtinfo != NULL) { IEEE80211_VERIFY_LENGTH(vhtinfo[1], - sizeof(struct ieee80211_ie_vht_operation) - 2, + sizeof(struct ieee80211_vht_operation), return); } diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c index 492a3038c971..a1db4a50c2ce 100644 --- a/sys/net80211/ieee80211_input.c +++ b/sys/net80211/ieee80211_input.c @@ -769,12 +769,12 @@ ieee80211_parse_beacon(struct ieee80211_node *ni, struct mbuf *m, /* Process VHT IEs */ if (scan->vhtcap != NULL) { IEEE80211_VERIFY_LENGTH(scan->vhtcap[1], - sizeof(struct ieee80211_ie_vhtcap) - 2, + sizeof(struct ieee80211_vht_cap), scan->vhtcap = NULL); } if (scan->vhtopmode != NULL) { IEEE80211_VERIFY_LENGTH(scan->vhtopmode[1], - sizeof(struct ieee80211_ie_vht_operation) - 2, + sizeof(struct ieee80211_vht_operation), scan->vhtopmode = NULL); } diff --git a/sys/net80211/ieee80211_output.c b/sys/net80211/ieee80211_output.c index 288f0c7da2c8..2819114651d5 100644 --- a/sys/net80211/ieee80211_output.c +++ b/sys/net80211/ieee80211_output.c @@ -2455,7 +2455,7 @@ ieee80211_probereq_ie_len(struct ieee80211vap *vap, struct ieee80211com *ic) sizeof(struct ieee80211_ie_htcap) : 0) #ifdef notyet + sizeof(struct ieee80211_ie_htinfo) /* XXX not needed? */ - + sizeof(struct ieee80211_ie_vhtcap) + + 2 + sizeof(struct ieee80211_vht_cap) #endif + ((vap->iv_flags & IEEE80211_F_WPA1 && vap->iv_wpa_ie != NULL) ? vap->iv_wpa_ie[1] : 0) @@ -2820,7 +2820,7 @@ ieee80211_send_mgmt(struct ieee80211_node *ni, int type, int arg) + 2 + 26 + sizeof(struct ieee80211_wme_info) + sizeof(struct ieee80211_ie_htcap) - + sizeof(struct ieee80211_ie_vhtcap) + + 2 + sizeof(struct ieee80211_vht_cap) + 4 + sizeof(struct ieee80211_ie_htcap) #ifdef IEEE80211_SUPPORT_SUPERG + sizeof(struct ieee80211_ath_ie) @@ -2953,8 +2953,8 @@ ieee80211_send_mgmt(struct ieee80211_node *ni, int type, int arg) + 2 + (IEEE80211_RATE_MAXSIZE - IEEE80211_RATE_SIZE) + sizeof(struct ieee80211_ie_htcap) + 4 + sizeof(struct ieee80211_ie_htinfo) + 4 - + sizeof(struct ieee80211_ie_vhtcap) - + sizeof(struct ieee80211_ie_vht_operation) + + 2 + sizeof(struct ieee80211_vht_cap) + + 2 + sizeof(struct ieee80211_vht_operation) + sizeof(struct ieee80211_wme_param) #ifdef IEEE80211_SUPPORT_SUPERG + sizeof(struct ieee80211_ath_ie) @@ -3112,8 +3112,8 @@ ieee80211_alloc_proberesp(struct ieee80211_node *bss, int legacy) + sizeof(struct ieee80211_wme_param) + 4 + sizeof(struct ieee80211_ie_htcap) + 4 + sizeof(struct ieee80211_ie_htinfo) - + sizeof(struct ieee80211_ie_vhtcap) - + sizeof(struct ieee80211_ie_vht_operation) + + 2 + sizeof(struct ieee80211_vht_cap) + + 2 + sizeof(struct ieee80211_vht_operation) #ifdef IEEE80211_SUPPORT_SUPERG + sizeof(struct ieee80211_ath_ie) #endif @@ -3727,8 +3727,8 @@ ieee80211_beacon_alloc(struct ieee80211_node *ni) /* XXX conditional? */ + 4+2*sizeof(struct ieee80211_ie_htcap)/* HT caps */ + 4+2*sizeof(struct ieee80211_ie_htinfo)/* HT info */ - + sizeof(struct ieee80211_ie_vhtcap)/* VHT caps */ - + sizeof(struct ieee80211_ie_vht_operation)/* VHT info */ + + 2 + sizeof(struct ieee80211_vht_cap)/* VHT caps */ + + 2 + sizeof(struct ieee80211_vht_operation)/* VHT info */ + (vap->iv_caps & IEEE80211_C_WME ? /* WME */ sizeof(struct ieee80211_wme_param) : 0) #ifdef IEEE80211_SUPPORT_SUPERG diff --git a/sys/net80211/ieee80211_vht.c b/sys/net80211/ieee80211_vht.c index 1561255be101..77a36a395d5c 100644 --- a/sys/net80211/ieee80211_vht.c +++ b/sys/net80211/ieee80211_vht.c @@ -342,7 +342,7 @@ ieee80211_vht_node_leave(struct ieee80211_node *ni) */ void ieee80211_vht_get_vhtcap_ie(struct ieee80211_node *ni, - struct ieee80211_ie_vhtcap *vhtcap, int opmode) + struct ieee80211_vht_cap *vhtcap, int opmode) { struct ieee80211vap *vap = ni->ni_vap; // struct ieee80211com *ic = vap->iv_ic; @@ -350,9 +350,6 @@ ieee80211_vht_get_vhtcap_ie(struct ieee80211_node *ni, uint32_t new_vhtcap; int i; - vhtcap->ie = IEEE80211_ELEMID_VHT_CAP; - vhtcap->len = sizeof(struct ieee80211_ie_vhtcap) - 2; - /* * Capabilities - it depends on whether we are a station * or not. @@ -680,19 +677,12 @@ ieee80211_vht_get_vhtcap_ie(struct ieee80211_node *ni, uint8_t * ieee80211_add_vhtcap(uint8_t *frm, struct ieee80211_node *ni) { - struct ieee80211_ie_vhtcap vhtcap; - int opmode; - - opmode = 0; - if (ni->ni_vap->iv_opmode == IEEE80211_M_STA) - opmode = 1; - - ieee80211_vht_get_vhtcap_ie(ni, &vhtcap, opmode); + struct ieee80211_vht_cap vhtcap; - memset(frm, '\0', sizeof(struct ieee80211_ie_vhtcap)); + ieee80211_vht_get_vhtcap_ie(ni, &vhtcap, 1); frm[0] = IEEE80211_ELEMID_VHT_CAP; - frm[1] = sizeof(struct ieee80211_ie_vhtcap) - 2; + frm[1] = sizeof(vhtcap); frm += 2; /* 32-bit VHT capability */ @@ -775,10 +765,9 @@ ieee80211_vht_get_chwidth_ie(struct ieee80211_channel *c) uint8_t * ieee80211_add_vhtinfo(uint8_t *frm, struct ieee80211_node *ni) { - memset(frm, '\0', sizeof(struct ieee80211_ie_vht_operation)); frm[0] = IEEE80211_ELEMID_VHT_OPMODE; - frm[1] = sizeof(struct ieee80211_ie_vht_operation) - 2; + frm[1] = sizeof(struct ieee80211_vht_operation); frm += 2; /* 8-bit chanwidth */ @@ -886,7 +875,7 @@ ieee80211_vht_adjust_channel(struct ieee80211com *ic, */ void ieee80211_vht_get_vhtinfo_ie(struct ieee80211_node *ni, - struct ieee80211_ie_vht_operation *vhtop, int opmode) + struct ieee80211_vht_operation *vhtop, int opmode) { printf("%s: called; TODO!\n", __func__); } diff --git a/sys/net80211/ieee80211_vht.h b/sys/net80211/ieee80211_vht.h index 756c2e367485..f2d1706ea0f2 100644 --- a/sys/net80211/ieee80211_vht.h +++ b/sys/net80211/ieee80211_vht.h @@ -61,8 +61,8 @@ struct ieee80211_channel * struct ieee80211_channel *, int); void ieee80211_vht_get_vhtcap_ie(struct ieee80211_node *ni, - struct ieee80211_ie_vhtcap *, int); + struct ieee80211_vht_cap *, int); void ieee80211_vht_get_vhtinfo_ie(struct ieee80211_node *ni, - struct ieee80211_ie_vht_operation *, int); + struct ieee80211_vht_operation *, int); #endif /* _NET80211_IEEE80211_VHT_H_ */ From nobody Mon Feb 19 08:07:51 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdZsN1h6kz5B307; Mon, 19 Feb 2024 08:07:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdZsM4WxWz4KMH; Mon, 19 Feb 2024 08:07:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YTrewU6YoIjBtwLXPAUSRLhpppAIoxm5hLOkASn6fco=; b=Lvm48jaVxNK8v1nn3BBlRZY618dZLtxYlTdi+lxpKaWGs2vnQJ5ic3eXjr03iKM/sroLok JP5PO/y6kOGepODBMRvpbrdQ58txcMfzNG32IRsvNNE5FeY0Hg4wAD3Frk+7kop5D1ObXX +JW75SCz/8qG4yYmZK/t5r0NPehyfErklKvlgZN80IOFrAhuBAEOjfvtMbfBRMdZs55sWG HHe9wDXfivs7EX+Bey4SiVT+S/mXNE3A3pgbUIQhf8JRqRnSQlzNw6NlHL33GZ1+e7p/ZT v1rj3kAU9FIktGZyfuMN5M4NTXIiaNZ8XiPcEtzsYA3JNmiCfTlPrxfAhAvu4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YTrewU6YoIjBtwLXPAUSRLhpppAIoxm5hLOkASn6fco=; b=GaatdkqNbEBvpI3QzfA65xPyru2mRyawjSm/rGGXvOWMOxOLNKrEgjrfMsF2vmV2Vx1fbm wyR3LczTBreIJgmzmmPXuH04lo7LtzgTfKEBbPT803vfBstzF/ghDu3L6Ymp9297a7svhv G7uOHEWzL/MYE650vQ5QQGCjYXOwQ8Q6Uj685L5SZbxaA+6rM/XMaoe9BJuRqQZ+LVFHFU pWSBv+m0jyp3yxXuDkQsj5bIw2vIfD3xOLj7ZI+IE7sKfvRO24j1KY9jdO+M5/9zEOV9e+ iYKWCiIOU2lMXltZGt/XWIyeOepCqXqqZeXHWEthl8Y9Ysam96GD1SxyLTcQYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708330071; a=rsa-sha256; cv=none; b=xXEG4N4W0bIf8fRgNOGdEOCwX5XzmwXF68RjWFkyR1XDNBFjmSEX1nNw1TZlRo6yUFR/3z sRJYf0u/HomJu7xt/vByeBfKiFQ+th8bjNlMWXDhdOcwQ3uFeHtXQ8L6DK+3E24605IKH0 xlEM9HDLj1MnO5kSUTZ2kgxib93TZGqVaU41MqImg85ES9lHj/3ae/IqZjz+oVF6cqs9ov C3nQJVgTqlSAroa7XkAKOMCyB7qBQQF6foc6Ji5mQVpKCrVaavd7t1i1P/EsUYeU+43CYE yvo5mmcLrUw61NVz3syVLPaElPwWmlxPOxU1ODZkCsAK28XSDumnDaNVK49+fA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdZsM3dS6zRGg; Mon, 19 Feb 2024 08:07:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41J87pqA015927; Mon, 19 Feb 2024 08:07:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J87pVB015924; Mon, 19 Feb 2024 08:07:51 GMT (envelope-from git) Date: Mon, 19 Feb 2024 08:07:51 GMT Message-Id: <202402190807.41J87pVB015924@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 1cf1f094680f - stable/13 - LinuxKPI: 802.11: fix field order in ieee80211_key_conf List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1cf1f094680fe3bfd9836800f83ed0b79e180340 Auto-Submitted: auto-generated The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=1cf1f094680fe3bfd9836800f83ed0b79e180340 commit 1cf1f094680fe3bfd9836800f83ed0b79e180340 Author: Bjoern A. Zeeb AuthorDate: 2024-01-28 00:51:23 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-02-19 08:02:00 +0000 LinuxKPI: 802.11: fix field order in ieee80211_key_conf When adding the new field link_id to struct ieee80211_key_conf, it was erroneously placed at the end of the struct; the zero-length (variable sized) array for the key always needs to stay last. Resort fields and add hopefully helpful comment to avoid the problem in the future. Fixes: adff403fe7a87 Reviewed by: cc Differential Revision: https://reviews.freebsd.org/D43635 (cherry picked from commit 828ce22f079df77b3bf52c4cf296959ea66bdc11) --- sys/compat/linuxkpi/common/include/net/mac80211.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index c4d001b3a7e8..293b6868cd50 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -510,9 +510,9 @@ struct ieee80211_key_conf { uint8_t hw_key_idx; /* Set by drv. */ uint8_t keyidx; uint16_t flags; - uint8_t keylen; - uint8_t key[0]; int8_t link_id; /* signed! */ + uint8_t keylen; + uint8_t key[0]; /* Must stay last! */ }; struct ieee80211_key_seq { From nobody Mon Feb 19 08:07:52 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdZsP00Ffz5B2xL; Mon, 19 Feb 2024 08:07:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdZsN5cV9z4KV6; Mon, 19 Feb 2024 08:07:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330072; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a8rfzGbR1CZykfhCA5wjJS8yeFLfRfoOKpygPh8CrBw=; b=lWr05bU8zcgSv1zZNoC7+dEoE8HU6jmZ35Eu4WZRO/f921BMzol/6p+HrE2c73t2L1HuqR ZlrozfHBBDkkkyG7ObrJVA9ajcr8DbHMvkOxBgAmmxAz/Wjn5ghmLjZvOuKZjPQMPB1ynv IFHef2JmdbNSbWLH4846qmD8IuDPV2aiHNtY46MdzWXaDiFS5InTQ9D44W4qfTOVYdvRmk 3c8Q7oqwzXFu4QphMw0NPx/LU21gxqwcMZsthtljoXAgkuYduKzMhfQUVGfGLRFsO0YzEJ jn9LD4KZNRqjGyoM0/K/mTN+xAn/jMNcDe0n66eNzj4ak7g3yW1upgKyvsJTzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330072; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a8rfzGbR1CZykfhCA5wjJS8yeFLfRfoOKpygPh8CrBw=; b=pmBGlVoFiZIg4P6FcdQ5+sE2G8YOLENJ88KD4NdkPNKPe4BV4hKglz0FK88ogUphNibeEq 9Huk9WG9TP/t54NqhGmUbbGmc0oDh8aM6YDruUtNiVjzo+g7G/bGysyzq7QrJ4k28Of/Fb f/jBiBhmCtUJw5bz8yi3PbMGa8Zb0WkV0C4VrPe+P+4nHeyWOLimRzKlSi9eqwU9831km5 wC8Dn0gH2tTvnr2H2XxW39oQ1QkLJZUfgztf0KbYA3p77oWmYbHNSq6I6LaZSUDBsWeWwa yBmuEM0FgiysCRKuIsXwNNvc1VgBlc4qKNJiBgu1IX9R4cVJfo7ftUElxh9RKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708330072; a=rsa-sha256; cv=none; b=qyUkdiXJnQ2oyLBw7XJsDVbLjjFWW7Uhv9taXJNPFAQmyjup9S0yzd8b9skJwakWV43a5W E69VcAiY94mlaQLVB1UgeSXlMvr3Fdk8xekn2mtzBu36JpLzlm5ltwF7JkxlbPcLaOIj6C dh/nBe2Ghfh323MFSyWc+sspUgAgIWsltD1CVVNkqtKq0JyDRhmrmre7YASvn3sBbD06+2 S3Sla96NMNrAid89L6yVzKHkEdxf/wpYTIfm2q34hTDAsWMQHZSc0RRHWpfiUqbnSnZQQ9 d422CW6+zT9/dBfVtSSj5yDnHUc/YyVMEgqplv4hvOnah6kciuRf7GZ2uAgpgg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdZsN4hTgzR5K; Mon, 19 Feb 2024 08:07:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41J87qRZ015978; Mon, 19 Feb 2024 08:07:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J87qBo015975; Mon, 19 Feb 2024 08:07:52 GMT (envelope-from git) Date: Mon, 19 Feb 2024 08:07:52 GMT Message-Id: <202402190807.41J87qBo015975@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: b42f8328250a - stable/13 - LinuxKPI: 802.11: extend ieee80211_key_seq and WLAN_KEY_LEN_* defines List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b42f8328250ad257cb43a9407245f22b1e2936cc Auto-Submitted: auto-generated The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=b42f8328250ad257cb43a9407245f22b1e2936cc commit b42f8328250ad257cb43a9407245f22b1e2936cc Author: Bjoern A. Zeeb AuthorDate: 2024-01-29 14:21:17 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-02-19 08:02:00 +0000 LinuxKPI: 802.11: extend ieee80211_key_seq and WLAN_KEY_LEN_* defines For iwlwifi(4) d3.c we need another struct in struct ieee80211_key_seq and related WLAN_KEY_LEN_* defines in. Reviewed by: cc, emaste Differential Revision: https://reviews.freebsd.org/D43646 (cherry picked from commit 2f029bf911e29dc46c32ea142daba4f26a2078f4) --- sys/compat/linuxkpi/common/include/linux/ieee80211.h | 4 ++++ sys/compat/linuxkpi/common/include/net/mac80211.h | 3 +++ 2 files changed, 7 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/ieee80211.h b/sys/compat/linuxkpi/common/include/linux/ieee80211.h index 5c18bb9fe3d9..09487a318811 100644 --- a/sys/compat/linuxkpi/common/include/linux/ieee80211.h +++ b/sys/compat/linuxkpi/common/include/linux/ieee80211.h @@ -133,7 +133,11 @@ enum wlan_ht_cap_sm_ps { #define WLAN_KEY_LEN_TKIP 32 #define WLAN_KEY_LEN_CCMP 16 #define WLAN_KEY_LEN_GCMP 16 +#define WLAN_KEY_LEN_AES_CMAC 16 #define WLAN_KEY_LEN_GCMP_256 32 +#define WLAN_KEY_LEN_BIP_CMAC_256 32 +#define WLAN_KEY_LEN_BIP_GMAC_128 16 +#define WLAN_KEY_LEN_BIP_GMAC_256 32 /* 802.11-2020, 9.4.2.55.3, Table 9-185 Subfields of the A-MPDU Parameters field */ enum ieee80211_min_mpdu_start_spacing { diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index 293b6868cd50..fc9d7829dae3 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -528,6 +528,9 @@ struct ieee80211_key_seq { struct { uint8_t pn[IEEE80211_CCMP_PN_LEN]; } aes_cmac; + struct { + uint8_t pn[IEEE80211_CCMP_PN_LEN]; + } aes_gmac; struct { uint32_t iv32; uint16_t iv16; From nobody Mon Feb 19 08:07:53 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdZsQ0m4zz5B30B; Mon, 19 Feb 2024 08:07:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdZsP6fWFz4KXW; Mon, 19 Feb 2024 08:07:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330073; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d3BVNCpieAXLztGUMeSzFsvM9Xh+qsD3NReqI4hxlLw=; b=feRCjf/A/H+jhc+znL7ddllLWp3rNcL5Mgma3Eu8/IFW9+d+CzERGYoldl48ts/2cq5Dhu 2OzByeeZrelxrFEIEo95aTmRPTWVz23S5C78ntTYSiY1tTiDtp0vWynwo0zzNKd2oVyGor mgTyhQUyxD6G0GgmP55EzM7gva5ySzbC4fWNVaWPQvdlCjCiyoF/0PUCFhvbpy4TggT4Bf btIaqvH6Seyky758bUUzCIJmOF+7pWL4pzXzxst2fsVOtPcRi8/wVquezjsjJm/TdyIMmb z6pEYIxpzOFds8v3wostywG4+x7MsXHIzz8IbwUfbPDPC+EMFrniFLhoWW0OOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330073; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d3BVNCpieAXLztGUMeSzFsvM9Xh+qsD3NReqI4hxlLw=; b=PBlDjVl5fCit5ziFX5EpFodZsiY6Mq49add9d8p3n3YJu1dl+GkGAk1jJ1ulGYoCJ4ZiXd Mk6JMKJe7zadJbYn3a5u1Mx34/WWD0nTQ+u2QfyENjTUq70IxX8M5DeOtn/KymCCV6HnMt 7obmh58dLplg/Z3sDwCyKkHP8N/a3PBEfxmQ5DHfVEABLMt1kCAa9LPzObotd5vwX6FRhu fTJvDGiIZEyA2wnnJeWhONz6ZVxsWjHRHXSd0x2/Dx80+ood/3yrbqQmZRXHPDslG+SUfM carB76LeMbb7pEtYjeGbS9f8sAlL4jHEFTjFI9+xOkvXDErJa5wFwIfgKIqKNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708330073; a=rsa-sha256; cv=none; b=aZXb6D47xm0WTriD1Ifs0RfC7yok5BEUTkFgz7y8qnGTimtu7+b3O7UEzJrwU7UmTVQIsX xu+Vjb0uTKvcIBPpS4jkCtIrko9JeoOUtF0KTdogP0Nb2y7jGtZ+ZwmBSh1oxscjUHatGE zFD/MxoReKs8tiMLBvD4HaVH/rWr0JoDOR+2p4O1TGPh9x2zcDDhQ+RKr/tbftqtD4oEPo l1EZyuFn22xxLoehsi9tLR/pI/p7TIRjXe61zCbPZjGoIkQglke3Rtla7R8t+NFB0QimTe /u+XSLWc7/xO2uwJn1JT5ZpZMDZN8QlpdKeafo2R615F/8R1PMoomA9ul2gabw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdZsP5jC6zRDm; Mon, 19 Feb 2024 08:07:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41J87rWR016026; Mon, 19 Feb 2024 08:07:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J87rdx016023; Mon, 19 Feb 2024 08:07:53 GMT (envelope-from git) Date: Mon, 19 Feb 2024 08:07:53 GMT Message-Id: <202402190807.41J87rdx016023@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: bbf3fc5b00b8 - stable/13 - iwlwifi: adjust to make d3.c compile List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: bbf3fc5b00b8fdacbb3b941dc953c3253a7b4f31 Auto-Submitted: auto-generated The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=bbf3fc5b00b8fdacbb3b941dc953c3253a7b4f31 commit bbf3fc5b00b8fdacbb3b941dc953c3253a7b4f31 Author: Bjoern A. Zeeb AuthorDate: 2024-01-29 14:23:01 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-02-19 08:02:00 +0000 iwlwifi: adjust to make d3.c compile struct iwl_mvm_wep_key_cmd ends in a variable sized array but later is included in another struct followed by the actual struct iwl_mvm_wep_key in d3.c. Make the array[0] instead of [] to avoid the warning about it being a GNU-extension. Also include string.h explicitly for memset_after(). Reviewed by: cc Differential Revision: https://reviews.freebsd.org/D43647 (cherry picked from commit e1d31d0685f0b430f385023b7de49f47be6c7de0) --- sys/contrib/dev/iwlwifi/fw/api/sta.h | 4 ++++ sys/contrib/dev/iwlwifi/mvm/d3.c | 3 +++ 2 files changed, 7 insertions(+) diff --git a/sys/contrib/dev/iwlwifi/fw/api/sta.h b/sys/contrib/dev/iwlwifi/fw/api/sta.h index d62fed543276..18f9470db301 100644 --- a/sys/contrib/dev/iwlwifi/fw/api/sta.h +++ b/sys/contrib/dev/iwlwifi/fw/api/sta.h @@ -477,7 +477,11 @@ struct iwl_mvm_wep_key_cmd { u8 decryption_type; u8 flags; u8 reserved; +#if defined(__linux__) struct iwl_mvm_wep_key wep_key[]; +#elif defined(__FreeBSD__) + struct iwl_mvm_wep_key wep_key[0]; +#endif } __packed; /* SEC_CURR_WEP_KEY_CMD_API_S_VER_2 */ /** diff --git a/sys/contrib/dev/iwlwifi/mvm/d3.c b/sys/contrib/dev/iwlwifi/mvm/d3.c index f6488b4bbe68..17d74a771d13 100644 --- a/sys/contrib/dev/iwlwifi/mvm/d3.c +++ b/sys/contrib/dev/iwlwifi/mvm/d3.c @@ -7,6 +7,9 @@ #include #include #include +#if defined(__FreeBSD__) +#include +#endif #include #include #include From nobody Mon Feb 19 08:07:54 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdZsR3Mkcz5B2ml; Mon, 19 Feb 2024 08:07:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdZsR0d2Zz4Kgg; Mon, 19 Feb 2024 08:07:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330075; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nAdW4SITYbNCrUH/x4l9sLfDCM0xOOiZq24OUXOImBw=; b=dD9l6xKGRdjYWax2nHls/lbFXg61gseRJn70Yy67y3O6ClQy7xCazn6ZGft15mAUeyVtJe kT2ACfgqFcUeJSKeZ97JPJXeKNPF1w6iGHtqXiEGEgLXupsd0TE8x1I9uBqoD+8+DN+Kj8 m0RNxcaW5Crc/T9etzbtHnv9m2XCqxhzBDbT5uTmkoepbWCuKvjMSsKspeSq7Ek8CZiGGX dj5SnIqC67z7wJnqFxmcZU6bv2VY9N+wRMOAoouY8Fd21ztnZAzcjtLHSYnRNENeUpPLy2 loyEBCTDv5n92i1KCsNKI7UJA2TCGqG17UofY6EI6+8FKSr0IQgHGQe8qOCUHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330075; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nAdW4SITYbNCrUH/x4l9sLfDCM0xOOiZq24OUXOImBw=; b=gbdmyZYc3CiGXJPj+/Z2fe2X5Ub4dKYH4CozWeXdWTr/PDzcgxqPcH0dzgMUYivAuPa2ps qQll4TI6UCUqOQMBmhBYOfQmA6BfouB8sTmx/9epufXUEDcjemIk45zBHyBvpnLMQBNVyx nG1mYLaHOfczIaLcK9LIxB6Dt4YZ88WMpfuZ9URw+zDHa/dj8Qn+aEt4wJlaxC9Fwx6yfS GlKNKXuu0QUI+45OB/tR417gpcdcd4OUM9BMYoQ9aofqbDQ8DbL0c8rl9FvPUHbtI6svnA Sp7kTCz4goxGkyMln1mKq57otiKy4193xFVjhwDyO3vlKsSjAKwpVhWl6iCu8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708330075; a=rsa-sha256; cv=none; b=gb3t5DIbyzDzPsHUrUskfLnAYWJGLShncNIOiv/d1KMZMhDJimPZnd8VOVKnM6RFGgFrgY gb7TcOtmHlAuGnwSihpa6Vgnc65JoA6AvNUUs2CoXcri4+ZyAm9gHV8LkhYs5xv0VL8FnO /MhyoKhyy8U7xTbIF3DMcDP7VOKxVjKrDYdJQh0Tu154B4sw2A58c2QBVQqlQHbdbC9L2G 4q6DMHGJbx9RisS/W5DHXS3Ni9Vs0sxiUWJ5t+PZ158uoIwu3L9YQb2nmd2PvUSgS/9d+I wPY3LSS5cwo2Ywr993p94AYKSsfYW88vI0DhccRTk1wimWLrs0oyWVqGWbbCLw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdZsQ6pqXzRGh; Mon, 19 Feb 2024 08:07:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41J87scv016086; Mon, 19 Feb 2024 08:07:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J87ssU016083; Mon, 19 Feb 2024 08:07:54 GMT (envelope-from git) Date: Mon, 19 Feb 2024 08:07:54 GMT Message-Id: <202402190807.41J87ssU016083@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 3da00e4c110f - stable/13 - iwlwifi: add the d3 (PM) bits to the Makefile (disabled) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3da00e4c110fcf8505eb4764eef884bbac806191 Auto-Submitted: auto-generated The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=3da00e4c110fcf8505eb4764eef884bbac806191 commit 3da00e4c110fcf8505eb4764eef884bbac806191 Author: Bjoern A. Zeeb AuthorDate: 2024-01-29 12:51:16 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-02-19 08:02:01 +0000 iwlwifi: add the d3 (PM) bits to the Makefile (disabled) Add the logic to conditionally enable PM for iwlwifi. This should help suspend/resume in the future. For now leave it disabled until other preconditional problems are sorted. Sponsored by: The FreeBSD Foundation (2023) Reviewed by: cc Differential Revision: https://reviews.freebsd.org/D43647 (cherry picked from commit 8f7c32a41a6a6d88e36ce2f588489274193c2c9a) --- sys/modules/iwlwifi/Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/modules/iwlwifi/Makefile b/sys/modules/iwlwifi/Makefile index 679490fdf774..256e08282ad7 100644 --- a/sys/modules/iwlwifi/Makefile +++ b/sys/modules/iwlwifi/Makefile @@ -3,6 +3,7 @@ DEVIWLWIFIDIR= ${SRCTOP}/sys/contrib/dev/iwlwifi .PATH: ${DEVIWLWIFIDIR} +WITH_CONFIG_PM= 0 WITH_DEBUGFS= 0 KMOD= if_iwlwifi @@ -36,6 +37,11 @@ SRCS+= fw/debugfs.c mvm/debugfs.c mvm/debugfs-vif.c CFLAGS+= -DCONFIG_IWLWIFI_DEBUGFS=${WITH_DEBUGFS} CFLAGS+= -DCONFIG_MAC80211_DEBUGFS=${WITH_DEBUGFS} .endif +.if defined(WITH_CONFIG_PM) && ${WITH_CONFIG_PM} > 0 +SRCS+= mvm/d3.c +CFLAGS+= -DCONFIG_PM=${WITH_CONFIG_PM} +CFLAGS+= -DCONFIG_PM_SLEEP=${WITH_CONFIG_PM} +.endif SRCS+= iwl-devtrace.c @@ -61,8 +67,6 @@ CFLAGS+= -DCONFIG_IWLWIFI_DEBUG=1 CFLAGS+= -DCONFIG_IWLWIFI_DEVICE_TRACING=1 #CFLAGS+= -DCONFIG_LOCKDEP=1 #CFLAGS+= -DCONFIG_NL80211_TESTMODE=1 -#CFLAGS+= -DCONFIG_PM=1 -#CFLAGS+= -DCONFIG_PM_SLEEP=1 #CFLAGS+= -DCONFIG_THERMAL=1 #CFLAGS+= -DCONFIG_EFI=1 From nobody Mon Feb 19 08:07:56 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdZsS39Yyz5B2kQ; Mon, 19 Feb 2024 08:07:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdZsS1hD6z4KWB; Mon, 19 Feb 2024 08:07:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330076; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wRTw54cTTi5s0+KIFthVbf4rQWuYTd8f/8eBePPT1nE=; b=KmNfniUNfgSL5x2Ejw8vk9DWgsrz6XsN63eazkJwUyfWvFh/OKFyrU42YbS2NdShEIeHqp cWAfEcCbPLWeHuj6DGxpvjb1SQ+9ALqMMYj0Rga872ZOP6SL/oZ0nMjyfJwo67ze0Z2gWD Y6RkReaiwsqx2exloYoNvcNLVPc5FXWzCU+qHrhqMMESaZFikFPvzg1KTkLgqZumfPnc6p jZVYD5D7DqqX0AWsQSig08IEEllzOFaj/GGT6wACcos+WSXwKXOltFaSQ6TZQ9NBAtLL5P j4NGcB4XgND8gISjAssm+5WfvHT2qWOP9xF/ZdoKxrJX9iKesZzZsXQ2svMwsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330076; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wRTw54cTTi5s0+KIFthVbf4rQWuYTd8f/8eBePPT1nE=; b=HZ/Jztxz2IFn88iSVCBXEMrX0ZouZxxlx5L3LGA6HLB5xBSDSH2kPPHGbKvp4uvbqeu4kI 5v30ujtHe1crw4wGSq5bnwwbmrOByINz4ZRJmykUTb16sD9OBuiOErE2bL0W8XWmDC7L3y TOEk9BezfFPmu/80IpPse1+LIyhMmSfnT/tAhjrDAdo5VWGpDQp+gc7R3MniulOYseiFkp Wd9a85WDCGAJPrHKvRhnSlrJRGCPWVx2yepMIWmUQmPSSIQWWJ54YApNr0EsBG53NfnYx2 h/Ja+XIb/vdBBBoQOriNGJGt9bRebpqav6FC74Q+Rwprr7PQUfQzQjhgFa/iBw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708330076; a=rsa-sha256; cv=none; b=wgREU7ogtKwfEMEfOvg6mHTdHmVvK9jV6S7WBNyYZFKpXtazgUfUQ6wQkJ03bkul1Ji2Xf 6cPCS+/Q3FrZxiVsV5gYBw3zLdhUbtLqQSFCjPTXfJTn2ry9nw27HrCKMoWj6jnA0+h+Id XiMnmJp/89ainSAQXBMFDMXnWqnz5S9XVJygQOsm60dDYOchlWp8K2Y88VvOXH/rVCPUwt c89QZPIvLY5UPDqg/mLRY2W60IJ3TicFaqfJLZG/SMppnje6s1bojZ0wJ8by1ws/l3V51r cuHaI4PssJHZcpAgB+bRaBydCOPuYMaRQq5ieYyqMg+nKxMS8Mwlj4+T2DDRlA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdZsS0m5zzRTh; Mon, 19 Feb 2024 08:07:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41J87u8P016141; Mon, 19 Feb 2024 08:07:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J87uWF016138; Mon, 19 Feb 2024 08:07:56 GMT (envelope-from git) Date: Mon, 19 Feb 2024 08:07:56 GMT Message-Id: <202402190807.41J87uWF016138@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 755a04671dd4 - stable/13 - net80211: fix a NULL deref in ieee80211_sta_join1() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 755a04671dd47390f6d49695a6ac9c2d31c9935c Auto-Submitted: auto-generated The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=755a04671dd47390f6d49695a6ac9c2d31c9935c commit 755a04671dd47390f6d49695a6ac9c2d31c9935c Author: Bjoern A. Zeeb AuthorDate: 2024-01-16 18:53:06 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-02-19 08:02:01 +0000 net80211: fix a NULL deref in ieee80211_sta_join1() When ieee80211_sta_join1() gets an obss without ni_nt trying to lock that will cause a NULL pointer deref. Check for the table to be valid and deal with the obss node accordingly. This can happen if sta_newstate() calls ieee80211_reset_bss() for nstate == INIT and ostate != INIT. ieee80211_reset_bss() itself calls ieee80211_node_table_reset() which calls node_reclaim() which ends up in ieee80211_del_node_nt() which does remove the node from the table and sets ni_table to NULL. That node (former iv_bss) can then be returned as obss in the (*iv_update_bss)() call in join1(). Reviewed by: adrian, cc Differential Revision: https://reviews.freebsd.org/D43469 (cherry picked from commit 8a5a3e3d0436a2de9dc5c2c10bd9a471b6338233) --- sys/net80211/ieee80211_node.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index 75795342f4b4..090c8c50c600 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -867,11 +867,14 @@ ieee80211_sta_join1(struct ieee80211_node *selbs) struct ieee80211_node_table *nt = obss->ni_table; copy_bss(selbs, obss); - ieee80211_node_decref(obss); /* iv_bss reference */ - - IEEE80211_NODE_LOCK(nt); - node_reclaim(nt, obss); /* station table reference */ - IEEE80211_NODE_UNLOCK(nt); + if (nt != NULL) { + ieee80211_node_decref(obss); /* iv_bss reference */ + IEEE80211_NODE_LOCK(nt); + node_reclaim(nt, obss); /* station table reference */ + IEEE80211_NODE_UNLOCK(nt); + } else { + ieee80211_free_node(obss); /* iv_bss reference */ + } obss = NULL; /* NB: guard against later use */ } From nobody Mon Feb 19 08:07:57 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdZsT4J9Dz5B30C; Mon, 19 Feb 2024 08:07:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdZsT2jF5z4KhD; Mon, 19 Feb 2024 08:07:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330077; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YgrBXB6aGw/VV63/FLrWiPRSi3p58jGXU9ni93k+Z8M=; b=Ef6LB4wWDza2jJ/EREPX5fEV+SH7svtKUJZ40tmKWJ2VS4DDEiEpsp4YLa/2K8jwdt4gA/ CkbvndXG8TbxnN4h36q/ix1CTRnArEMmXoCn+0EkYNe9hB1d2sNRFcD+iV1CBQ1Mkpza+/ VEaUlNTg1Y6zcqkGeDBCGZS5RINdu+mqWUo0tv49Dp5YFiFauIJpsm3TNE3s+TJXgfv+vq QJfPfT1M80PTUL21TF1So5PObS1MiFIEDmZkdBHPu7WNMAx6z0shSIswIEU1XbheNz5epA IDZ/TZ+g/lMMqL/KK4DyD02K9lr2NStPMue+rorlp7SbC4/fBmVq/8QWO7yd5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330077; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YgrBXB6aGw/VV63/FLrWiPRSi3p58jGXU9ni93k+Z8M=; b=jZoPHS/9MewcLa3xloR5WNhz2RVymZHgmcpANI1JMwCIWC8yOltvWlHuMQ4Vx9/jPmgXXZ vA9cKL5mZ7FOH2m2HH9xH8/e1C5jJ58/Xfcad7Pvvf/5lzabZIlGnDdwzLJtl0kjsNavh0 RZdoQd571WraSQHLGkc4Px3qw1nfLc7GiisULPBbMe+LZ1GMs8jvQyERqxAkaVCNLVRSPC Qri+F+e+B6AYY/YakHhnLL42WJfVqhbxQjOH5/c24NPdXQ6YJr2HanBQthzylyrK4gNs9v AafPHE0KxTKAio5LqPeUsh6I7enuOoZe3ZwXcgjphbbS0Ztda7RTffm1d2Sz1g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708330077; a=rsa-sha256; cv=none; b=U/TmAE6fYEfqfqdC+C0tsd5v89GMCGji9Jd6gQNvxO6Pz15Zp03CoUyu5s8ZEkVeF3oHMy sqjWQSOUteE173auKEO/rrX/DeXYD6AasAXRJlrrdkwFmer833aqwzwvdh5HRtfNg4Ns2v exxzOzV1Vsb7k7ygd0ZuTBV25kzmDmGhJSIwgk0mp76zB3YAdhX1aZE7PXcbVaCwdLRRTo KJpGRQH+ltgXVWiUL9T/B2qMgEu9NylK9pp+Dox6aUKBCZ4NOCp62UQWAToXhoKhPUlaNp U8/aS9IuwGGNdq33oSvxcohF+7w1MoySs3WPBNuTnsUlTrpkKnpuSnDWeelLUw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdZsT1qL0zRGj; Mon, 19 Feb 2024 08:07:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41J87vTK016195; Mon, 19 Feb 2024 08:07:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J87vLs016192; Mon, 19 Feb 2024 08:07:57 GMT (envelope-from git) Date: Mon, 19 Feb 2024 08:07:57 GMT Message-Id: <202402190807.41J87vLs016192@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: f8ec03794357 - stable/13 - net80211: make sure calls to (*iv_update_bss)() are locked List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f8ec0379435745d800ec149f9289401c792e61bb Auto-Submitted: auto-generated The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=f8ec0379435745d800ec149f9289401c792e61bb commit f8ec0379435745d800ec149f9289401c792e61bb Author: Bjoern A. Zeeb AuthorDate: 2024-01-19 14:52:03 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-02-19 08:02:01 +0000 net80211: make sure calls to (*iv_update_bss)() are locked It turned out thare various calls into (*iv_update_bss)(), that is direct changes to vap->iv_bss in the old days, happened without synchronisation. Use locking assertions to document the requirement or status quo at some callers given ic locking will eventually have to be dealt with. Reviewed by: cc Differential Revision: https://reviews.freebsd.org/D43512 (cherry picked from commit 49619f73151aeaca4cef5adf631253da04a46e19) --- sys/net80211/ieee80211_node.c | 15 +++++++++++++++ sys/net80211/ieee80211_proto.c | 2 ++ 2 files changed, 17 insertions(+) diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index 090c8c50c600..37bbe07ef430 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -171,6 +171,10 @@ ieee80211_node_vattach(struct ieee80211vap *vap) void ieee80211_node_latevattach(struct ieee80211vap *vap) { + + /* XXX should ieee80211_vap_attach(), our only caller hold the lock? */ + IEEE80211_UNLOCK_ASSERT(vap->iv_ic); + if (vap->iv_opmode == IEEE80211_M_HOSTAP) { /* XXX should we allow max aid to be zero? */ if (vap->iv_max_aid < IEEE80211_AID_MIN) { @@ -191,7 +195,9 @@ ieee80211_node_latevattach(struct ieee80211vap *vap) } } + IEEE80211_LOCK(vap->iv_ic); ieee80211_reset_bss(vap); + IEEE80211_UNLOCK(vap->iv_ic); vap->iv_auth = ieee80211_authenticator_get(vap->iv_bss->ni_authmode); } @@ -201,11 +207,16 @@ ieee80211_node_vdetach(struct ieee80211vap *vap) { struct ieee80211com *ic = vap->iv_ic; + /* XXX should ieee80211_vap_detach(), our only caller hold the lock? */ + IEEE80211_UNLOCK_ASSERT(vap->iv_ic); + ieee80211_node_table_reset(&ic->ic_sta, vap); + IEEE80211_LOCK(ic); if (vap->iv_bss != NULL) { ieee80211_free_node(vap->iv_bss); vap->iv_update_bss(vap, NULL); } + IEEE80211_UNLOCK(ic); if (vap->iv_aid_bitmap != NULL) { IEEE80211_FREE(vap->iv_aid_bitmap, M_80211_NODE); vap->iv_aid_bitmap = NULL; @@ -455,6 +466,8 @@ ieee80211_reset_bss(struct ieee80211vap *vap) struct ieee80211com *ic = vap->iv_ic; struct ieee80211_node *ni, *obss; + IEEE80211_LOCK_ASSERT(ic); + ieee80211_node_table_reset(&ic->ic_sta, vap); /* XXX multi-bss: wrong */ ieee80211_vap_reset_erp(vap); @@ -854,7 +867,9 @@ ieee80211_sta_join1(struct ieee80211_node *selbs) /* * Committed to selbs, setup state. */ + IEEE80211_LOCK(ic); /* XXX may recurse here, check callers. */ obss = vap->iv_update_bss(vap, selbs); /* NB: caller assumed to bump refcnt */ + IEEE80211_UNLOCK(ic); /* * Check if old+new node have the same address in which * case we can reassociate when operating in sta mode. diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c index cf467c08462c..5ed9f2e3f50e 100644 --- a/sys/net80211/ieee80211_proto.c +++ b/sys/net80211/ieee80211_proto.c @@ -830,6 +830,8 @@ vap_update_bss(struct ieee80211vap *vap, struct ieee80211_node *ni) { struct ieee80211_node *obss; + IEEE80211_LOCK_ASSERT(vap->iv_ic); + obss = vap->iv_bss; vap->iv_bss = ni; From nobody Mon Feb 19 08:07:58 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdZsV4nhBz5B30G; Mon, 19 Feb 2024 08:07:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdZsV3VGrz4KQf; Mon, 19 Feb 2024 08:07:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330078; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=psf47EmRH+caLnIg4lZ6Qamlf46bbumqvwn3RHFlU6I=; b=PChzDH7ycp+ngrB67gxeydhC0R6szXNqo0zU3KUQmDJgNyWDZOZe/VuwogrjMvqz85n4VO svJcWEbpjJN11zZ5fyUXz09hn6QXIURaIze+MAP89BqpPtrj0mtUhrBhS2xM8K8JwVpWeK 3/En6Dflh9Ra/wBThrXa7ILxZYChT/YWkYcTkVIGb7ZTwtLtpRbOeS+sQDxNuODpiNHMs5 oUH7BvG+ZoVk1KfgmfioWYF1v62i9BRn3D8Fm6qh4kesPsxk4GXyIlvti3VtKQCIXcnJCP KqMzxJ4NU7kMAlaojAKjIzKzcfK3k+/UavuIeYLYEFgBK5JEn6Lgdj+/HSgcxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330078; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=psf47EmRH+caLnIg4lZ6Qamlf46bbumqvwn3RHFlU6I=; b=Gqnpf+b3dkj+UOuJ7I+UsXGToyyDa6FAE99rhjsdApMV9jT1JiMcsjPmorSaX/ZdBK6xF/ zzPckAYdtM98Pjj7LrxtFvhTs0GA6ZfMGIUYqP420U4RvN3J2FOAKauu4dsQgfH+rxk+9x InpRI5hEidpJUQUGd2XfNrHqOJWLpZaOUgAhBPp106sYaYywKkilOjMdl79oQTzQzfAFss ilhPYklKdui+xYIAfCw3oz40z0KJBArc/YP/IRaL7WNjhoE7mZ61Plz+WfMML2am0VU70q LBy/GrNpsuSF3A5JqUZjrI7k2hhXHNILm+KPsIZrIHR2AyWD4JEvRKvueWkCdw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708330078; a=rsa-sha256; cv=none; b=cvioQmult/jIXpNsrL1uiP3e63tldrlEn3tXPnlgiQlD2qZbJdC53cfpoA6W5oinDxBJQD V3qlnuDZ9PyHVAgvHl9rQKGUU7SVQOa/IQbS/utBXeeOk8OukUCwEFxbXIsGoQA5jizV8X eKVpNIQE7N7U02oGSGRNIxGsg9vyOG3bIyi4Vb52yt+9gQP3EIBQNqcMufHb62jpfOB4Gs sC1yy98XfRU/ez1A/H4uP7KNTs0IY6Qay35ft259UnVQmoMsbESSGR9ZFCBQIgl19+vs40 NGDsIbFLB4P+wCDkqp8p5FfVQWUPVbTHcE5FST50IP6BrEEaTZV4fmxGetNVYA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdZsV2bLJzRDn; Mon, 19 Feb 2024 08:07:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41J87wuu016242; Mon, 19 Feb 2024 08:07:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J87wDr016239; Mon, 19 Feb 2024 08:07:58 GMT (envelope-from git) Date: Mon, 19 Feb 2024 08:07:58 GMT Message-Id: <202402190807.41J87wDr016239@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 5427cefd1d03 - stable/13 - net80211: fix checks for (*iv_preamble_update)/(*iv_ht_protmode_update) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5427cefd1d03e428a0148a6f65a39c280fa38374 Auto-Submitted: auto-generated The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=5427cefd1d03e428a0148a6f65a39c280fa38374 commit 5427cefd1d03e428a0148a6f65a39c280fa38374 Author: Bjoern A. Zeeb AuthorDate: 2024-01-29 20:59:05 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-02-19 08:02:01 +0000 net80211: fix checks for (*iv_preamble_update)/(*iv_ht_protmode_update) Both vap_update_preamble() and vap_update_ht_protmode() also check for (*iv_erp_protmode_update)() rather than (*iv_preamble_update)() or (*iv_ht_protmode_update)() before calling the later. Use the appropriate NULL-function-pointer checks before calling it. All seem unused currently so no functional changes expected. Fixes: f1481c8d3b58e Reviewed by: cc Differential Revision: https://reviews.freebsd.org/D43655 (cherry picked from commit 48d689d6cabe41f9c04e75b774ef5b3e45b94469) --- sys/net80211/ieee80211_proto.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c index 5ed9f2e3f50e..d00b7de0ab31 100644 --- a/sys/net80211/ieee80211_proto.c +++ b/sys/net80211/ieee80211_proto.c @@ -1051,7 +1051,7 @@ vap_update_preamble(void *arg, int npending) IEEE80211_UNLOCK(ic); /* Driver notification */ - if (vap->iv_erp_protmode_update != NULL) + if (vap->iv_preamble_update != NULL) vap->iv_preamble_update(vap); } @@ -1191,7 +1191,7 @@ vap_update_ht_protmode(void *arg, int npending) ic->ic_curhtprotmode); /* Driver update */ - if (vap->iv_erp_protmode_update != NULL) + if (vap->iv_ht_protmode_update != NULL) vap->iv_ht_protmode_update(vap); } From nobody Mon Feb 19 08:07:59 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdZsW6nHRz5B2mw; Mon, 19 Feb 2024 08:07:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdZsW52wFz4Kht; Mon, 19 Feb 2024 08:07:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330079; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KmF2KKboWh+LOxjgovQWM3oSfqwNERvNWALltSjNzH4=; b=IoejcRClhW4OK577feWi+scR84kDL82r8XGaO52iBn2A/zwx5fSTkTxIoNWW33Zmh9LU6r RS/O92A8jyV5OkRLTnI8MT+gRmSDyQEGE4Ma94kyN0q5wXW4hlzdSAePuOxErqJbSmRwG0 XS4DBorqRweLDtRpNcJqWaYgefKHYcs+HhapViZDtiLkqQSUJcEWF1ioQR8wWvb94X5bs2 sHyq9x7bzTzraNev3/ck8WlerDYKPalaeMTg2Gw+pEQbDC0omTRymkIbok2AkqRn7rgKyl ZMv0x4iD8cYo+K/17Y98l2YjrXQEjiAONxyAbsrtheb1QnyTXw8bEiSgYTx3bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330079; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KmF2KKboWh+LOxjgovQWM3oSfqwNERvNWALltSjNzH4=; b=kLiUhyzJEp7gOa+2BWNu7VCARqoJY5UYhDuuXx2OiYAW5sGUlpJfnIdLMOhtzfbk5dRuDV onx3jUdnOP8Vndr1WoFdq1XJUKidpxl1nzFub62rhq9Eo/LMatYep6MQ5ZvW8TLG58AsoW NnEDml4hfq/WjEPSpytLTNTsbROFEjQr+Lzxql1oeufbxKLHoamOdtX8B+Yo43yX0hXAi0 abYAUTUAGnjdR3aEMyn74eeDa8Eo/COlAQjhi0KLsjVnY8OYwkQW9/b3upAPTm6nc7cHv4 MCkdRSz9A6D5h6uPVzMO8bGTZ5nDPrOnVNGRQD0f3uDrP0V8o+gVosYNYVCe8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708330079; a=rsa-sha256; cv=none; b=tQsyp+gY+knL2QGOg9JuLTKwq3RXtoGA7Aiv8Z1XLldDwbTMBouI6NCuKsxn0OcOUuinSc 4rbgAx3TGU/31Ix3i4hBxROaH3nY+GQY6NOaQ1ly2vEAV9GMf8vDpttOYYKcyH2YRfZ202 8R35kcXsxyXjouft7j84JOEveq7TxHC+zsjrAdvclZz+YnGDElCAesdmxcXZ3grsawXIEm FULq5/XN2OD+ExibAXqh1+i88nJXDsPWg1cK45z6KF4MplBEpHtQglUZB5A6ZQKOp7qw9H B4/6p51kswCs0gjfaS6I8o8KF6hN8y+jaNy+SNxUBiKg6cnGkkiZV+q2VPSOVA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdZsW3t97zRW2; Mon, 19 Feb 2024 08:07:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41J87x07016291; Mon, 19 Feb 2024 08:07:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J87xD0016288; Mon, 19 Feb 2024 08:07:59 GMT (envelope-from git) Date: Mon, 19 Feb 2024 08:07:59 GMT Message-Id: <202402190807.41J87xD0016288@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 7e5dc3c1fdc0 - stable/13 - LinuxKPI: 802.11: correct HT protection fields List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7e5dc3c1fdc0d6bffa1dac23c5618fccf3bab15c Auto-Submitted: auto-generated The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=7e5dc3c1fdc0d6bffa1dac23c5618fccf3bab15c commit 7e5dc3c1fdc0d6bffa1dac23c5618fccf3bab15c Author: Bjoern A. Zeeb AuthorDate: 2024-01-29 22:35:08 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-02-19 08:02:01 +0000 LinuxKPI: 802.11: correct HT protection fields It seems during the initial buildup of the file, the defines were either mixed or not flagged as "FIXME". Define the values through to the net80211 definitions and also annotate them by at least some standards reference. Fixes: 6b4cac814e32f Reviewed by: cc Differential Revision: https://reviews.freebsd.org/D43658 (cherry picked from commit 53eb2c63c9628f7f19d88d759e1932c10c9f08af) --- sys/compat/linuxkpi/common/include/linux/ieee80211.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/ieee80211.h b/sys/compat/linuxkpi/common/include/linux/ieee80211.h index 09487a318811..2000e7480ff8 100644 --- a/sys/compat/linuxkpi/common/include/linux/ieee80211.h +++ b/sys/compat/linuxkpi/common/include/linux/ieee80211.h @@ -197,11 +197,12 @@ enum ieee80211_min_mpdu_start_spacing { #define IEEE80211_PPE_THRES_RU_INDEX_BITMASK_MASK 8 /* TODO FIXME ax? */ #define IEEE80211_HE_PPE_THRES_INFO_HEADER_SIZE 16 /* TODO FIXME ax? */ -#define IEEE80211_HT_OP_MODE_PROTECTION 0x03 /* MASK */ -#define IEEE80211_HT_OP_MODE_PROTECTION_NONE 0x00 -#define IEEE80211_HT_OP_MODE_PROTECTION_20MHZ 0x01 -#define IEEE80211_HT_OP_MODE_PROTECTION_NONHT_MIXED 0x02 -#define IEEE80211_HT_OP_MODE_PROTECTION_NONMEMBER 0x03 +/* 802.11-2012, Table 8-130-HT Operation element fields and subfields, HT Protection */ +#define IEEE80211_HT_OP_MODE_PROTECTION IEEE80211_HTINFO_OPMODE /* Mask. */ +#define IEEE80211_HT_OP_MODE_PROTECTION_NONE IEEE80211_HTINFO_OPMODE_PURE /* No protection */ +#define IEEE80211_HT_OP_MODE_PROTECTION_NONMEMBER IEEE80211_HTINFO_OPMODE_PROTOPT /* Nonmember protection */ +#define IEEE80211_HT_OP_MODE_PROTECTION_20MHZ IEEE80211_HTINFO_OPMODE_HT20PR /* 20 MHz protection */ +#define IEEE80211_HT_OP_MODE_PROTECTION_NONHT_MIXED IEEE80211_HTINFO_OPMODE_MIXED /* Non-HT mixed */ /* 9.6.13.1, Table 9-342 TDLS Action field values. */ From nobody Mon Feb 19 08:08:00 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdZsY0XJFz5B2vR; Mon, 19 Feb 2024 08:08:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdZsX5r1tz4KYk; Mon, 19 Feb 2024 08:08:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330080; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jh2lmKBRNKfQlGQovI3OGUk5/XDyFxrvGv14+SJsZhY=; b=Tc2+a3H2iVny0+l0TV9F47DbWf9QCTnrV3YMkV3legWlPaak1ExadynAQ09Wd9N5D6vcjn 8l6SKhF1uGScHhcCyLPnwLIEdMlQrYlOI+qAu6pQi6y4UW790Ew5B6JpxI0gURR6G1MtF5 m8b08JDPxbGrmFgH5aBroE0Pt0YUPO/9OJfQC0yp2mJj+ildQB9LyXceoWUEqFAjgwAdUc 4Wba2wti7j1Wd6kw1Pxf1isvS3cWG4knQMIpMvuMorhevdR9SKKeK/FUtrX9M9g8Xw2pQn u+mcLBNAi6NwpC5mIcF+Ggd+jt/95hJELIEpMoo6W4HyfXNhn5J9ziJ91+yZnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330080; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jh2lmKBRNKfQlGQovI3OGUk5/XDyFxrvGv14+SJsZhY=; b=KYN8k4Bf8MqNvKG74GcFCg2Ay6WQRrH3Rh4c6T67oW23NugaMuis1/ojoc77Xuss9QqWd+ CjbENwWg6hl/tmM9fVjwGybD0FyMAldoKx0i/5eBqvdp5vBrVtDVPma0MOj58IW0hMupUe WWOyhyJgONgzRIMs4HAYXGZtCbU4xeu/kAwuyyeOaS+VKj/rorkKeqluwfgjHsl1kU958q soyXPO0yM02o5KF8ALNurrjxyzj//fchPKnHvM3TrvtpSMjD5KwADF2GoWV+c2kx5LxKF0 emFT8Z4hGogwzw/1gtYXe2TQyQTcxnxW22OHahz8fSNEzFemY2t93UvEVgqf9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708330080; a=rsa-sha256; cv=none; b=e2rgQx65+pUhNAgzWO876Wt9vRYTLfqwvW2KXuGZwodV5qsCnMTjn+iBxI9yJH2XpCh0f5 A/eta3fO4DnhwMR+6iu8TFM+46arIOWAZ1QkDidA9osUK9mTLVEotqGoriHsDOt+WlJTEW gBCevoGeqwM0+SIlhiNE5xBfQe8jVqhDNEHddokXinoEiO2luDr/bdXOOQuAIv0WbiBi+d PewWscstxjBhHt9C7C/Em2bTmyuspDO+9jGlyrB0EpyYPD02262xC7gDP+3UsMxvqhOgED o3Cxn60heUc4OeUuy6O+Dgjjsc68Ry5T77gBxY+S1FRbVFClX114mVt59Nyuiw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdZsX4xcfzRW3; Mon, 19 Feb 2024 08:08:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41J880qD016340; Mon, 19 Feb 2024 08:08:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J880lL016337; Mon, 19 Feb 2024 08:08:00 GMT (envelope-from git) Date: Mon, 19 Feb 2024 08:08:00 GMT Message-Id: <202402190808.41J880lL016337@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 6a56d8553b55 - stable/13 - iwlwifi: improve error message List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6a56d8553b557c61fc770ff6b1f202b2ac6180c6 Auto-Submitted: auto-generated The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=6a56d8553b557c61fc770ff6b1f202b2ac6180c6 commit 6a56d8553b557c61fc770ff6b1f202b2ac6180c6 Author: Bjoern A. Zeeb AuthorDate: 2024-02-12 16:09:12 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-02-19 08:02:01 +0000 iwlwifi: improve error message In case we cannot identify the firmware monitor buf_location, print the type (usually 0 = invalid) so we have an idea at least of what was set (or not). (cherry picked from commit df9d7d1e0eb6004c5f5fde78bcc7c28cc27950fb) --- sys/contrib/dev/iwlwifi/pcie/ctxt-info-gen3.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/contrib/dev/iwlwifi/pcie/ctxt-info-gen3.c b/sys/contrib/dev/iwlwifi/pcie/ctxt-info-gen3.c index fa4a14546860..5919346a059f 100644 --- a/sys/contrib/dev/iwlwifi/pcie/ctxt-info-gen3.c +++ b/sys/contrib/dev/iwlwifi/pcie/ctxt-info-gen3.c @@ -68,7 +68,11 @@ iwl_pcie_ctxt_info_dbg_enable(struct iwl_trans *trans, } break; default: +#if defined(__linux__) IWL_ERR(trans, "WRT: Invalid buffer destination\n"); +#elif defined(__FreeBSD__) + IWL_ERR(trans, "WRT: Invalid buffer destination: %d\n", le32_to_cpu(fw_mon_cfg->buf_location)); +#endif } out: if (dbg_flags) From nobody Mon Feb 19 08:08:02 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdZsb1xv6z5B2sQ; Mon, 19 Feb 2024 08:08:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdZsb0Kgwz4KnH; Mon, 19 Feb 2024 08:08:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330083; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KCSQLThYFO4YaPBjuowUZyeANP3C0/Oa4OX9iepEnFw=; b=I9T8kpE0WvXiIqoU544NsVIZxaf6yR0OQv3t9FAhjCcx/8XXBxg/eWAenUFns9tLDKc+/7 i/2nu4UrwzWfc0PTWCCkGDr5QrQ1PP9BqA67M+XULlYkCGZWTL+p+J+uDS0om630TRhKEq nw+lVoGJjvGYyuSNjHikUZY7b+Y2sVGX+ZiIsIqwHnni3JsuZDz9nL1Ea6gQBFEbd7fTJ2 QjUamEp+myUXHd2mF+JKwPa/fbimzlCjgLIZdVNdEXg3mWCuEOR5PLCykBuimwmV5TGI4F Zqw50g8PLlHpSX5LRC5XHPEg3PZcBVfeB2BE7AroDmJRmRbPk/85XEr5x9/M5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330083; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KCSQLThYFO4YaPBjuowUZyeANP3C0/Oa4OX9iepEnFw=; b=pMav8NRIFnWthbhT03oHh70cYUYDqSv9ZKtXYoVhuYppD4FlHpXAaQ/B3aLkRUMKbFlFaE eulMrsaH8vwqH3+SOQWMLbnYRnSeFnMZC41d62tT/3yqLbo5+8tj988Tvx/ziBF1qCj+Zf PmxkJOliLdgnnPeNAGkBVwwqeTINCkUGLKSFV0lCCknC8hXyxG8H+6Dm2qlzWhsCuxIIBK qBFrUVgRaHSM81isPHyXXXIchYoVDhIARGFdBPDlc4HboULoJlBJtLTC8wnnCi5AgoBWbt O2w7Wuuxe2MP34Sc3r8Uq6ipEJdiP9lTkuSNSuYkhj2e31krmEtM4NOcpl/4IA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708330083; a=rsa-sha256; cv=none; b=PvVZFPnCX59hzixWO79a5Oay1LpCqmm1vAU8BGAaZG47GsT1h59xLD+BobRa3CGq/OZqbG FgiHCC6vO21rfwSSbJgxGPy/XqVvqUQWsJE31cRcy6Z6U7jvdZ7fdVe/Ucp8oMf6nOvxU7 HA/0iWkwVK/tzip/qyc2ZbJSzqMnS5bRX1+gwKzN8iUR88jVZmUJS0oiPHUv/9oh034vTN 2jTRsgg+rW02fSYAe2+cUb0tEKdJQuv6fnWQyFLB2EmpcZprkaNCuY4XuqW/t2+TOwDIVw AH8VRVbDZ/NX7dgREGgsVokOPaxY/LGVWePSDY771GSxT1Whzjb4OOHKJ39A5g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdZsZ6WRrzR85; Mon, 19 Feb 2024 08:08:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41J882W7016449; Mon, 19 Feb 2024 08:08:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J882fa016446; Mon, 19 Feb 2024 08:08:02 GMT (envelope-from git) Date: Mon, 19 Feb 2024 08:08:02 GMT Message-Id: <202402190808.41J882fa016446@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 184ccc414686 - stable/13 - LinuxKPI: 802.11: band-aid for invalid state changes after (*iv_update_bss) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 184ccc414686ea32c64f063c081c7cc1adeae7c3 Auto-Submitted: auto-generated The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=184ccc414686ea32c64f063c081c7cc1adeae7c3 commit 184ccc414686ea32c64f063c081c7cc1adeae7c3 Author: Bjoern A. Zeeb AuthorDate: 2024-02-03 16:33:56 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-02-19 08:02:02 +0000 LinuxKPI: 802.11: band-aid for invalid state changes after (*iv_update_bss) With firmware based solutions we cannot just jump from an active session to a new iv_bss node without tearing down state for the old and bringing up the new node. This likely used to work on softmac based cards/drivers where one could essentially set the state and fire at will. We track (*iv_update_bss) calls from net80211 and set a local flag that we are out of synch and do not allow any further operations up the state machine until we hit INIT or SCAN. That means someone will take the state down, clean up firmware state and then we can join again and build up state. Apparently this problem has been "known" for a while as native iwm(4) and others have similar workarounds (though less strict) and can be equally pestered into bad states. For LinuxKPI all the KASSERTs just massively brought this problem out. The solution will be some rewrites in net80211. Until then, try to keep us more stable at least and not die on second join1() calls triggered by service netif start wlan0 and similar. PR: 271979, 271988, 275255, 263613, 274003 Sponsored by: The FreeBSD Foundation (2023, partial) Reviewed by: cc Differential Revision: https://reviews.freebsd.org/D43725 (cherry picked from commit 2ac8a2189ac6707f48f77ef2e36baf696a0d2f40) --- sys/compat/linuxkpi/common/src/linux_80211.c | 309 +++++++++++++++++++-------- sys/compat/linuxkpi/common/src/linux_80211.h | 2 + 2 files changed, 216 insertions(+), 95 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index b71deedb12b8..b1c3b5c32ded 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -611,6 +611,7 @@ lkpi_find_lkpi80211_chan(struct lkpi_hw *lhw, return (NULL); } +#if 0 static struct linuxkpi_ieee80211_channel * lkpi_get_lkpi80211_chan(struct ieee80211com *ic, struct ieee80211_node *ni) { @@ -635,6 +636,7 @@ lkpi_get_lkpi80211_chan(struct ieee80211com *ic, struct ieee80211_node *ni) return (chan); } +#endif struct linuxkpi_ieee80211_channel * linuxkpi_ieee80211_get_channel(struct wiphy *wiphy, uint32_t freq) @@ -1040,19 +1042,37 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int uint32_t changed; int error; - chan = lkpi_get_lkpi80211_chan(vap->iv_ic, vap->iv_bss); + /* + * In here we use vap->iv_bss until lvif->lvif_bss is set. + * For all later (STATE >= AUTH) functions we need to use the lvif + * cache which will be tracked even through (*iv_update_bss)(). + */ + + if (vap->iv_bss == NULL) { + ic_printf(vap->iv_ic, "%s: no iv_bss for vap %p\n", __func__, vap); + return (EINVAL); + } + ni = ieee80211_ref_node(vap->iv_bss); + if (ni->ni_chan == NULL || ni->ni_chan == IEEE80211_CHAN_ANYC) { + ic_printf(vap->iv_ic, "%s: no channel set for iv_bss ni %p " + "on vap %p\n", __func__, ni, vap); + ieee80211_free_node(ni); + return (EINVAL); + } + + lhw = vap->iv_ic->ic_softc; + chan = lkpi_find_lkpi80211_chan(lhw, ni->ni_chan); if (chan == NULL) { - ic_printf(vap->iv_ic, "%s: failed to get channel\n", __func__); + ic_printf(vap->iv_ic, "%s: failed to get LKPI channel from " + "iv_bss ni %p on vap %p\n", __func__, ni, vap); + ieee80211_free_node(ni); return (ESRCH); } - lhw = vap->iv_ic->ic_softc; hw = LHW_TO_HW(lhw); lvif = VAP_TO_LVIF(vap); vif = LVIF_TO_VIF(lvif); - ni = ieee80211_ref_node(vap->iv_bss); - IEEE80211_UNLOCK(vap->iv_ic); LKPI_80211_LHW_LOCK(lhw); @@ -1077,6 +1097,8 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int conf->def.center_freq1 = chan->center_freq; conf->def.center_freq2 = 0; IMPROVE("Check vht_cap from band not just chan?"); + KASSERT(ni->ni_chan != NULL && ni->ni_chan != IEEE80211_CHAN_ANYC, + ("%s:%d: ni %p ni_chan %p\n", __func__, __LINE__, ni, ni->ni_chan)); #ifdef LKPI_80211_HT if (IEEE80211_IS_CHAN_HT(ni->ni_chan)) { if (IEEE80211_IS_CHAN_HT40(ni->ni_chan)) { @@ -1187,6 +1209,8 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int * workflow so live with this. It is a compat layer after all. */ if (ni->ni_drv_data == NULL) { + ic_printf(vap->iv_ic, "%s:%d: lkpi_lsta_alloc to be called: " + "ni %p lsta %p\n", __func__, __LINE__, ni, ni->ni_drv_data); lsta = lkpi_lsta_alloc(vap, ni->ni_macaddr, hw, ni); if (lsta == NULL) { error = ENOMEM; @@ -1199,8 +1223,22 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int lsta = ni->ni_drv_data; } - /* Insert the [l]sta into the list of known stations. */ LKPI_80211_LVIF_LOCK(lvif); + /* XXX-BZ KASSERT later? */ + /* XXX-BZ this should have caught the upper lkpi_lsta_alloc() too! */ + if (lvif->lvif_bss_synched || lvif->lvif_bss != NULL) + ic_printf(vap->iv_ic, "%s:%d: lvif %p vap %p iv_bss %p lvif_bss %p " + "lvif_bss->ni %p synched %d, ni %p lsta %p\n", __func__, __LINE__, + lvif, vap, vap->iv_bss, lvif->lvif_bss, + (lvif->lvif_bss != NULL) ? lvif->lvif_bss->ni : NULL, + lvif->lvif_bss_synched, ni, lsta); + + /* Reference the ni for this cache of lsta. */ + ieee80211_ref_node(vap->iv_bss); + lvif->lvif_bss = lsta; + lvif->lvif_bss_synched = true; + + /* Insert the [l]sta into the list of known stations. */ TAILQ_INSERT_TAIL(&lvif->lsta_head, lsta, lsta_entry); LKPI_80211_LVIF_UNLOCK(lvif); @@ -1272,9 +1310,23 @@ lkpi_sta_auth_to_scan(struct ieee80211vap *vap, enum ieee80211_state nstate, int lvif = VAP_TO_LVIF(vap); vif = LVIF_TO_VIF(lvif); - /* Keep ni around. */ - ni = ieee80211_ref_node(vap->iv_bss); - lsta = ni->ni_drv_data; + LKPI_80211_LVIF_LOCK(lvif); +#ifdef LINUXKPI_DEBUG_80211 + /* XXX-BZ KASSERT later; state going down so no action. */ + if (lvif->lvif_bss == NULL) + ic_printf(vap->iv_ic, "%s:%d: lvif %p vap %p iv_bss %p lvif_bss %p " + "lvif_bss->ni %p synched %d\n", __func__, __LINE__, + lvif, vap, vap->iv_bss, lvif->lvif_bss, + (lvif->lvif_bss != NULL) ? lvif->lvif_bss->ni : NULL, + lvif->lvif_bss_synched); +#endif + + lsta = lvif->lvif_bss; + LKPI_80211_LVIF_UNLOCK(lvif); + KASSERT(lsta != NULL && lsta->ni != NULL, ("%s: lsta %p ni %p " + "lvif %p vap %p\n", __func__, + lsta, (lsta != NULL) ? lsta->ni : NULL, lvif, vap)); + ni = lsta->ni; /* Reference held for lvif_bss. */ sta = LSTA_TO_STA(lsta); lkpi_lsta_dump(lsta, ni, __func__, __LINE__); @@ -1324,6 +1376,13 @@ lkpi_sta_auth_to_scan(struct ieee80211vap *vap, enum ieee80211_state nstate, int lkpi_lsta_dump(lsta, ni, __func__, __LINE__); + LKPI_80211_LVIF_LOCK(lvif); + /* Remove ni reference for this cache of lsta. */ + lvif->lvif_bss = NULL; + lvif->lvif_bss_synched = false; + LKPI_80211_LVIF_UNLOCK(lvif); + ieee80211_free_node(ni); /* was lvif->lvif_bss->ni */ + lkpi_lsta_remove(lsta, lvif); /* conf_tx */ @@ -1347,8 +1406,6 @@ lkpi_sta_auth_to_scan(struct ieee80211vap *vap, enum ieee80211_state nstate, int out: LKPI_80211_LHW_UNLOCK(lhw); IEEE80211_LOCK(vap->iv_ic); - if (ni != NULL) - ieee80211_free_node(ni); return (error); } @@ -1370,7 +1427,6 @@ lkpi_sta_auth_to_assoc(struct ieee80211vap *vap, enum ieee80211_state nstate, in struct ieee80211_hw *hw; struct lkpi_vif *lvif; struct ieee80211_vif *vif; - struct ieee80211_node *ni; struct lkpi_sta *lsta; struct ieee80211_prep_tx_info prep_tx_info; int error; @@ -1382,15 +1438,30 @@ lkpi_sta_auth_to_assoc(struct ieee80211vap *vap, enum ieee80211_state nstate, in IEEE80211_UNLOCK(vap->iv_ic); LKPI_80211_LHW_LOCK(lhw); - ni = NULL; + + LKPI_80211_LVIF_LOCK(lvif); + /* XXX-BZ KASSERT later? */ + if (!lvif->lvif_bss_synched || lvif->lvif_bss == NULL) { +#ifdef LINUXKPI_DEBUG_80211 + ic_printf(vap->iv_ic, "%s:%d: lvif %p vap %p iv_bss %p lvif_bss %p " + "lvif_bss->ni %p synched %d\n", __func__, __LINE__, + lvif, vap, vap->iv_bss, lvif->lvif_bss, + (lvif->lvif_bss != NULL) ? lvif->lvif_bss->ni : NULL, + lvif->lvif_bss_synched); +#endif + error = ENOTRECOVERABLE; + LKPI_80211_LVIF_UNLOCK(lvif); + goto out; + } + lsta = lvif->lvif_bss; + LKPI_80211_LVIF_UNLOCK(lvif); + + KASSERT(lsta != NULL, ("%s: lsta %p\n", __func__, lsta)); /* Finish auth. */ IMPROVE("event callback"); /* Update sta_state (NONE to AUTH). */ - ni = ieee80211_ref_node(vap->iv_bss); - lsta = ni->ni_drv_data; - KASSERT(lsta != NULL, ("%s: ni %p lsta is NULL\n", __func__, ni)); KASSERT(lsta->state == IEEE80211_STA_NONE, ("%s: lsta %p state not " "NONE: %#x\n", __func__, lsta, lsta->state)); error = lkpi_80211_mo_sta_state(hw, vif, lsta, IEEE80211_STA_AUTH); @@ -1434,8 +1505,6 @@ lkpi_sta_auth_to_assoc(struct ieee80211vap *vap, enum ieee80211_state nstate, in out: LKPI_80211_LHW_UNLOCK(lhw); IEEE80211_LOCK(vap->iv_ic); - if (ni != NULL) - ieee80211_free_node(ni); return (error); } @@ -1447,20 +1516,37 @@ lkpi_sta_a_to_a(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) struct ieee80211_hw *hw; struct lkpi_vif *lvif; struct ieee80211_vif *vif; - struct ieee80211_node *ni; struct lkpi_sta *lsta; struct ieee80211_prep_tx_info prep_tx_info; + int error; lhw = vap->iv_ic->ic_softc; hw = LHW_TO_HW(lhw); lvif = VAP_TO_LVIF(vap); vif = LVIF_TO_VIF(lvif); - ni = ieee80211_ref_node(vap->iv_bss); - IEEE80211_UNLOCK(vap->iv_ic); LKPI_80211_LHW_LOCK(lhw); - lsta = ni->ni_drv_data; + + LKPI_80211_LVIF_LOCK(lvif); + /* XXX-BZ KASSERT later? */ + if (!lvif->lvif_bss_synched || lvif->lvif_bss == NULL) { +#ifdef LINUXKPI_DEBUG_80211 + ic_printf(vap->iv_ic, "%s:%d: lvif %p vap %p iv_bss %p lvif_bss %p " + "lvif_bss->ni %p synched %d\n", __func__, __LINE__, + lvif, vap, vap->iv_bss, lvif->lvif_bss, + (lvif->lvif_bss != NULL) ? lvif->lvif_bss->ni : NULL, + lvif->lvif_bss_synched); +#endif + LKPI_80211_LVIF_UNLOCK(lvif); + error = ENOTRECOVERABLE; + goto out; + } + lsta = lvif->lvif_bss; + LKPI_80211_LVIF_UNLOCK(lvif); + + KASSERT(lsta != NULL, ("%s: lsta %p! lvif %p vap %p\n", __func__, + lsta, lvif, vap)); IMPROVE("event callback?"); @@ -1482,12 +1568,12 @@ lkpi_sta_a_to_a(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) lsta->in_mgd = true; } + error = 0; +out: LKPI_80211_LHW_UNLOCK(lhw); IEEE80211_LOCK(vap->iv_ic); - if (ni != NULL) - ieee80211_free_node(ni); - return (0); + return (error); } static int @@ -1509,16 +1595,30 @@ _lkpi_sta_assoc_to_down(struct ieee80211vap *vap, enum ieee80211_state nstate, i lvif = VAP_TO_LVIF(vap); vif = LVIF_TO_VIF(lvif); - /* Keep ni around. */ - ni = ieee80211_ref_node(vap->iv_bss); - lsta = ni->ni_drv_data; + IEEE80211_UNLOCK(vap->iv_ic); + LKPI_80211_LHW_LOCK(lhw); + + LKPI_80211_LVIF_LOCK(lvif); +#ifdef LINUXKPI_DEBUG_80211 + /* XXX-BZ KASSERT later; state going down so no action. */ + if (lvif->lvif_bss == NULL) + ic_printf(vap->iv_ic, "%s:%d: lvif %p vap %p iv_bss %p lvif_bss %p " + "lvif_bss->ni %p synched %d\n", __func__, __LINE__, + lvif, vap, vap->iv_bss, lvif->lvif_bss, + (lvif->lvif_bss != NULL) ? lvif->lvif_bss->ni : NULL, + lvif->lvif_bss_synched); +#endif + lsta = lvif->lvif_bss; + LKPI_80211_LVIF_UNLOCK(lvif); + KASSERT(lsta != NULL && lsta->ni != NULL, ("%s: lsta %p ni %p " + "lvif %p vap %p\n", __func__, + lsta, (lsta != NULL) ? lsta->ni : NULL, lvif, vap)); + + ni = lsta->ni; /* Reference held for lvif_bss. */ sta = LSTA_TO_STA(lsta); lkpi_lsta_dump(lsta, ni, __func__, __LINE__); - IEEE80211_UNLOCK(vap->iv_ic); - LKPI_80211_LHW_LOCK(lhw); - /* flush, drop. */ lkpi_80211_mo_flush(hw, vif, nitems(sta->txq), true); @@ -1614,6 +1714,13 @@ _lkpi_sta_assoc_to_down(struct ieee80211vap *vap, enum ieee80211_state nstate, i bss_changed |= BSS_CHANGED_BSSID; lkpi_80211_mo_bss_info_changed(hw, vif, &vif->bss_conf, bss_changed); + LKPI_80211_LVIF_LOCK(lvif); + /* Remove ni reference for this cache of lsta. */ + lvif->lvif_bss = NULL; + lvif->lvif_bss_synched = false; + LKPI_80211_LVIF_UNLOCK(lvif); + ieee80211_free_node(ni); /* was lvif->lvif_bss->ni */ + lkpi_lsta_remove(lsta, lvif); /* conf_tx */ @@ -1639,8 +1746,6 @@ out: LKPI_80211_LHW_UNLOCK(lhw); IEEE80211_LOCK(vap->iv_ic); outni: - if (ni != NULL) - ieee80211_free_node(ni); return (error); } @@ -1698,16 +1803,34 @@ lkpi_sta_assoc_to_run(struct ieee80211vap *vap, enum ieee80211_state nstate, int IEEE80211_UNLOCK(vap->iv_ic); LKPI_80211_LHW_LOCK(lhw); - ni = NULL; + + LKPI_80211_LVIF_LOCK(lvif); + /* XXX-BZ KASSERT later? */ + if (!lvif->lvif_bss_synched || lvif->lvif_bss == NULL) { +#ifdef LINUXKPI_DEBUG_80211 + ic_printf(vap->iv_ic, "%s:%d: lvif %p vap %p iv_bss %p lvif_bss %p " + "lvif_bss->ni %p synched %d\n", __func__, __LINE__, + lvif, vap, vap->iv_bss, lvif->lvif_bss, + (lvif->lvif_bss != NULL) ? lvif->lvif_bss->ni : NULL, + lvif->lvif_bss_synched); +#endif + LKPI_80211_LVIF_UNLOCK(lvif); + error = ENOTRECOVERABLE; + goto out; + } + lsta = lvif->lvif_bss; + LKPI_80211_LVIF_UNLOCK(lvif); + KASSERT(lsta != NULL && lsta->ni != NULL, ("%s: lsta %p ni %p " + "lvif %p vap %p\n", __func__, + lsta, (lsta != NULL) ? lsta->ni : NULL, lvif, vap)); + + ni = lsta->ni; /* Reference held for lvif_bss. */ IMPROVE("ponder some of this moved to ic_newassoc, scan_assoc_success, " "and to lesser extend ieee80211_notify_node_join"); /* Finish assoc. */ /* Update sta_state (AUTH to ASSOC) and set aid. */ - ni = ieee80211_ref_node(vap->iv_bss); - lsta = ni->ni_drv_data; - KASSERT(lsta != NULL, ("%s: ni %p lsta is NULL\n", __func__, ni)); KASSERT(lsta->state == IEEE80211_STA_AUTH, ("%s: lsta %p state not " "AUTH: %#x\n", __func__, lsta, lsta->state)); sta = LSTA_TO_STA(lsta); @@ -1820,8 +1943,6 @@ lkpi_sta_assoc_to_run(struct ieee80211vap *vap, enum ieee80211_state nstate, int out: LKPI_80211_LHW_UNLOCK(lhw); IEEE80211_LOCK(vap->iv_ic); - if (ni != NULL) - ieee80211_free_node(ni); return (error); } @@ -1857,9 +1978,23 @@ lkpi_sta_run_to_assoc(struct ieee80211vap *vap, enum ieee80211_state nstate, int lvif = VAP_TO_LVIF(vap); vif = LVIF_TO_VIF(lvif); - /* Keep ni around. */ - ni = ieee80211_ref_node(vap->iv_bss); - lsta = ni->ni_drv_data; + LKPI_80211_LVIF_LOCK(lvif); +#ifdef LINUXKPI_DEBUG_80211 + /* XXX-BZ KASSERT later; state going down so no action. */ + if (lvif->lvif_bss == NULL) + ic_printf(vap->iv_ic, "%s:%d: lvif %p vap %p iv_bss %p lvif_bss %p " + "lvif_bss->ni %p synched %d\n", __func__, __LINE__, + lvif, vap, vap->iv_bss, lvif->lvif_bss, + (lvif->lvif_bss != NULL) ? lvif->lvif_bss->ni : NULL, + lvif->lvif_bss_synched); +#endif + lsta = lvif->lvif_bss; + LKPI_80211_LVIF_UNLOCK(lvif); + KASSERT(lsta != NULL && lsta->ni != NULL, ("%s: lsta %p ni %p " + "lvif %p vap %p\n", __func__, + lsta, (lsta != NULL) ? lsta->ni : NULL, lvif, vap)); + + ni = lsta->ni; /* Reference held for lvif_bss. */ sta = LSTA_TO_STA(lsta); lkpi_lsta_dump(lsta, ni, __func__, __LINE__); @@ -1955,8 +2090,6 @@ out: LKPI_80211_LHW_UNLOCK(lhw); IEEE80211_LOCK(vap->iv_ic); outni: - if (ni != NULL) - ieee80211_free_node(ni); return (error); } @@ -1979,16 +2112,30 @@ lkpi_sta_run_to_init(struct ieee80211vap *vap, enum ieee80211_state nstate, int lvif = VAP_TO_LVIF(vap); vif = LVIF_TO_VIF(lvif); - /* Keep ni around. */ - ni = ieee80211_ref_node(vap->iv_bss); - lsta = ni->ni_drv_data; + IEEE80211_UNLOCK(vap->iv_ic); + LKPI_80211_LHW_LOCK(lhw); + + LKPI_80211_LVIF_LOCK(lvif); +#ifdef LINUXKPI_DEBUG_80211 + /* XXX-BZ KASSERT later; state going down so no action. */ + if (lvif->lvif_bss == NULL) + ic_printf(vap->iv_ic, "%s:%d: lvif %p vap %p iv_bss %p lvif_bss %p " + "lvif_bss->ni %p synched %d\n", __func__, __LINE__, + lvif, vap, vap->iv_bss, lvif->lvif_bss, + (lvif->lvif_bss != NULL) ? lvif->lvif_bss->ni : NULL, + lvif->lvif_bss_synched); +#endif + lsta = lvif->lvif_bss; + LKPI_80211_LVIF_UNLOCK(lvif); + KASSERT(lsta != NULL && lsta->ni != NULL, ("%s: lsta %p ni %p " + "lvif %p vap %p\n", __func__, + lsta, (lsta != NULL) ? lsta->ni : NULL, lvif, vap)); + + ni = lsta->ni; /* Reference held for lvif_bss. */ sta = LSTA_TO_STA(lsta); lkpi_lsta_dump(lsta, ni, __func__, __LINE__); - IEEE80211_UNLOCK(vap->iv_ic); - LKPI_80211_LHW_LOCK(lhw); - /* flush, drop. */ lkpi_80211_mo_flush(hw, vif, nitems(sta->txq), true); @@ -2108,6 +2255,13 @@ lkpi_sta_run_to_init(struct ieee80211vap *vap, enum ieee80211_state nstate, int bss_changed |= BSS_CHANGED_BSSID; lkpi_80211_mo_bss_info_changed(hw, vif, &vif->bss_conf, bss_changed); + LKPI_80211_LVIF_LOCK(lvif); + /* Remove ni reference for this cache of lsta. */ + lvif->lvif_bss = NULL; + lvif->lvif_bss_synched = false; + LKPI_80211_LVIF_UNLOCK(lvif); + ieee80211_free_node(ni); /* was lvif->lvif_bss->ni */ + lkpi_lsta_remove(lsta, lvif); /* conf_tx */ @@ -2133,8 +2287,6 @@ out: LKPI_80211_LHW_UNLOCK(lhw); IEEE80211_LOCK(vap->iv_ic); outni: - if (ni != NULL) - ieee80211_free_node(ni); return (error); } @@ -2307,53 +2459,18 @@ static struct ieee80211_node * lkpi_iv_update_bss(struct ieee80211vap *vap, struct ieee80211_node *ni) { struct lkpi_vif *lvif; - struct ieee80211_node *obss; - struct lkpi_sta *lsta; - struct ieee80211_sta *sta; - - obss = vap->iv_bss; - -#ifdef LINUXKPI_DEBUG_80211 - if (linuxkpi_debug_80211 & D80211_TRACE) - ic_printf(vap->iv_ic, "%s: obss %p ni_drv_data %p " - "ni %p ni_drv_data %p\n", __func__, - obss, (obss != NULL) ? obss->ni_drv_data : NULL, - ni, (ni != NULL) ? ni->ni_drv_data : NULL); -#endif + struct ieee80211_node *rni; - /* Nothing to copy from. Just return. */ - if (obss == NULL || obss->ni_drv_data == NULL) - goto out; - - /* Nothing to copy to. Just return. */ - IMPROVE("clearing the obss might still be needed?"); - if (ni == NULL) - goto out; + IEEE80211_LOCK_ASSERT(vap->iv_ic); - /* Nothing changed? panic? */ - if (obss == ni) - goto out; + lvif = VAP_TO_LVIF(vap); - lsta = obss->ni_drv_data; - obss->ni_drv_data = ni->ni_drv_data; - ni->ni_drv_data = lsta; - if (lsta != NULL) { - lsta->ni = ni; - sta = LSTA_TO_STA(lsta); - IEEE80211_ADDR_COPY(sta->addr, lsta->ni->ni_macaddr); - IEEE80211_ADDR_COPY(sta->deflink.addr, sta->addr); - } - lsta = obss->ni_drv_data; - if (lsta != NULL) { - lsta->ni = obss; - sta = LSTA_TO_STA(lsta); - IEEE80211_ADDR_COPY(sta->addr, lsta->ni->ni_macaddr); - IEEE80211_ADDR_COPY(sta->deflink.addr, sta->addr); - } + LKPI_80211_LVIF_LOCK(lvif); + lvif->lvif_bss_synched = false; + LKPI_80211_LVIF_UNLOCK(lvif); -out: - lvif = VAP_TO_LVIF(vap); - return (lvif->iv_update_bss(vap, ni)); + rni = lvif->iv_update_bss(vap, ni); + return (rni); } #ifdef LKPI_80211_WME @@ -2474,6 +2591,8 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], lvif = malloc(len, M_80211_VAP, M_WAITOK | M_ZERO); mtx_init(&lvif->mtx, "lvif", NULL, MTX_DEF); TAILQ_INIT(&lvif->lsta_head); + lvif->lvif_bss = NULL; + lvif->lvif_bss_synched = false; vap = LVIF_TO_VAP(lvif); vif = LVIF_TO_VIF(lvif); diff --git a/sys/compat/linuxkpi/common/src/linux_80211.h b/sys/compat/linuxkpi/common/src/linux_80211.h index c9ac19321ab3..4aeca414973c 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.h +++ b/sys/compat/linuxkpi/common/src/linux_80211.h @@ -156,6 +156,8 @@ struct lkpi_vif { struct ieee80211_node * (*iv_update_bss)(struct ieee80211vap *, struct ieee80211_node *); TAILQ_HEAD(, lkpi_sta) lsta_head; + struct lkpi_sta *lvif_bss; + bool lvif_bss_synched; bool added_to_drv; /* Driver knows; i.e. we called add_interface(). */ bool hw_queue_stopped[IEEE80211_NUM_ACS]; From nobody Mon Feb 19 08:08:01 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdZsZ0qGKz5B2vS; Mon, 19 Feb 2024 08:08:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdZsZ05JWz4KtD; Mon, 19 Feb 2024 08:08:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330082; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3jZ7mO6CLvxzYF21fgVVyzvt8GYG31jfQr4WNkuljV4=; b=aFEz15szom+8yy5quJpDClK7Ll/jnL+vZcEhE0h9cxj3CxvLAYm9UEoSsHV4s4+ISe0Msd x0RD7vbHjJ3x2s4KN/63gyMuN/Hhy06Df/i8sAEnONWCWUz4FUeqO8EOU0eeCxo5Yp1mcW 53mt/plSiDMyR3bKD+jAPDuBCj5t0+AdoRj1aWu1ZoCLA84022r50eXADRRpD6xttMK9ao jaalj7kURjn67PgngFu1lLNE+MdIwwuujHtNX92LweIkEo3YmOnl1E7QBjYGZoplIeOQyW 92/9MGqaAjJQta4Oy5FHznAE94EP/2UPtOMbVIVQRcKsLyaMxz9Aa35zyRAtfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330082; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3jZ7mO6CLvxzYF21fgVVyzvt8GYG31jfQr4WNkuljV4=; b=ZB+d2QgjvOs85GzXT1NHJmxHYNbgb+f+jAmYKUWXVBAI8QM3pW5Jb9Nka6dfrxFFlkTQS8 MlyeTwCqU5pBAbVA2ra1siNB+o4UakdSZa3NJpLrsZqhLfVdJztW/JSS1DCnprGRI9WPkJ FHJD0HgvKR+AaaMett/BsiIbN7HzFYpyJZ9C4VKw6V5q2mwI6PMWYoOm3wmrD4lIYE0qS9 vvCPplPj603cSGI/WV2thRGjlllaeOANo7TZv4WGj6dEKDm4LPkus69y/oyKgjVH3pPU42 gfPA5EzPmp8n/dNnde7dhlXamoBmyaXLZm3yh4ATBt3Jujw2I9GjYEZPNRHlWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708330082; a=rsa-sha256; cv=none; b=dUHaNfR2UQ7DjWWaCX46HcOmptZxKNz+Kyy2pxJ0AItChHxt3bxscJoknurft+FGU2M9gv F3znLgb7IkTGi39PhPzYd1R7dpRnyNsFXdJqRW50L8/DpJ/328zH5dev9VPN6a42ko9I/3 5Bjnfxth04h/Hpxkd5W8bFrTDFJObUVKsBpai/5wNbHSw7JdmQ+7PryB/tzoP9GbUXoC5z ZXUDxgp2s0dQzbGz04y3uU6bNzdmldTlhOji3NXL27MBol74xuOrAMiWuO0XJVILKvSkeb xef4+hWZbmtBcQV+g/QuWuLaZuIgJfOWANl2L23FYIw0AxcM6O6Ohe5hGhcK8A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdZsY6JXPzR5L; Mon, 19 Feb 2024 08:08:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41J8814C016391; Mon, 19 Feb 2024 08:08:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J881YO016388; Mon, 19 Feb 2024 08:08:01 GMT (envelope-from git) Date: Mon, 19 Feb 2024 08:08:01 GMT Message-Id: <202402190808.41J881YO016388@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: a7e1fc7f620d - stable/13 - net80211: deal with lost state transitions List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a7e1fc7f620d3341549c1380f550aaafbdb45622 Auto-Submitted: auto-generated The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=a7e1fc7f620d3341549c1380f550aaafbdb45622 commit a7e1fc7f620d3341549c1380f550aaafbdb45622 Author: Bjoern A. Zeeb AuthorDate: 2024-01-10 10:14:16 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-02-19 08:02:01 +0000 net80211: deal with lost state transitions Since 5efea30f039c4 we can possibly lose a state transition which can cause trouble further down the road. The reproducer from 643d6dce6c1e can trigger these for example. Drivers for firmware based wireless cards have worked around some of this (and other) problems in the past. Add an array of tasks rather than a single one as we would simply get npending > 1 and lose order with other tasks. Try to keep state changes updated as queued in case we end up with more than one at a time. While this is not ideal either (call it a hack) it will sort the problem for now. We will queue in ieee80211_new_state_locked() and do checks there and dequeue in ieee80211_newstate_cb(). If we still overrun the (currently) 8 slots we will drop the state change rather than overwrite the last one. When dequeing we will update iv_nstate and keep it around for historic reasons for the moment. The longer term we should make the callers of ieee80211_new_state[_locked]() actually use the returned errors and act appropriately but that will touch a lot more places and drivers (possibly incl. changed behaviour for ioctls). rtwn(4) and rum(4) should probably be revisted and net80211 internals removed (for rum(4) at least the current logic still seems prone to races). PR: 271979, 271988, 275255, 263613, 274003 Sponsored by: The FreeBSD Foundation (in 2023) Reviewed by: cc Differential Revision: https://reviews.freebsd.org/D43389 (cherry picked from commit 713db49d06deee90dd358b2e4b9ca05368a5eaf6) Given this changes the internal structure of 'struct ieee80211vap', which gets allocated by the drivers, and we do not have enough spares, all wireless drivers need to be recompiled. Given we are forced to do the update, we leave fields in the middle of the struct and add more spares at the same time. __FreeBSD_version gets updated to 1303501 to be able to detect this change. (cherry picked from commit a890a3a5ddf33acb0a4000885945b89156799b07) --- UPDATING | 6 ++ sys/dev/rtwn/if_rtwn.c | 4 +- sys/dev/usb/wlan/if_rum.c | 4 +- sys/net80211/ieee80211.c | 4 +- sys/net80211/ieee80211_ddb.c | 15 ++++- sys/net80211/ieee80211_proto.c | 124 ++++++++++++++++++++++++++++++++++------- sys/net80211/ieee80211_var.h | 18 +++--- sys/sys/param.h | 2 +- 8 files changed, 143 insertions(+), 34 deletions(-) diff --git a/UPDATING b/UPDATING index 8e7fa2999475..974b0dbd30c2 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,12 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20240218: + MFC of 713db49d06de changed 'struct ieee80211vap' internals in net80211. + Given we do not have enough spares and the struct is allocated by + drivers, all wireless drivers have to be recompiled. + __FreeBSD_version is updated to 1303501 to track this change. + 20240207: sendmail 8.18.1 has been imported and merged. This version enforces stricter RFC compliance by default, especially with respect to line diff --git a/sys/dev/rtwn/if_rtwn.c b/sys/dev/rtwn/if_rtwn.c index baf427b4aafc..4334d5700e51 100644 --- a/sys/dev/rtwn/if_rtwn.c +++ b/sys/dev/rtwn/if_rtwn.c @@ -614,10 +614,12 @@ rtwn_vap_delete(struct ieee80211vap *vap) struct ieee80211com *ic = vap->iv_ic; struct rtwn_softc *sc = ic->ic_softc; struct rtwn_vap *uvp = RTWN_VAP(vap); + int i; /* Put vap into INIT state + stop device if needed. */ ieee80211_stop(vap); - ieee80211_draintask(ic, &vap->iv_nstate_task); + for (i = 0; i < NET80211_IV_NSTATE_NUM; i++) + ieee80211_draintask(ic, &vap->iv_nstate_task[i]); ieee80211_draintask(ic, &ic->ic_parent_task); RTWN_LOCK(sc); diff --git a/sys/dev/usb/wlan/if_rum.c b/sys/dev/usb/wlan/if_rum.c index d4efc37a783f..364f02393d8d 100644 --- a/sys/dev/usb/wlan/if_rum.c +++ b/sys/dev/usb/wlan/if_rum.c @@ -719,10 +719,12 @@ rum_vap_delete(struct ieee80211vap *vap) struct rum_vap *rvp = RUM_VAP(vap); struct ieee80211com *ic = vap->iv_ic; struct rum_softc *sc = ic->ic_softc; + int i; /* Put vap into INIT state. */ ieee80211_new_state(vap, IEEE80211_S_INIT, -1); - ieee80211_draintask(ic, &vap->iv_nstate_task); + for (i = 0; i < NET80211_IV_NSTATE_NUM; i++) + ieee80211_draintask(ic, &vap->iv_nstate_task[i]); RUM_LOCK(sc); /* Cancel any unfinished Tx. */ diff --git a/sys/net80211/ieee80211.c b/sys/net80211/ieee80211.c index 2bc85b7ac04a..a3de9fd91797 100644 --- a/sys/net80211/ieee80211.c +++ b/sys/net80211/ieee80211.c @@ -729,6 +729,7 @@ ieee80211_vap_detach(struct ieee80211vap *vap) { struct ieee80211com *ic = vap->iv_ic; struct ifnet *ifp = vap->iv_ifp; + int i; CURVNET_SET(ifp->if_vnet); @@ -743,7 +744,8 @@ ieee80211_vap_detach(struct ieee80211vap *vap) /* * Flush any deferred vap tasks. */ - ieee80211_draintask(ic, &vap->iv_nstate_task); + for (i = 0; i < NET80211_IV_NSTATE_NUM; i++) + ieee80211_draintask(ic, &vap->iv_nstate_task[i]); ieee80211_draintask(ic, &vap->iv_swbmiss_task); ieee80211_draintask(ic, &vap->iv_wme_task); ieee80211_draintask(ic, &ic->ic_parent_task); diff --git a/sys/net80211/ieee80211_ddb.c b/sys/net80211/ieee80211_ddb.c index 29de6d10fcc3..f028c4273ee3 100644 --- a/sys/net80211/ieee80211_ddb.c +++ b/sys/net80211/ieee80211_ddb.c @@ -470,8 +470,9 @@ _db_show_vap(const struct ieee80211vap *vap, int showmesh, int showprocs) if (vap->iv_opmode == IEEE80211_M_MBSS) db_printf("(%p)", vap->iv_mesh); #endif - db_printf(" state %s", ieee80211_state_name[vap->iv_state]); - db_printf(" ifp %p(%s)", vap->iv_ifp, vap->iv_ifp->if_xname); + db_printf(" state %#x %s", vap->iv_state, + ieee80211_state_name[vap->iv_state]); + db_printf(" ifp %p(%s)", vap->iv_ifp, if_name(vap->iv_ifp)); db_printf("\n"); db_printf("\tic %p", vap->iv_ic); @@ -482,6 +483,16 @@ _db_show_vap(const struct ieee80211vap *vap, int showmesh, int showprocs) struct sysctllog *iv_sysctl; /* dynamic sysctl context */ #endif db_printf("\n"); + + db_printf("\tiv_nstate %#x %s iv_nstate_b %d iv_nstate_n %d\n", + vap->iv_nstate, ieee80211_state_name[vap->iv_nstate], /* historic */ + vap->iv_nstate_b, vap->iv_nstate_n); + for (i = 0; i < NET80211_IV_NSTATE_NUM; i++) { + db_printf("\t [%d] iv_nstates %#x %s _task %p _args %d\n", i, + vap->iv_nstates[i], ieee80211_state_name[vap->iv_nstates[i]], + &vap->iv_nstate_task[i], vap->iv_nstate_args[i]); + } + db_printf("\tdebug=%b\n", vap->iv_debug, IEEE80211_MSG_BITS); db_printf("\tflags=%b\n", vap->iv_flags, IEEE80211_F_BITS); diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c index d00b7de0ab31..208ff783ad76 100644 --- a/sys/net80211/ieee80211_proto.c +++ b/sys/net80211/ieee80211_proto.c @@ -340,7 +340,8 @@ ieee80211_proto_vattach(struct ieee80211vap *vap) vap->iv_bmiss_max = IEEE80211_BMISS_MAX; callout_init_mtx(&vap->iv_swbmiss, IEEE80211_LOCK_OBJ(ic), 0); callout_init(&vap->iv_mgtsend, 1); - TASK_INIT(&vap->iv_nstate_task, 0, ieee80211_newstate_cb, vap); + for (i = 0; i < NET80211_IV_NSTATE_NUM; i++) + TASK_INIT(&vap->iv_nstate_task[i], 0, ieee80211_newstate_cb, vap); TASK_INIT(&vap->iv_swbmiss_task, 0, beacon_swmiss, vap); TASK_INIT(&vap->iv_wme_task, 0, vap_update_wme, vap); TASK_INIT(&vap->iv_slot_task, 0, vap_update_slot, vap); @@ -2497,6 +2498,51 @@ wakeupwaiting(struct ieee80211vap *vap0) } } +static int +_ieee80211_newstate_get_next_empty_slot(struct ieee80211vap *vap) +{ + int nstate_num; + + IEEE80211_LOCK_ASSERT(vap->iv_ic); + + if (vap->iv_nstate_n >= NET80211_IV_NSTATE_NUM) + return (-1); + + nstate_num = vap->iv_nstate_b + vap->iv_nstate_n; + nstate_num %= NET80211_IV_NSTATE_NUM; + vap->iv_nstate_n++; + + return (nstate_num); +} + +static int +_ieee80211_newstate_get_next_pending_slot(struct ieee80211vap *vap) +{ + int nstate_num; + + IEEE80211_LOCK_ASSERT(vap->iv_ic); + + KASSERT(vap->iv_nstate_n > 0, ("%s: vap %p iv_nstate_n %d\n", + __func__, vap, vap->iv_nstate_n)); + + nstate_num = vap->iv_nstate_b; + vap->iv_nstate_b++; + if (vap->iv_nstate_b >= NET80211_IV_NSTATE_NUM) + vap->iv_nstate_b = 0; + vap->iv_nstate_n--; + + return (nstate_num); +} + +static int +_ieee80211_newstate_get_npending(struct ieee80211vap *vap) +{ + + IEEE80211_LOCK_ASSERT(vap->iv_ic); + + return (vap->iv_nstate_n); +} + /* * Handle post state change work common to all operating modes. */ @@ -2506,17 +2552,25 @@ ieee80211_newstate_cb(void *xvap, int npending) struct ieee80211vap *vap = xvap; struct ieee80211com *ic = vap->iv_ic; enum ieee80211_state nstate, ostate; - int arg, rc; + int arg, rc, nstate_num; + KASSERT(npending == 1, ("%s: vap %p with npending %d != 1\n", + __func__, vap, npending)); IEEE80211_LOCK(ic); - nstate = vap->iv_nstate; - arg = vap->iv_nstate_arg; + nstate_num = _ieee80211_newstate_get_next_pending_slot(vap); + + /* + * Update the historic fields for now as they are used in some + * drivers and reduce code changes for now. + */ + vap->iv_nstate = nstate = vap->iv_nstates[nstate_num]; + arg = vap->iv_nstate_args[nstate_num]; IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, "%s:%d: running state update %s -> %s (%d)\n", __func__, __LINE__, ieee80211_state_name[vap->iv_state], - ieee80211_state_name[vap->iv_nstate], + ieee80211_state_name[nstate], npending); if (vap->iv_flags_ext & IEEE80211_FEXT_REINIT) { @@ -2527,9 +2581,10 @@ ieee80211_newstate_cb(void *xvap, int npending) /* Deny any state changes while we are here. */ vap->iv_nstate = IEEE80211_S_INIT; IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, - "%s: %s -> %s arg %d\n", __func__, + "%s: %s -> %s arg %d -> %s arg %d\n", __func__, ieee80211_state_name[vap->iv_state], - ieee80211_state_name[vap->iv_nstate], arg); + ieee80211_state_name[vap->iv_nstate], 0, + ieee80211_state_name[nstate], arg); vap->iv_newstate(vap, vap->iv_nstate, 0); IEEE80211_LOCK_ASSERT(ic); vap->iv_flags_ext &= ~(IEEE80211_FEXT_REINIT | @@ -2670,7 +2725,7 @@ ieee80211_new_state_locked(struct ieee80211vap *vap, struct ieee80211com *ic = vap->iv_ic; struct ieee80211vap *vp; enum ieee80211_state ostate; - int nrunning, nscanning; + int nrunning, nscanning, nstate_num; IEEE80211_LOCK_ASSERT(ic); @@ -2692,14 +2747,6 @@ ieee80211_new_state_locked(struct ieee80211vap *vap, ieee80211_state_name[nstate], ieee80211_state_name[vap->iv_nstate]); return -1; - } else if (vap->iv_state != vap->iv_nstate) { - /* Warn if the previous state hasn't completed. */ - IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, - "%s:%d: pending %s -> %s (now to %s) transition lost\n", - __func__, __LINE__, - ieee80211_state_name[vap->iv_state], - ieee80211_state_name[vap->iv_nstate], - ieee80211_state_name[nstate]); } } @@ -2722,7 +2769,16 @@ ieee80211_new_state_locked(struct ieee80211vap *vap, nscanning++; } } - ostate = vap->iv_state; + /* + * Look ahead for the "old state" at that point when the last queued + * state transition is run. + */ + if (vap->iv_nstate_n == 0) { + ostate = vap->iv_state; + } else { + nstate_num = (vap->iv_nstate_b + vap->iv_nstate_n - 1) % NET80211_IV_NSTATE_NUM; + ostate = vap->iv_nstates[nstate_num]; + } IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, "%s: %s -> %s (arg %d) (nrunning %d nscanning %d)\n", __func__, ieee80211_state_name[ostate], ieee80211_state_name[nstate], arg, @@ -2816,11 +2872,37 @@ ieee80211_new_state_locked(struct ieee80211vap *vap, default: break; } - /* defer the state change to a thread */ - vap->iv_nstate = nstate; - vap->iv_nstate_arg = arg; + /* + * Defer the state change to a thread. + * We support up-to NET80211_IV_NSTATE_NUM pending state changes + * using a separate task for each. Otherwise, if we enqueue + * more than one state change they will be folded together, + * npedning will be > 1 and we may run then out of sequence with + * other events. + * This is kind-of a hack after 10 years but we know how to provoke + * these cases now (and seen them in the wild). + */ + nstate_num = _ieee80211_newstate_get_next_empty_slot(vap); + if (nstate_num == -1) { + /* + * This is really bad and we should just go kaboom. + * Instead drop it. No one checks the return code anyway. + */ + ic_printf(ic, "%s:%d: pending %s -> %s (now to %s) " + "transition lost. %d/%d pending state changes:\n", + __func__, __LINE__, + ieee80211_state_name[vap->iv_state], + ieee80211_state_name[vap->iv_nstate], + ieee80211_state_name[nstate], + _ieee80211_newstate_get_npending(vap), + NET80211_IV_NSTATE_NUM); + + return (EAGAIN); + } + vap->iv_nstates[nstate_num] = nstate; + vap->iv_nstate_args[nstate_num] = arg; vap->iv_flags_ext |= IEEE80211_FEXT_STATEWAIT; - ieee80211_runtask(ic, &vap->iv_nstate_task); + ieee80211_runtask(ic, &vap->iv_nstate_task[nstate_num]); return EINPROGRESS; } diff --git a/sys/net80211/ieee80211_var.h b/sys/net80211/ieee80211_var.h index 868f1886069c..aa99ccefd248 100644 --- a/sys/net80211/ieee80211_var.h +++ b/sys/net80211/ieee80211_var.h @@ -410,9 +410,16 @@ struct ieee80211vap { uint32_t iv_com_state; /* com usage / detached flag */ enum ieee80211_opmode iv_opmode; /* operation mode */ enum ieee80211_state iv_state; /* state machine state */ - enum ieee80211_state iv_nstate; /* pending state */ - int iv_nstate_arg; /* pending state arg */ - struct task iv_nstate_task; /* deferred state processing */ + + /* Deferred state processing. */ + enum ieee80211_state iv_nstate; /* next pending state (historic) */ +#define NET80211_IV_NSTATE_NUM 8 + int iv_nstate_b; /* First filled slot. */ + int iv_nstate_n; /* # of filled slots. */ + enum ieee80211_state iv_nstates[NET80211_IV_NSTATE_NUM]; /* queued pending state(s) */ + int iv_nstate_args[NET80211_IV_NSTATE_NUM]; /* queued pending state(s) arg */ + struct task iv_nstate_task[NET80211_IV_NSTATE_NUM]; + struct task iv_swbmiss_task;/* deferred iv_bmiss call */ struct callout iv_mgtsend; /* mgmt frame response timer */ /* inactivity timer settings */ @@ -604,10 +611,7 @@ struct ieee80211vap { struct ieee80211_node * (*iv_update_bss)(struct ieee80211vap *, struct ieee80211_node *); -#ifdef __ILP32__ - uint32_t iv_spare0; -#endif - uint64_t iv_spare[5]; + uint64_t iv_spare[36]; }; MALLOC_DECLARE(M_80211_VAP); diff --git a/sys/sys/param.h b/sys/sys/param.h index be58e408b5ad..77088d010ea6 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -59,7 +59,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1303500 /* Master, propagated to newvers */ +#define __FreeBSD_version 1303501 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Mon Feb 19 08:08:03 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdZsc1lkpz5B2vY; Mon, 19 Feb 2024 08:08:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdZsc0sl0z4KtY; Mon, 19 Feb 2024 08:08:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oa8xxx+zJxA7gNk7e9Qz+8M4iKR367csCLdYOqPr7J4=; b=eeDpSMhtcw4EhHAMZKc6P5C2uWAt/NZ0Lo0rNyW/a4jt49tJ+tdTrC08KP6kpVtPyUNAVT rym40+dpioZDFMmacxlT/UHbv0JY0vp/gVC31SA/zQzvJwCrcYUD6vGyrKtLDIS1Y46AFy G7+2w4Twh4CZAqqCpvhp1vwYFqvMpIVpj1hb2JLUHXgA+ncy5EREpbzXRJ1cFTRqsBSln6 3Yf/pjIIAefYg38viH8RVMgZuzk23ckP8YJSD+S+RaoNZSgQ8UOZN4vS5uKGaDOjSBKqGD W3kHpjjFFPdUXvJeUQhQspf9NnuyT0IR/bFYVoWDq9oik3WN1Ma5SBdBK/L8pQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oa8xxx+zJxA7gNk7e9Qz+8M4iKR367csCLdYOqPr7J4=; b=VplPcWMLRxJcl1nydRMtA7+p5kQmeeamNBQXryJDLYchEhustZcTc3DUA4+IXzR6QQu7ND xncSaG2k4ubDR8S2aWx5qVnv6CBS1svLgWOz44yZ0MKgm1ThLJKRNvFhjYhtMx+yXv7sio e/t3FKlRRvyXdNDGLc+900yADj/X6QGPs9/cx2z/TfNx+3G0XJ3X+5+wbrpqJYOCxSHWFP XJpr4UaV8VAKn8UfHPP5KFYt+KW3S0lMElnU03XHH4fNsqUJf5ZPthkR5BkGxmM4voceG7 Fm2F3+T7rrF7108zF+FaVANcRkLpP6IvWbt05zc+6D2CgzVdZNnASj2b2yEbdA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708330084; a=rsa-sha256; cv=none; b=nb/D95tqDcPWihutGqHxSoOHihRhefrUmZ2bGpS+KUlxtSdpITT3ldTqt6Mzo+nCz9neyd ASh5arjg0BolfInjGV0PUb52c3VmE5rUXhs/Azo5l1P/+TNykPkq6bgnlGBZxjDRMI1AUa kmcDcMVizcbhfPIdOtW9znnjydtJmdfg8ZpkV/65JPOjRSERC/8q10VkMQVniCa+zeEGsl +5ckqvT6ryEdGYn2wJsUA+1CRC1/A+QjNIMA6yW0rOKt11Os8FzD1DDdJ8MlyGrv/QefLh oYv/q32FyBMFpqFRd1DPuDtBpqHeQlFl9K9jTdMLGjb3OPR0qI8HQE2VFnGgYw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdZsb747zzRGk; Mon, 19 Feb 2024 08:08:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41J8830h016510; Mon, 19 Feb 2024 08:08:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J883Xw016507; Mon, 19 Feb 2024 08:08:03 GMT (envelope-from git) Date: Mon, 19 Feb 2024 08:08:03 GMT Message-Id: <202402190808.41J883Xw016507@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 223edc1a3c2f - stable/13 - LinuxKPI: 802.11: update the ni/lsta reference cycle List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 223edc1a3c2fc86dbc7fa0ecd00f26a85d7c7b43 Auto-Submitted: auto-generated The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=223edc1a3c2fc86dbc7fa0ecd00f26a85d7c7b43 commit 223edc1a3c2fc86dbc7fa0ecd00f26a85d7c7b43 Author: Bjoern A. Zeeb AuthorDate: 2024-02-05 14:51:08 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-02-19 08:02:02 +0000 LinuxKPI: 802.11: update the ni/lsta reference cycle Update the ni/lsta reference cycle, add extra checks and assertions. This is to accomodate problems we were seeing based on net80211 behaviour (join1() and (*iv_update_bss)() as well as state changes for new iv_bss nodes during an active session). This should hopefully help to stabilise behaviour until the underlying problems gets properly addressed (for this and all other device drivers). PR: 272607, 273985, 274003 Reviewed by: cc Differential Revision: https://reviews.freebsd.org/D43753 (cherry picked from commit 0936c648ad0ee5152dc19f261e77fe9c1833fe05) --- sys/compat/linuxkpi/common/src/linux_80211.c | 209 +++++++++++++++++---------- sys/compat/linuxkpi/common/src/linux_80211.h | 1 + 2 files changed, 130 insertions(+), 80 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index b1c3b5c32ded..35eef4cf0640 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -247,25 +247,14 @@ lkpi_lsta_dump(struct lkpi_sta *lsta, struct ieee80211_node *ni, static void lkpi_lsta_remove(struct lkpi_sta *lsta, struct lkpi_vif *lvif) { - struct ieee80211_node *ni; - - IMPROVE("XXX-BZ remove tqe_prev check once ni-sta-state-sync is fixed"); - ni = lsta->ni; LKPI_80211_LVIF_LOCK(lvif); - if (lsta->lsta_entry.tqe_prev != NULL) - TAILQ_REMOVE(&lvif->lsta_head, lsta, lsta_entry); + KASSERT(lsta->lsta_entry.tqe_prev != NULL, + ("%s: lsta %p lsta_entry.tqe_prev %p ni %p\n", __func__, + lsta, lsta->lsta_entry.tqe_prev, lsta->ni)); + TAILQ_REMOVE(&lvif->lsta_head, lsta, lsta_entry); LKPI_80211_LVIF_UNLOCK(lvif); - - lsta->ni = NULL; - ni->ni_drv_data = NULL; - if (ni != NULL) - ieee80211_free_node(ni); - - IMPROVE("more from lkpi_ic_node_free() should happen here."); - - free(lsta, M_LKPI80211); } static struct lkpi_sta * @@ -287,13 +276,16 @@ lkpi_lsta_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN], lsta->added_to_drv = false; lsta->state = IEEE80211_STA_NOTEXIST; -#if 0 /* - * This needs to be done in node_init() as ieee80211_alloc_node() - * will initialise the refcount after us. + * Link the ni to the lsta here without taking a reference. + * For one we would have to take the reference in node_init() + * as ieee80211_alloc_node() will initialise the refcount after us. + * For the other a ni and an lsta are 1:1 mapped and always together + * from [ic_]node_alloc() to [ic_]node_free() so we are essentally + * using the ni references for the lsta as well despite it being + * two separate allocations. */ - lsta->ni = ieee80211_ref_node(ni); -#endif + lsta->ni = ni; /* The back-pointer "drv_data" to net80211_node let's us get lsta. */ ni->ni_drv_data = lsta; @@ -378,6 +370,7 @@ lkpi_lsta_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN], mtx_init(&lsta->txq_mtx, "lsta_txq", NULL, MTX_DEF); TASK_INIT(&lsta->txq_task, 0, lkpi_80211_txq_task, lsta); mbufq_init(&lsta->txq, IFQ_MAXLEN); + lsta->txq_ready = true; return (lsta); @@ -393,6 +386,54 @@ cleanup: return (NULL); } +static void +lkpi_lsta_free(struct lkpi_sta *lsta, struct ieee80211_node *ni) +{ + struct mbuf *m; + + if (lsta->added_to_drv) + panic("%s: Trying to free an lsta still known to firmware: " + "lsta %p ni %p added_to_drv %d\n", + __func__, lsta, ni, lsta->added_to_drv); + + /* XXX-BZ free resources, ... */ + IMPROVE(); + + /* XXX locking */ + lsta->txq_ready = false; + + /* Drain taskq, won't be restarted until added_to_drv is set again. */ + while (taskqueue_cancel(taskqueue_thread, &lsta->txq_task, NULL) != 0) + taskqueue_drain(taskqueue_thread, &lsta->txq_task); + + /* Flush mbufq (make sure to release ni refs!). */ + m = mbufq_dequeue(&lsta->txq); + while (m != NULL) { + struct ieee80211_node *nim; + + nim = (struct ieee80211_node *)m->m_pkthdr.rcvif; + if (nim != NULL) + ieee80211_free_node(nim); + m_freem(m); + m = mbufq_dequeue(&lsta->txq); + } + KASSERT(mbufq_empty(&lsta->txq), ("%s: lsta %p has txq len %d != 0\n", + __func__, lsta, mbufq_len(&lsta->txq))); + + /* Drain sta->txq[] */ + mtx_destroy(&lsta->txq_mtx); + + /* Remove lsta from vif; that is done by the state machine. Should assert it? */ + + IMPROVE("Make sure everything is cleaned up."); + + /* Free lsta. */ + lsta->ni = NULL; + ni->ni_drv_data = NULL; + free(lsta, M_LKPI80211); +} + + static enum nl80211_band lkpi_net80211_chan_to_nl80211_band(struct ieee80211_channel *c) { @@ -1052,11 +1093,17 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int ic_printf(vap->iv_ic, "%s: no iv_bss for vap %p\n", __func__, vap); return (EINVAL); } + /* + * Keep the ni alive locally. In theory (and practice) iv_bss can change + * once we unlock here. This is due to net80211 allowing state changes + * and new join1() despite having an active node as well as due to + * the fact that the iv_bss can be swapped under the hood in (*iv_update_bss). + */ ni = ieee80211_ref_node(vap->iv_bss); if (ni->ni_chan == NULL || ni->ni_chan == IEEE80211_CHAN_ANYC) { ic_printf(vap->iv_ic, "%s: no channel set for iv_bss ni %p " "on vap %p\n", __func__, ni, vap); - ieee80211_free_node(ni); + ieee80211_free_node(ni); /* Error handling for the local ni. */ return (EINVAL); } @@ -1065,7 +1112,7 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int if (chan == NULL) { ic_printf(vap->iv_ic, "%s: failed to get LKPI channel from " "iv_bss ni %p on vap %p\n", __func__, ni, vap); - ieee80211_free_node(ni); + ieee80211_free_node(ni); /* Error handling for the local ni. */ return (ESRCH); } @@ -1073,6 +1120,18 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int lvif = VAP_TO_LVIF(vap); vif = LVIF_TO_VIF(lvif); + LKPI_80211_LVIF_LOCK(lvif); + /* XXX-BZ KASSERT later? */ + if (lvif->lvif_bss_synched || lvif->lvif_bss != NULL) { + ic_printf(vap->iv_ic, "%s:%d: lvif %p vap %p iv_bss %p lvif_bss %p " + "lvif_bss->ni %p synched %d\n", __func__, __LINE__, + lvif, vap, vap->iv_bss, lvif->lvif_bss, + (lvif->lvif_bss != NULL) ? lvif->lvif_bss->ni : NULL, + lvif->lvif_bss_synched); + return (EBUSY); + } + LKPI_80211_LVIF_UNLOCK(lvif); + IEEE80211_UNLOCK(vap->iv_ic); LKPI_80211_LHW_LOCK(lhw); @@ -1200,32 +1259,17 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int lkpi_80211_mo_bss_info_changed(hw, vif, &vif->bss_conf, bss_changed); /* - * This is a bandaid for now. If we went through (*iv_update_bss)() - * and then removed the lsta we end up here without a lsta and have - * to manually allocate and link it in as lkpi_ic_node_alloc()/init() - * would normally do. - * XXX-BZ I do not like this but currently we have no good way of - * intercepting the bss swap and state changes and packets going out - * workflow so live with this. It is a compat layer after all. + * Given ni and lsta are 1:1 from alloc to free we can assert that + * ni always has lsta data attach despite net80211 node swapping + * under the hoods. */ - if (ni->ni_drv_data == NULL) { - ic_printf(vap->iv_ic, "%s:%d: lkpi_lsta_alloc to be called: " - "ni %p lsta %p\n", __func__, __LINE__, ni, ni->ni_drv_data); - lsta = lkpi_lsta_alloc(vap, ni->ni_macaddr, hw, ni); - if (lsta == NULL) { - error = ENOMEM; - ic_printf(vap->iv_ic, "%s:%d: lkpi_lsta_alloc " - "failed: %d\n", __func__, __LINE__, error); - goto out; - } - lsta->ni = ieee80211_ref_node(ni); - } else { - lsta = ni->ni_drv_data; - } + KASSERT(ni->ni_drv_data != NULL, ("%s: ni %p ni_drv_data %p\n", + __func__, ni, ni->ni_drv_data)); + lsta = ni->ni_drv_data; LKPI_80211_LVIF_LOCK(lvif); - /* XXX-BZ KASSERT later? */ - /* XXX-BZ this should have caught the upper lkpi_lsta_alloc() too! */ + /* Re-check given (*iv_update_bss) could have happened. */ + /* XXX-BZ KASSERT later? or deal as error? */ if (lvif->lvif_bss_synched || lvif->lvif_bss != NULL) ic_printf(vap->iv_ic, "%s:%d: lvif %p vap %p iv_bss %p lvif_bss %p " "lvif_bss->ni %p synched %d, ni %p lsta %p\n", __func__, __LINE__, @@ -1233,8 +1277,13 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int (lvif->lvif_bss != NULL) ? lvif->lvif_bss->ni : NULL, lvif->lvif_bss_synched, ni, lsta); - /* Reference the ni for this cache of lsta. */ - ieee80211_ref_node(vap->iv_bss); + /* + * Reference the ni for this cache of lsta/ni on lvif->lvif_bss + * essentially out lsta version of the iv_bss. + * Do NOT use iv_bss here anymore as that may have diverged from our + * function local ni already and would lead to inconsistencies. + */ + ieee80211_ref_node(ni); lvif->lvif_bss = lsta; lvif->lvif_bss_synched = true; @@ -1287,6 +1336,10 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int out: LKPI_80211_LHW_UNLOCK(lhw); IEEE80211_LOCK(vap->iv_ic); + /* + * Release the reference that keop the ni stable locally + * during the work of this function. + */ if (ni != NULL) ieee80211_free_node(ni); return (error); @@ -1381,9 +1434,13 @@ lkpi_sta_auth_to_scan(struct ieee80211vap *vap, enum ieee80211_state nstate, int lvif->lvif_bss = NULL; lvif->lvif_bss_synched = false; LKPI_80211_LVIF_UNLOCK(lvif); - ieee80211_free_node(ni); /* was lvif->lvif_bss->ni */ - lkpi_lsta_remove(lsta, lvif); + /* + * The very last release the reference on the ni for the ni/lsta on + * lvif->lvif_bss. Upon return from this both ni and lsta are invalid + * and potentially freed. + */ + ieee80211_free_node(ni); /* conf_tx */ @@ -1719,9 +1776,13 @@ _lkpi_sta_assoc_to_down(struct ieee80211vap *vap, enum ieee80211_state nstate, i lvif->lvif_bss = NULL; lvif->lvif_bss_synched = false; LKPI_80211_LVIF_UNLOCK(lvif); - ieee80211_free_node(ni); /* was lvif->lvif_bss->ni */ - lkpi_lsta_remove(lsta, lvif); + /* + * The very last release the reference on the ni for the ni/lsta on + * lvif->lvif_bss. Upon return from this both ni and lsta are invalid + * and potentially freed. + */ + ieee80211_free_node(ni); /* conf_tx */ @@ -2260,9 +2321,13 @@ lkpi_sta_run_to_init(struct ieee80211vap *vap, enum ieee80211_state nstate, int lvif->lvif_bss = NULL; lvif->lvif_bss_synched = false; LKPI_80211_LVIF_UNLOCK(lvif); - ieee80211_free_node(ni); /* was lvif->lvif_bss->ni */ - lkpi_lsta_remove(lsta, lvif); + /* + * The very last release the reference on the ni for the ni/lsta on + * lvif->lvif_bss. Upon return from this both ni and lsta are invalid + * and potentially freed. + */ + ieee80211_free_node(ni); /* conf_tx */ @@ -3409,7 +3474,6 @@ lkpi_ic_node_init(struct ieee80211_node *ni) { struct ieee80211com *ic; struct lkpi_hw *lhw; - struct lkpi_sta *lsta; int error; ic = ni->ni_ic; @@ -3421,11 +3485,6 @@ lkpi_ic_node_init(struct ieee80211_node *ni) return (error); } - lsta = ni->ni_drv_data; - - /* Now take the reference before linking it to the table. */ - lsta->ni = ieee80211_ref_node(ni); - /* XXX-BZ Sync other state over. */ IMPROVE(); @@ -3458,30 +3517,15 @@ lkpi_ic_node_free(struct ieee80211_node *ni) ic = ni->ni_ic; lhw = ic->ic_softc; lsta = ni->ni_drv_data; - if (lsta == NULL) - goto out; - /* XXX-BZ free resources, ... */ - IMPROVE(); + /* KASSERT lsta is not NULL here. Print ni/ni__refcnt. */ - /* Flush mbufq (make sure to release ni refs!). */ -#ifdef __notyet__ - KASSERT(mbufq_empty(&lsta->txq), ("%s: lsta %p has txq len %d != 0\n", - __func__, lsta, mbufq_len(&lsta->txq))); -#endif - /* Drain taskq. */ - - /* Drain sta->txq[] */ - mtx_destroy(&lsta->txq_mtx); - - /* Remove lsta if added_to_drv. */ - - /* Remove lsta from vif */ - /* Remove ref from lsta node... */ - /* Free lsta. */ - lkpi_lsta_remove(lsta, VAP_TO_LVIF(ni->ni_vap)); + /* + * Pass in the original ni just in case of error we could check that + * it is the same as lsta->ni. + */ + lkpi_lsta_free(lsta, ni); -out: if (lhw->ic_node_free != NULL) lhw->ic_node_free(ni); } @@ -3493,6 +3537,11 @@ lkpi_ic_raw_xmit(struct ieee80211_node *ni, struct mbuf *m, struct lkpi_sta *lsta; lsta = ni->ni_drv_data; + /* XXX locking */ + if (!lsta->txq_ready) { + m_free(m); + return (ENETDOWN); + } /* Queue the packet and enqueue the task to handle it. */ LKPI_80211_LSTA_LOCK(lsta); diff --git a/sys/compat/linuxkpi/common/src/linux_80211.h b/sys/compat/linuxkpi/common/src/linux_80211.h index 4aeca414973c..b36b27168566 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.h +++ b/sys/compat/linuxkpi/common/src/linux_80211.h @@ -134,6 +134,7 @@ struct lkpi_sta { struct ieee80211_key_conf *kc; enum ieee80211_sta_state state; + bool txq_ready; /* Can we run the taskq? */ bool added_to_drv; /* Driver knows; i.e. we called ...(). */ bool in_mgd; /* XXX-BZ should this be per-vif? */ From nobody Mon Feb 19 08:08:05 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdZsd3Sd6z5B37d; Mon, 19 Feb 2024 08:08:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdZsd2Bydz4Kny; Mon, 19 Feb 2024 08:08:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330085; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qfGPc/vDioQa0kwXW5XCDA7hDbGFC61F2fqqOJEPRNY=; b=rLOfniv0wxWsVQ8XEja/CmNymjBU/b2DrvKqcJnr9nz8ytTK+IpB/n/iitAyxCEQIHl4aw 7i3r/v0GaTXIOGVPa87invUWup7wFYI/CF3i2X6EuK/cwDHKvGNVbBHaIh7TIsM7W4J82I g+6jQY8JVrKxD8gmu43DElSp5TJeh0bZ9EQ/ibgel4SynKq+tGpMvMVhS0HDD1eE8BXjyj ojvXeb8TLHDC/UNlwtAcZWu8xZm0b7JkTN4f9Oan7r9PX5OQAeH6J4N4t1fbIAkyFMZKKW fBP4JeKGlfVOA4lEcIoJ1pKH/HrSdUagkyn2BJPCIcE8XWR+ptvnHqNlRRxAfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708330085; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qfGPc/vDioQa0kwXW5XCDA7hDbGFC61F2fqqOJEPRNY=; b=Sn0k8sR8g9adHMHYmqj/6cvHsq6g3ZGaVpwmgsL/LUFAjveNRvFGlrdl5fNPmXStLRGj+L 8IjDKNpVK76WdJWmIHvtKPmstrt/65+0MXoQ+nsWosnYo0sZYPeX0MUwnTWFWybswrDyES Ez+vEd++PZzjUOlePDj1JA8NxsIfMez/qCXFW0Y6IwA3/jrC5qKR+1boztMCR/p3SbU7Hu wqhCrMjKHEtP4F6aDXBNBNU+L6/va6Rh5JAdv64H8PAiYe5+kMFexqtJN5ZKkpp2RJNCN2 +uD5YXAnrc8LAjTyN0zddnQnIVavU0KWNxLpaZ5+dZ65A5FnhTwYXqnm9WeHTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708330085; a=rsa-sha256; cv=none; b=vuGGb0c80wIRycimFwrPXChnY/hbH46Ea8+51qhtrp6DGzFBGjmJY1Uz0fbj4oohzLJ6Yw 3Vhse8dTY3xcP42f3/5onm9thEO/XnV3pjjWZsw9410VrJTqyOCdFE1+S5SGWsSKWXe5bG VpPp3v+UpIdSH/1UkqPQBG8Mj1FDGmIT8JBda+OR+4ySHBpJQ7civEnMaWs1P7QptB/pY4 Np32nbgBq4FwLx5uWefD8TPzMb9jezEItck4sgkqcIYPReE4e5enwpV1/x1aZ4hNqF8pVl 1Ibr7QhdMaeA4JYkzdf1aINX9+y4YbBDENgZwCNLYLDiiuXQuNeYYXwU8M8fDQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdZsd1FVkzRGl; Mon, 19 Feb 2024 08:08:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41J885uc016561; Mon, 19 Feb 2024 08:08:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J885fh016558; Mon, 19 Feb 2024 08:08:05 GMT (envelope-from git) Date: Mon, 19 Feb 2024 08:08:05 GMT Message-Id: <202402190808.41J885fh016558@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 763b10806cd4 - stable/13 - LinuxKPI: 802.11: lsta txq locking cleanup List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 763b10806cd4ebdcbd2b6753d4f50ec088dc57fb Auto-Submitted: auto-generated The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=763b10806cd4ebdcbd2b6753d4f50ec088dc57fb commit 763b10806cd4ebdcbd2b6753d4f50ec088dc57fb Author: Bjoern A. Zeeb AuthorDate: 2024-02-14 21:56:48 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-02-19 08:02:02 +0000 LinuxKPI: 802.11: lsta txq locking cleanup Rename the LSTA lock to LSTA_TXQ lock as that is really what it is and put down the full set of macros. Replace the init and destroy with the macro invocation rather than direct code. Put locking around the txq_ready unset and check. Move the taskq_enqueue call under lock to be sure we do not call it anymore after txq_ready got unset. Leave a comment related to the node reference which is passed into the TX path on the recvif mbuf pointer. Fixes: 0936c648ad0ee PR: 274382 (possibly) Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D43909 (cherry picked from commit fa4e4257943650c0b5f58c01bb0bdfadea61dfb2) --- sys/compat/linuxkpi/common/src/linux_80211.c | 31 ++++++++++++++++++---------- sys/compat/linuxkpi/common/src/linux_80211.h | 14 +++++++++++-- 2 files changed, 32 insertions(+), 13 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 35eef4cf0640..876ff3693bd0 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -367,7 +367,7 @@ lkpi_lsta_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN], } /* Deferred TX path. */ - mtx_init(&lsta->txq_mtx, "lsta_txq", NULL, MTX_DEF); + LKPI_80211_LSTA_TXQ_LOCK_INIT(lsta); TASK_INIT(&lsta->txq_task, 0, lkpi_80211_txq_task, lsta); mbufq_init(&lsta->txq, IFQ_MAXLEN); lsta->txq_ready = true; @@ -399,8 +399,11 @@ lkpi_lsta_free(struct lkpi_sta *lsta, struct ieee80211_node *ni) /* XXX-BZ free resources, ... */ IMPROVE(); - /* XXX locking */ + /* Drain sta->txq[] */ + + LKPI_80211_LSTA_TXQ_LOCK(lsta); lsta->txq_ready = false; + LKPI_80211_LSTA_TXQ_UNLOCK(lsta); /* Drain taskq, won't be restarted until added_to_drv is set again. */ while (taskqueue_cancel(taskqueue_thread, &lsta->txq_task, NULL) != 0) @@ -419,9 +422,7 @@ lkpi_lsta_free(struct lkpi_sta *lsta, struct ieee80211_node *ni) } KASSERT(mbufq_empty(&lsta->txq), ("%s: lsta %p has txq len %d != 0\n", __func__, lsta, mbufq_len(&lsta->txq))); - - /* Drain sta->txq[] */ - mtx_destroy(&lsta->txq_mtx); + LKPI_80211_LSTA_TXQ_LOCK_DESTROY(lsta); /* Remove lsta from vif; that is done by the state machine. Should assert it? */ @@ -3537,16 +3538,21 @@ lkpi_ic_raw_xmit(struct ieee80211_node *ni, struct mbuf *m, struct lkpi_sta *lsta; lsta = ni->ni_drv_data; - /* XXX locking */ + LKPI_80211_LSTA_TXQ_LOCK(lsta); if (!lsta->txq_ready) { + LKPI_80211_LSTA_TXQ_UNLOCK(lsta); + /* + * Free the mbuf (do NOT release ni ref for the m_pkthdr.rcvif! + * ieee80211_raw_output() does that in case of error). + */ m_free(m); return (ENETDOWN); } /* Queue the packet and enqueue the task to handle it. */ - LKPI_80211_LSTA_LOCK(lsta); mbufq_enqueue(&lsta->txq, m); - LKPI_80211_LSTA_UNLOCK(lsta); + taskqueue_enqueue(taskqueue_thread, &lsta->txq_task); + LKPI_80211_LSTA_TXQ_UNLOCK(lsta); #ifdef LINUXKPI_DEBUG_80211 if (linuxkpi_debug_80211 & D80211_TRACE_TX) @@ -3555,7 +3561,6 @@ lkpi_ic_raw_xmit(struct ieee80211_node *ni, struct mbuf *m, mbufq_len(&lsta->txq)); #endif - taskqueue_enqueue(taskqueue_thread, &lsta->txq_task); return (0); } @@ -3770,9 +3775,13 @@ lkpi_80211_txq_task(void *ctx, int pending) mbufq_init(&mq, IFQ_MAXLEN); - LKPI_80211_LSTA_LOCK(lsta); + LKPI_80211_LSTA_TXQ_LOCK(lsta); + /* + * Do not re-check lsta->txq_ready here; we may have a pending + * disassoc frame still. + */ mbufq_concat(&mq, &lsta->txq); - LKPI_80211_LSTA_UNLOCK(lsta); + LKPI_80211_LSTA_TXQ_UNLOCK(lsta); m = mbufq_dequeue(&mq); while (m != NULL) { diff --git a/sys/compat/linuxkpi/common/src/linux_80211.h b/sys/compat/linuxkpi/common/src/linux_80211.h index b36b27168566..d25614de56dc 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.h +++ b/sys/compat/linuxkpi/common/src/linux_80211.h @@ -310,8 +310,18 @@ struct lkpi_wiphy { #define LKPI_80211_LVIF_LOCK(_lvif) mtx_lock(&(_lvif)->mtx) #define LKPI_80211_LVIF_UNLOCK(_lvif) mtx_unlock(&(_lvif)->mtx) -#define LKPI_80211_LSTA_LOCK(_lsta) mtx_lock(&(_lsta)->txq_mtx) -#define LKPI_80211_LSTA_UNLOCK(_lsta) mtx_unlock(&(_lsta)->txq_mtx) +#define LKPI_80211_LSTA_TXQ_LOCK_INIT(_lsta) \ + mtx_init(&(_lsta)->txq_mtx, "lsta-txq", NULL, MTX_DEF); +#define LKPI_80211_LSTA_TXQ_LOCK_DESTROY(_lsta) \ + mtx_destroy(&(_lsta)->txq_mtx); +#define LKPI_80211_LSTA_TXQ_LOCK(_lsta) \ + mtx_lock(&(_lsta)->txq_mtx) +#define LKPI_80211_LSTA_TXQ_UNLOCK(_lsta) \ + mtx_unlock(&(_lsta)->txq_mtx) +#define LKPI_80211_LSTA_TXQ_LOCK_ASSERT(_lsta) \ + mtx_assert(&(_lsta)->txq_mtx, MA_OWNED) +#define LKPI_80211_LSTA_TXQ_UNLOCK_ASSERT(_lsta) \ + mtx_assert(&(_lsta)->txq_mtx, MA_NOTOWNED) #define LKPI_80211_LTXQ_LOCK_INIT(_ltxq) \ mtx_init(&(_ltxq)->ltxq_mtx, "ltxq", NULL, MTX_DEF); From nobody Mon Feb 19 09:52:03 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Tdd9b391Zz5BJgR; Mon, 19 Feb 2024 09:52:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Tdd9b2jhMz4fJd; Mon, 19 Feb 2024 09:52:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708336323; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hUxTB3XdwnfMPOCEq60g8GjIhJRusQahKiKkJjkIowI=; b=Dqz2++ovQImlMlwM/iZqaypL/H4blPTA3SC2cHoFUIAId00RSzfYhr2pdDJw8caCQR9fQx 9JzjZV/0mqBa5En7FyojEwFyABJt4BDKJ4yHZGYN9Ta3hASiSOhsScvoLj+SMs/GTPfqCR V80KPEeHHpzgvmoCkUam7ZwUo68+VDuKWA/6COJz6w0omi+WQHRUCGiDCQdO14ocWaXVmq BBrNpLxRxxihM4Hzlo7vwEK1LW6KZZ8BVCMXGMVScshYc9FuxQvjurFnrzqlDZtGuUIv3F VTxizY239pBNn3xN/lj4LNzUpziUub6f+ZqzERxm9lfhMI6Go7BtHIEHvL+nzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708336323; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hUxTB3XdwnfMPOCEq60g8GjIhJRusQahKiKkJjkIowI=; b=oHiNYxz+WFpxDG6o5lFKp0P2oR1WhMlVnDun2aJvEOsCZGavb61vj34z6HiG1Mj+0U9FyR EKGYvu6xPFuvlkLyQWju6My1YfaXVx8SydxpO21JEj1x/+98M2Q9y92xucMkWO6meRbbRS xVNOpx05fXQjklkgZNrjvk4mtuZFO5vgKn5Ryj7i/nC+GEN/iYrzdjVFZj6OKuGfACtTgU xOqu4TbSOnrx8X43TjI8E6LPPvHvRu7FugNEn+Fu7OugPEEWzPKAxoO8MEo7syhPcpYC2E yEzqEVefHasO9eD4545XLYYvYpE8cAQR6/ibnbYpVt07Bgk64oX2Cf+CQhifQg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708336323; a=rsa-sha256; cv=none; b=edBTqBflW2gNvnDrlx8vX0+ijhOIJJ1VnGC3q263tHglNoVFx6xjmnSHNTVXhI9L0EMFjq sZ3u/FCBO+DoQRd0k4og9aT75adMy6hjQUGR/Biu3Ovtzwk+MLWrh9uSPESJR75rjZjP24 eT69tm5ww/IPdzdwPUhNd73smNauLNvP2MNbl4tCI+nyGXkVn38S0uJnmZlIKPQIb/JoLc pxpQ4enEJq9ugicdivdlEV81779Kc/CSZZGiT+b7DTOMKdyoEtMcJ45en30PiMbrfu3I5C synsYmlGJ/G8zOLcp/pxBVl3dvcwzXxKeUTAT9E0Vb+ixUECcdCYP4OL6HGpBQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Tdd9b1mZZzV84; Mon, 19 Feb 2024 09:52:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41J9q3sd095491; Mon, 19 Feb 2024 09:52:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J9q3jp095488; Mon, 19 Feb 2024 09:52:03 GMT (envelope-from git) Date: Mon, 19 Feb 2024 09:52:03 GMT Message-Id: <202402190952.41J9q3jp095488@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andriy Gapon Subject: git: 75316a59b39e - releng/13.3 - rdmsr_safe/wrmsr_safe: handle pcb_onfault nesting List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.3 X-Git-Reftype: branch X-Git-Commit: 75316a59b39ee83ed8b0e98597abb7baeea6a788 Auto-Submitted: auto-generated The branch releng/13.3 has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=75316a59b39ee83ed8b0e98597abb7baeea6a788 commit 75316a59b39ee83ed8b0e98597abb7baeea6a788 Author: Andriy Gapon AuthorDate: 2024-01-30 06:45:01 +0000 Commit: Andriy Gapon CommitDate: 2024-02-19 09:51:07 +0000 rdmsr_safe/wrmsr_safe: handle pcb_onfault nesting rdmsr_safe and wrmsr_safe can be called while pcb_onfault is already set, so the functions are modified to preserve the handler rather than resetting it before returning. One case where that happens is when AMD microcode update routine is executed on a stack where copyin / copyout was already active. Here is a sample panic message from a crash caused by resetting the handler: <118>Updating CPU Microcode... Fatal trap 12: page fault while in kernel mode cpuid = 3; apic id = 03 fault virtual address = 0x11ed0de6000 fault code = supervisor write data, page not present instruction pointer = 0x20:0xffffffff80c2df03 stack pointer = 0x28:0xfffffe01ce4a4c70 frame pointer = 0x28:0xfffffe01ce4a4c70 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 117 (logger) trap number = 12 panic: page fault cpuid = 3 time = 1681462027 KDB: stack backtrace: db_trace_self_wrapper() at 0xffffffff80615deb = db_trace_self_wrapper+0x2b/frame 0xfffffe01ce4a4830 kdb_backtrace() at 0xffffffff80943c77 = kdb_backtrace+0x37/frame 0xfffffe01ce4a48e0 vpanic() at 0xffffffff808f5fe5 = vpanic+0x185/frame 0xfffffe01ce4a4940 panic() at 0xffffffff808f5da3 = panic+0x43/frame 0xfffffe01ce4a49a0 trap_fatal() at 0xffffffff80c31849 = trap_fatal+0x379/frame 0xfffffe01ce4a4a00 trap_pfault() at 0xffffffff80c318b5 = trap_pfault+0x65/frame 0xfffffe01ce4a4a60 trap() at 0xffffffff80c30f5f = trap+0x29f/frame 0xfffffe01ce4a4b80 trap_check() at 0xffffffff80c31c29 = trap_check+0x29/frame 0xfffffe01ce4a4ba0 calltrap() at 0xffffffff80c07fd8 = calltrap+0x8/frame 0xfffffe01ce4a4ba0 --- trap 0xc, rip = 0xffffffff80c2df03, rsp = 0xfffffe01ce4a4c70, rbp = 0xfffffe01ce4a4c70 --- copyout_nosmap_std() at 0xffffffff80c2df03 = copyout_nosmap_std+0x63/frame 0xfffffe01ce4a4c70 uiomove_faultflag() at 0xffffffff8095f0d5 = uiomove_faultflag+0xe5/frame 0xfffffe01ce4a4cb0 uiomove() at 0xffffffff8095efeb = uiomove+0xb/frame 0xfffffe01ce4a4cc0 pipe_read() at 0xffffffff80968860 = pipe_read+0x230/frame 0xfffffe01ce4a4d30 dofileread() at 0xffffffff809653cb = dofileread+0x8b/frame 0xfffffe01ce4a4d80 sys_read() at 0xffffffff80964fa0 = sys_read+0xc0/frame 0xfffffe01ce4a4df0 amd64_syscall() at 0xffffffff80c3221a = amd64_syscall+0x18a/frame 0xfffffe01ce4a4f30 fast_syscall_common() at 0xffffffff80c088eb = fast_syscall_common+0xf8/frame 0xfffffe01ce4a4f30 --- syscall (3, FreeBSD ELF64, read), rip = 0x11ece41cfaa, rsp = 0x11ecbec4908, rbp = 0x11ecbec4920 --- Uptime: 41s And another one: Fatal trap 12: page fault while in kernel mode cpuid = 4; apic id = 04 fault virtual address = 0x800a22000 fault code = supervisor write data, page not present instruction pointer = 0x20:0xffffffff80b2c7ca stack pointer = 0x28:0xfffffe01c55b5480 frame pointer = 0x28:0xfffffe01c55b5480 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 68418 (pfctl) trap number = 12 panic: page fault cpuid = 4 time = 1625184463 KDB: stack backtrace: db_trace_self_wrapper() at 0xffffffff805c1e8b = db_trace_self_wrapper+0x2b/frame 0xfffffe01c55b5040 kdb_backtrace() at 0xffffffff808874b7 = kdb_backtrace+0x37/frame 0xfffffe01c55b50f0 vpanic() at 0xffffffff808449d8 = vpanic+0x188/frame 0xfffffe01c55b5150 panic() at 0xffffffff808445f3 = panic+0x43/frame 0xfffffe01c55b51b0 trap_fatal() at 0xffffffff80b300a5 = trap_fatal+0x375/frame 0xfffffe01c55b5210 trap_pfault() at 0xffffffff80b30180 = trap_pfault+0x80/frame 0xfffffe01c55b5280 trap() at 0xffffffff80b2f729 = trap+0x289/frame 0xfffffe01c55b5390 trap_check() at 0xffffffff80b304d9 = trap_check+0x29/frame 0xfffffe01c55b53b0 calltrap() at 0xffffffff80b0bb28 = calltrap+0x8/frame 0xfffffe01c55b53b0 --- trap 0xc, rip = 0xffffffff80b2c7ca, rsp = 0xfffffe01c55b5480, rbp = 0xfffffe01c55b5480 --- copyout_nosmap_std() at 0xffffffff80b2c7ca = copyout_nosmap_std+0x15a/frame 0xfffffe01c55b5480 pfioctl() at 0xffffffff85539358 = pfioctl+0x4d28/frame 0xfffffe01c55b5940 devfs_ioctl() at 0xffffffff807176cf = devfs_ioctl+0xcf/frame 0xfffffe01c55b59a0 VOP_IOCTL_APV() at 0xffffffff80bb26e2 = VOP_IOCTL_APV+0x92/frame 0xfffffe01c55b59c0 VOP_IOCTL() at 0xffffffff80928014 = VOP_IOCTL+0x34/frame 0xfffffe01c55b5a10 vn_ioctl() at 0xffffffff80923330 = vn_ioctl+0xc0/frame 0xfffffe01c55b5b00 devfs_ioctl_f() at 0xffffffff80717bbe = devfs_ioctl_f+0x1e/frame 0xfffffe01c55b5b20 fo_ioctl() at 0xffffffff808abc6b = fo_ioctl+0xb/frame 0xfffffe01c55b5b30 kern_ioctl() at 0xffffffff808abc01 = kern_ioctl+0x1d1/frame 0xfffffe01c55b5b80 sys_ioctl() at 0xffffffff808ab982 = sys_ioctl+0x132/frame 0xfffffe01c55b5c50 syscallenter() at 0xffffffff80b30cc9 = syscallenter+0x159/frame 0xfffffe01c55b5ca0 amd64_syscall() at 0xffffffff80b309a5 = amd64_syscall+0x15/frame 0xfffffe01c55b5d30 fast_syscall_common() at 0xffffffff80b0c44e = fast_syscall_common+0xf8/frame 0xfffffe01c55b5d30 PR: 276426 Reviewed by: kib, markj Approved by: re (cperciva) (cherry picked from commit 486b265a8fb6b2aad37f2819fa04feacf8184d53) --- sys/amd64/amd64/support.S | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/amd64/amd64/support.S b/sys/amd64/amd64/support.S index 936065a78879..dd269138c23f 100644 --- a/sys/amd64/amd64/support.S +++ b/sys/amd64/amd64/support.S @@ -1533,6 +1533,7 @@ ENTRY(rdmsr_safe) /* int rdmsr_safe(u_int msr, uint64_t *data) */ PUSH_FRAME_POINTER movq PCPU(CURPCB),%r8 + movq PCB_ONFAULT(%r8),%r9 movq $msr_onfault,PCB_ONFAULT(%r8) movl %edi,%ecx rdmsr /* Read MSR pointed by %ecx. Returns @@ -1541,8 +1542,8 @@ ENTRY(rdmsr_safe) movl %eax,%eax /* zero-extend %eax -> %rax */ orq %rdx,%rax movq %rax,(%rsi) - xorq %rax,%rax - movq %rax,PCB_ONFAULT(%r8) + movq %r9,PCB_ONFAULT(%r8) + xorl %eax,%eax POP_FRAME_POINTER ret @@ -1554,6 +1555,7 @@ ENTRY(wrmsr_safe) /* int wrmsr_safe(u_int msr, uint64_t data) */ PUSH_FRAME_POINTER movq PCPU(CURPCB),%r8 + movq PCB_ONFAULT(%r8),%r9 movq $msr_onfault,PCB_ONFAULT(%r8) movl %edi,%ecx movl %esi,%eax @@ -1561,8 +1563,8 @@ ENTRY(wrmsr_safe) movl %esi,%edx wrmsr /* Write MSR pointed by %ecx. Accepts hi byte in edx, lo in %eax. */ - xorq %rax,%rax - movq %rax,PCB_ONFAULT(%r8) + movq %r9,PCB_ONFAULT(%r8) + xorl %eax,%eax POP_FRAME_POINTER ret @@ -1571,7 +1573,7 @@ ENTRY(wrmsr_safe) */ ALIGN_TEXT msr_onfault: - movq $0,PCB_ONFAULT(%r8) + movq %r9,PCB_ONFAULT(%r8) movl $EFAULT,%eax POP_FRAME_POINTER ret From nobody Mon Feb 19 16:10:17 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdnZ21t4dz5C58V; Mon, 19 Feb 2024 16:10:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdnZ16cjWz4Nrc; Mon, 19 Feb 2024 16:10:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708359017; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cmqXDiBVWyrEFnJp4rQVxZ9FLyuspSk/tjPoiMYb1aw=; b=f3jR1IgI3hhX63MV4Jm82uDuUkqw2PGV/t1smM6r0H2G4BibmB2cyCgytamnzaC2Hf/Gz4 ToFLwgH0gqUI4FFiZBAE6V9F+ikR/PjT71/kirlLr5NBICpgtEVUp+S9gFUUFgCIu6q5vw Tos5KrysPMCf8/ZZuhtHTz9lv0NnDHl2DJcyzqi6RF18wMFEiiTinFT/sLB9IGKR1O+I2q 3oxFdpJ49cDmvoJYtk3T4lzSQKNzaH2FEjYTNkMYYj0EXddebfgZi1M2WPGU7yvbs8X04s bo4oAybaHYW0qssAns9FZp/X3dPcgRNjAJ3beLcbV0DJdvc/CE3oNBG72ASlUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708359017; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cmqXDiBVWyrEFnJp4rQVxZ9FLyuspSk/tjPoiMYb1aw=; b=sj3ogJBGfINBPoBbt8G/P2Ck9QCpEx/L+Jg9EWuYRBMo/h1Ymm1/N1rtr+XGN5elDZBIq0 g+lvqqUPKIPo6bXjlB6t6x4q0FhEq9qF8OKXjs3Ia6a4jxRZDq1B2oHkIJOEG4dP6ojLiS u3QBMqTczlG9InQM+0SnDwpoKVqc6VCsgV/oCYCcTS4C6q9xUqLF+ZDdUYjHvfaq2nbRwj ExoKx0oz+yvXEF/SgrMywANwrov/aq9Sl5cJmRMUDRsUQSELKCbruYZ7H7RUKnFQ8WINIr m6H8Jdd64AVFFlqtc08qZz1KJm/sijmjd0xT4bfRPOhFYjKdZH4Xis+8GNLyjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708359017; a=rsa-sha256; cv=none; b=wRJ30p0s0kCOD/cbTWRrjCgOY2kyhI8jdsyUo6Je6OrYypJAvc5u5g0c4DbSpOPtb/4yDG Gwy3n8YQJECrWxc75GgjVjijLWNlOfaCXGeT5qLxs5S4D2wmxk1VUaG4v92WQ+zm8NuLaX lfNzqEClyoYawNdZbimXdAkM8/bcOXnSo1sULcsaSBEmVyI2jFngMSm1zeCfnzI/YVx0Lb Yzq5vZ+viXAo8hr5YMfN8+xRN2WudniPdOCW27CtPjedHuCDBSsPt5QYuHZ71fj+Gfwb3g FL8tEfgfqdVoVt6fUUKQbPYjL9OINYmgfDUGQCdNbgkGzJ+mq2ePM7Y4NzXp8g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdnZ15k2Rzgdy; Mon, 19 Feb 2024 16:10:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGAHeM035524; Mon, 19 Feb 2024 16:10:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGAHc4035511; Mon, 19 Feb 2024 16:10:17 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:10:17 GMT Message-Id: <202402191610.41JGAHc4035511@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 804a4c1c7b8f - releng/13.3 - LinuxKPI: 802.11: more TXQ implementation and locking List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/releng/13.3 X-Git-Reftype: branch X-Git-Commit: 804a4c1c7b8fe00a6924fa5e4ae27a487bdc2337 Auto-Submitted: auto-generated The branch releng/13.3 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=804a4c1c7b8fe00a6924fa5e4ae27a487bdc2337 commit 804a4c1c7b8fe00a6924fa5e4ae27a487bdc2337 Author: Bjoern A. Zeeb AuthorDate: 2023-12-12 01:59:17 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-02-19 16:06:43 +0000 LinuxKPI: 802.11: more TXQ implementation and locking Implement ieee80211_handle_wake_tx_queue() and ieee80211_tx_dequeue_ni() while looking at the code. They are needed by various wireless drivers. Introduce an ltxq lock and protect the skbq by that. This prevents panics due to a race between a driver upcall and the net80211 tx downcall. While the former should be rcu protected we cannot rely on that. It remains questionable if we need to protect further fields there (with a different lock?). Also introduce a txq_mtx on the lhw which needs to be further deployed but we need to come up with a good strategy to not end up with 7 different locks. Approved by: re (cperciva) Sponsored by: The FreeBSD Foundation PR: 274178, 275710 Tested by: cc (cherry picked from commit eac3646fcdd445297cade756630335e23e92ea13) (cherry picked from commit 3df959638baa60c1c88e9ac66289502f99ad8418) --- sys/compat/linuxkpi/common/include/net/mac80211.h | 27 +++++---- sys/compat/linuxkpi/common/src/linux_80211.c | 67 +++++++++++++++++++++-- sys/compat/linuxkpi/common/src/linux_80211.h | 29 +++++++++- 3 files changed, 107 insertions(+), 16 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index 7e6fb1bce16e..fee29d3b1a1d 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -1114,6 +1114,8 @@ void linuxkpi_ieee80211_txq_schedule_start(struct ieee80211_hw *, uint8_t); struct ieee80211_txq *linuxkpi_ieee80211_next_txq(struct ieee80211_hw *, uint8_t); void linuxkpi_ieee80211_schedule_txq(struct ieee80211_hw *, struct ieee80211_txq *, bool); +void linuxkpi_ieee80211_handle_wake_tx_queue(struct ieee80211_hw *, + struct ieee80211_txq *); /* -------------------------------------------------------------------------- */ @@ -1678,7 +1680,7 @@ static inline void ieee80211_return_txq(struct ieee80211_hw *hw, struct ieee80211_txq *txq, bool withoutpkts) { - linuxkpi_ieee80211_schedule_txq(hw, txq, true); + linuxkpi_ieee80211_schedule_txq(hw, txq, withoutpkts); } static inline void @@ -1703,7 +1705,7 @@ static inline void ieee80211_handle_wake_tx_queue(struct ieee80211_hw *hw, struct ieee80211_txq *txq) { - TODO(); + linuxkpi_ieee80211_handle_wake_tx_queue(hw, txq); } /* -------------------------------------------------------------------------- */ @@ -2194,13 +2196,25 @@ ieee80211_tkip_add_iv(u8 *crypto_hdr, struct ieee80211_key_conf *keyconf, TODO(); } -static __inline struct sk_buff * +static inline struct sk_buff * ieee80211_tx_dequeue(struct ieee80211_hw *hw, struct ieee80211_txq *txq) { return (linuxkpi_ieee80211_tx_dequeue(hw, txq)); } +static inline struct sk_buff * +ieee80211_tx_dequeue_ni(struct ieee80211_hw *hw, struct ieee80211_txq *txq) +{ + struct sk_buff *skb; + + local_bh_disable(); + skb = linuxkpi_ieee80211_tx_dequeue(hw, txq); + local_bh_enable(); + + return (skb); +} + static __inline void ieee80211_update_mu_groups(struct ieee80211_vif *vif, u_int _i, uint8_t *ms, uint8_t *up) @@ -2453,13 +2467,6 @@ ieee80211_stop_rx_ba_session_offl(struct ieee80211_vif *vif, uint8_t *addr, TODO(); } -static __inline struct sk_buff * -ieee80211_tx_dequeue_ni(struct ieee80211_hw *hw, struct ieee80211_txq *txq) -{ - TODO(); - return (NULL); -} - static __inline void ieee80211_tx_rate_update(struct ieee80211_hw *hw, struct ieee80211_sta *sta, struct ieee80211_tx_info *info) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 340503307c97..3988c5260f66 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -249,6 +249,7 @@ lkpi_lsta_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN], ltxq->txq.sta = sta; TAILQ_ELEM_INIT(ltxq, txq_entry); skb_queue_head_init(<xq->skbq); + LKPI_80211_LTXQ_LOCK_INIT(ltxq); sta->txq[tid] = <xq->txq; } @@ -286,8 +287,13 @@ lkpi_lsta_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN], return (lsta); cleanup: - for (; tid >= 0; tid--) + for (; tid >= 0; tid--) { + struct lkpi_txq *ltxq; + + ltxq = TXQ_TO_LTXQ(sta->txq[tid]); + LKPI_80211_LTXQ_LOCK_DESTROY(ltxq); free(sta->txq[tid], M_LKPI80211); + } free(lsta, M_LKPI80211); return (NULL); } @@ -881,6 +887,7 @@ lkpi_wake_tx_queues(struct ieee80211_hw *hw, struct ieee80211_sta *sta, { struct lkpi_txq *ltxq; int tid; + bool ltxq_empty; /* Wake up all queues to know they are allocated in the driver. */ for (tid = 0; tid < nitems(sta->txq); tid++) { @@ -899,7 +906,10 @@ lkpi_wake_tx_queues(struct ieee80211_hw *hw, struct ieee80211_sta *sta, if (dequeue_seen && !ltxq->seen_dequeue) continue; - if (no_emptyq && skb_queue_empty(<xq->skbq)) + LKPI_80211_LTXQ_LOCK(ltxq); + ltxq_empty = skb_queue_empty(<xq->skbq); + LKPI_80211_LTXQ_UNLOCK(ltxq); + if (no_emptyq && ltxq_empty) continue; lkpi_80211_mo_wake_tx_queue(hw, sta->txq[tid]); @@ -3395,6 +3405,7 @@ lkpi_80211_txq_tx_one(struct lkpi_sta *lsta, struct mbuf *m) KASSERT(ltxq != NULL, ("%s: lsta %p sta %p m %p skb %p " "ltxq %p != NULL\n", __func__, lsta, sta, m, skb, ltxq)); + LKPI_80211_LTXQ_LOCK(ltxq); skb_queue_tail(<xq->skbq, skb); #ifdef LINUXKPI_DEBUG_80211 if (linuxkpi_debug_80211 & D80211_TRACE_TX) @@ -3407,6 +3418,7 @@ lkpi_80211_txq_tx_one(struct lkpi_sta *lsta, struct mbuf *m) skb_queue_len(<xq->skbq), ltxq->txq.ac, ltxq->txq.tid, ac, skb->priority, skb->qmap); #endif + LKPI_80211_LTXQ_UNLOCK(ltxq); lkpi_80211_mo_wake_tx_queue(hw, <xq->txq); return; } @@ -3645,6 +3657,7 @@ linuxkpi_ieee80211_alloc_hw(size_t priv_len, const struct ieee80211_ops *ops) LKPI_80211_LHW_LOCK_INIT(lhw); LKPI_80211_LHW_SCAN_LOCK_INIT(lhw); + LKPI_80211_LHW_TXQ_LOCK_INIT(lhw); sx_init_flags(&lhw->lvif_sx, "lhw-lvif", SX_RECURSE | SX_DUPOK); TAILQ_INIT(&lhw->lvif_head); for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) { @@ -3683,9 +3696,10 @@ linuxkpi_ieee80211_iffree(struct ieee80211_hw *hw) lhw->ic = NULL; /* Cleanup more of lhw here or in wiphy_free()? */ - sx_destroy(&lhw->lvif_sx); - LKPI_80211_LHW_LOCK_DESTROY(lhw); + LKPI_80211_LHW_TXQ_LOCK_DESTROY(lhw); LKPI_80211_LHW_SCAN_LOCK_DESTROY(lhw); + LKPI_80211_LHW_LOCK_DESTROY(lhw); + sx_destroy(&lhw->lvif_sx); IMPROVE(); } @@ -4564,7 +4578,11 @@ linuxkpi_ieee80211_tx_dequeue(struct ieee80211_hw *hw, goto stopped; } + IMPROVE("hw(TX_FRAG_LIST)"); + + LKPI_80211_LTXQ_LOCK(ltxq); skb = skb_dequeue(<xq->skbq); + LKPI_80211_LTXQ_UNLOCK(ltxq); stopped: return (skb); @@ -4581,10 +4599,12 @@ linuxkpi_ieee80211_txq_get_depth(struct ieee80211_txq *txq, ltxq = TXQ_TO_LTXQ(txq); fc = bc = 0; + LKPI_80211_LTXQ_LOCK(ltxq); skb_queue_walk(<xq->skbq, skb) { fc++; bc += skb->len; } + LKPI_80211_LTXQ_UNLOCK(ltxq); if (frame_cnt) *frame_cnt = fc; if (byte_cnt) @@ -5137,13 +5157,17 @@ void linuxkpi_ieee80211_schedule_txq(struct ieee80211_hw *hw, { struct lkpi_hw *lhw; struct lkpi_txq *ltxq; + bool ltxq_empty; ltxq = TXQ_TO_LTXQ(txq); IMPROVE_TXQ("LOCKING"); /* Only schedule if work to do or asked to anyway. */ - if (!withoutpkts && skb_queue_empty(<xq->skbq)) + LKPI_80211_LTXQ_LOCK(ltxq); + ltxq_empty = skb_queue_empty(<xq->skbq); + LKPI_80211_LTXQ_UNLOCK(ltxq); + if (!withoutpkts && ltxq_empty) goto out; /* Make sure we do not double-schedule. */ @@ -5156,6 +5180,39 @@ out: return; } +void +linuxkpi_ieee80211_handle_wake_tx_queue(struct ieee80211_hw *hw, + struct ieee80211_txq *txq) +{ + struct lkpi_hw *lhw; + struct ieee80211_txq *ntxq; + struct ieee80211_tx_control control; + struct sk_buff *skb; + + lhw = HW_TO_LHW(hw); + + LKPI_80211_LHW_TXQ_LOCK(lhw); + ieee80211_txq_schedule_start(hw, txq->ac); + do { + ntxq = ieee80211_next_txq(hw, txq->ac); + if (ntxq == NULL) + break; + + memset(&control, 0, sizeof(control)); + control.sta = ntxq->sta; + do { + skb = linuxkpi_ieee80211_tx_dequeue(hw, ntxq); + if (skb == NULL) + break; + lkpi_80211_mo_tx(hw, &control, skb); + } while(1); + + ieee80211_return_txq(hw, ntxq, false); + } while (1); + ieee80211_txq_schedule_end(hw, txq->ac); + LKPI_80211_LHW_TXQ_UNLOCK(lhw); +} + /* -------------------------------------------------------------------------- */ struct lkpi_cfg80211_bss { diff --git a/sys/compat/linuxkpi/common/src/linux_80211.h b/sys/compat/linuxkpi/common/src/linux_80211.h index 74dc3c9f9dee..9100d1c2e73e 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.h +++ b/sys/compat/linuxkpi/common/src/linux_80211.h @@ -100,6 +100,7 @@ struct lkpi_radiotap_rx_hdr { struct lkpi_txq { TAILQ_ENTRY(lkpi_txq) txq_entry; + struct mtx ltxq_mtx; bool seen_dequeue; bool stopped; uint32_t txq_generation; @@ -175,6 +176,7 @@ struct lkpi_hw { /* name it mac80211_sc? */ struct sx sx; + struct mtx txq_mtx; uint32_t txq_generation[IEEE80211_NUM_ACS]; TAILQ_HEAD(, lkpi_txq) scheduled_txqs[IEEE80211_NUM_ACS]; @@ -247,13 +249,26 @@ struct lkpi_wiphy { mtx_destroy(&(_lhw)->scan_mtx); #define LKPI_80211_LHW_SCAN_LOCK(_lhw) \ mtx_lock(&(_lhw)->scan_mtx) -#define LKPI_80211_LHW_SCAN_UNLOCK(_lhw) \ +#define LKPI_80211_LHW_SCAN_UNLOCK(_lhw) \ mtx_unlock(&(_lhw)->scan_mtx) #define LKPI_80211_LHW_SCAN_LOCK_ASSERT(_lhw) \ mtx_assert(&(_lhw)->scan_mtx, MA_OWNED) #define LKPI_80211_LHW_SCAN_UNLOCK_ASSERT(_lhw) \ mtx_assert(&(_lhw)->scan_mtx, MA_NOTOWNED) +#define LKPI_80211_LHW_TXQ_LOCK_INIT(_lhw) \ + mtx_init(&(_lhw)->txq_mtx, "lhw-txq", NULL, MTX_DEF | MTX_RECURSE); +#define LKPI_80211_LHW_TXQ_LOCK_DESTROY(_lhw) \ + mtx_destroy(&(_lhw)->txq_mtx); +#define LKPI_80211_LHW_TXQ_LOCK(_lhw) \ + mtx_lock(&(_lhw)->txq_mtx) +#define LKPI_80211_LHW_TXQ_UNLOCK(_lhw) \ + mtx_unlock(&(_lhw)->txq_mtx) +#define LKPI_80211_LHW_TXQ_LOCK_ASSERT(_lhw) \ + mtx_assert(&(_lhw)->txq_mtx, MA_OWNED) +#define LKPI_80211_LHW_TXQ_UNLOCK_ASSERT(_lhw) \ + mtx_assert(&(_lhw)->txq_mtx, MA_NOTOWNED) + #define LKPI_80211_LHW_LVIF_LOCK(_lhw) sx_xlock(&(_lhw)->lvif_sx) #define LKPI_80211_LHW_LVIF_UNLOCK(_lhw) sx_xunlock(&(_lhw)->lvif_sx) @@ -263,6 +278,18 @@ struct lkpi_wiphy { #define LKPI_80211_LSTA_LOCK(_lsta) mtx_lock(&(_lsta)->txq_mtx) #define LKPI_80211_LSTA_UNLOCK(_lsta) mtx_unlock(&(_lsta)->txq_mtx) +#define LKPI_80211_LTXQ_LOCK_INIT(_ltxq) \ + mtx_init(&(_ltxq)->ltxq_mtx, "ltxq", NULL, MTX_DEF); +#define LKPI_80211_LTXQ_LOCK_DESTROY(_ltxq) \ + mtx_destroy(&(_ltxq)->ltxq_mtx); +#define LKPI_80211_LTXQ_LOCK(_ltxq) \ + mtx_lock(&(_ltxq)->ltxq_mtx) +#define LKPI_80211_LTXQ_UNLOCK(_ltxq) \ + mtx_unlock(&(_ltxq)->ltxq_mtx) +#define LKPI_80211_LTXQ_LOCK_ASSERT(_ltxq) \ + mtx_assert(&(_ltxq)->ltxq_mtx, MA_OWNED) +#define LKPI_80211_LTXQ_UNLOCK_ASSERT(_ltxq) \ + mtx_assert(&(_ltxq)->ltxq_mtx, MA_NOTOWNED) int lkpi_80211_mo_start(struct ieee80211_hw *); void lkpi_80211_mo_stop(struct ieee80211_hw *); From nobody Mon Feb 19 16:10:14 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdnYz0Vzbz5C5Df; Mon, 19 Feb 2024 16:10:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdnYy4XzNz4NjG; Mon, 19 Feb 2024 16:10:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708359014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=83xzlp+JSaV3Qo7jx1NRW5+vdjnMPDRQXcX6JJN1/wg=; b=G9EnK9cTwu0VhicRXUF5cdAwF8Rcmzg9YNbAwpDnSzdJnpO0/sIcP5L8SCO/9EzWGSlyyA xWGd14MH6qh9USrtnUqjOvs6sDFzNHpx0fw3UYCUIUhVH269QphKSw2vQ4/dzsXWtppN+A Ab38vpFnHbPCG8xNNxmUcUEPsNS3Fjmsgki9lbRiKHzb2d+X5LutBPF4/yFUazrnH4d70r T8fNLgHULKwDc4HHO55hgMlh4yNWFzTdzXNIS+Hycujp0gig3iBu7fAiipLuW7vRTdslIQ Kx1HyIQrTWyT1kCoQgGClCk7F3ObQjrl4y9A20E/GrOJUS0r63x4bOr5IzdWng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708359014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=83xzlp+JSaV3Qo7jx1NRW5+vdjnMPDRQXcX6JJN1/wg=; b=JZjdtMkuFWhwFBugz4ylVzoY9yT9s1WqwZ8aaa18tQbNJQhqqtaN/xB78GYh6G89gaHTu0 o7y3JaQ+d8ftPYMv0z8J3QEbWoSBm0xwXgNZySkj4R8X7JPlgItLZBf7WEg9O62ixvjjQd vmUxRsgQeJMyJdapTnr4QGUvLDPfqmXa8Y2MZJLcez2YjuKmtRchdDBldHSh7aecQLG0Qu e1h4biil4NRYqA3teoWvCBCZieKctniFaO1KIPeJ0luktYnfzvX/5tbX2IEzDgXKGb4fW4 mxtlRr5VZr7pFVthgh5A7IokyOtS7+ogD6ED98fQ+juTExDELWfscU8JertppQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708359014; a=rsa-sha256; cv=none; b=khEww7pIWBbJRXAnARKzYs44c+k78F4xcR2lH6FUJlilG2VWdCHOtsA2gEITNOcE0CBWd9 zJi56k+VLRhPd8yvdTbsWptTfZDmSLsz5hXuWCQjeBYSoosurknXSpaeEMpc3s1CgMW5Gu 4i9SxAMyc4DYX+1NbHxmc0BZvinxqcd9fx6nnySZSN/p1VrcNuMK+SQrZVMxLk14FACcUO fDdwAuO8FJVPoYSmjclqBWHN2dOnPg0dGnFViAtE/9em2g+C+81W+AlYiGSv6JJodqGgVM k2+iGMi30O7JJLNNbGADE6TdBYfvVzVU20xmKQ+RE0GaMsWlYTQ1qLKPsg5HZw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdnYy3cNgzhRy; Mon, 19 Feb 2024 16:10:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGAEOZ033539; Mon, 19 Feb 2024 16:10:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGAEBv033527; Mon, 19 Feb 2024 16:10:14 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:10:14 GMT Message-Id: <202402191610.41JGAEBv033527@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: dc50f981e17c - releng/13.3 - bwn: remove unused ic_headroom List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/releng/13.3 X-Git-Reftype: branch X-Git-Commit: dc50f981e17c39a486616315d142785a20f87612 Auto-Submitted: auto-generated The branch releng/13.3 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=dc50f981e17c39a486616315d142785a20f87612 commit dc50f981e17c39a486616315d142785a20f87612 Author: Frank Hilgendorf AuthorDate: 2023-12-13 23:48:08 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-02-19 16:05:54 +0000 bwn: remove unused ic_headroom Unlike bwi(4), bwn(4) does not rely on ic_headroom (despite having it set) but splits the bwn_txhdr (first) segment into its own transaction. Remove ic_headroom to avoid net80211 troubles with not enough space in the mbuf around ieee80211_mbuf_adjust(). PR: 275616 Approved by: re (cperciva) (cherry picked from commit 59dba901f227420647e4856f03cb782a3375c220) (cherry picked from commit 0f032804b6ec70c8f8ee4fe1ed83a3356946b5e8) --- sys/dev/bwn/if_bwn.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/dev/bwn/if_bwn.c b/sys/dev/bwn/if_bwn.c index e104f359ee42..b90dc2dbeab7 100644 --- a/sys/dev/bwn/if_bwn.c +++ b/sys/dev/bwn/if_bwn.c @@ -808,8 +808,6 @@ bwn_attach_post(struct bwn_softc *sc) /* call MI attach routine. */ ieee80211_ifattach(ic); - ic->ic_headroom = sizeof(struct bwn_txhdr); - /* override default methods */ ic->ic_raw_xmit = bwn_raw_xmit; ic->ic_updateslot = bwn_updateslot; From nobody Mon Feb 19 16:10:18 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdnZ323ZMz5C4q8; Mon, 19 Feb 2024 16:10:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdnZ30GQ3z4Ntd; Mon, 19 Feb 2024 16:10:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708359019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vqQlyR6tekwdTgn1i65MWepJUt1+zT9EQVOm4BHf1Pc=; b=gfiq9KbjZv2acS2tVJQjerDbLXnJ6sBJ3n10qavZK1hXGDFegwxkRbBujSO2f8Yc27kRWf 5gUxNBubr1VsIOT0Hh1g9652PFeV7sdPLBI5PYI3pCL00ZafMPo0Cvt9uUzq9xjvHtweVd lEq5k4MKGF680KaZotfLQiUdLn14oZsIDUFSD/7ibuh24A8SprvTaAml22m4D1zGf3xEDH dZGc84enkJN01f9cuCLbmL22vkdNnXash9oCFnzgdJo3nvgyDcJi8qN1Mr86jC8CpECPkh dYcSPNnr7hSR3NtKyIfhBkDvy4u0CoHwRe+IV6PjpeiSS0nPc2hOJ9lpEtcL3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708359019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vqQlyR6tekwdTgn1i65MWepJUt1+zT9EQVOm4BHf1Pc=; b=w79yQb3Q2gqH3I7zhwllhHdedJNq4W6BzjSMHczNXZGC1i+in4lF7fhBgGTyTBeneiJ13E R4c08nKP/OAwKrI+6DMzbwxcLe+ixAMkqLMAKmNhIcKkCxK5RobS1mcOb6PuYQH24wRFW+ Hg/kUNBEHibuZK+/D1G33ITFtVoicyPSU7dgd2st9Luc34QxlRgBPa8/ZQ2bSEHb2Dh95l yT8O2Xj7Qeq07y3CwFPPGoW1jegg8tD10Oq3V4/nSY+uuWdKOx+b22qCk9wfFzKTyVFvG+ F7UFFHqJfqdqBIIQ71E4wh4ctNG+4j68beyYGTnaINRu47cWHKEZfO1Gd2kUfg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708359019; a=rsa-sha256; cv=none; b=hoM7PzeA7ePuoBvyPW668NyaP6eD3rr2Q6vDIiQPJXmoini6EQDOY5sladobmyBDhC3JEr 5HoUKrTjsM2grPs2VVxxePcv/aoC76SQZWnEa/7wG++H/q/N798pOWfZskQOptj3D/9tlH nOTxr2EbAZNR/CRcbj6mrWZuyr6YFwqnMqGTvwVM3ycX8/fbDzGpYfhL8XLCQePJ2hV4y+ 49smQMmmSeUjpI/ynBLntjU6Nod360IPVAn80BA8MW5jgWRxOQRkokGPN8SN+jUhCPRymM r+t+B79Z2a4nxHpfyIhHXnPxbf2qwo6nyDimrW5d2MjmO9pDsBmKcBsQkmynQQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdnZ26TzSzhPf; Mon, 19 Feb 2024 16:10:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGAIoJ035737; Mon, 19 Feb 2024 16:10:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGAIOA035734; Mon, 19 Feb 2024 16:10:18 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:10:18 GMT Message-Id: <202402191610.41JGAIOA035734@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: f93d06ac87f4 - releng/13.3 - net80211: improve logging about state transitions lost List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/releng/13.3 X-Git-Reftype: branch X-Git-Commit: f93d06ac87f4d5f496fe5669dc56b912e11c136e Auto-Submitted: auto-generated The branch releng/13.3 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=f93d06ac87f4d5f496fe5669dc56b912e11c136e commit f93d06ac87f4d5f496fe5669dc56b912e11c136e Author: Bjoern A. Zeeb AuthorDate: 2023-11-12 23:51:14 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-02-19 16:06:51 +0000 net80211: improve logging about state transitions lost It is possible that we call ieee80211_new_state_locked() again before a previous task finished to completion (not run yet or unlocked in between) since 5efea30f039c4 (and follow-up). In either case we would overwrite the new state and argument in the vap. While most drivers somehow deal with that (or not), LinuxKPI 802.11 compat code has KASSERTs to keep net80211, LinuxKPI and driver/firmware state in sync and they may trigger due to a missing transition or more likely a changed ni/lsta. Enhance the wlandebug +state logging for these cases so they are easier to debug. While here remove the unconditional logging to the message buffer; it has been here for a good decade but not helped to actually identify and sort the problem. Approved by: re (cperciva) Sponsored by: The FreeBSD Foundation Reviewed by: cc Differential Revision: https://reviews.freebsd.org/D42560 (cherry picked from commit 72bb33a36b62fa30f69f01d3f6ae372be2c95b59) (cherry picked from commit a2764047702db519aca9e1b3cf6b475e5a723c65) --- sys/net80211/ieee80211_proto.c | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c index f6d144169c48..cf467c08462c 100644 --- a/sys/net80211/ieee80211_proto.c +++ b/sys/net80211/ieee80211_proto.c @@ -2510,6 +2510,13 @@ ieee80211_newstate_cb(void *xvap, int npending) nstate = vap->iv_nstate; arg = vap->iv_nstate_arg; + IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, + "%s:%d: running state update %s -> %s (%d)\n", + __func__, __LINE__, + ieee80211_state_name[vap->iv_state], + ieee80211_state_name[vap->iv_nstate], + npending); + if (vap->iv_flags_ext & IEEE80211_FEXT_REINIT) { /* * We have been requested to drop back to the INIT before @@ -2677,29 +2684,30 @@ ieee80211_new_state_locked(struct ieee80211vap *vap, * until this is completed. */ IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, - "%s: %s -> %s (%s) transition discarded\n", - __func__, + "%s:%d: %s -> %s (%s) transition discarded\n", + __func__, __LINE__, ieee80211_state_name[vap->iv_state], ieee80211_state_name[nstate], ieee80211_state_name[vap->iv_nstate]); return -1; } else if (vap->iv_state != vap->iv_nstate) { -#if 0 /* Warn if the previous state hasn't completed. */ IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, - "%s: pending %s -> %s transition lost\n", __func__, + "%s:%d: pending %s -> %s (now to %s) transition lost\n", + __func__, __LINE__, ieee80211_state_name[vap->iv_state], - ieee80211_state_name[vap->iv_nstate]); -#else - /* XXX temporarily enable to identify issues */ - if_printf(vap->iv_ifp, - "%s: pending %s -> %s transition lost\n", - __func__, ieee80211_state_name[vap->iv_state], - ieee80211_state_name[vap->iv_nstate]); -#endif + ieee80211_state_name[vap->iv_nstate], + ieee80211_state_name[nstate]); } } + IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, + "%s:%d: starting state update %s -> %s (%s)\n", + __func__, __LINE__, + ieee80211_state_name[vap->iv_state], + ieee80211_state_name[vap->iv_nstate], + ieee80211_state_name[nstate]); + nrunning = nscanning = 0; /* XXX can track this state instead of calculating */ TAILQ_FOREACH(vp, &ic->ic_vaps, iv_next) { From nobody Mon Feb 19 16:10:19 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdnZ44WWDz5C5Dm; Mon, 19 Feb 2024 16:10:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdnZ40td1z4Nx5; Mon, 19 Feb 2024 16:10:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708359020; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OJWSwadkv3/Uxv5cquSWrNOcxU/e6lAnmtlUh/MrDY0=; b=BnSaitBIkcchsAq2WkRUyOQ59blBAUl8L8JS7NSB+WVXvQdea9TJfer8ab7IKoKbucp4d2 d9VCBV/w7oQ6iGASopSJ7zqncujQznXyzoiy+TaYONtY5CVUqDMpOiIOwgY24sAr+Ltzlt PvMVX7trKRg2zkppGZ7TkGa23Tf0sffG8MifQU9ctJuZwxNUb4P3RhxTGU3A4A2CeD8cQY zo1YLBRijn3cK0QXDAN+S0mSp0FDA3OhbLvNW6XEvSCCNeyiVS9EpZNvqYo2olg4Z+YktH i94S+y11qiBV/d3642dksfGHvMYRz9SVEiSoI5Nh8TJVIFxwc8NwXkRh0USFIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708359020; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OJWSwadkv3/Uxv5cquSWrNOcxU/e6lAnmtlUh/MrDY0=; b=Dd9bfKxxj8VBv5RV7CyOUC5jZxu1ETq2ofzNUY4Pga6gLZOsy3I0xVBtvp1b0muvU6eklw /E2nUeHzERN6Zy4oAvHzHpJL3R29PhHFOAG4HU45Rsn6bq8h7twbDcbnGyEVUEZy3nZ8ef 598TEXh/TSLk2BFBg3JI/KYiTVtlYz+k4AeZHbNGg1N5Altr1mnPurTXeaC98Bqiw0+7ve J5S03W8u7fCSHxQz/JAQcmHtyXXP7B111WP2Pe4qMFMI5SRIefpl60IX/0l9bkXMOuxkyo G9t0EWyRLhhzVOSU2cs3Wsp5nFKE5OzOpPF5ss3t5sXw+182TxYkHxTzKfbKpQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708359020; a=rsa-sha256; cv=none; b=MqEKBSdBQYxdBTXAxOtjsk6f0XjCpzdIy7eUiTAEk74gXspcj6eQZS4za+SKZW8TgWX8To JlUR8jnSVk9vD13funGwKlhlpkt4FwmZfVylAG5foZouNkz89bSj5PvUt2mn7BO/YzlAlK wq8pp4XZvGoY+XHTiV4rR7uEBy9k+hEQCgKLwGysI+1UK10sw0hYoD1AOxxpFUUzFp+JEG 757SrboVC5mGpF8Jz5Q7HDWSyvEmqMr1buDIHnoR6uw2f+lefJfIw5q5GSlPBp2R6G8K05 QbTybrdrtiiJTtwqs1qyxMKhx2onknNwtneZE1JBkTqcKEiQoBVceTdCWvfBlQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdnZ4008czh9v; Mon, 19 Feb 2024 16:10:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGAJxI035791; Mon, 19 Feb 2024 16:10:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGAJjN035788; Mon, 19 Feb 2024 16:10:19 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:10:19 GMT Message-Id: <202402191610.41JGAJjN035788@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 5463d4cd99f3 - releng/13.3 - LinuxKPI: 802.11: fix field order in ieee80211_key_conf List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/releng/13.3 X-Git-Reftype: branch X-Git-Commit: 5463d4cd99f339f7ed40a70679f48eb31f2b819e Auto-Submitted: auto-generated The branch releng/13.3 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=5463d4cd99f339f7ed40a70679f48eb31f2b819e commit 5463d4cd99f339f7ed40a70679f48eb31f2b819e Author: Bjoern A. Zeeb AuthorDate: 2024-01-28 00:51:23 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-02-19 16:06:59 +0000 LinuxKPI: 802.11: fix field order in ieee80211_key_conf When adding the new field link_id to struct ieee80211_key_conf, it was erroneously placed at the end of the struct; the zero-length (variable sized) array for the key always needs to stay last. Resort fields and add hopefully helpful comment to avoid the problem in the future. Approved by: re (cperciva) Fixes: adff403fe7a87 Reviewed by: cc Differential Revision: https://reviews.freebsd.org/D43635 (cherry picked from commit 828ce22f079df77b3bf52c4cf296959ea66bdc11) (cherry picked from commit 1cf1f094680fe3bfd9836800f83ed0b79e180340) --- sys/compat/linuxkpi/common/include/net/mac80211.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index fee29d3b1a1d..f6d807263cef 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -507,9 +507,9 @@ struct ieee80211_key_conf { uint8_t hw_key_idx; /* Set by drv. */ uint8_t keyidx; uint16_t flags; - uint8_t keylen; - uint8_t key[0]; int8_t link_id; /* signed! */ + uint8_t keylen; + uint8_t key[0]; /* Must stay last! */ }; struct ieee80211_key_seq { From nobody Mon Feb 19 16:10:21 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdnZ53f21z5C54f; Mon, 19 Feb 2024 16:10:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdnZ5298Pz4NpR; Mon, 19 Feb 2024 16:10:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708359021; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gKLLpeD8uX6vgMbgSDNbxHLIDAEOifP18X6tKZIPvvM=; b=I9+uT37kxulQ28fuEI/11iNjc15WTbtBVLk+6qqS7neGNeFZGFgsC6SITOMryf2xXUbWuo zMj4ivwl6DOh7rCz/QDH0fodP6+nPSdu/PJ3rur2GhnvI2dPoxh5N3UG+LPhiB1XTp17h5 CQV+z7as2ROi9IwGeEZ+sgY+V/7xWC7aQqPa3gVK4HA5d2h9AaAnZkM0cuDvz4JRCq7ydQ 4WESKgf5aGBm3Y7Nxbc+Q/4FQr+GWtiqXoFQnUwTssOH8O4PnWXlZANeU9nFqeUJwEx/4c wn/f9b1efqO6G7YcDBHCjSGhzwmNNn6cgUPC2qcgDXG85HRUjak0SAp5g7tC7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708359021; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gKLLpeD8uX6vgMbgSDNbxHLIDAEOifP18X6tKZIPvvM=; b=sg4kwVRVk2tZ1rAP4633K7DwAE+naO95cxHDvpinfPqH2asIvr3DHcv8A6gYXkDPt4519E Qi2sVY5iFNILvE75bJ+NnXrcH2AvMHVdKBlTQzag4lcMCHwRwmfeQNyUCRsqwagK5ODag2 HaYASqj0rKDUsSvNpFvjf5nnFfL0Hodmc6sWG8ItB9fmjPllVJFZyS48cLis0MPB3SlUEw lGDOlqgdt+LgaMVk0FETHWJyJ0qW/APcuY2Kmf1pBU2xBvnYVatLD6Za1wi5INLjKtSTYX WxkIg0ZLthOld1RyefdjIwuy3xqdrEraByTBvHGy3g6U4/W58N+m0PfuV2AyLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708359021; a=rsa-sha256; cv=none; b=uVACcnltDOTO6uLdkYo2GBYuSGDGLMtjQXkJWp4f3l8a80SHG6LNGa47JPW+CWQUtWsXZa +Qurbn5p3Oq1chORJbiKWWu/tT2yZk/bKqb+WaUTSwwd1NNO2yH7yjcmlV7Oj7wgMrxVOs Y4kQ7guTspw3eay0jL66Ouc8ErfmhstP2GB7Gw0NlVYAVJNico2ixXL7ucaFMqm+c3TcFu 41EnizYYTgtG6dJRquGuTniI3yU0Tpw+hjZhjWRO3dijMpGwEyIvnkSX32ONma6Ed4a0jv gdO2xntUX7ODrTnt7oMq0AYaGWfNZndBXHENefKZ3ikBnjU2dRvUZj3dc6vMYA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdnZ51GPNzh9w; Mon, 19 Feb 2024 16:10:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGALxk035842; Mon, 19 Feb 2024 16:10:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGALVN035839; Mon, 19 Feb 2024 16:10:21 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:10:21 GMT Message-Id: <202402191610.41JGALVN035839@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: f7c8d5448446 - releng/13.3 - net80211: fix a NULL deref in ieee80211_sta_join1() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/releng/13.3 X-Git-Reftype: branch X-Git-Commit: f7c8d5448446a470baaca560f91c884e5ceeecc7 Auto-Submitted: auto-generated The branch releng/13.3 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=f7c8d5448446a470baaca560f91c884e5ceeecc7 commit f7c8d5448446a470baaca560f91c884e5ceeecc7 Author: Bjoern A. Zeeb AuthorDate: 2024-01-16 18:53:06 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-02-19 16:07:06 +0000 net80211: fix a NULL deref in ieee80211_sta_join1() When ieee80211_sta_join1() gets an obss without ni_nt trying to lock that will cause a NULL pointer deref. Check for the table to be valid and deal with the obss node accordingly. This can happen if sta_newstate() calls ieee80211_reset_bss() for nstate == INIT and ostate != INIT. ieee80211_reset_bss() itself calls ieee80211_node_table_reset() which calls node_reclaim() which ends up in ieee80211_del_node_nt() which does remove the node from the table and sets ni_table to NULL. That node (former iv_bss) can then be returned as obss in the (*iv_update_bss)() call in join1(). Approved by: re (cperciva) Reviewed by: adrian, cc Differential Revision: https://reviews.freebsd.org/D43469 (cherry picked from commit 8a5a3e3d0436a2de9dc5c2c10bd9a471b6338233) (cherry picked from commit 755a04671dd47390f6d49695a6ac9c2d31c9935c) --- sys/net80211/ieee80211_node.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index a70edfa3acc4..0f0ecf37fe94 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -867,11 +867,14 @@ ieee80211_sta_join1(struct ieee80211_node *selbs) struct ieee80211_node_table *nt = obss->ni_table; copy_bss(selbs, obss); - ieee80211_node_decref(obss); /* iv_bss reference */ - - IEEE80211_NODE_LOCK(nt); - node_reclaim(nt, obss); /* station table reference */ - IEEE80211_NODE_UNLOCK(nt); + if (nt != NULL) { + ieee80211_node_decref(obss); /* iv_bss reference */ + IEEE80211_NODE_LOCK(nt); + node_reclaim(nt, obss); /* station table reference */ + IEEE80211_NODE_UNLOCK(nt); + } else { + ieee80211_free_node(obss); /* iv_bss reference */ + } obss = NULL; /* NB: guard against later use */ } From nobody Mon Feb 19 16:10:22 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdnZ64Ts9z5C4qF; Mon, 19 Feb 2024 16:10:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdnZ62jkGz4Nv6; Mon, 19 Feb 2024 16:10:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708359022; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CahYoabJMu+le2e5tw5Dqia2eU0sgt1YFTDrNam61bE=; b=lU3AmAdzpwM8/q0Q0wkZRKyxkz7fpVXKVbD7cCwlLPJzfMvtmyJEKfs7mMtlydfp2x9HWN VX2czwImSD9MtHiKOHg2X8Nkc3jGNXODiYBfZ1lRX6WnBS5GaigGVIrMlaejgmi6e63oxr FIcK/5eqna0aW4v8xpNdYsJP2yDoOe9FJyB4Zq2JUNKnsOvS9pgdlEjtCSZetRtnkMXulR VjBsPRPl8pkWJrZ2ONCON/go28oQkjBE0Nhpu6aQ9bzk1pjS1J+2r7Q17FXJvJuwN7Mhcv h1YzxmC7mj7HGtag/nh/KXIlLuXjMObJoNzWtjAwhXrq1/ObGtzJ0xSdczf74w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708359022; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CahYoabJMu+le2e5tw5Dqia2eU0sgt1YFTDrNam61bE=; b=kX/7cE7Zf5bdW7x2+IDrXjEH07Qb+y39bXu/sAB2cDWpmtOWO5Nt9rveFhZqdBcyz2wjyE 7CbV2XYPFM1ur9B04U6eetZt/aopfThMBPQesmxfVZeqQj23IMp3IP8l0K9A3O/1dthT7J Xs2l0X40ccLdsYlhl26M+SxAbJDy41KoigU5L5NCnqQTU/z2/QcfC+5OXK7JBktgDwTyOo 1D0CzvvF71H5Z/I9LSf3kc4fCtnrFOoHlAQ7E/LSIrL7CL/9JT9SCYv0cHVqKEw2I66hKb t635nHQZHohNgU+NKptmYWOk8sXd/Ulyo8fGucfdVuNpnbfYYj8UXg7qLlpI4g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708359022; a=rsa-sha256; cv=none; b=mcurYT+CAJUmH31YEf43dXkkxryaHtRo81emAp+DA7nB+05lJ8xWdX2SaySUfz8LwgTwnd TTZGeICH12NhNLUN2owAElSnu1t48WW5G+vHigylrK29Zi0nHDbfdhuvcGHobyQLCdS1Ii kO7FExmIqONj0ivVEt3tMXgEBcHJB92c2g1bJvtM8y3aj8Stt+gZmNikj9rZ2kHu7qjEyp D7ffQfIMhuUvMXcRf858tlCTk8RDDUSKzOFElwJAffDE066qRoPtr3JwKJsI8K7rayne/k qmM/oJlA7OW/MnUKJHTES/ZQbP5adAKeXsp7Mhkiq62b/jXmjnwXrkJDyM1YYg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdnZ61p38zh9x; Mon, 19 Feb 2024 16:10:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGAMA1035900; Mon, 19 Feb 2024 16:10:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGAMvw035897; Mon, 19 Feb 2024 16:10:22 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:10:22 GMT Message-Id: <202402191610.41JGAMvw035897@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: eecf453c0e56 - releng/13.3 - net80211: make sure calls to (*iv_update_bss)() are locked List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/releng/13.3 X-Git-Reftype: branch X-Git-Commit: eecf453c0e56c179539756212977456c9561c71c Auto-Submitted: auto-generated The branch releng/13.3 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=eecf453c0e56c179539756212977456c9561c71c commit eecf453c0e56c179539756212977456c9561c71c Author: Bjoern A. Zeeb AuthorDate: 2024-01-19 14:52:03 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-02-19 16:07:13 +0000 net80211: make sure calls to (*iv_update_bss)() are locked It turned out thare various calls into (*iv_update_bss)(), that is direct changes to vap->iv_bss in the old days, happened without synchronisation. Use locking assertions to document the requirement or status quo at some callers given ic locking will eventually have to be dealt with. Approved by: re (cperciva) Reviewed by: cc Differential Revision: https://reviews.freebsd.org/D43512 (cherry picked from commit 49619f73151aeaca4cef5adf631253da04a46e19) (cherry picked from commit f8ec0379435745d800ec149f9289401c792e61bb) --- sys/net80211/ieee80211_node.c | 15 +++++++++++++++ sys/net80211/ieee80211_proto.c | 2 ++ 2 files changed, 17 insertions(+) diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index 0f0ecf37fe94..c851d83d8d47 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -171,6 +171,10 @@ ieee80211_node_vattach(struct ieee80211vap *vap) void ieee80211_node_latevattach(struct ieee80211vap *vap) { + + /* XXX should ieee80211_vap_attach(), our only caller hold the lock? */ + IEEE80211_UNLOCK_ASSERT(vap->iv_ic); + if (vap->iv_opmode == IEEE80211_M_HOSTAP) { /* XXX should we allow max aid to be zero? */ if (vap->iv_max_aid < IEEE80211_AID_MIN) { @@ -191,7 +195,9 @@ ieee80211_node_latevattach(struct ieee80211vap *vap) } } + IEEE80211_LOCK(vap->iv_ic); ieee80211_reset_bss(vap); + IEEE80211_UNLOCK(vap->iv_ic); vap->iv_auth = ieee80211_authenticator_get(vap->iv_bss->ni_authmode); } @@ -201,11 +207,16 @@ ieee80211_node_vdetach(struct ieee80211vap *vap) { struct ieee80211com *ic = vap->iv_ic; + /* XXX should ieee80211_vap_detach(), our only caller hold the lock? */ + IEEE80211_UNLOCK_ASSERT(vap->iv_ic); + ieee80211_node_table_reset(&ic->ic_sta, vap); + IEEE80211_LOCK(ic); if (vap->iv_bss != NULL) { ieee80211_free_node(vap->iv_bss); vap->iv_update_bss(vap, NULL); } + IEEE80211_UNLOCK(ic); if (vap->iv_aid_bitmap != NULL) { IEEE80211_FREE(vap->iv_aid_bitmap, M_80211_NODE); vap->iv_aid_bitmap = NULL; @@ -455,6 +466,8 @@ ieee80211_reset_bss(struct ieee80211vap *vap) struct ieee80211com *ic = vap->iv_ic; struct ieee80211_node *ni, *obss; + IEEE80211_LOCK_ASSERT(ic); + ieee80211_node_table_reset(&ic->ic_sta, vap); /* XXX multi-bss: wrong */ ieee80211_vap_reset_erp(vap); @@ -854,7 +867,9 @@ ieee80211_sta_join1(struct ieee80211_node *selbs) /* * Committed to selbs, setup state. */ + IEEE80211_LOCK(ic); /* XXX may recurse here, check callers. */ obss = vap->iv_update_bss(vap, selbs); /* NB: caller assumed to bump refcnt */ + IEEE80211_UNLOCK(ic); /* * Check if old+new node have the same address in which * case we can reassociate when operating in sta mode. diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c index cf467c08462c..5ed9f2e3f50e 100644 --- a/sys/net80211/ieee80211_proto.c +++ b/sys/net80211/ieee80211_proto.c @@ -830,6 +830,8 @@ vap_update_bss(struct ieee80211vap *vap, struct ieee80211_node *ni) { struct ieee80211_node *obss; + IEEE80211_LOCK_ASSERT(vap->iv_ic); + obss = vap->iv_bss; vap->iv_bss = ni; From nobody Mon Feb 19 16:10:23 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdnZ76LNXz5C5Kg; Mon, 19 Feb 2024 16:10:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdnZ73P6Cz4Nxj; Mon, 19 Feb 2024 16:10:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708359023; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iRGR0G+2xkTDARMnuW1w+A9sx7dv7dwlAK2oLoGCF7g=; b=JI4Bb5pCBByE2sxa/YWs3FR2m69jl9Z9fyeWVKytJXu3JNQDBbXN1tg5LcybwGfY52ukaP 5MADV1tWcjTyUlTmA4mX3JSt8PEVVpI/lqLHsi33gTy4NUYEDTWzZdEfDavKe7Wn+O8bLp WXPSfkDnxhBlW3baqRljF42hGQNQ/pXUZKLrZlvvcf17beDED/slSIsrK8bimmbE0O4X9q AEBqu4r3wqJtWUa1ynN6jY9uHe6GyXPQQA6xVifNyxD2hYZPYRH2pXLT0UgSgxkZ3PBP9C qJPd06iaeQCgnZnacDnPAlvfUi2w9iFhAhGg1JuudVrbi4AW9s+buPrvkDcuRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708359023; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iRGR0G+2xkTDARMnuW1w+A9sx7dv7dwlAK2oLoGCF7g=; b=o2NCYpotF3yPtsp5B2Fd3DCfJ4wwVy6kdttQmqK47Z2xPt1oeWmBz0w+l0HPitLduYc9rf 1FakwYUZE6MQtBzxvvXqisXmzdBCZFilhfSsPSlIYff5GhOh4WO6zLfdAf/lqIPlyHpDut W6+gKV6cdFEJNU9tozWF+YbSEeyyOtsCE/kY8jP0SDPKZTn1/WlV80UQmeX1vuml5KtzQy uauUPq+xWWDVJct8o0dRVZaqaYfqnGiaRyzc6n61cI7QRVY3oPh1WHILu9eBPu8HPA0d+z 9cBaoC5Fq4sy0qXkfYxHQu/2prAH7xDvY7i1qtqtNDXgN2en39CJn61N5TmNNg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708359023; a=rsa-sha256; cv=none; b=rd4L+o/PUKciuD0VWvV3Mfwf1mbUn5plK7P1Li0chxnm7MIWPTj4Qy1NbgMxvqiCN18Wxg TXIAocIxy2cbKcs1b2hM7OCXeY6tghVq4F54Pg3Xv7n3PoIjGRV+XcEvkMSGb3CHyXsbMC TJAqlZS8Nyql3OR40QFaBqK9SDAGuyGNszZ45umhygjrvDUqxpxbONLu5lDj8apTWRPmQB hvd8tnuGagw7vDgCLz0jcOCMLou7OCDnKrBihdewB7bPvrs46nu5bgS5cUBcn/bNbOzfNI 62Jnn2BGNDISsZrMdtcAyn4C8A9eEDZGtHHHHpxz8guPDL3j7g8pcWh6KA1YuQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdnZ72SFyzh9y; Mon, 19 Feb 2024 16:10:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGANMF035950; Mon, 19 Feb 2024 16:10:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGANWl035946; Mon, 19 Feb 2024 16:10:23 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:10:23 GMT Message-Id: <202402191610.41JGANWl035946@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 9b998db87c28 - releng/13.3 - net80211: deal with lost state transitions List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/releng/13.3 X-Git-Reftype: branch X-Git-Commit: 9b998db87c28356fce21784c4f8bfb8737615e1f Auto-Submitted: auto-generated The branch releng/13.3 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=9b998db87c28356fce21784c4f8bfb8737615e1f commit 9b998db87c28356fce21784c4f8bfb8737615e1f Author: Bjoern A. Zeeb AuthorDate: 2024-01-10 10:14:16 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-02-19 16:07:20 +0000 net80211: deal with lost state transitions Since 5efea30f039c4 we can possibly lose a state transition which can cause trouble further down the road. The reproducer from 643d6dce6c1e can trigger these for example. Drivers for firmware based wireless cards have worked around some of this (and other) problems in the past. Add an array of tasks rather than a single one as we would simply get npending > 1 and lose order with other tasks. Try to keep state changes updated as queued in case we end up with more than one at a time. While this is not ideal either (call it a hack) it will sort the problem for now. We will queue in ieee80211_new_state_locked() and do checks there and dequeue in ieee80211_newstate_cb(). If we still overrun the (currently) 8 slots we will drop the state change rather than overwrite the last one. When dequeing we will update iv_nstate and keep it around for historic reasons for the moment. The longer term we should make the callers of ieee80211_new_state[_locked]() actually use the returned errors and act appropriately but that will touch a lot more places and drivers (possibly incl. changed behaviour for ioctls). rtwn(4) and rum(4) should probably be revisted and net80211 internals removed (for rum(4) at least the current logic still seems prone to races). PR: 271979, 271988, 275255, 263613, 274003 Sponsored by: The FreeBSD Foundation (in 2023) Reviewed by: cc Differential Revision: https://reviews.freebsd.org/D43389 (cherry picked from commit 713db49d06deee90dd358b2e4b9ca05368a5eaf6) Given this changes the internal structure of 'struct ieee80211vap', which gets allocated by the drivers, and we do not have enough spares, all wireless drivers need to be recompiled. Given we are forced to do the update, we leave fields in the middle of the struct and add more spares at the same time. __FreeBSD_version will get updated to 1303001 to be able to detect this change. Approved by: re (cperciva) (cherry picked from commit a890a3a5ddf33acb0a4000885945b89156799b07) (cherry picked from commit a7e1fc7f620d3341549c1380f550aaafbdb45622) --- sys/dev/rtwn/if_rtwn.c | 4 +- sys/dev/usb/wlan/if_rum.c | 4 +- sys/net80211/ieee80211.c | 4 +- sys/net80211/ieee80211_ddb.c | 15 ++++- sys/net80211/ieee80211_proto.c | 124 ++++++++++++++++++++++++++++++++++------- sys/net80211/ieee80211_var.h | 18 +++--- 6 files changed, 136 insertions(+), 33 deletions(-) diff --git a/sys/dev/rtwn/if_rtwn.c b/sys/dev/rtwn/if_rtwn.c index baf427b4aafc..4334d5700e51 100644 --- a/sys/dev/rtwn/if_rtwn.c +++ b/sys/dev/rtwn/if_rtwn.c @@ -614,10 +614,12 @@ rtwn_vap_delete(struct ieee80211vap *vap) struct ieee80211com *ic = vap->iv_ic; struct rtwn_softc *sc = ic->ic_softc; struct rtwn_vap *uvp = RTWN_VAP(vap); + int i; /* Put vap into INIT state + stop device if needed. */ ieee80211_stop(vap); - ieee80211_draintask(ic, &vap->iv_nstate_task); + for (i = 0; i < NET80211_IV_NSTATE_NUM; i++) + ieee80211_draintask(ic, &vap->iv_nstate_task[i]); ieee80211_draintask(ic, &ic->ic_parent_task); RTWN_LOCK(sc); diff --git a/sys/dev/usb/wlan/if_rum.c b/sys/dev/usb/wlan/if_rum.c index d4efc37a783f..364f02393d8d 100644 --- a/sys/dev/usb/wlan/if_rum.c +++ b/sys/dev/usb/wlan/if_rum.c @@ -719,10 +719,12 @@ rum_vap_delete(struct ieee80211vap *vap) struct rum_vap *rvp = RUM_VAP(vap); struct ieee80211com *ic = vap->iv_ic; struct rum_softc *sc = ic->ic_softc; + int i; /* Put vap into INIT state. */ ieee80211_new_state(vap, IEEE80211_S_INIT, -1); - ieee80211_draintask(ic, &vap->iv_nstate_task); + for (i = 0; i < NET80211_IV_NSTATE_NUM; i++) + ieee80211_draintask(ic, &vap->iv_nstate_task[i]); RUM_LOCK(sc); /* Cancel any unfinished Tx. */ diff --git a/sys/net80211/ieee80211.c b/sys/net80211/ieee80211.c index 2bc85b7ac04a..a3de9fd91797 100644 --- a/sys/net80211/ieee80211.c +++ b/sys/net80211/ieee80211.c @@ -729,6 +729,7 @@ ieee80211_vap_detach(struct ieee80211vap *vap) { struct ieee80211com *ic = vap->iv_ic; struct ifnet *ifp = vap->iv_ifp; + int i; CURVNET_SET(ifp->if_vnet); @@ -743,7 +744,8 @@ ieee80211_vap_detach(struct ieee80211vap *vap) /* * Flush any deferred vap tasks. */ - ieee80211_draintask(ic, &vap->iv_nstate_task); + for (i = 0; i < NET80211_IV_NSTATE_NUM; i++) + ieee80211_draintask(ic, &vap->iv_nstate_task[i]); ieee80211_draintask(ic, &vap->iv_swbmiss_task); ieee80211_draintask(ic, &vap->iv_wme_task); ieee80211_draintask(ic, &ic->ic_parent_task); diff --git a/sys/net80211/ieee80211_ddb.c b/sys/net80211/ieee80211_ddb.c index 29de6d10fcc3..f028c4273ee3 100644 --- a/sys/net80211/ieee80211_ddb.c +++ b/sys/net80211/ieee80211_ddb.c @@ -470,8 +470,9 @@ _db_show_vap(const struct ieee80211vap *vap, int showmesh, int showprocs) if (vap->iv_opmode == IEEE80211_M_MBSS) db_printf("(%p)", vap->iv_mesh); #endif - db_printf(" state %s", ieee80211_state_name[vap->iv_state]); - db_printf(" ifp %p(%s)", vap->iv_ifp, vap->iv_ifp->if_xname); + db_printf(" state %#x %s", vap->iv_state, + ieee80211_state_name[vap->iv_state]); + db_printf(" ifp %p(%s)", vap->iv_ifp, if_name(vap->iv_ifp)); db_printf("\n"); db_printf("\tic %p", vap->iv_ic); @@ -482,6 +483,16 @@ _db_show_vap(const struct ieee80211vap *vap, int showmesh, int showprocs) struct sysctllog *iv_sysctl; /* dynamic sysctl context */ #endif db_printf("\n"); + + db_printf("\tiv_nstate %#x %s iv_nstate_b %d iv_nstate_n %d\n", + vap->iv_nstate, ieee80211_state_name[vap->iv_nstate], /* historic */ + vap->iv_nstate_b, vap->iv_nstate_n); + for (i = 0; i < NET80211_IV_NSTATE_NUM; i++) { + db_printf("\t [%d] iv_nstates %#x %s _task %p _args %d\n", i, + vap->iv_nstates[i], ieee80211_state_name[vap->iv_nstates[i]], + &vap->iv_nstate_task[i], vap->iv_nstate_args[i]); + } + db_printf("\tdebug=%b\n", vap->iv_debug, IEEE80211_MSG_BITS); db_printf("\tflags=%b\n", vap->iv_flags, IEEE80211_F_BITS); diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c index 5ed9f2e3f50e..bc097888a1d6 100644 --- a/sys/net80211/ieee80211_proto.c +++ b/sys/net80211/ieee80211_proto.c @@ -340,7 +340,8 @@ ieee80211_proto_vattach(struct ieee80211vap *vap) vap->iv_bmiss_max = IEEE80211_BMISS_MAX; callout_init_mtx(&vap->iv_swbmiss, IEEE80211_LOCK_OBJ(ic), 0); callout_init(&vap->iv_mgtsend, 1); - TASK_INIT(&vap->iv_nstate_task, 0, ieee80211_newstate_cb, vap); + for (i = 0; i < NET80211_IV_NSTATE_NUM; i++) + TASK_INIT(&vap->iv_nstate_task[i], 0, ieee80211_newstate_cb, vap); TASK_INIT(&vap->iv_swbmiss_task, 0, beacon_swmiss, vap); TASK_INIT(&vap->iv_wme_task, 0, vap_update_wme, vap); TASK_INIT(&vap->iv_slot_task, 0, vap_update_slot, vap); @@ -2497,6 +2498,51 @@ wakeupwaiting(struct ieee80211vap *vap0) } } +static int +_ieee80211_newstate_get_next_empty_slot(struct ieee80211vap *vap) +{ + int nstate_num; + + IEEE80211_LOCK_ASSERT(vap->iv_ic); + + if (vap->iv_nstate_n >= NET80211_IV_NSTATE_NUM) + return (-1); + + nstate_num = vap->iv_nstate_b + vap->iv_nstate_n; + nstate_num %= NET80211_IV_NSTATE_NUM; + vap->iv_nstate_n++; + + return (nstate_num); +} + +static int +_ieee80211_newstate_get_next_pending_slot(struct ieee80211vap *vap) +{ + int nstate_num; + + IEEE80211_LOCK_ASSERT(vap->iv_ic); + + KASSERT(vap->iv_nstate_n > 0, ("%s: vap %p iv_nstate_n %d\n", + __func__, vap, vap->iv_nstate_n)); + + nstate_num = vap->iv_nstate_b; + vap->iv_nstate_b++; + if (vap->iv_nstate_b >= NET80211_IV_NSTATE_NUM) + vap->iv_nstate_b = 0; + vap->iv_nstate_n--; + + return (nstate_num); +} + +static int +_ieee80211_newstate_get_npending(struct ieee80211vap *vap) +{ + + IEEE80211_LOCK_ASSERT(vap->iv_ic); + + return (vap->iv_nstate_n); +} + /* * Handle post state change work common to all operating modes. */ @@ -2506,17 +2552,25 @@ ieee80211_newstate_cb(void *xvap, int npending) struct ieee80211vap *vap = xvap; struct ieee80211com *ic = vap->iv_ic; enum ieee80211_state nstate, ostate; - int arg, rc; + int arg, rc, nstate_num; + KASSERT(npending == 1, ("%s: vap %p with npending %d != 1\n", + __func__, vap, npending)); IEEE80211_LOCK(ic); - nstate = vap->iv_nstate; - arg = vap->iv_nstate_arg; + nstate_num = _ieee80211_newstate_get_next_pending_slot(vap); + + /* + * Update the historic fields for now as they are used in some + * drivers and reduce code changes for now. + */ + vap->iv_nstate = nstate = vap->iv_nstates[nstate_num]; + arg = vap->iv_nstate_args[nstate_num]; IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, "%s:%d: running state update %s -> %s (%d)\n", __func__, __LINE__, ieee80211_state_name[vap->iv_state], - ieee80211_state_name[vap->iv_nstate], + ieee80211_state_name[nstate], npending); if (vap->iv_flags_ext & IEEE80211_FEXT_REINIT) { @@ -2527,9 +2581,10 @@ ieee80211_newstate_cb(void *xvap, int npending) /* Deny any state changes while we are here. */ vap->iv_nstate = IEEE80211_S_INIT; IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, - "%s: %s -> %s arg %d\n", __func__, + "%s: %s -> %s arg %d -> %s arg %d\n", __func__, ieee80211_state_name[vap->iv_state], - ieee80211_state_name[vap->iv_nstate], arg); + ieee80211_state_name[vap->iv_nstate], 0, + ieee80211_state_name[nstate], arg); vap->iv_newstate(vap, vap->iv_nstate, 0); IEEE80211_LOCK_ASSERT(ic); vap->iv_flags_ext &= ~(IEEE80211_FEXT_REINIT | @@ -2670,7 +2725,7 @@ ieee80211_new_state_locked(struct ieee80211vap *vap, struct ieee80211com *ic = vap->iv_ic; struct ieee80211vap *vp; enum ieee80211_state ostate; - int nrunning, nscanning; + int nrunning, nscanning, nstate_num; IEEE80211_LOCK_ASSERT(ic); @@ -2692,14 +2747,6 @@ ieee80211_new_state_locked(struct ieee80211vap *vap, ieee80211_state_name[nstate], ieee80211_state_name[vap->iv_nstate]); return -1; - } else if (vap->iv_state != vap->iv_nstate) { - /* Warn if the previous state hasn't completed. */ - IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, - "%s:%d: pending %s -> %s (now to %s) transition lost\n", - __func__, __LINE__, - ieee80211_state_name[vap->iv_state], - ieee80211_state_name[vap->iv_nstate], - ieee80211_state_name[nstate]); } } @@ -2722,7 +2769,16 @@ ieee80211_new_state_locked(struct ieee80211vap *vap, nscanning++; } } - ostate = vap->iv_state; + /* + * Look ahead for the "old state" at that point when the last queued + * state transition is run. + */ + if (vap->iv_nstate_n == 0) { + ostate = vap->iv_state; + } else { + nstate_num = (vap->iv_nstate_b + vap->iv_nstate_n - 1) % NET80211_IV_NSTATE_NUM; + ostate = vap->iv_nstates[nstate_num]; + } IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, "%s: %s -> %s (arg %d) (nrunning %d nscanning %d)\n", __func__, ieee80211_state_name[ostate], ieee80211_state_name[nstate], arg, @@ -2816,11 +2872,37 @@ ieee80211_new_state_locked(struct ieee80211vap *vap, default: break; } - /* defer the state change to a thread */ - vap->iv_nstate = nstate; - vap->iv_nstate_arg = arg; + /* + * Defer the state change to a thread. + * We support up-to NET80211_IV_NSTATE_NUM pending state changes + * using a separate task for each. Otherwise, if we enqueue + * more than one state change they will be folded together, + * npedning will be > 1 and we may run then out of sequence with + * other events. + * This is kind-of a hack after 10 years but we know how to provoke + * these cases now (and seen them in the wild). + */ + nstate_num = _ieee80211_newstate_get_next_empty_slot(vap); + if (nstate_num == -1) { + /* + * This is really bad and we should just go kaboom. + * Instead drop it. No one checks the return code anyway. + */ + ic_printf(ic, "%s:%d: pending %s -> %s (now to %s) " + "transition lost. %d/%d pending state changes:\n", + __func__, __LINE__, + ieee80211_state_name[vap->iv_state], + ieee80211_state_name[vap->iv_nstate], + ieee80211_state_name[nstate], + _ieee80211_newstate_get_npending(vap), + NET80211_IV_NSTATE_NUM); + + return (EAGAIN); + } + vap->iv_nstates[nstate_num] = nstate; + vap->iv_nstate_args[nstate_num] = arg; vap->iv_flags_ext |= IEEE80211_FEXT_STATEWAIT; - ieee80211_runtask(ic, &vap->iv_nstate_task); + ieee80211_runtask(ic, &vap->iv_nstate_task[nstate_num]); return EINPROGRESS; } diff --git a/sys/net80211/ieee80211_var.h b/sys/net80211/ieee80211_var.h index 868f1886069c..aa99ccefd248 100644 --- a/sys/net80211/ieee80211_var.h +++ b/sys/net80211/ieee80211_var.h @@ -410,9 +410,16 @@ struct ieee80211vap { uint32_t iv_com_state; /* com usage / detached flag */ enum ieee80211_opmode iv_opmode; /* operation mode */ enum ieee80211_state iv_state; /* state machine state */ - enum ieee80211_state iv_nstate; /* pending state */ - int iv_nstate_arg; /* pending state arg */ - struct task iv_nstate_task; /* deferred state processing */ + + /* Deferred state processing. */ + enum ieee80211_state iv_nstate; /* next pending state (historic) */ +#define NET80211_IV_NSTATE_NUM 8 + int iv_nstate_b; /* First filled slot. */ + int iv_nstate_n; /* # of filled slots. */ + enum ieee80211_state iv_nstates[NET80211_IV_NSTATE_NUM]; /* queued pending state(s) */ + int iv_nstate_args[NET80211_IV_NSTATE_NUM]; /* queued pending state(s) arg */ + struct task iv_nstate_task[NET80211_IV_NSTATE_NUM]; + struct task iv_swbmiss_task;/* deferred iv_bmiss call */ struct callout iv_mgtsend; /* mgmt frame response timer */ /* inactivity timer settings */ @@ -604,10 +611,7 @@ struct ieee80211vap { struct ieee80211_node * (*iv_update_bss)(struct ieee80211vap *, struct ieee80211_node *); -#ifdef __ILP32__ - uint32_t iv_spare0; -#endif - uint64_t iv_spare[5]; + uint64_t iv_spare[36]; }; MALLOC_DECLARE(M_80211_VAP); From nobody Mon Feb 19 16:10:24 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdnZ86R55z5C54h; Mon, 19 Feb 2024 16:10:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdnZ845BJz4Nsf; Mon, 19 Feb 2024 16:10:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708359024; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l7n2IcKObUbuij2zJ3GsGIomm13tjodZNeH55UGv7cY=; b=uCPsZ1SM4C+qmGMtonCOfDXrAG33KUVIrbgawF30e2iBs8vMF/VnH1yTcBj1A7DHWtHEKh +7LFQi29XQSGZSSNj4nj+0ADC0V90JYQf+1UG0BfpPheIbvGw25iSxvhOyGavSub7DTPnt EsFDex/LGtuLLIIZEzSahauPkWMEV+EXpTgoPDZrhrV2si0Zv1zrH9zZP+bun+Y/o4Qrdb D3SGv4qbCScxkCIjSEJx9RQUvlqEuwlQN1b/DlKIOhTTYEQns2XNMl0f9b+Vzikdd9KQGa mcqp8NFViVk8Z/tnmGHwgj7y5YEFBWr8Dn5kRm+d1hmpAGXAVbyE0QqhT5lOPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708359024; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l7n2IcKObUbuij2zJ3GsGIomm13tjodZNeH55UGv7cY=; b=m/jQWWv4YVUGeTjkzHQDe0zGFZKPdkXL0HadbqykXL0Ml0M8DtECkTLbJu5ip0+Ham4Wj9 MNLa1jZNZctAImJDfoQlzs7zX6TfgYwyWqMOxEjrGuGSgWSP1pGRaYiE2jgHtXm6j9Q2sa rLJeuYnYQO/ukw0cA4UcQhlToz8DkTnHzKekQDOJBoF1B775cvnZ0KYssQwIYdoc/ULONu rcaupcJGk8Up6xRsa9Da3Vl1lkqtxiZXl0I2EJ5UO6dXsLPe1dzTazk2HFmKLgfdnSzjN8 4oNm5wjJKTiXKiXNLsyvwuyHvB9GVGAU1sOHv5yH+oNrbTEVQ5OWRIE0ZvpQxg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708359024; a=rsa-sha256; cv=none; b=ZKTsO/+Ibp/o418dpr0RMRjiAqjKdo+qUv43gpuZjeObOKk6OvZUypd2igtMiODc7EMLFb rrzLROt8dJA17GJR7RVFO9NMNnUoMOHXvYsnpEagzCahWzB2flDF31OE3qSfmPbFFCGfmB 3SDl2yC96VFHVZZd8uOCfL3bRdCSciXDaD7TTkMrABUS4FE2hiq5mkvaRxpK2L2qU10cTp cU82QK0qdIKQZm7qjrMcIy0QRAs0hxILwGLmJxc7kPlP+jWd2Mu4fyIWD/pFw8zFcB0S0a mazUnbeNPEzZMLGzy1qOESXAdkU48LZFqR3Ah6Vr15Q0KDDFDF5LR2TgZvsvnQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdnZ83BgRzghk; Mon, 19 Feb 2024 16:10:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGAOgS036005; Mon, 19 Feb 2024 16:10:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGAOlE036002; Mon, 19 Feb 2024 16:10:24 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:10:24 GMT Message-Id: <202402191610.41JGAOlE036002@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: a75a3d7afcc8 - releng/13.3 - Bump __FreeBSD_version for net80211 'struct ieee80211vap' changes List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/releng/13.3 X-Git-Reftype: branch X-Git-Commit: a75a3d7afcc88dc0bc9b2797cce983056acadf10 Auto-Submitted: auto-generated The branch releng/13.3 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=a75a3d7afcc88dc0bc9b2797cce983056acadf10 commit a75a3d7afcc88dc0bc9b2797cce983056acadf10 Author: Bjoern A. Zeeb AuthorDate: 2024-02-19 08:35:44 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-02-19 16:09:05 +0000 Bump __FreeBSD_version for net80211 'struct ieee80211vap' changes Change 9b998db87c28 changed 'struct ieee80211vap' internals in net80211. Given we do not have enough spares and the struct is allocated by drivers, all wireless drivers have to be recompiled. __FreeBSD_version is updated to 1303001 to track this change. Approved by: re (cperciva) --- UPDATING | 6 ++++++ sys/sys/param.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index 8e7fa2999475..931c58a42ada 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,12 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20240218: + Change 9b998db87c28 changed 'struct ieee80211vap' internals in net80211. + Given we do not have enough spares and the struct is allocated by + drivers, all wireless drivers have to be recompiled. + __FreeBSD_version is updated to 1303001 to track this change. + 20240207: sendmail 8.18.1 has been imported and merged. This version enforces stricter RFC compliance by default, especially with respect to line diff --git a/sys/sys/param.h b/sys/sys/param.h index 21c9593c6635..c36485bd132a 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -59,7 +59,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1303000 /* Master, propagated to newvers */ +#define __FreeBSD_version 1303001 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Mon Feb 19 16:10:25 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdnZ95nwCz5C54l; Mon, 19 Feb 2024 16:10:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdnZ953fkz4Nvt; Mon, 19 Feb 2024 16:10:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708359025; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qlfl4ixlPvBxsusc1QeKfcLgHAz+oxKouDigM2nSyC0=; b=GvUcf7Hmm5N//TXuyEYLCoXknEGIcfikGzAOtkg6EZmcI5QlhGHIg0pO7x+CoMyMT3b38N 7cTAuWPockKNZivKCfdfpC4tGiG8FR8cwMWIOGKwaxSVTcpFtBHgQMmEe2RlF3vSrNj35j hxxXoSM5yr7wNsnwpS+xIq37rya9SRX+PnI9+OeexUHFVnL5Tkb2VjdIIKWl3V4pbOrpkm JWlgktoVXLT8kHkUkbvKtuAvw0ux2KmzXoF2sjeb00zUhj3YIntT0ZqExFL3FikUOo7m4D AuuZO7ZDEJF2ac1dDZBJGfzv3+n/tuPG6pHIVvGomJxEKKVRrojGKeAJ3wwZpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708359025; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qlfl4ixlPvBxsusc1QeKfcLgHAz+oxKouDigM2nSyC0=; b=FJBUEl61kcJCN+XXoRvalL9vGsViTH0fJ5zblzvn7wx/GkN0Hlxezd4yRosjvCIp0mVyqi 1A2m0WcUucX1O3VKIodkkRvur9ergrtjDfV2cZa+QrzBs+ZZCumJcsXzuAJkuSLbL/AsNm Tv+Va3shtt1Hx33IzogbqpcN1R/AoaoKtDDvxboZkFyWNy87XOKJFjaIG2g3xoA+v00PYz 3JRkIH980wBXgXS2UEQyUTppkbQRP2FfedQzqfDHuYemkBOTT8deYcm7/c9i7+pdAV8DFG zuV8x85yzWnkQ/StnBxzLrnK33ijXPVXNPHEw5UiyS2ALW6yhqG6gikYI33T6Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708359025; a=rsa-sha256; cv=none; b=Kuwp0OWMZgobfTrp3YLV94r27JuWbQTAyVOcSO/wAonfe4REeGGbe5C2IrK5bIJRVyANDv FFY1oslRRmgg6zoQD65DcfsI1oonlYGk0Od15zJFJmDNfPhdmTThtBzVyelhtgdQWFAZbk zpYfcwB3URKRNmYWo+3qs6RxocPRdn2HwreKExpb8DjEg3dviAJWjva5DxtLqAZEmkQAdG aE7FMBBaxxNvQl26sxDxBKDlmEO92BtFClHwRU5zloI94FT2EQ93Jkuz8PKU16QzaF//21 ZOAfpR4wWHZf/C1N9aXtkilvIMJwWBlVNes8tn/myvXIAsjR8W+yfcRxHGiBiA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdnZ949fvzhdK; Mon, 19 Feb 2024 16:10:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGAPY1036067; Mon, 19 Feb 2024 16:10:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGAPMo036064; Mon, 19 Feb 2024 16:10:25 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:10:25 GMT Message-Id: <202402191610.41JGAPMo036064@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: d4b4efc6db6c - releng/13.3 - LinuxKPI: 802.11: band-aid for invalid state changes after (*iv_update_bss) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/releng/13.3 X-Git-Reftype: branch X-Git-Commit: d4b4efc6db6c6c3a9abf2f187ba1ccc0e40028cf Auto-Submitted: auto-generated The branch releng/13.3 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=d4b4efc6db6c6c3a9abf2f187ba1ccc0e40028cf commit d4b4efc6db6c6c3a9abf2f187ba1ccc0e40028cf Author: Bjoern A. Zeeb AuthorDate: 2024-02-03 16:33:56 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-02-19 16:09:22 +0000 LinuxKPI: 802.11: band-aid for invalid state changes after (*iv_update_bss) With firmware based solutions we cannot just jump from an active session to a new iv_bss node without tearing down state for the old and bringing up the new node. This likely used to work on softmac based cards/drivers where one could essentially set the state and fire at will. We track (*iv_update_bss) calls from net80211 and set a local flag that we are out of synch and do not allow any further operations up the state machine until we hit INIT or SCAN. That means someone will take the state down, clean up firmware state and then we can join again and build up state. Apparently this problem has been "known" for a while as native iwm(4) and others have similar workarounds (though less strict) and can be equally pestered into bad states. For LinuxKPI all the KASSERTs just massively brought this problem out. The solution will be some rewrites in net80211. Until then, try to keep us more stable at least and not die on second join1() calls triggered by service netif start wlan0 and similar. Approved by: re (cperciva) PR: 271979, 271988, 275255, 263613, 274003 Sponsored by: The FreeBSD Foundation (2023, partial) Reviewed by: cc Differential Revision: https://reviews.freebsd.org/D43725 (cherry picked from commit 2ac8a2189ac6707f48f77ef2e36baf696a0d2f40) (cherry picked from commit 184ccc414686ea32c64f063c081c7cc1adeae7c3) --- sys/compat/linuxkpi/common/src/linux_80211.c | 309 +++++++++++++++++++-------- sys/compat/linuxkpi/common/src/linux_80211.h | 2 + 2 files changed, 216 insertions(+), 95 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 3988c5260f66..4b4c323e123e 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -516,6 +516,7 @@ lkpi_find_lkpi80211_chan(struct lkpi_hw *lhw, return (NULL); } +#if 0 static struct linuxkpi_ieee80211_channel * lkpi_get_lkpi80211_chan(struct ieee80211com *ic, struct ieee80211_node *ni) { @@ -540,6 +541,7 @@ lkpi_get_lkpi80211_chan(struct ieee80211com *ic, struct ieee80211_node *ni) return (chan); } +#endif struct linuxkpi_ieee80211_channel * linuxkpi_ieee80211_get_channel(struct wiphy *wiphy, uint32_t freq) @@ -945,19 +947,37 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int uint32_t changed; int error; - chan = lkpi_get_lkpi80211_chan(vap->iv_ic, vap->iv_bss); + /* + * In here we use vap->iv_bss until lvif->lvif_bss is set. + * For all later (STATE >= AUTH) functions we need to use the lvif + * cache which will be tracked even through (*iv_update_bss)(). + */ + + if (vap->iv_bss == NULL) { + ic_printf(vap->iv_ic, "%s: no iv_bss for vap %p\n", __func__, vap); + return (EINVAL); + } + ni = ieee80211_ref_node(vap->iv_bss); + if (ni->ni_chan == NULL || ni->ni_chan == IEEE80211_CHAN_ANYC) { + ic_printf(vap->iv_ic, "%s: no channel set for iv_bss ni %p " + "on vap %p\n", __func__, ni, vap); + ieee80211_free_node(ni); + return (EINVAL); + } + + lhw = vap->iv_ic->ic_softc; + chan = lkpi_find_lkpi80211_chan(lhw, ni->ni_chan); if (chan == NULL) { - ic_printf(vap->iv_ic, "%s: failed to get channel\n", __func__); + ic_printf(vap->iv_ic, "%s: failed to get LKPI channel from " + "iv_bss ni %p on vap %p\n", __func__, ni, vap); + ieee80211_free_node(ni); return (ESRCH); } - lhw = vap->iv_ic->ic_softc; hw = LHW_TO_HW(lhw); lvif = VAP_TO_LVIF(vap); vif = LVIF_TO_VIF(lvif); - ni = ieee80211_ref_node(vap->iv_bss); - IEEE80211_UNLOCK(vap->iv_ic); LKPI_80211_LHW_LOCK(lhw); @@ -981,6 +1001,8 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int conf->def.width = NL80211_CHAN_WIDTH_20_NOHT; conf->def.center_freq1 = chan->center_freq; conf->def.center_freq2 = 0; + KASSERT(ni->ni_chan != NULL && ni->ni_chan != IEEE80211_CHAN_ANYC, + ("%s:%d: ni %p ni_chan %p\n", __func__, __LINE__, ni, ni->ni_chan)); /* Responder ... */ conf->min_def.chan = chan; conf->min_def.width = NL80211_CHAN_WIDTH_20_NOHT; @@ -1060,6 +1082,8 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int * workflow so live with this. It is a compat layer after all. */ if (ni->ni_drv_data == NULL) { + ic_printf(vap->iv_ic, "%s:%d: lkpi_lsta_alloc to be called: " + "ni %p lsta %p\n", __func__, __LINE__, ni, ni->ni_drv_data); lsta = lkpi_lsta_alloc(vap, ni->ni_macaddr, hw, ni); if (lsta == NULL) { error = ENOMEM; @@ -1072,8 +1096,22 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int lsta = ni->ni_drv_data; } - /* Insert the [l]sta into the list of known stations. */ LKPI_80211_LVIF_LOCK(lvif); + /* XXX-BZ KASSERT later? */ + /* XXX-BZ this should have caught the upper lkpi_lsta_alloc() too! */ + if (lvif->lvif_bss_synched || lvif->lvif_bss != NULL) + ic_printf(vap->iv_ic, "%s:%d: lvif %p vap %p iv_bss %p lvif_bss %p " + "lvif_bss->ni %p synched %d, ni %p lsta %p\n", __func__, __LINE__, + lvif, vap, vap->iv_bss, lvif->lvif_bss, + (lvif->lvif_bss != NULL) ? lvif->lvif_bss->ni : NULL, + lvif->lvif_bss_synched, ni, lsta); + + /* Reference the ni for this cache of lsta. */ + ieee80211_ref_node(vap->iv_bss); + lvif->lvif_bss = lsta; + lvif->lvif_bss_synched = true; + + /* Insert the [l]sta into the list of known stations. */ TAILQ_INSERT_TAIL(&lvif->lsta_head, lsta, lsta_entry); LKPI_80211_LVIF_UNLOCK(lvif); @@ -1145,9 +1183,23 @@ lkpi_sta_auth_to_scan(struct ieee80211vap *vap, enum ieee80211_state nstate, int lvif = VAP_TO_LVIF(vap); vif = LVIF_TO_VIF(lvif); - /* Keep ni around. */ - ni = ieee80211_ref_node(vap->iv_bss); - lsta = ni->ni_drv_data; + LKPI_80211_LVIF_LOCK(lvif); +#ifdef LINUXKPI_DEBUG_80211 + /* XXX-BZ KASSERT later; state going down so no action. */ + if (lvif->lvif_bss == NULL) + ic_printf(vap->iv_ic, "%s:%d: lvif %p vap %p iv_bss %p lvif_bss %p " + "lvif_bss->ni %p synched %d\n", __func__, __LINE__, + lvif, vap, vap->iv_bss, lvif->lvif_bss, + (lvif->lvif_bss != NULL) ? lvif->lvif_bss->ni : NULL, + lvif->lvif_bss_synched); +#endif + + lsta = lvif->lvif_bss; + LKPI_80211_LVIF_UNLOCK(lvif); + KASSERT(lsta != NULL && lsta->ni != NULL, ("%s: lsta %p ni %p " + "lvif %p vap %p\n", __func__, + lsta, (lsta != NULL) ? lsta->ni : NULL, lvif, vap)); + ni = lsta->ni; /* Reference held for lvif_bss. */ sta = LSTA_TO_STA(lsta); lkpi_lsta_dump(lsta, ni, __func__, __LINE__); @@ -1197,6 +1249,13 @@ lkpi_sta_auth_to_scan(struct ieee80211vap *vap, enum ieee80211_state nstate, int lkpi_lsta_dump(lsta, ni, __func__, __LINE__); + LKPI_80211_LVIF_LOCK(lvif); + /* Remove ni reference for this cache of lsta. */ + lvif->lvif_bss = NULL; + lvif->lvif_bss_synched = false; + LKPI_80211_LVIF_UNLOCK(lvif); + ieee80211_free_node(ni); /* was lvif->lvif_bss->ni */ + lkpi_lsta_remove(lsta, lvif); /* conf_tx */ @@ -1220,8 +1279,6 @@ lkpi_sta_auth_to_scan(struct ieee80211vap *vap, enum ieee80211_state nstate, int out: LKPI_80211_LHW_UNLOCK(lhw); IEEE80211_LOCK(vap->iv_ic); - if (ni != NULL) - ieee80211_free_node(ni); return (error); } @@ -1243,7 +1300,6 @@ lkpi_sta_auth_to_assoc(struct ieee80211vap *vap, enum ieee80211_state nstate, in struct ieee80211_hw *hw; struct lkpi_vif *lvif; struct ieee80211_vif *vif; - struct ieee80211_node *ni; struct lkpi_sta *lsta; struct ieee80211_prep_tx_info prep_tx_info; int error; @@ -1255,15 +1311,30 @@ lkpi_sta_auth_to_assoc(struct ieee80211vap *vap, enum ieee80211_state nstate, in IEEE80211_UNLOCK(vap->iv_ic); LKPI_80211_LHW_LOCK(lhw); - ni = NULL; + + LKPI_80211_LVIF_LOCK(lvif); + /* XXX-BZ KASSERT later? */ + if (!lvif->lvif_bss_synched || lvif->lvif_bss == NULL) { +#ifdef LINUXKPI_DEBUG_80211 + ic_printf(vap->iv_ic, "%s:%d: lvif %p vap %p iv_bss %p lvif_bss %p " + "lvif_bss->ni %p synched %d\n", __func__, __LINE__, + lvif, vap, vap->iv_bss, lvif->lvif_bss, + (lvif->lvif_bss != NULL) ? lvif->lvif_bss->ni : NULL, + lvif->lvif_bss_synched); +#endif + error = ENOTRECOVERABLE; + LKPI_80211_LVIF_UNLOCK(lvif); + goto out; + } + lsta = lvif->lvif_bss; + LKPI_80211_LVIF_UNLOCK(lvif); + + KASSERT(lsta != NULL, ("%s: lsta %p\n", __func__, lsta)); /* Finish auth. */ IMPROVE("event callback"); /* Update sta_state (NONE to AUTH). */ - ni = ieee80211_ref_node(vap->iv_bss); - lsta = ni->ni_drv_data; - KASSERT(lsta != NULL, ("%s: ni %p lsta is NULL\n", __func__, ni)); KASSERT(lsta->state == IEEE80211_STA_NONE, ("%s: lsta %p state not " "NONE: %#x\n", __func__, lsta, lsta->state)); error = lkpi_80211_mo_sta_state(hw, vif, lsta, IEEE80211_STA_AUTH); @@ -1307,8 +1378,6 @@ lkpi_sta_auth_to_assoc(struct ieee80211vap *vap, enum ieee80211_state nstate, in out: LKPI_80211_LHW_UNLOCK(lhw); IEEE80211_LOCK(vap->iv_ic); - if (ni != NULL) - ieee80211_free_node(ni); return (error); } @@ -1320,20 +1389,37 @@ lkpi_sta_a_to_a(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) struct ieee80211_hw *hw; struct lkpi_vif *lvif; struct ieee80211_vif *vif; - struct ieee80211_node *ni; struct lkpi_sta *lsta; struct ieee80211_prep_tx_info prep_tx_info; + int error; lhw = vap->iv_ic->ic_softc; hw = LHW_TO_HW(lhw); lvif = VAP_TO_LVIF(vap); vif = LVIF_TO_VIF(lvif); - ni = ieee80211_ref_node(vap->iv_bss); - IEEE80211_UNLOCK(vap->iv_ic); LKPI_80211_LHW_LOCK(lhw); - lsta = ni->ni_drv_data; + + LKPI_80211_LVIF_LOCK(lvif); + /* XXX-BZ KASSERT later? */ + if (!lvif->lvif_bss_synched || lvif->lvif_bss == NULL) { +#ifdef LINUXKPI_DEBUG_80211 + ic_printf(vap->iv_ic, "%s:%d: lvif %p vap %p iv_bss %p lvif_bss %p " + "lvif_bss->ni %p synched %d\n", __func__, __LINE__, + lvif, vap, vap->iv_bss, lvif->lvif_bss, + (lvif->lvif_bss != NULL) ? lvif->lvif_bss->ni : NULL, + lvif->lvif_bss_synched); +#endif + LKPI_80211_LVIF_UNLOCK(lvif); + error = ENOTRECOVERABLE; + goto out; + } + lsta = lvif->lvif_bss; + LKPI_80211_LVIF_UNLOCK(lvif); + + KASSERT(lsta != NULL, ("%s: lsta %p! lvif %p vap %p\n", __func__, + lsta, lvif, vap)); IMPROVE("event callback?"); @@ -1355,12 +1441,12 @@ lkpi_sta_a_to_a(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) lsta->in_mgd = true; } + error = 0; +out: LKPI_80211_LHW_UNLOCK(lhw); IEEE80211_LOCK(vap->iv_ic); - if (ni != NULL) - ieee80211_free_node(ni); - return (0); + return (error); } static int @@ -1382,16 +1468,30 @@ _lkpi_sta_assoc_to_down(struct ieee80211vap *vap, enum ieee80211_state nstate, i lvif = VAP_TO_LVIF(vap); vif = LVIF_TO_VIF(lvif); - /* Keep ni around. */ - ni = ieee80211_ref_node(vap->iv_bss); - lsta = ni->ni_drv_data; + IEEE80211_UNLOCK(vap->iv_ic); + LKPI_80211_LHW_LOCK(lhw); + + LKPI_80211_LVIF_LOCK(lvif); +#ifdef LINUXKPI_DEBUG_80211 + /* XXX-BZ KASSERT later; state going down so no action. */ + if (lvif->lvif_bss == NULL) + ic_printf(vap->iv_ic, "%s:%d: lvif %p vap %p iv_bss %p lvif_bss %p " + "lvif_bss->ni %p synched %d\n", __func__, __LINE__, + lvif, vap, vap->iv_bss, lvif->lvif_bss, + (lvif->lvif_bss != NULL) ? lvif->lvif_bss->ni : NULL, + lvif->lvif_bss_synched); +#endif + lsta = lvif->lvif_bss; + LKPI_80211_LVIF_UNLOCK(lvif); + KASSERT(lsta != NULL && lsta->ni != NULL, ("%s: lsta %p ni %p " + "lvif %p vap %p\n", __func__, + lsta, (lsta != NULL) ? lsta->ni : NULL, lvif, vap)); + + ni = lsta->ni; /* Reference held for lvif_bss. */ sta = LSTA_TO_STA(lsta); lkpi_lsta_dump(lsta, ni, __func__, __LINE__); - IEEE80211_UNLOCK(vap->iv_ic); - LKPI_80211_LHW_LOCK(lhw); - /* flush, drop. */ lkpi_80211_mo_flush(hw, vif, nitems(sta->txq), true); @@ -1487,6 +1587,13 @@ _lkpi_sta_assoc_to_down(struct ieee80211vap *vap, enum ieee80211_state nstate, i bss_changed |= BSS_CHANGED_BSSID; lkpi_80211_mo_bss_info_changed(hw, vif, &vif->bss_conf, bss_changed); + LKPI_80211_LVIF_LOCK(lvif); + /* Remove ni reference for this cache of lsta. */ + lvif->lvif_bss = NULL; + lvif->lvif_bss_synched = false; + LKPI_80211_LVIF_UNLOCK(lvif); + ieee80211_free_node(ni); /* was lvif->lvif_bss->ni */ + lkpi_lsta_remove(lsta, lvif); /* conf_tx */ @@ -1512,8 +1619,6 @@ out: LKPI_80211_LHW_UNLOCK(lhw); IEEE80211_LOCK(vap->iv_ic); outni: - if (ni != NULL) - ieee80211_free_node(ni); return (error); } @@ -1571,16 +1676,34 @@ lkpi_sta_assoc_to_run(struct ieee80211vap *vap, enum ieee80211_state nstate, int IEEE80211_UNLOCK(vap->iv_ic); LKPI_80211_LHW_LOCK(lhw); - ni = NULL; + + LKPI_80211_LVIF_LOCK(lvif); + /* XXX-BZ KASSERT later? */ + if (!lvif->lvif_bss_synched || lvif->lvif_bss == NULL) { +#ifdef LINUXKPI_DEBUG_80211 + ic_printf(vap->iv_ic, "%s:%d: lvif %p vap %p iv_bss %p lvif_bss %p " + "lvif_bss->ni %p synched %d\n", __func__, __LINE__, + lvif, vap, vap->iv_bss, lvif->lvif_bss, + (lvif->lvif_bss != NULL) ? lvif->lvif_bss->ni : NULL, + lvif->lvif_bss_synched); +#endif + LKPI_80211_LVIF_UNLOCK(lvif); + error = ENOTRECOVERABLE; + goto out; + } + lsta = lvif->lvif_bss; + LKPI_80211_LVIF_UNLOCK(lvif); + KASSERT(lsta != NULL && lsta->ni != NULL, ("%s: lsta %p ni %p " + "lvif %p vap %p\n", __func__, + lsta, (lsta != NULL) ? lsta->ni : NULL, lvif, vap)); + + ni = lsta->ni; /* Reference held for lvif_bss. */ IMPROVE("ponder some of this moved to ic_newassoc, scan_assoc_success, " "and to lesser extend ieee80211_notify_node_join"); /* Finish assoc. */ /* Update sta_state (AUTH to ASSOC) and set aid. */ - ni = ieee80211_ref_node(vap->iv_bss); - lsta = ni->ni_drv_data; - KASSERT(lsta != NULL, ("%s: ni %p lsta is NULL\n", __func__, ni)); KASSERT(lsta->state == IEEE80211_STA_AUTH, ("%s: lsta %p state not " "AUTH: %#x\n", __func__, lsta, lsta->state)); sta = LSTA_TO_STA(lsta); @@ -1688,8 +1811,6 @@ lkpi_sta_assoc_to_run(struct ieee80211vap *vap, enum ieee80211_state nstate, int out: LKPI_80211_LHW_UNLOCK(lhw); IEEE80211_LOCK(vap->iv_ic); - if (ni != NULL) - ieee80211_free_node(ni); return (error); } @@ -1725,9 +1846,23 @@ lkpi_sta_run_to_assoc(struct ieee80211vap *vap, enum ieee80211_state nstate, int lvif = VAP_TO_LVIF(vap); vif = LVIF_TO_VIF(lvif); - /* Keep ni around. */ - ni = ieee80211_ref_node(vap->iv_bss); - lsta = ni->ni_drv_data; + LKPI_80211_LVIF_LOCK(lvif); +#ifdef LINUXKPI_DEBUG_80211 + /* XXX-BZ KASSERT later; state going down so no action. */ + if (lvif->lvif_bss == NULL) + ic_printf(vap->iv_ic, "%s:%d: lvif %p vap %p iv_bss %p lvif_bss %p " + "lvif_bss->ni %p synched %d\n", __func__, __LINE__, + lvif, vap, vap->iv_bss, lvif->lvif_bss, + (lvif->lvif_bss != NULL) ? lvif->lvif_bss->ni : NULL, + lvif->lvif_bss_synched); +#endif + lsta = lvif->lvif_bss; + LKPI_80211_LVIF_UNLOCK(lvif); + KASSERT(lsta != NULL && lsta->ni != NULL, ("%s: lsta %p ni %p " + "lvif %p vap %p\n", __func__, + lsta, (lsta != NULL) ? lsta->ni : NULL, lvif, vap)); + + ni = lsta->ni; /* Reference held for lvif_bss. */ sta = LSTA_TO_STA(lsta); lkpi_lsta_dump(lsta, ni, __func__, __LINE__); @@ -1823,8 +1958,6 @@ out: LKPI_80211_LHW_UNLOCK(lhw); IEEE80211_LOCK(vap->iv_ic); outni: - if (ni != NULL) - ieee80211_free_node(ni); return (error); } @@ -1847,16 +1980,30 @@ lkpi_sta_run_to_init(struct ieee80211vap *vap, enum ieee80211_state nstate, int lvif = VAP_TO_LVIF(vap); vif = LVIF_TO_VIF(lvif); - /* Keep ni around. */ - ni = ieee80211_ref_node(vap->iv_bss); - lsta = ni->ni_drv_data; + IEEE80211_UNLOCK(vap->iv_ic); + LKPI_80211_LHW_LOCK(lhw); + + LKPI_80211_LVIF_LOCK(lvif); +#ifdef LINUXKPI_DEBUG_80211 + /* XXX-BZ KASSERT later; state going down so no action. */ + if (lvif->lvif_bss == NULL) + ic_printf(vap->iv_ic, "%s:%d: lvif %p vap %p iv_bss %p lvif_bss %p " + "lvif_bss->ni %p synched %d\n", __func__, __LINE__, + lvif, vap, vap->iv_bss, lvif->lvif_bss, + (lvif->lvif_bss != NULL) ? lvif->lvif_bss->ni : NULL, + lvif->lvif_bss_synched); +#endif + lsta = lvif->lvif_bss; + LKPI_80211_LVIF_UNLOCK(lvif); + KASSERT(lsta != NULL && lsta->ni != NULL, ("%s: lsta %p ni %p " + "lvif %p vap %p\n", __func__, + lsta, (lsta != NULL) ? lsta->ni : NULL, lvif, vap)); + + ni = lsta->ni; /* Reference held for lvif_bss. */ sta = LSTA_TO_STA(lsta); lkpi_lsta_dump(lsta, ni, __func__, __LINE__); - IEEE80211_UNLOCK(vap->iv_ic); - LKPI_80211_LHW_LOCK(lhw); - /* flush, drop. */ lkpi_80211_mo_flush(hw, vif, nitems(sta->txq), true); @@ -1976,6 +2123,13 @@ lkpi_sta_run_to_init(struct ieee80211vap *vap, enum ieee80211_state nstate, int bss_changed |= BSS_CHANGED_BSSID; lkpi_80211_mo_bss_info_changed(hw, vif, &vif->bss_conf, bss_changed); + LKPI_80211_LVIF_LOCK(lvif); + /* Remove ni reference for this cache of lsta. */ + lvif->lvif_bss = NULL; + lvif->lvif_bss_synched = false; + LKPI_80211_LVIF_UNLOCK(lvif); + ieee80211_free_node(ni); /* was lvif->lvif_bss->ni */ + lkpi_lsta_remove(lsta, lvif); /* conf_tx */ @@ -2001,8 +2155,6 @@ out: LKPI_80211_LHW_UNLOCK(lhw); IEEE80211_LOCK(vap->iv_ic); outni: - if (ni != NULL) - ieee80211_free_node(ni); return (error); } @@ -2175,53 +2327,18 @@ static struct ieee80211_node * lkpi_iv_update_bss(struct ieee80211vap *vap, struct ieee80211_node *ni) { struct lkpi_vif *lvif; - struct ieee80211_node *obss; - struct lkpi_sta *lsta; - struct ieee80211_sta *sta; - - obss = vap->iv_bss; - -#ifdef LINUXKPI_DEBUG_80211 - if (linuxkpi_debug_80211 & D80211_TRACE) - ic_printf(vap->iv_ic, "%s: obss %p ni_drv_data %p " - "ni %p ni_drv_data %p\n", __func__, - obss, (obss != NULL) ? obss->ni_drv_data : NULL, - ni, (ni != NULL) ? ni->ni_drv_data : NULL); -#endif + struct ieee80211_node *rni; - /* Nothing to copy from. Just return. */ - if (obss == NULL || obss->ni_drv_data == NULL) - goto out; - - /* Nothing to copy to. Just return. */ - IMPROVE("clearing the obss might still be needed?"); - if (ni == NULL) - goto out; + IEEE80211_LOCK_ASSERT(vap->iv_ic); - /* Nothing changed? panic? */ - if (obss == ni) - goto out; + lvif = VAP_TO_LVIF(vap); - lsta = obss->ni_drv_data; - obss->ni_drv_data = ni->ni_drv_data; - ni->ni_drv_data = lsta; - if (lsta != NULL) { - lsta->ni = ni; - sta = LSTA_TO_STA(lsta); - IEEE80211_ADDR_COPY(sta->addr, lsta->ni->ni_macaddr); - IEEE80211_ADDR_COPY(sta->deflink.addr, sta->addr); - } - lsta = obss->ni_drv_data; - if (lsta != NULL) { - lsta->ni = obss; - sta = LSTA_TO_STA(lsta); - IEEE80211_ADDR_COPY(sta->addr, lsta->ni->ni_macaddr); - IEEE80211_ADDR_COPY(sta->deflink.addr, sta->addr); - } + LKPI_80211_LVIF_LOCK(lvif); + lvif->lvif_bss_synched = false; + LKPI_80211_LVIF_UNLOCK(lvif); -out: - lvif = VAP_TO_LVIF(vap); - return (lvif->iv_update_bss(vap, ni)); + rni = lvif->iv_update_bss(vap, ni); + return (rni); } #ifdef LKPI_80211_WME @@ -2342,6 +2459,8 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], lvif = malloc(len, M_80211_VAP, M_WAITOK | M_ZERO); mtx_init(&lvif->mtx, "lvif", NULL, MTX_DEF); TAILQ_INIT(&lvif->lsta_head); + lvif->lvif_bss = NULL; + lvif->lvif_bss_synched = false; vap = LVIF_TO_VAP(lvif); vif = LVIF_TO_VIF(lvif); diff --git a/sys/compat/linuxkpi/common/src/linux_80211.h b/sys/compat/linuxkpi/common/src/linux_80211.h index 9100d1c2e73e..ae4b8379e88c 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.h +++ b/sys/compat/linuxkpi/common/src/linux_80211.h @@ -147,6 +147,8 @@ struct lkpi_vif { struct ieee80211_node * (*iv_update_bss)(struct ieee80211vap *, struct ieee80211_node *); TAILQ_HEAD(, lkpi_sta) lsta_head; + struct lkpi_sta *lvif_bss; + bool lvif_bss_synched; bool added_to_drv; /* Driver knows; i.e. we called add_interface(). */ bool hw_queue_stopped[IEEE80211_NUM_ACS]; From nobody Mon Feb 19 16:10:26 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdnZB75Q8z5C5Kl; Mon, 19 Feb 2024 16:10:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdnZB6GyKz4P1p; Mon, 19 Feb 2024 16:10:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708359026; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V8xDyq7MX2kQ4UdhsZxpxPEpvBjocIlZWCfJzNjagsI=; b=pTpx1rmhYLUOAMKz9CCBsDTS3hT5sJ1LqQqzrFzsVvCCjz+70+NPJOspyPK3C0ZO6yRky+ zsJ1uLxAwSLaojN2S6Y60bCdGO99Km+M7MJ8+Y6aLbvMCIx8A/I9BHlK7Uqq0lxRmtoj48 UbnCg1zRGcXM/qV1veT7PjkPZyuLaJ+5OTkUe7fd63P1TVMUKbZw2LWQlfhrZDLL3sD/c9 8YFSq53rad/P7xWwgGt+CXjdyvqL43dUXDaQGDTBnrI0n8gsB6LgDIwEPiOYZbR5vvH/MB mnwUx7AaiMqOvRIgc9UqvE/Hcim7gSPlCx69URmbihGEj/dl2D6gmr5lIapX2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708359026; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V8xDyq7MX2kQ4UdhsZxpxPEpvBjocIlZWCfJzNjagsI=; b=f8J/Ake6IpgVFEkjL6HRVdnRbSUPMb8g8B3rNUrVIUivV3d6y5a6jlnLUknB+jsTZQWvS7 PMKMVdwpEACQnisZfzuO/aucKQg67ynRkQ/c6yJL3bHbkrc4w/DHXyNfaZbYOcP7jX3CUH UGI/dTzGZ9sy/Hafd9rtO8LERWY9LFGFDqGwfF/sbJyPPYvvdZfh2h8v0KR3e+hjD1GwZy DT5sObAiT1Nr8GblNy9GZwrLJluUx3O/MahKuWBwcadBWdl1PKeXXZFZX8GcPrtEPU4blK sveXflBJUWqE4sXVmSVIdSfuzOhzsufHLiscIXTuGhLlbsMGHSgdvu1w6JoSXw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708359026; a=rsa-sha256; cv=none; b=yrAVgfd1okVL5r0ol2CCSN/txio0JKFQf3ppAKFwi2w0teQYseXSgHt4W+nxfx3YkRIlkY 64L/9pHVJCMLRu0y2iMnT4yk+TdN9lxUIcqZ5U4hf6Ma64gfsKTPcu3W06xiovMs73ORt7 jJvFIN+DFzyDxUDyvyMaPTpWiSZq8bEuAWkTEgCyXmKCER7NvNIxFDBB36l4M2UMeBP0It CPsy1ScW2PflpDyxdd6WBVAjMdjF1Q3MXI1YvProtMV6Qb02aB3Y5XTkN6uPEB/aHmMRkQ w7Z5CyDP7QzwhCnsAcJ9PdqM4/77BjgdaN3anbZwgFKsyPiFMB7htsZvQ623rg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdnZB5N9Szghl; Mon, 19 Feb 2024 16:10:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGAQdZ036121; Mon, 19 Feb 2024 16:10:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGAQ8O036118; Mon, 19 Feb 2024 16:10:26 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:10:26 GMT Message-Id: <202402191610.41JGAQ8O036118@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 9b2da4bc5a68 - releng/13.3 - LinuxKPI: 802.11: update the ni/lsta reference cycle List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/releng/13.3 X-Git-Reftype: branch X-Git-Commit: 9b2da4bc5a68294bc1dcfdd0d0ccadf747bafd67 Auto-Submitted: auto-generated The branch releng/13.3 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=9b2da4bc5a68294bc1dcfdd0d0ccadf747bafd67 commit 9b2da4bc5a68294bc1dcfdd0d0ccadf747bafd67 Author: Bjoern A. Zeeb AuthorDate: 2024-02-05 14:51:08 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-02-19 16:09:22 +0000 LinuxKPI: 802.11: update the ni/lsta reference cycle Update the ni/lsta reference cycle, add extra checks and assertions. This is to accomodate problems we were seeing based on net80211 behaviour (join1() and (*iv_update_bss)() as well as state changes for new iv_bss nodes during an active session). This should hopefully help to stabilise behaviour until the underlying problems gets properly addressed (for this and all other device drivers). Approved by: re (cperciva) PR: 272607, 273985, 274003 Reviewed by: cc Differential Revision: https://reviews.freebsd.org/D43753 (cherry picked from commit 0936c648ad0ee5152dc19f261e77fe9c1833fe05) (cherry picked from commit 223edc1a3c2fc86dbc7fa0ecd00f26a85d7c7b43) --- sys/compat/linuxkpi/common/src/linux_80211.c | 209 +++++++++++++++++---------- sys/compat/linuxkpi/common/src/linux_80211.h | 1 + 2 files changed, 130 insertions(+), 80 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 4b4c323e123e..d6431e7fc1d5 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -168,25 +168,14 @@ lkpi_lsta_dump(struct lkpi_sta *lsta, struct ieee80211_node *ni, static void lkpi_lsta_remove(struct lkpi_sta *lsta, struct lkpi_vif *lvif) { - struct ieee80211_node *ni; - - IMPROVE("XXX-BZ remove tqe_prev check once ni-sta-state-sync is fixed"); - ni = lsta->ni; LKPI_80211_LVIF_LOCK(lvif); - if (lsta->lsta_entry.tqe_prev != NULL) - TAILQ_REMOVE(&lvif->lsta_head, lsta, lsta_entry); + KASSERT(lsta->lsta_entry.tqe_prev != NULL, + ("%s: lsta %p lsta_entry.tqe_prev %p ni %p\n", __func__, + lsta, lsta->lsta_entry.tqe_prev, lsta->ni)); + TAILQ_REMOVE(&lvif->lsta_head, lsta, lsta_entry); LKPI_80211_LVIF_UNLOCK(lvif); - - lsta->ni = NULL; - ni->ni_drv_data = NULL; - if (ni != NULL) - ieee80211_free_node(ni); - - IMPROVE("more from lkpi_ic_node_free() should happen here."); - - free(lsta, M_LKPI80211); } static struct lkpi_sta * @@ -206,13 +195,16 @@ lkpi_lsta_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN], lsta->added_to_drv = false; lsta->state = IEEE80211_STA_NOTEXIST; -#if 0 /* - * This needs to be done in node_init() as ieee80211_alloc_node() - * will initialise the refcount after us. + * Link the ni to the lsta here without taking a reference. + * For one we would have to take the reference in node_init() + * as ieee80211_alloc_node() will initialise the refcount after us. + * For the other a ni and an lsta are 1:1 mapped and always together + * from [ic_]node_alloc() to [ic_]node_free() so we are essentally + * using the ni references for the lsta as well despite it being + * two separate allocations. */ - lsta->ni = ieee80211_ref_node(ni); -#endif + lsta->ni = ni; /* The back-pointer "drv_data" to net80211_node let's us get lsta. */ ni->ni_drv_data = lsta; @@ -283,6 +275,7 @@ lkpi_lsta_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN], mtx_init(&lsta->txq_mtx, "lsta_txq", NULL, MTX_DEF); TASK_INIT(&lsta->txq_task, 0, lkpi_80211_txq_task, lsta); mbufq_init(&lsta->txq, IFQ_MAXLEN); + lsta->txq_ready = true; return (lsta); @@ -298,6 +291,54 @@ cleanup: return (NULL); } +static void +lkpi_lsta_free(struct lkpi_sta *lsta, struct ieee80211_node *ni) +{ + struct mbuf *m; + + if (lsta->added_to_drv) + panic("%s: Trying to free an lsta still known to firmware: " + "lsta %p ni %p added_to_drv %d\n", + __func__, lsta, ni, lsta->added_to_drv); + + /* XXX-BZ free resources, ... */ + IMPROVE(); + + /* XXX locking */ + lsta->txq_ready = false; + + /* Drain taskq, won't be restarted until added_to_drv is set again. */ + while (taskqueue_cancel(taskqueue_thread, &lsta->txq_task, NULL) != 0) + taskqueue_drain(taskqueue_thread, &lsta->txq_task); + + /* Flush mbufq (make sure to release ni refs!). */ + m = mbufq_dequeue(&lsta->txq); + while (m != NULL) { + struct ieee80211_node *nim; + + nim = (struct ieee80211_node *)m->m_pkthdr.rcvif; + if (nim != NULL) + ieee80211_free_node(nim); + m_freem(m); + m = mbufq_dequeue(&lsta->txq); + } + KASSERT(mbufq_empty(&lsta->txq), ("%s: lsta %p has txq len %d != 0\n", + __func__, lsta, mbufq_len(&lsta->txq))); + + /* Drain sta->txq[] */ + mtx_destroy(&lsta->txq_mtx); + + /* Remove lsta from vif; that is done by the state machine. Should assert it? */ + + IMPROVE("Make sure everything is cleaned up."); + + /* Free lsta. */ + lsta->ni = NULL; + ni->ni_drv_data = NULL; + free(lsta, M_LKPI80211); +} + + static enum nl80211_band lkpi_net80211_chan_to_nl80211_band(struct ieee80211_channel *c) { @@ -957,11 +998,17 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int ic_printf(vap->iv_ic, "%s: no iv_bss for vap %p\n", __func__, vap); return (EINVAL); } + /* + * Keep the ni alive locally. In theory (and practice) iv_bss can change + * once we unlock here. This is due to net80211 allowing state changes + * and new join1() despite having an active node as well as due to + * the fact that the iv_bss can be swapped under the hood in (*iv_update_bss). + */ ni = ieee80211_ref_node(vap->iv_bss); if (ni->ni_chan == NULL || ni->ni_chan == IEEE80211_CHAN_ANYC) { ic_printf(vap->iv_ic, "%s: no channel set for iv_bss ni %p " "on vap %p\n", __func__, ni, vap); - ieee80211_free_node(ni); + ieee80211_free_node(ni); /* Error handling for the local ni. */ return (EINVAL); } @@ -970,7 +1017,7 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int if (chan == NULL) { ic_printf(vap->iv_ic, "%s: failed to get LKPI channel from " "iv_bss ni %p on vap %p\n", __func__, ni, vap); - ieee80211_free_node(ni); + ieee80211_free_node(ni); /* Error handling for the local ni. */ return (ESRCH); } @@ -978,6 +1025,18 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int lvif = VAP_TO_LVIF(vap); vif = LVIF_TO_VIF(lvif); + LKPI_80211_LVIF_LOCK(lvif); + /* XXX-BZ KASSERT later? */ + if (lvif->lvif_bss_synched || lvif->lvif_bss != NULL) { + ic_printf(vap->iv_ic, "%s:%d: lvif %p vap %p iv_bss %p lvif_bss %p " + "lvif_bss->ni %p synched %d\n", __func__, __LINE__, + lvif, vap, vap->iv_bss, lvif->lvif_bss, + (lvif->lvif_bss != NULL) ? lvif->lvif_bss->ni : NULL, + lvif->lvif_bss_synched); + return (EBUSY); + } + LKPI_80211_LVIF_UNLOCK(lvif); + IEEE80211_UNLOCK(vap->iv_ic); LKPI_80211_LHW_LOCK(lhw); @@ -1073,32 +1132,17 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int lkpi_80211_mo_bss_info_changed(hw, vif, &vif->bss_conf, bss_changed); /* - * This is a bandaid for now. If we went through (*iv_update_bss)() - * and then removed the lsta we end up here without a lsta and have - * to manually allocate and link it in as lkpi_ic_node_alloc()/init() - * would normally do. - * XXX-BZ I do not like this but currently we have no good way of - * intercepting the bss swap and state changes and packets going out - * workflow so live with this. It is a compat layer after all. + * Given ni and lsta are 1:1 from alloc to free we can assert that + * ni always has lsta data attach despite net80211 node swapping + * under the hoods. */ - if (ni->ni_drv_data == NULL) { - ic_printf(vap->iv_ic, "%s:%d: lkpi_lsta_alloc to be called: " - "ni %p lsta %p\n", __func__, __LINE__, ni, ni->ni_drv_data); - lsta = lkpi_lsta_alloc(vap, ni->ni_macaddr, hw, ni); - if (lsta == NULL) { - error = ENOMEM; - ic_printf(vap->iv_ic, "%s:%d: lkpi_lsta_alloc " - "failed: %d\n", __func__, __LINE__, error); - goto out; - } - lsta->ni = ieee80211_ref_node(ni); - } else { - lsta = ni->ni_drv_data; - } + KASSERT(ni->ni_drv_data != NULL, ("%s: ni %p ni_drv_data %p\n", + __func__, ni, ni->ni_drv_data)); + lsta = ni->ni_drv_data; LKPI_80211_LVIF_LOCK(lvif); - /* XXX-BZ KASSERT later? */ - /* XXX-BZ this should have caught the upper lkpi_lsta_alloc() too! */ + /* Re-check given (*iv_update_bss) could have happened. */ + /* XXX-BZ KASSERT later? or deal as error? */ if (lvif->lvif_bss_synched || lvif->lvif_bss != NULL) ic_printf(vap->iv_ic, "%s:%d: lvif %p vap %p iv_bss %p lvif_bss %p " "lvif_bss->ni %p synched %d, ni %p lsta %p\n", __func__, __LINE__, @@ -1106,8 +1150,13 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int (lvif->lvif_bss != NULL) ? lvif->lvif_bss->ni : NULL, lvif->lvif_bss_synched, ni, lsta); - /* Reference the ni for this cache of lsta. */ - ieee80211_ref_node(vap->iv_bss); + /* + * Reference the ni for this cache of lsta/ni on lvif->lvif_bss + * essentially out lsta version of the iv_bss. + * Do NOT use iv_bss here anymore as that may have diverged from our + * function local ni already and would lead to inconsistencies. + */ + ieee80211_ref_node(ni); lvif->lvif_bss = lsta; lvif->lvif_bss_synched = true; @@ -1160,6 +1209,10 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int out: LKPI_80211_LHW_UNLOCK(lhw); IEEE80211_LOCK(vap->iv_ic); + /* + * Release the reference that keop the ni stable locally + * during the work of this function. + */ if (ni != NULL) ieee80211_free_node(ni); return (error); @@ -1254,9 +1307,13 @@ lkpi_sta_auth_to_scan(struct ieee80211vap *vap, enum ieee80211_state nstate, int lvif->lvif_bss = NULL; lvif->lvif_bss_synched = false; LKPI_80211_LVIF_UNLOCK(lvif); - ieee80211_free_node(ni); /* was lvif->lvif_bss->ni */ - lkpi_lsta_remove(lsta, lvif); + /* + * The very last release the reference on the ni for the ni/lsta on + * lvif->lvif_bss. Upon return from this both ni and lsta are invalid + * and potentially freed. + */ + ieee80211_free_node(ni); /* conf_tx */ @@ -1592,9 +1649,13 @@ _lkpi_sta_assoc_to_down(struct ieee80211vap *vap, enum ieee80211_state nstate, i lvif->lvif_bss = NULL; lvif->lvif_bss_synched = false; LKPI_80211_LVIF_UNLOCK(lvif); - ieee80211_free_node(ni); /* was lvif->lvif_bss->ni */ - lkpi_lsta_remove(lsta, lvif); + /* + * The very last release the reference on the ni for the ni/lsta on + * lvif->lvif_bss. Upon return from this both ni and lsta are invalid + * and potentially freed. + */ + ieee80211_free_node(ni); /* conf_tx */ @@ -2128,9 +2189,13 @@ lkpi_sta_run_to_init(struct ieee80211vap *vap, enum ieee80211_state nstate, int lvif->lvif_bss = NULL; lvif->lvif_bss_synched = false; LKPI_80211_LVIF_UNLOCK(lvif); - ieee80211_free_node(ni); /* was lvif->lvif_bss->ni */ - lkpi_lsta_remove(lsta, lvif); + /* + * The very last release the reference on the ni for the ni/lsta on + * lvif->lvif_bss. Upon return from this both ni and lsta are invalid + * and potentially freed. + */ + ieee80211_free_node(ni); /* conf_tx */ @@ -3270,7 +3335,6 @@ lkpi_ic_node_init(struct ieee80211_node *ni) { struct ieee80211com *ic; struct lkpi_hw *lhw; - struct lkpi_sta *lsta; int error; ic = ni->ni_ic; @@ -3282,11 +3346,6 @@ lkpi_ic_node_init(struct ieee80211_node *ni) return (error); } - lsta = ni->ni_drv_data; - - /* Now take the reference before linking it to the table. */ - lsta->ni = ieee80211_ref_node(ni); - /* XXX-BZ Sync other state over. */ IMPROVE(); @@ -3319,30 +3378,15 @@ lkpi_ic_node_free(struct ieee80211_node *ni) ic = ni->ni_ic; lhw = ic->ic_softc; lsta = ni->ni_drv_data; - if (lsta == NULL) - goto out; - /* XXX-BZ free resources, ... */ - IMPROVE(); + /* KASSERT lsta is not NULL here. Print ni/ni__refcnt. */ - /* Flush mbufq (make sure to release ni refs!). */ -#ifdef __notyet__ - KASSERT(mbufq_empty(&lsta->txq), ("%s: lsta %p has txq len %d != 0\n", - __func__, lsta, mbufq_len(&lsta->txq))); -#endif - /* Drain taskq. */ - - /* Drain sta->txq[] */ - mtx_destroy(&lsta->txq_mtx); - - /* Remove lsta if added_to_drv. */ - - /* Remove lsta from vif */ - /* Remove ref from lsta node... */ - /* Free lsta. */ - lkpi_lsta_remove(lsta, VAP_TO_LVIF(ni->ni_vap)); + /* + * Pass in the original ni just in case of error we could check that + * it is the same as lsta->ni. + */ + lkpi_lsta_free(lsta, ni); -out: if (lhw->ic_node_free != NULL) lhw->ic_node_free(ni); } @@ -3354,6 +3398,11 @@ lkpi_ic_raw_xmit(struct ieee80211_node *ni, struct mbuf *m, struct lkpi_sta *lsta; lsta = ni->ni_drv_data; + /* XXX locking */ + if (!lsta->txq_ready) { + m_free(m); + return (ENETDOWN); + } /* Queue the packet and enqueue the task to handle it. */ LKPI_80211_LSTA_LOCK(lsta); diff --git a/sys/compat/linuxkpi/common/src/linux_80211.h b/sys/compat/linuxkpi/common/src/linux_80211.h index ae4b8379e88c..d9cb1a538f91 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.h +++ b/sys/compat/linuxkpi/common/src/linux_80211.h @@ -125,6 +125,7 @@ struct lkpi_sta { struct ieee80211_key_conf *kc; enum ieee80211_sta_state state; + bool txq_ready; /* Can we run the taskq? */ bool added_to_drv; /* Driver knows; i.e. we called ...(). */ bool in_mgd; /* XXX-BZ should this be per-vif? */ From nobody Mon Feb 19 16:10:27 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdnZD2FcJz5C4qT; Mon, 19 Feb 2024 16:10:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdnZD0P5Fz4P87; Mon, 19 Feb 2024 16:10:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708359028; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DpZOYSWGDtWVtRqt0wVA0Yldh1L8HgKKU64brOWPLCc=; b=qyU375uRS4aMCBux2Fcu80e6QOSZ6bqs4pjHvhUz+w7+fxw3rgj4bMagNu+QkJFZtju3en ztRNCNQx3O/WJUvMheDYOvlsF1QgU5zhSJBNokh/ahpkjoshFNUooW3dVMGi5gqTHbIpcM OPtpjHsGHR1xw6K2Jr414Sb5j4aPDHO6eqKGMfjch9KnUEocNhdd0t5ih79pPqM9XJmj05 uSjTRSVkP9oLBisDo+0oJn41Bluvq1rHfq9qQQBK1t418vE4y2CvPaauiaDJBpx+cbH87Y ZBoILkzG3ksoR4axA4Zp5JHUzk/jlD9l3iZGBA5H/RPX7COSnC6Oe/NpboxOGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708359028; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DpZOYSWGDtWVtRqt0wVA0Yldh1L8HgKKU64brOWPLCc=; b=jLkQSM8yrGl+CO1kbQf0sT4B8+kGQQ4BbE4Kv5eCyMyE7UNPNwNR/DCHXPJOidG49kqcPV FAhd6RPLyN+bebJK7ZV+/lZuF7o2T1Pd/LOKJzn3BEwM3iIbvsazta0inu1C6T/GjYe1Om aSwFIKMJLH15IuXWtGJKjgrMzNMcaoLXmnPJFCJSV/r2LeRX061HJUUh/Nb+Qo/r3jh5oV HmHQH8DFe0+JfMlgJLc4iv7QWRju/Oe13oWnbaIEM/jASz2n5YO8jT1Ab1WFLJK8YNAOwb ZnquPhCD//ulOp+kK55wIUCyeKI7RQyQlsoRKDZ7WLfcAgnSACxmQW/elQ0h1Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708359028; a=rsa-sha256; cv=none; b=IIaEQfCgv6nq4nY/9f47VAFgQS7XyAFIXOpikhKKU+ui2fGIUnLvTxXA2b9E61YtWJSMUN Jz8aMMMD61n5vBAQcBhz2W/TrVtRuDr9GGsyFGZH6H8S+WXLuYAQ7tXbw1FziCFOd38i45 vnKRymTA7+fLhxeZButCCaxjAb10+XiveD/1qh3SOXzRGWr6FDUEeRphgrxGYL48EKjlIW +p/YtFsgQIBY6WopWYCQBtDQgwrxIuLCWgXD+k0KZoXTUwtnIn/YQXFDzquufPktmRmKpN hJBs+Kn3/cWfgwYXB8K/2bCK/YutsxgYEG/P6Tz+uimKcN6DY04hj9Hjc/ql9g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdnZC6bw0zghm; Mon, 19 Feb 2024 16:10:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGARwC036170; Mon, 19 Feb 2024 16:10:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGAROx036167; Mon, 19 Feb 2024 16:10:27 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:10:27 GMT Message-Id: <202402191610.41JGAROx036167@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 401dbf9cfc0c - releng/13.3 - LinuxKPI: 802.11: lsta txq locking cleanup List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/releng/13.3 X-Git-Reftype: branch X-Git-Commit: 401dbf9cfc0cfb2a02355d41bf73e146bd3dfb74 Auto-Submitted: auto-generated The branch releng/13.3 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=401dbf9cfc0cfb2a02355d41bf73e146bd3dfb74 commit 401dbf9cfc0cfb2a02355d41bf73e146bd3dfb74 Author: Bjoern A. Zeeb AuthorDate: 2024-02-14 21:56:48 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-02-19 16:09:22 +0000 LinuxKPI: 802.11: lsta txq locking cleanup Rename the LSTA lock to LSTA_TXQ lock as that is really what it is and put down the full set of macros. Replace the init and destroy with the macro invocation rather than direct code. Put locking around the txq_ready unset and check. Move the taskq_enqueue call under lock to be sure we do not call it anymore after txq_ready got unset. Leave a comment related to the node reference which is passed into the TX path on the recvif mbuf pointer. Approved by: re (cperciva) Fixes: 0936c648ad0ee PR: 274382 (possibly) Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D43909 (cherry picked from commit fa4e4257943650c0b5f58c01bb0bdfadea61dfb2) (cherry picked from commit 763b10806cd4ebdcbd2b6753d4f50ec088dc57fb) --- sys/compat/linuxkpi/common/src/linux_80211.c | 31 ++++++++++++++++++---------- sys/compat/linuxkpi/common/src/linux_80211.h | 14 +++++++++++-- 2 files changed, 32 insertions(+), 13 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index d6431e7fc1d5..adddb0fc3500 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -272,7 +272,7 @@ lkpi_lsta_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN], } /* Deferred TX path. */ - mtx_init(&lsta->txq_mtx, "lsta_txq", NULL, MTX_DEF); + LKPI_80211_LSTA_TXQ_LOCK_INIT(lsta); TASK_INIT(&lsta->txq_task, 0, lkpi_80211_txq_task, lsta); mbufq_init(&lsta->txq, IFQ_MAXLEN); lsta->txq_ready = true; @@ -304,8 +304,11 @@ lkpi_lsta_free(struct lkpi_sta *lsta, struct ieee80211_node *ni) /* XXX-BZ free resources, ... */ IMPROVE(); - /* XXX locking */ + /* Drain sta->txq[] */ + + LKPI_80211_LSTA_TXQ_LOCK(lsta); lsta->txq_ready = false; + LKPI_80211_LSTA_TXQ_UNLOCK(lsta); /* Drain taskq, won't be restarted until added_to_drv is set again. */ while (taskqueue_cancel(taskqueue_thread, &lsta->txq_task, NULL) != 0) @@ -324,9 +327,7 @@ lkpi_lsta_free(struct lkpi_sta *lsta, struct ieee80211_node *ni) } KASSERT(mbufq_empty(&lsta->txq), ("%s: lsta %p has txq len %d != 0\n", __func__, lsta, mbufq_len(&lsta->txq))); - - /* Drain sta->txq[] */ - mtx_destroy(&lsta->txq_mtx); + LKPI_80211_LSTA_TXQ_LOCK_DESTROY(lsta); /* Remove lsta from vif; that is done by the state machine. Should assert it? */ @@ -3398,16 +3399,21 @@ lkpi_ic_raw_xmit(struct ieee80211_node *ni, struct mbuf *m, struct lkpi_sta *lsta; lsta = ni->ni_drv_data; - /* XXX locking */ + LKPI_80211_LSTA_TXQ_LOCK(lsta); if (!lsta->txq_ready) { + LKPI_80211_LSTA_TXQ_UNLOCK(lsta); + /* + * Free the mbuf (do NOT release ni ref for the m_pkthdr.rcvif! + * ieee80211_raw_output() does that in case of error). + */ m_free(m); return (ENETDOWN); } /* Queue the packet and enqueue the task to handle it. */ - LKPI_80211_LSTA_LOCK(lsta); mbufq_enqueue(&lsta->txq, m); - LKPI_80211_LSTA_UNLOCK(lsta); + taskqueue_enqueue(taskqueue_thread, &lsta->txq_task); + LKPI_80211_LSTA_TXQ_UNLOCK(lsta); #ifdef LINUXKPI_DEBUG_80211 if (linuxkpi_debug_80211 & D80211_TRACE_TX) @@ -3416,7 +3422,6 @@ lkpi_ic_raw_xmit(struct ieee80211_node *ni, struct mbuf *m, mbufq_len(&lsta->txq)); #endif - taskqueue_enqueue(taskqueue_thread, &lsta->txq_task); return (0); } @@ -3624,9 +3629,13 @@ lkpi_80211_txq_task(void *ctx, int pending) mbufq_init(&mq, IFQ_MAXLEN); - LKPI_80211_LSTA_LOCK(lsta); + LKPI_80211_LSTA_TXQ_LOCK(lsta); + /* + * Do not re-check lsta->txq_ready here; we may have a pending + * disassoc frame still. + */ mbufq_concat(&mq, &lsta->txq); - LKPI_80211_LSTA_UNLOCK(lsta); + LKPI_80211_LSTA_TXQ_UNLOCK(lsta); m = mbufq_dequeue(&mq); while (m != NULL) { diff --git a/sys/compat/linuxkpi/common/src/linux_80211.h b/sys/compat/linuxkpi/common/src/linux_80211.h index d9cb1a538f91..7a1d5877b874 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.h +++ b/sys/compat/linuxkpi/common/src/linux_80211.h @@ -278,8 +278,18 @@ struct lkpi_wiphy { #define LKPI_80211_LVIF_LOCK(_lvif) mtx_lock(&(_lvif)->mtx) #define LKPI_80211_LVIF_UNLOCK(_lvif) mtx_unlock(&(_lvif)->mtx) -#define LKPI_80211_LSTA_LOCK(_lsta) mtx_lock(&(_lsta)->txq_mtx) -#define LKPI_80211_LSTA_UNLOCK(_lsta) mtx_unlock(&(_lsta)->txq_mtx) +#define LKPI_80211_LSTA_TXQ_LOCK_INIT(_lsta) \ + mtx_init(&(_lsta)->txq_mtx, "lsta-txq", NULL, MTX_DEF); +#define LKPI_80211_LSTA_TXQ_LOCK_DESTROY(_lsta) \ + mtx_destroy(&(_lsta)->txq_mtx); +#define LKPI_80211_LSTA_TXQ_LOCK(_lsta) \ + mtx_lock(&(_lsta)->txq_mtx) +#define LKPI_80211_LSTA_TXQ_UNLOCK(_lsta) \ + mtx_unlock(&(_lsta)->txq_mtx) +#define LKPI_80211_LSTA_TXQ_LOCK_ASSERT(_lsta) \ + mtx_assert(&(_lsta)->txq_mtx, MA_OWNED) +#define LKPI_80211_LSTA_TXQ_UNLOCK_ASSERT(_lsta) \ + mtx_assert(&(_lsta)->txq_mtx, MA_NOTOWNED) #define LKPI_80211_LTXQ_LOCK_INIT(_ltxq) \ mtx_init(&(_ltxq)->ltxq_mtx, "ltxq", NULL, MTX_DEF); From nobody Mon Feb 19 16:44:44 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpKr0cC4z5C9Bb; Mon, 19 Feb 2024 16:44:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpKn2wMPz4Zyk; Mon, 19 Feb 2024 16:44:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361085; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dXW6cqVwPInlhfj1JDByKBWfP3sMLDGIBUBU9l/rx+8=; b=aQ126EILQoUFAB/Y2/qX6XFmBjGEFEDIXKgyQE9d+72PdyYDfnQ6/VTMo9B+qVhqK3jaYo YB3eV04kQmxmacUIYztFcNaZCUPa1z+Mm1i3ToiME6UDaZ7bcJw//9rsxVy2D0t6GVly+4 /+lF8h9fMY9jzhQhA7aXn+f4TABqK/IqZB9WYohrfyk5/2NhdoiXL/ZOQUU0o+60UYg9Ur 1iiDkob4wdFRXbbv3wQ1mHHrCril8aWqMjfT8VHBNBXucww92xm28AiUMyMAuUvnM0mYE+ y6HE8tIhcEv81HlXgErXj96940SYvXKTtvpU2mlSFflWJHtqa6zarIejq1N+ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361085; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dXW6cqVwPInlhfj1JDByKBWfP3sMLDGIBUBU9l/rx+8=; b=g6bIcNFQHqT1vOCtPIisEcRfvGpg1XtVdsscelefEAWWLenfDvhppgjR3sUW5TJPVhwDdJ 7+S7fq19xb462crBdf0zsVr5SYxVf43yUBy431ptIlILA+XgmZAKs/5GDBWNVx5FbwIXga 24hxV+rk/G+By9yw9vcgfQn3zVXsiT92DFaZtB9zVlIlKiBrfXsIFaXyhaLSpuedu1BVS+ qtOVXgdPAYKXAWd/1uvFyBncX5JSAqgj3D60VJPBUBEZYc53FD3q1NxJAHpF7qNrKHQJFP r8rH5wRsFjUrHck0ow7DiLsebBPsWX9uFvULPYCaFqNWe9D+IsUnpQwDXgJcJg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361085; a=rsa-sha256; cv=none; b=XTgHnQlMUri4Ghascdqc04WDhvpg+xEjhaaFl4PFXuMDYEpVUUNbTRg0SBMrv/7CXuqTNx iaGXLok7o8uaMgE2i2WxIKxJO9EYJ8bxuaj2YNQbs/vmlbfOtot7vXrjICZxdmErd02MHm mbe2rxiJkXZs8kUHMktACTtK11uqExTP5RTKrUcemOtqrevDCQOKln1aTfYpZlIoXS80bx n/uUHLBPdQAIyyfP4V5vyQZjBtw8U6BcwOrUzv0y9AqQN4zP85QrzuRiEbmwVb7JkD/lgD eTDDol/bwEvTsd3tt1Pe9MRhtEu6d5qApEn6utW2OoiHZiIxIUFkkhow9CvZtQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpKm709KzjDG; Mon, 19 Feb 2024 16:44:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGiis8093769; Mon, 19 Feb 2024 16:44:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGiipr093766; Mon, 19 Feb 2024 16:44:44 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:44:44 GMT Message-Id: <202402191644.41JGiipr093766@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: d73a0b6014f2 - stable/13 - arm64: Fix the TCR_EPD0 definition List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: d73a0b6014f2048f1e885f9d93dd7016cf5fbda2 Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=d73a0b6014f2048f1e885f9d93dd7016cf5fbda2 commit d73a0b6014f2048f1e885f9d93dd7016cf5fbda2 Author: Andrew Turner AuthorDate: 2023-09-06 17:32:15 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 12:37:15 +0000 arm64: Fix the TCR_EPD0 definition Sponsored by: Arm Ltd (cherry picked from commit 8f26d01f53316c055cc1116eb56ff438da50d831) --- 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 2f2cdf08585a..314330021495 100644 --- a/sys/arm64/include/armreg.h +++ b/sys/arm64/include/armreg.h @@ -2126,7 +2126,7 @@ #define TCR_IRGN0_SHIFT 8 #define TCR_IRGN0_WBWA (1UL << TCR_IRGN0_SHIFT) #define TCR_EPD0_SHIFT 7 -#define TCR_EPD0 (1UL << TCR_EPD1_SHIFT) +#define TCR_EPD0 (1UL << TCR_EPD0_SHIFT) /* Bit 6 is reserved */ #define TCR_T0SZ_SHIFT 0 #define TCR_T0SZ_MASK 0x3f From nobody Mon Feb 19 16:44:48 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpKs6mtsz5C8v8; Mon, 19 Feb 2024 16:44:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpKr3Z2pz4Zyv; Mon, 19 Feb 2024 16:44:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361088; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0DpbtCbyxGGqgPCDH/yuBi5zTSXR+OHWLnAzMzJtBqc=; b=ZZcndlylw6+MgznPaBfmpnm6TDZCkFfEWO6FSQgowiIjB4iooW6WUVKwSn2KPlufvVQiuC y77wnzY/XV8/PBd7p2CchYQSno9g59fw7UzCb1d29M483UGF64pr6K4MEUZIOetXCCcpdP aKftFLIdys2zE9yx7pfdR1+gX+aqQ6d2Fh7NZ2FVAbY3vo6qNBjJ58On8kezyGyoJmyBn3 As21gE71yCg36xIqGD1V85HqFlSTccgEIjF6+Wt43s0BV3HUJD3xtmIrknBXE17wzSNrQc cYVBiIDqABwwQPOSBYlrJBj5TaWfVHu3v/1TyG9FYbVgHRlLHrscf6KUEP4GcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361088; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0DpbtCbyxGGqgPCDH/yuBi5zTSXR+OHWLnAzMzJtBqc=; b=TbY6UfgWiqt6XMcbWZpzOP2c/XefrHxc5Dx7k+ovOW/G8qiQ0y24AmamVfa2Iy43m+UVtt qbiYeMMy2yqRxITrDvvgar8hyFzb0puSKP+SGZMkfdTDieA22U6IHs8Lej6DIjTFe9TFcf fzSwnnfe3p3MAAKEHjq7V1FFaXNdgtir4zrbp8cZvYsyQ4atuvXIjFdyF0+RTDzHAUlZu9 4MdJJvgjOetkclRhax2PpJYRQYIhCipf+fP1q5m1WLBpufDMAcOjWCFVIwb0w6pKq1tvnI QSeG+T8ZPPlZ77+nGrmZ4TNmP1MGBnvzBfnbIsrpLCGjUa26EOh2kNI+cY6WCQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361088; a=rsa-sha256; cv=none; b=UrosdR+K7EUM3YDG00J5AHvAb0aKGx0w5X7Wz1sCwbEgW85E5a+KJmZ0HjLemBbUYd9cTC tIjatRk7xeGCMSlwaReJWIzpLjA3EdoTP3JdIVM3HkpZRAMyHLgMnLdW0wmdA/fb/9Y4QK iTBzKzsteD6ywPVUg3zNTnu9NLm+TO/Bd9qsugPeEjQ3PtWEP6b7frDBwJVbupl3OAeC7W cnhOnxAZl+J9Airkt184kPCR82P2KNJgRGCr1ppO9r4bD3Jio8eiHlFASB2lSXbWejGOIC KdNeGR5OBh/uWPW/n+UFB2MmKmpJiTPu8utOCEDDXIJVYG260Zxu5xc140X1Kw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpKr2Z33zjSL; Mon, 19 Feb 2024 16:44:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGimXh093917; Mon, 19 Feb 2024 16:44:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGim8f093914; Mon, 19 Feb 2024 16:44:48 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:44:48 GMT Message-Id: <202402191644.41JGim8f093914@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: db5176875809 - stable/13 - arm64: Add TCR register masks List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: db51768758097c64d5a99b5efd210f57ea22c122 Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=db51768758097c64d5a99b5efd210f57ea22c122 commit db51768758097c64d5a99b5efd210f57ea22c122 Author: Andrew Turner AuthorDate: 2023-09-08 13:29:19 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 12:38:31 +0000 arm64: Add TCR register masks These will be used by bhyve to implement page table walking. Sponsored by: Arm Ltd (cherry picked from commit a35e47369f88e8c2e14b7371a1a5e1152680551f) --- sys/arm64/include/armreg.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/arm64/include/armreg.h b/sys/arm64/include/armreg.h index be070a451691..e2395951f524 100644 --- a/sys/arm64/include/armreg.h +++ b/sys/arm64/include/armreg.h @@ -2100,6 +2100,7 @@ #define TCR_IPS_44BIT (4UL << TCR_IPS_SHIFT) #define TCR_IPS_48BIT (5UL << TCR_IPS_SHIFT) #define TCR_TG1_SHIFT 30 +#define TCR_TG1_MASK (3UL << TCR_TG1_SHIFT) #define TCR_TG1_16K (1UL << TCR_TG1_SHIFT) #define TCR_TG1_4K (2UL << TCR_TG1_SHIFT) #define TCR_TG1_64K (3UL << TCR_TG1_SHIFT) @@ -2114,8 +2115,10 @@ #define TCR_A1_SHIFT 22 #define TCR_A1 (0x1UL << TCR_A1_SHIFT) #define TCR_T1SZ_SHIFT 16 +#define TCR_T1SZ_MASK (0x3fUL << TCR_T1SZ_SHIFT) #define TCR_T1SZ(x) ((x) << TCR_T1SZ_SHIFT) #define TCR_TG0_SHIFT 14 +#define TCR_TG0_MASK (3UL << TCR_TG0_SHIFT) #define TCR_TG0_4K (0UL << TCR_TG0_SHIFT) #define TCR_TG0_64K (1UL << TCR_TG0_SHIFT) #define TCR_TG0_16K (2UL << TCR_TG0_SHIFT) @@ -2129,7 +2132,7 @@ #define TCR_EPD0 (1UL << TCR_EPD0_SHIFT) /* Bit 6 is reserved */ #define TCR_T0SZ_SHIFT 0 -#define TCR_T0SZ_MASK 0x3f +#define TCR_T0SZ_MASK (0x3fUL << TCR_T0SZ_SHIFT) #define TCR_T0SZ(x) ((x) << TCR_T0SZ_SHIFT) #define TCR_TxSZ(x) (TCR_T1SZ(x) | TCR_T0SZ(x)) From nobody Mon Feb 19 16:44:45 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpKr0kYnz5C984; Mon, 19 Feb 2024 16:44:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpKp1XNdz4Zr8; Mon, 19 Feb 2024 16:44:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361086; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=InXX6hKhjhEGHZpBZgrVSpSNjBiHNdGZI2IGSs/RZN8=; b=vSHDuQSooR1mK7bbemayOkOlHzI/QLY5FTf2vctEYtaBgVRfNq9F1BFfwZT/ybp1Ghj3LK NGhnDgleCn0de1bPLNkkCmSxre6l17aI/CSXmcZ7gH+Q/WHH+lLM0GAQNmEdDS0k9z2k8b lldmaoED7wKB7JiQVeoi7n2+rDXHNt4paXfS7ZOrdhFP62E5tvhuAbvPShFSnQiD0DH8wo k5KWEpS6myf+10L/Ph6L7x11hp/o+b1fIMBJDoqMzGeivJWT8a9acIWBwmw0Beuj1u7t4F Ffcn872dTcpJKG3BPAFVPdrbAH/S4LEaDhhocVtXYcWul6wg4FvxmSCAHRJPYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361086; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=InXX6hKhjhEGHZpBZgrVSpSNjBiHNdGZI2IGSs/RZN8=; b=J91VMdmXk/HVpDamtmO6Qjawk4P1GAv99+tkthqpV8td26lYSsEd6TJEf3pMVJfsNrpvtO al/J0haFPiUydCbqlpw2VwpPJ/NdiXrRKCdoAacQkwKyWmDQ0ignI3LILtAObpRA6tkBoL jNEoB6ge90wrA2kS36yfDksRgwPYOpooCMVtpey39+fz/IsnzF739myJYJMvYX2MdbQsRM 0aBQA6QwsK+Nssrl86A1+Nk3lNRGDeAsH3TF7EMxN0JGV80guAotk56XqMHI/GZkGhVIoA QFrldgWprhuhz0B1hPNPUovP9L8fkyP2VRBmi9tGQO4KoFzV/Fr+9ksYRBuqlw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361086; a=rsa-sha256; cv=none; b=FI0C5s7LA+CRVu+8HJnr9oDIObnTt5ltCyDOogKTy6jCTdsiYUe9GD0XL9FreQohu1/Is5 JB8OJU12MgtVaSx1YE1kpBMS7NOTAzaTvKiTW4YqdzgJuJhzbaeO7t8GxyysvzHgnT4t83 VgZ77tNOxdDZKGj9AZKAwoHoz/bA6zjiaf7f3Vbsmq4dgDz+ErDkxnXfTGCAsP+p3hOmai 8YdBVuz7d2QaEUhpfUoy5TwIuR7Yx9xhx3d2qaOuDOpItcWpKFzbP/3BbEpXRGaSq1HGcG xexJFhTcXnH3K1+XXLcUQC2NsSuCPH/q4mXfS7rkgfIrbnc2rdm6CsgEpdp2RQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpKp0chQzjDH; Mon, 19 Feb 2024 16:44:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGijH0093812; Mon, 19 Feb 2024 16:44:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGijB8093809; Mon, 19 Feb 2024 16:44:45 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:44:45 GMT Message-Id: <202402191644.41JGijB8093809@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 9fbac657f11b - stable/13 - arm64: Enable FEAT_E0PD when supported List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 9fbac657f11b868186ea4ad52af203d9c94ebb51 Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=9fbac657f11b868186ea4ad52af203d9c94ebb51 commit 9fbac657f11b868186ea4ad52af203d9c94ebb51 Author: Andrew Turner AuthorDate: 2023-09-06 11:07:41 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 12:37:44 +0000 arm64: Enable FEAT_E0PD when supported FEAT_E0PD adds two fields to the tcr_el1 special register that, when set, cause userspace access to either the top or bottom half of the address spaces without a page walk. This can be used to stop userspace probing the kernel address space as the CPU will raise an exception in the same time if the probed address is in the TLB or not. Reviewed by: kevans Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D41760 (cherry picked from commit 9e2cafe4fb901214903484998adf51a6cc5e4ebb) --- sys/arm64/arm64/identcpu.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c index 200841782f03..cb7850c2aa2a 100644 --- a/sys/arm64/arm64/identcpu.c +++ b/sys/arm64/arm64/identcpu.c @@ -2090,6 +2090,31 @@ cpu_features_sysinit(void *dummy __unused) /* Log features before APs are released and start printing to the dmesg. */ SYSINIT(cpu_features, SI_SUB_SMP - 1, SI_ORDER_ANY, cpu_features_sysinit, NULL); +static void +tcr_set_e0pd1(void *arg __unused) +{ + uint64_t tcr; + + tcr = READ_SPECIALREG(tcr_el1); + tcr |= TCR_E0PD1; + WRITE_SPECIALREG(tcr_el1, tcr); + isb(); +} + +/* Enable support for more recent architecture features */ +static void +cpu_feat_support(void *arg __unused) +{ + /* + * If FEAT_E0PD is supported use it to cause faults without a page + * table walk if userspace tries to access kernel memory. + */ + if (ID_AA64MMFR2_E0PD_VAL(kern_cpu_desc.id_aa64mmfr2) != + ID_AA64MMFR2_E0PD_NONE) + smp_rendezvous(NULL, tcr_set_e0pd1, NULL, NULL); +} +SYSINIT(cpu_feat_support, SI_SUB_SMP, SI_ORDER_ANY, cpu_feat_support, NULL); + #ifdef COMPAT_FREEBSD32 static u_long parse_cpu_features_hwcap32(void) From nobody Mon Feb 19 16:44:49 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpKt0xMcz5C93L; Mon, 19 Feb 2024 16:44:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpKs5G0Fz4Zx4; Mon, 19 Feb 2024 16:44:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361089; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2/8MAqvQW1t/omdaJWfx5CLBjYjk36rg0+INcS8NZi8=; b=hYxOerbIdF3u+aFTUdl/NQ2u/U1ZGom2u4MxwiR3h6uulFzJyFnQAULLpAwzQi9GeubvTx 6yo95sa5Qlc1D8uGS5hR6whRtrH5lvAZ+wELDGdwg0tqARMwlYkW3x9xSHf6aWVPoS7HLn 5LvSi8iXZEZjxQnbvo+n4k2OFlOsbdM0JuSols5B9v8q7dRaQJyjrarv95s6W2gt4NbX3j bqWn2mK+r714mO+kiavWyZVPBQBxczQrCYsyAUQ2SBo2/QExhdLhiM/U+f9bv0j0qrsTHL Go5OhmtZrEVY0m5li/k8IBgO6oEtSZQoBNs6Rk4D1Td7uLk+de0UuSBvBZK4ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361089; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2/8MAqvQW1t/omdaJWfx5CLBjYjk36rg0+INcS8NZi8=; b=ibIB24sHqRtJ/g/19xt9Gj8e9A1sPG0noDxe4Hstn82ZQzXa85j7XHoPiV2J17+MaAzUcR nqqWAqZ5y34gvJ0EIXhSLvq4LUaWnGMOKrmBYMkxuIe1dLQIE7iZFIB+SUxjdJb+5k5Quu l5U/GJkkli8GOs737Y8u5pa9hTPVzfkmt+RSUYO/s+byb82SQaq9oOvdHXzeksxoK/T3qW NF4P4b9l2LCmi7bZOZ9qh0k08fwI2RFlzPM1co+HDSsC+ow/Srp4UU/uXh7rRgcvE9LHlw BiBT2x6aZJV78Lwa9M06HIwaHQe/ByZ3H5qRr3L5frEHhlr1KmO0FRB8QmX1pA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361089; a=rsa-sha256; cv=none; b=k450vfqXYbB8oaDNrt9Qy/akUFQkTRqXKVxSORxjBm/VF2PWNXrKvV890npEoh7vbumKHN cJLd3wvb9lrGSbNe5PyGwHTaVJKZgv/uAHrxp8yDuvZNTBMPmdOkWUwpdhWey7uCjvUEe2 u3iHz5GlyqQQZWvVVbubLXrZQ+GRTpAz79s6Bd1AUiswUglseNyY1zdNgYjCa0POxEO88l Yq5DX5dRz0rCZhXwhimnbM+3mBPoL1w8b3cX9LFsoiwg5J4cW2Qfb69aUYci87+MXywx8J 9BPPu6iSMAXm9ZzpX5T7DMI32yzWmQHQq/p63LrVFt1o7S2vh88FCfWqODiPzw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpKs3X52zj6f; Mon, 19 Feb 2024 16:44:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGinFC093953; Mon, 19 Feb 2024 16:44:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGinsp093950; Mon, 19 Feb 2024 16:44:49 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:44:49 GMT Message-Id: <202402191644.41JGinsp093950@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 3c89290626a7 - stable/13 - arm64: Export HWCAP_CPUID List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 3c89290626a7ed6db87774535bd07783c3c64e28 Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=3c89290626a7ed6db87774535bd07783c3c64e28 commit 3c89290626a7ed6db87774535bd07783c3c64e28 Author: Andrew Turner AuthorDate: 2023-09-22 16:20:17 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 12:39:24 +0000 arm64: Export HWCAP_CPUID We have export the CPUID registers since 2018 but never set the HWCAP_CPUID flag to tell userspace it could use them. Fix this by setting it. Sponsored by: Arm Ltd (cherry picked from commit d61f9bfb0e5c119c97a559f187b1e9c73077307b) --- sys/arm64/arm64/identcpu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c index cb7850c2aa2a..ebd1abb67dcb 100644 --- a/sys/arm64/arm64/identcpu.c +++ b/sys/arm64/arm64/identcpu.c @@ -2041,6 +2041,8 @@ identify_cpu_sysinit(void *dummy __unused) /* Find the values to export to userspace as AT_HWCAP and AT_HWCAP2 */ parse_cpu_features(); + /* We export the CPUID registers */ + elf_hwcap |= HWCAP_CPUID; #ifdef COMPAT_FREEBSD32 /* Set the default caps and any that need to check multiple fields */ From nobody Mon Feb 19 16:44:50 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpKv0Cslz5C93T; Mon, 19 Feb 2024 16:44:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpKt5j2zz4b79; Mon, 19 Feb 2024 16:44:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361090; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=etUdzcF0KYBf/KENeizcBzZx5lR9MW/hvC3MBVWDYrQ=; b=sgEi+u555LjWaHk+AdS3/JfEQtAKdcXa9/9m0JRuiaCRCiNTD4Gz/zl/8Jx5JRVWW34nB2 Ju6JwFbMs4bQY0XKmSYxOWOUYAuKpAQx8ggWYGXAa+6NI8IMo2eTH9eltL4juDDlaGRSbN eHYvwEcCqGwc9SoYVOWZoTkE/8bO0sIWYtt5IuAwElnDED1EEDLFAVTajUWFVMNFarpmak hJJZ9aFLjZ4AdB6FxFniw8BbNFil7/+sAWXkPtVGy2WmQuD/x51vMJ8/X8Y7CI08e0OC1+ KEZjWM0e732Jcavqr2Tj9DWnSk34E6mWNXGdRP2panQiRNBHyrg2GyoB4aQFaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361090; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=etUdzcF0KYBf/KENeizcBzZx5lR9MW/hvC3MBVWDYrQ=; b=PwS8DoTP0KhAMURkjOe8jt66jQJ5aWbaijhG0AoxRBnc+Z9vV/+vG8MRumeCv9Dk0GcQYV K/wkuTsOi8S2YlTP6YEQCfGSxloWXPK543Zcxuctl/smPLj7LPCHv65QZ72s8g7tBb0tWc GmHDQzQAyvj0szDRY9XyTsA158fdyrbJRg1415exQQ2qqA5zwGnbmFQseo8kkrlHsGKmK6 7OuRksrLdtROEdVYANfZ7CIQBaorgw2wvcDnyvLq8whbGhh5oWdKYdJxaR4QyEJgMahkTn j5HzfHRqHg4pObHKhKQTOZp7ZRzbfMHF6dF60HoArwgZAWg0H1d5y0hok1PWMQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361090; a=rsa-sha256; cv=none; b=eeCspeEjUjvh+M5QUMIHU3ol0/vdmuECSq4uCSF9AyLVIR9KS+i8AMWIoSBtqHiK8YHEzz c9XL8Q0PV7vibKoSOn9RNAUi3TRKd3L/1V65JSu2DtFadnXh0vmclH2PfKNsdbDZY5M86H W99KR02LY+Z/l4qG2ZHoYEHNBmMahLUl5WnuM8aHjfXWxfz66DM80DtlqgDM6WScRJCJxl zd2Ddb+fGeOl/uFSCFYoNfHzJXp3cVg6To9JxF/r60dA9cf+J/MQCX8y3VFoFDsnUayTqG hqjN2atCGrr52lZG+V37NACCztnng81mFdKECNP/A+G5X16TH3a9TB2pvnKvyQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpKt4WZ2zjSM; Mon, 19 Feb 2024 16:44:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGioJo093989; Mon, 19 Feb 2024 16:44:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGioRd093986; Mon, 19 Feb 2024 16:44:50 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:44:50 GMT Message-Id: <202402191644.41JGioRd093986@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: ed304b0be0df - stable/13 - Add BTI exceptions List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: ed304b0be0df1e89e50f8463f0a46989b66acc1f Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=ed304b0be0df1e89e50f8463f0a46989b66acc1f commit ed304b0be0df1e89e50f8463f0a46989b66acc1f Author: Andrew Turner AuthorDate: 2023-04-05 12:28:46 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 12:39:49 +0000 Add BTI exceptions We could hit these when executing code marked as using BTI but jumps to a non-branch target instruction. Sponsored by: Arm Ltd Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39450 (cherry picked from commit 450f731b7f2351d475b43bbc6234eea28adfd2b0) --- sys/arm64/arm64/locore.S | 2 +- sys/arm64/arm64/trap.c | 11 +++++++++++ sys/arm64/include/armreg.h | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index 4712f8591b8b..d48984e39a59 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -737,7 +737,7 @@ sctlr_set: .quad (SCTLR_LSMAOE | SCTLR_nTLSMD | SCTLR_UCI | SCTLR_SPAN | \ SCTLR_nTWE | SCTLR_nTWI | SCTLR_UCT | SCTLR_DZE | \ SCTLR_I | SCTLR_SED | SCTLR_SA0 | SCTLR_SA | SCTLR_C | \ - SCTLR_M | SCTLR_CP15BEN) + SCTLR_M | SCTLR_CP15BEN | SCTLR_BT1 | SCTLR_BT0) sctlr_clear: /* Bits to clear */ .quad (SCTLR_EE | SCTLR_E0E | SCTLR_IESB | SCTLR_WXN | SCTLR_UMA | \ diff --git a/sys/arm64/arm64/trap.c b/sys/arm64/arm64/trap.c index d62ebba3debd..d6f847d6b88c 100644 --- a/sys/arm64/arm64/trap.c +++ b/sys/arm64/arm64/trap.c @@ -526,6 +526,12 @@ do_el1h_sync(struct thread *td, struct trapframe *frame) panic("Undefined instruction: %08x", *(uint32_t *)frame->tf_elr); break; + case EXCP_BTI: + far = READ_SPECIALREG(far_el1); + print_registers(frame); + print_gp_register("far", far); + panic("Branch Target exception"); + break; default: print_registers(frame); print_gp_register("far", READ_SPECIALREG(far_el1)); @@ -660,6 +666,11 @@ do_el0_sync(struct thread *td, struct trapframe *frame, uint64_t far) (void *)frame->tf_elr, exception); userret(td, frame); break; + case EXCP_BTI: + call_trapsignal(td, SIGILL, ILL_ILLOPC, (void *)frame->tf_elr, + exception); + userret(td, frame); + break; default: call_trapsignal(td, SIGBUS, BUS_OBJERR, (void *)frame->tf_elr, exception); diff --git a/sys/arm64/include/armreg.h b/sys/arm64/include/armreg.h index e2395951f524..098c55361913 100644 --- a/sys/arm64/include/armreg.h +++ b/sys/arm64/include/armreg.h @@ -411,6 +411,7 @@ #define EXCP_UNKNOWN 0x00 /* Unkwn exception */ #define EXCP_TRAP_WFI_WFE 0x01 /* Trapped WFI or WFE */ #define EXCP_FP_SIMD 0x07 /* VFP/SIMD trap */ +#define EXCP_BTI 0x0d /* Branch Target Exception */ #define EXCP_ILL_STATE 0x0e /* Illegal execution state */ #define EXCP_SVC32 0x11 /* SVC trap for AArch32 */ #define EXCP_SVC64 0x15 /* SVC trap for AArch64 */ From nobody Mon Feb 19 16:44:52 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpKx2gMfz5C95s; Mon, 19 Feb 2024 16:44:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpKx0DHqz4b7D; Mon, 19 Feb 2024 16:44:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361093; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jEOe5C+G6blV6Zf/bQXe/yHWU9pBNbMKU+e+0W0d2A4=; b=EY6hLrYZ1xvAoOcuGjFf/pWL5ifSluUrdLEWqqW+1+9LElWYb6G8FcbSeI+l42/bymtHQl JIteXyXg2mkwbfDhSuU/ioiIaDy6lUkzmyS/rPwrpVaHcy4PGcbzfFohuMaQuX6zeV/RKg iQqgJoBq99tRKh9fPBfsRSHZXTR2O5X5qo26MLTGl4QTKCRVEj8Gxitcd7TIHe3QG5xI/u xwNL9bgX6r+qkYmzdMhq5BM23aJDxluJLH0Js1W2LPWcP/tBNm+QijRSMk1AjGj6qQObrq /y6iULApOzLRyzLrnNOk8ahp9ntJUrgBaiXLN833AXRa8rQzju9gO27/v3I0hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361093; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jEOe5C+G6blV6Zf/bQXe/yHWU9pBNbMKU+e+0W0d2A4=; b=JYKfTVNd5keNXWPb9sHzYk++9yhvMyiHiqT8CwG/L8YLkackIAyawwmG0/sxYsC/qB6/mD YDgfPm9SmzwTN2rzUXRfiDl2c5HSFZMzIr7IW9TaVhae9VDJBUPSjTryEh/fchzf18ahe2 uvEvv6WUy4OIa6XZzR8/meicaZMGtALU+0UNCzbJkFD/VclWPBU9e0LfeqmXq4IS3wQ8f4 Had4mmDC5idVbhurlISkqWR1KlbOWZ+AnaOIVIjfYc4/rK4IXK6eCREawigUtcNNj05C7t vkvOu+8Op6x3Um2Kc1Rzqd+QkBtjryC+CRhdfXlH4o6WhhzUCFRUXi42JeAzJA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361093; a=rsa-sha256; cv=none; b=R3yjWfwJEZCDbG9wMOPQLFTOYICn2+LwGdm8y+D4PRN4F0AeZA2peyqqD+e8kIIiccAmo+ ZZgmA8YcDa3tHYvVUhYAaCdWzldHuzt8fXTBaEqpW/r3u+C5mTND59NQMyKHEK9IvG/v4M fqV3F1qrscdBqv61EOfYipJybqrUPnSkzm7aTRQ5CwmfRWbXCsX+xsKdVwRl89Vxe7wk+C GMFg3EhmZyrwfqgFkCcMxmZYLSylb4jcoY+ERC4Vu7eRa7aA5uPuDNy0yBDPEC3go4y9a0 +muyTyiyMFTOMPzkLmAJ/1CWsdSzNlN9mk1nW4SYE5w4/FWyhbMiEo5RKrcIjg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpKw6QJYzjVS; Mon, 19 Feb 2024 16:44:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGiq8W094096; Mon, 19 Feb 2024 16:44:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGiqwu094092; Mon, 19 Feb 2024 16:44:52 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:44:52 GMT Message-Id: <202402191644.41JGiqwu094092@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: f323ecb4e075 - stable/13 - arm64: Raise a SIGBUS on a user external abort List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: f323ecb4e075f48f23d94f91b2b4b99074c21ebf Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=f323ecb4e075f48f23d94f91b2b4b99074c21ebf commit f323ecb4e075f48f23d94f91b2b4b99074c21ebf Author: Andrew Turner AuthorDate: 2023-09-29 13:55:48 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 12:40:25 +0000 arm64: Raise a SIGBUS on a user external abort When userspace triggers an external abort allow it to handle the abort by raising a SIGBUS. Reviewed by: markj, kib Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42018 (cherry picked from commit a69450102ff1fe1466077a021a16bb265274d3a2) --- sys/arm64/arm64/trap.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/arm64/arm64/trap.c b/sys/arm64/arm64/trap.c index d6f847d6b88c..74122cd508ab 100644 --- a/sys/arm64/arm64/trap.c +++ b/sys/arm64/arm64/trap.c @@ -223,19 +223,25 @@ static void external_abort(struct thread *td, struct trapframe *frame, uint64_t esr, uint64_t far, int lower) { + if (lower) { + call_trapsignal(td, SIGBUS, BUS_OBJERR, (void *)far, + ESR_ELx_EXCEPTION(frame->tf_esr)); + userret(td, frame); + return; + } /* * Try to handle synchronous external aborts caused by * bus_space_peek() and/or bus_space_poke() functions. */ - if (!lower && test_bs_fault((void *)frame->tf_elr)) { + if (test_bs_fault((void *)frame->tf_elr)) { frame->tf_elr = (uint64_t)generic_bs_fault; return; } print_registers(frame); print_gp_register("far", far); - panic("Unhandled EL%d external data abort", lower ? 0: 1); + panic("Unhandled external data abort"); } static void From nobody Mon Feb 19 16:44:51 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpKw02Zkz5C91k; Mon, 19 Feb 2024 16:44:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpKv6Cc0z4b4x; Mon, 19 Feb 2024 16:44:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361091; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ivnWxvwL4M1k7yDyzcj69f2RzFa5GxfsQibdQ/3l23k=; b=refq4YOrZ4K5S5SWQ35S5EfxtR+NRm/Z4ykHQyXZi7zULTkK15B4SeTGWXyF/m6ccZORdf M2yECY3jfqcgWqcjFjijGnUOBweotoLRc26DtXnsXXoQNYuz390WTEEGXwYnWwOHvSPRB6 p3XpbLafxj4WhITlG7Ml9xXM2YOsgy6JANVjnFJcjeYMvgh6X9cWGFuPVq6Np3rPIbs7fG dDFx6QNcWfHhEsIzUSC8pQIfvFUWFXWmrbmpDfuzI+NR2rC3BgcDtnhRF2M+HShGpYMxZ7 uNeCfaY7TkWDdSzYrmJ8LZjeBmqE8MXQAU6Vng8g6mfxYES4QXrULhuoJ24jRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361091; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ivnWxvwL4M1k7yDyzcj69f2RzFa5GxfsQibdQ/3l23k=; b=BqHwUJlXCkKRPH950kTcEcFkfhnOgjfIy0C2IbXlCDHY2xJK5poHrdLTjnRvcPj7GfUtQF UcNhRPSGztn0aEUyYkFYyMp+u/AgfDi+qZTbW7y+u3/VD8Kt5Hygx1g9qy2zDKTV0rNuk3 FnVUqeDBJpt1EzTR3trj9VqMJD7ycgMiRcueE86lxj2XjP0jL2FsKt1TLW8Dw8iH7ylO5g c6lyYqKnxm74AtHG1V1s4g6kQXDW/0gQk/0Us0kanIFnZdzfgxiZ9Dg+N/eQoSW1QvL/L/ xQKz5X1A6XDhQTDlACNtfUxfxKSDJTwl7ZauYytLTLycZDuVoH8zvC9/0jxkgw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361091; a=rsa-sha256; cv=none; b=C06czp7j2vwLY1L4O2zpoQHhCVUIWo4H0Xewa19N10fDKrjtZbejukf9qsZ9xP8jKat8O4 pEBbCfxIu76oKZcEHTYuYj82tKgeZ71mJ3ZkICsOXdjEN69obPYhYy0DsLCl/Tf0TYUk/u yllHt7lsF27jpN4QYeREqFX1weE9/UiKqVoc+Soe47rh6U+2GEQqwF89zjsZk/hLcQGllk szKK23/F2cFvAMpge05KdAHq18C1xKd/zQZkuQ2VqTsiqVszQfh1TV8Bsjrhlu6FhL9gfD aVYaXqXLRIX3pXz9igseQFVTaMb8kGxCcdQzmDOjOF0tuom9CWyDSbeyT19aCQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpKv5F1Mzj9Q; Mon, 19 Feb 2024 16:44:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGipoV094041; Mon, 19 Feb 2024 16:44:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGipn3094038; Mon, 19 Feb 2024 16:44:51 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:44:51 GMT Message-Id: <202402191644.41JGipn3094038@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 2bcdaf2b58ba - stable/13 - arm64: Add BTI landing pads to assembly functions List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 2bcdaf2b58badd91686af190825d994cddfcdc38 Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=2bcdaf2b58badd91686af190825d994cddfcdc38 commit 2bcdaf2b58badd91686af190825d994cddfcdc38 Author: Andrew Turner AuthorDate: 2023-10-03 08:52:02 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 12:40:03 +0000 arm64: Add BTI landing pads to assembly functions When we enable BTI iboth the first instruction in a function that could be called indirectly, and a branch within a function need a valid landing pad instruction. There are three options for these instructions: 1. A breakpoint instruction 2. A pointer authentication PACIASP/PACIBSP 3. A BTI instruction Option 1 will raise a breakpoint exception so isn't useable in either cases. Option 2 could be used in some function entry cases, but needs to be paired with an authentication instruction, and is normally only used in non-leaf functions we can't use it in this case. This leaves option 3. There are four variants of the instruction, the C variant is used on function entry and the J variant is for jumping within a function. There is also a JC that works with both and one with no target that works with neither. Reviewed by: markj Sponsored by: Arm Ltd Sponsored by: The FreeBSD Foundation (earlier version) Differential Revision: https://reviews.freebsd.org/D42078 (cherry picked from commit e340882d3e49a98aa39b13041a2bf714c30dccdf) --- sys/arm64/arm64/locore.S | 4 ++++ sys/arm64/include/asm.h | 30 +++++++++++++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index d48984e39a59..58f0ad8d85aa 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -99,6 +99,8 @@ ENTRY(_start) br x15 virtdone: + BTI_J + /* Set up the stack */ adrp x25, initstack_end add x25, x25, :lo12:initstack_end @@ -199,6 +201,8 @@ ENTRY(mpentry) br x15 mp_virtdone: + BTI_J + /* Start using the AP boot stack */ ldr x4, =bootstack ldr x4, [x4] diff --git a/sys/arm64/include/asm.h b/sys/arm64/include/asm.h index 783e8ee82c66..cfbcd2623e69 100644 --- a/sys/arm64/include/asm.h +++ b/sys/arm64/include/asm.h @@ -44,7 +44,7 @@ #define LENTRY(sym) \ .text; .align 2; .type sym,#function; sym: \ - .cfi_startproc; DTRACE_NOP + .cfi_startproc; BTI_C; DTRACE_NOP #define ENTRY(sym) \ .globl sym; LENTRY(sym) #define EENTRY(sym) \ @@ -110,4 +110,32 @@ dsb sy; \ isb +/* + * When a CPU that implements FEAT_BTI uses a BR/BLR instruction (or the + * pointer authentication variants, e.g. BLRAA) and the target location + * has the GP attribute in its page table, then the target of the BR/BLR + * needs to be a valid BTI landing pad. + * + * BTI_C should be used at the start of a function and is used in the + * ENTRY macro. It can be replaced by PACIASP or PACIBSP, however these + * also need an appropriate authenticate instruction before returning. + * + * BTI_J should be used as the target instruction when branching with a + * BR instruction within a function. + * + * When using a BR to branch to a new function, e.g. a tail call, then + * the target register should be x16 or x17 so it is compatible with + * the BRI_C instruction. + * + * As these instructions are in the hint space they are a NOP when + * the CPU doesn't implement FEAT_BTI so are safe to use. + */ +#ifdef __ARM_FEATURE_BTI_DEFAULT +#define BTI_C hint #34 +#define BTI_J hint #36 +#else +#define BTI_C +#define BTI_J +#endif + #endif /* _MACHINE_ASM_H_ */ From nobody Mon Feb 19 16:44:53 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpKy4QBxz5C8yB; Mon, 19 Feb 2024 16:44:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpKy1DQVz4b7J; Mon, 19 Feb 2024 16:44:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361094; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=di6dBBQT+nn4394MkE0zFBwPdH3ZOKTcN/iXk6Vqj+I=; b=esO8b4WtBkpUYJuGJ+QuypftJDC6Us2ADcYONegG0MxosDVSxR2vfzX2FW8ZFmK/AY+nM3 RtCQkriX+x3GL6HSS0iRdzt/HqeTe9Rp2/mwuKQmbdV2KxxGNCHC3EUJvpKz1mg440Bj5z XqfI/W5jaIvj4fLfSeFf4IncsYYLrOzAh1HPaIGJvOe6WMoizltPrD5ZzXANEYg2qfn3Ae fgvspteUjz9yFB35qZq5JXOuWR9pdK6zVLbY5a+LhpaQ1eJB60lA269Ubw1UxZ83Oeu/IO CvczNuEaOg4KpZmLx2eVRzxXLc2HfYz+rYf3wS8h42tT3PeGIr3fPWrBRpjfOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361094; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=di6dBBQT+nn4394MkE0zFBwPdH3ZOKTcN/iXk6Vqj+I=; b=g0BOsDWjhtpvQ58g1H1L7fiC//zq2GfuUE9gB71Vy8hzUxrXTMOoo7EvjU0Kb9wQzEewwW AssorAS0V7d+2i0cuKMUBgpPgefg6pkSua2FmlGhlZMLDB3223aRPtue7R3zoCipEVcBhM oPAkiWDB9wGHwQOHCRaLqygnfZYqUcXJ27JM5irc2rXgGMDV3zXwe3/R7PzNRMukUVXh0r 3dZ7H+9JCZEp+sUmHz5G89KO8yaegiA7MbdlL/MsxsESBFD8spBpeywmXd4vn3XFs00Xwb i1f2kBFbpgjOEerOuJw4nXjqeLTx2IX7EDzM+jxBTWNgCV91yoFdL7AOt2zQoA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361094; a=rsa-sha256; cv=none; b=UVReMVDGk0wv3GZyFZ2o05/Rxrch1A4WeZto+PToRI50dsn4uE5B5c663yXvq0F7c3QHnn TY3y1vGTq/jmhMk4bCElxjkkHziSGtYVFW02CKqkSLBd7ChC1UQONdjPihnwzsURcrUkS4 btrUoZS+QMOhYhUZ3rycD4WjBjP3WFCPF56PGsZaqH/uWlk5apO3vtB2sgUXKWu+yVEexo 9z1HWVnVJBxBhG+4a42qZzKIEX1UbhIiMcVuCTN5EB1qoXSSVCNsJ7Pfx0aQYh2k3wtKBs SE94jdkWfPaMptZMapmLvfDcajPwHLdoggoEb1Pg/+LMkjRjvqYURMUVlk7/gA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpKy0KNnzjSN; Mon, 19 Feb 2024 16:44:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGireS094147; Mon, 19 Feb 2024 16:44:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGirll094144; Mon, 19 Feb 2024 16:44:53 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:44:53 GMT Message-Id: <202402191644.41JGirll094144@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 892cc8813aff - stable/13 - sys/sys: Check for __ASSEMBLER__ in elf_common.h List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 892cc8813aff01429614a27192061d013e8f52c4 Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=892cc8813aff01429614a27192061d013e8f52c4 commit 892cc8813aff01429614a27192061d013e8f52c4 Author: Andrew Turner AuthorDate: 2023-10-12 09:45:43 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 12:40:43 +0000 sys/sys: Check for __ASSEMBLER__ in elf_common.h When preprocessing assembly files with clang or gcc the __ASSEMBLER__ macro is defined. Check for this as an alternative to LOCORE in elf_common.h so it can be included by .S files. Reviewed by: imp Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42224 (cherry picked from commit f39010b1393d471f1c59195acde5d95cdb66847c) --- sys/sys/elf_common.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/sys/elf_common.h b/sys/sys/elf_common.h index 2bb7e458314c..4af241bb085c 100644 --- a/sys/sys/elf_common.h +++ b/sys/sys/elf_common.h @@ -44,7 +44,7 @@ * not include the padding. */ -#ifndef LOCORE +#if !defined(LOCORE) && !defined(__ASSEMBLER__) typedef struct { u_int32_t n_namesz; /* Length of name. */ u_int32_t n_descsz; /* Length of descriptor. */ @@ -112,7 +112,7 @@ typedef Elf_Note Elf_Nhdr; * The header for GNU-style hash sections. */ -#ifndef LOCORE +#if !defined(LOCORE) && !defined(__ASSEMBLER__) typedef struct { u_int32_t gh_nbuckets; /* Number of hash buckets. */ u_int32_t gh_symndx; /* First visible symbol in .dynsym. */ From nobody Mon Feb 19 16:44:55 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpL00TDgz5C95x; Mon, 19 Feb 2024 16:44:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpKz3xXtz4ZxW; Mon, 19 Feb 2024 16:44:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361095; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DGbZ/E1jTG6rCybmJVbMJm2mngo4etPlvPWKnUR+LH0=; b=kkQqsyMODE3Hcm/cba0e2hLGnKWVLO+P7lIVLskzZ53AL7IB9bzVrGITczE6eKDiGTOkf6 ODI0okmJX5C6czuO1obLzAKH7t34MbG5mrU7eaIIj99DOK2zKSnJFmLfj54mFOH2UkN+Zm 53+pgF6X0wGudRcx2tn+DsXVIaYEQvZcmvRgZfMrhcrQt1T1OT/shqVqkz2dS1c/xqNwT7 adPjRGejV/oyLXKMiSG1YSyufC9GqWCQ4NjYBa3bqFy01T+3e+d2A2ESTQmoHQEbumV8lB 68JkWcy9Y7fcz8V29BOrpvEPEIK11ifYAEJEO5gbjBe4DuxyqiZDaPjcEPWq+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361095; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DGbZ/E1jTG6rCybmJVbMJm2mngo4etPlvPWKnUR+LH0=; b=qISsETQuO9nx/oiXtBl6w/ktSnTPZkx8qOQMGeQks4Twue/AYupzGtsPexMBXhidnHCehD UdU5PCZ3laIAROOabZXz3QOTkxn97J3XG/vXpXYKTF4kqFZH+1msokdTiorCl5P3zKzy05 Ww3DGCsI1IbG8XCO8pF6jMXH3SJTg8a8ErVu8OjdU2iGB2L8U6XiB0x05mogbcUWotwZl5 RDJC4xieFp2ENqCXQtVafet8uIvUMOVHHg05uhc+uELBb1FyoYkcpm2kZWXuBkq+zTG38K /K5s72aOemok3NNuZ6dtYJZxzyVdvsvQRQjAZniYw6OG/FRGiFBO/JGAuhHYbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361095; a=rsa-sha256; cv=none; b=h/fL4ROpSYiG/3rAK7cynxb04w2VLKlgH5G2aWaGuyGgqXVPx5wD8LJydqZH2lYrb1oqyu UOk6r/ZBTK6ZOMlqYuPQcaz3yZg8FFjuuecqjUd1C+EDZk1kzvwbbJunJCYto+Fm8AP4h+ JKo2fQwUCQK4AE2DoXXg3X4ww+HRn/RoQ197afCGn8Bf9AjfcesDR1AJtpub7dsuhqALfr XvFTPzuUpvAKychoZqXZqF2328O5CZ8u2n7/m1XPpFZOrV3uK+JQWv6XeAZ+laGqOK+iHY tEzF4xY2pO8KuocAdZWUUX5DbK+kcyFdW0WRoGrZn3/AJBZiRjb0LKeHSEOPFg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpKz1LflzjDK; Mon, 19 Feb 2024 16:44:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGitpt094207; Mon, 19 Feb 2024 16:44:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGitH7094204; Mon, 19 Feb 2024 16:44:55 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:44:55 GMT Message-Id: <202402191644.41JGitH7094204@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 29e38839272e - stable/13 - arm64: Support creating a BTI & PAC note List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 29e38839272e9aa43dfc8c548385eb27452cb6b1 Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=29e38839272e9aa43dfc8c548385eb27452cb6b1 commit 29e38839272e9aa43dfc8c548385eb27452cb6b1 Author: Andrew Turner AuthorDate: 2023-10-10 13:00:59 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 12:40:53 +0000 arm64: Support creating a BTI & PAC note To detect when an object file is build with the Branch Target Identification (BTI) and Pointer Authentication Code (PAC) extensions there is an elf note the compiler will insert. It will only do so from a high level language, e.g. C or C++. To get the not in assembly add the GNU_PROPERTY_AARCH64_FEATURE_1_NOTE macro that can be used to create it, and the GNU_PROPERTY_AARCH64_FEATURE_1_VAL macro to insert the correct value based on which combination of BTI and PAC are enabled. Reviewed by: markj (earlier version), emaste Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42225 (cherry picked from commit 82597d2102a02c4e9e9355717c32867d34b77ef0) --- sys/arm64/include/asm.h | 52 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/sys/arm64/include/asm.h b/sys/arm64/include/asm.h index cfbcd2623e69..955fb51af030 100644 --- a/sys/arm64/include/asm.h +++ b/sys/arm64/include/asm.h @@ -138,4 +138,56 @@ #define BTI_J #endif +/* + * GNU_PROPERTY_AARCH64_FEATURE_1_NOTE can be used to insert a note that + * the current assembly file is built with Pointer Authentication (PAC) or + * Branch Target Identification support (BTI). As the linker requires all + * object files in an executable or library to have the GNU property + * note to emit it in the created elf file we need to add a note to all + * assembly files that support BTI so the kernel and dynamic linker can + * mark memory used by the file as guarded. + * + * The GNU_PROPERTY_AARCH64_FEATURE_1_VAL macro encodes the combination + * of PAC and BTI that have been enabled. It can be used as follows: + * GNU_PROPERTY_AARCH64_FEATURE_1_NOTE(GNU_PROPERTY_AARCH64_FEATURE_1_VAL); + * + * To use this you need to include for + * GNU_PROPERTY_AARCH64_FEATURE_1_* + */ +#if defined(__ARM_FEATURE_BTI_DEFAULT) +#if defined(__ARM_FEATURE_PAC_DEFAULT) +/* BTI, PAC */ +#define GNU_PROPERTY_AARCH64_FEATURE_1_VAL \ + (GNU_PROPERTY_AARCH64_FEATURE_1_BTI | GNU_PROPERTY_AARCH64_FEATURE_1_PAC) +#else +/* BTI, no PAC */ +#define GNU_PROPERTY_AARCH64_FEATURE_1_VAL \ + (GNU_PROPERTY_AARCH64_FEATURE_1_BTI) +#endif +#elif defined(__ARM_FEATURE_PAC_DEFAULT) +/* No BTI, PAC */ +#define GNU_PROPERTY_AARCH64_FEATURE_1_VAL \ + (GNU_PROPERTY_AARCH64_FEATURE_1_PAC) +#else +/* No BTI, no PAC */ +#define GNU_PROPERTY_AARCH64_FEATURE_1_VAL 0 +#endif + +#if defined(__ARM_FEATURE_BTI_DEFAULT) || defined(__ARM_FEATURE_PAC_DEFAULT) +#define GNU_PROPERTY_AARCH64_FEATURE_1_NOTE(x) \ + .section .note.gnu.property, "a"; \ + .balign 8; \ + .4byte 0x4; /* sizeof(vendor) */ \ + .4byte 0x10; /* sizeof(note data) */ \ + .4byte (NT_GNU_PROPERTY_TYPE_0); \ + .asciz "GNU"; /* vendor */ \ + /* note data: */ \ + .4byte (GNU_PROPERTY_AARCH64_FEATURE_1_AND); \ + .4byte 0x4; /* sizeof(property) */ \ + .4byte (x); /* property */ \ + .4byte 0 +#else +#define GNU_PROPERTY_AARCH64_FEATURE_1_NOTE(x) +#endif + #endif /* _MACHINE_ASM_H_ */ From nobody Mon Feb 19 16:44:56 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpL04x5sz5C98h; Mon, 19 Feb 2024 16:44:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpL02z1Tz4b0d; Mon, 19 Feb 2024 16:44:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361096; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ekQx/pMppzPPbfaymKiqnH+9xfroaMCxWzp9zdd1MK8=; b=LxftpL+98sZa7dn44p1WDD7QMdqagddTLm0MlHOJA07y2h3XjGwzru3oUOo2+bEpu7mwRJ +1s7MwwiG+Z9l4Pb0VFWVVNhDEOdtRJSLD2Gfl2Pqsvmi+rHXAocZMfMtNMT4CopxdqZyC zWHnJDu1SeQOQi0pdB/O1kJC6XHmj8ooyiz+c6EOmbtvGRayGayrYbEiSqYRKBggVnY7Gu /7v+ucqCD17kKTIS8BfuXLEY/s244zyl6A+gsbg/N5CulDLY7nwZSYWHHKADDD8G66gGXF +tIshze0Im5cJ/3RUod2mw3tviQgaBFGo9okgNXGKG7lnz/awNbYZguBYGE4rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361096; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ekQx/pMppzPPbfaymKiqnH+9xfroaMCxWzp9zdd1MK8=; b=ToQN82F4W0o8X6Nkt6AOfYCN0vsXoHxfqcm50wfpDS9mq9UfTL/eZwyFHjphvcSXYIc6/d Ed+mqRPhicHGgddthKcJeIb5JYcNEEwQJ9Ejw+UN+46LmHhF0RZMJZPXjEbahJ7TjvSj6M DazeS1DoD9I003WQrcHn8zlag5smZ5sqLLAgnSYeKvgGTBT14u+A6pLmrJhYUNwJhxOM77 4Dqbn0W4vqy4r1SmzOdHV+Ihlk0EsL4+Sn3NtSoLDquAjLYAPxgD+hn/L3YKtvZNtPoGBn q7ZUt4SiLlrTTzd4cGnHWAtqTkdrEi4KJrv18E+MXfTC6Dnqc1nTh3rF63b/pw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361096; a=rsa-sha256; cv=none; b=RgnTSJQLxBX3aD/EYTza7LzSYkr4ilAPFYCiuCWSsIijsu1Sp8nF+LgKRVv/qzWi7nzYTG jazUQqPmfnxOJSvYHsr2R3FDHCwGPlbBPklIHJ1euQnE4jFmIt4GdWeJgpk4YjXWjX0cik vMfYC4tdLEjfwLOSXD3VvQVvfWTZxCPByH1AfRGaWmWioqjipSv8O/0erGPqDJf+AIMRST OJkCKWb5FzOqK7MqI2Emgh0czxxEqcYRCuABY13JjsuAU3pB5it6GWX+YJsLsdvpIpIDkx 8Vf0FJLoyj6jA8bjxVX/WGhIzmOp0JmbBa0V1ixmuLEQ77lquasfA9dGvN1I4g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpL022FgzjGp; Mon, 19 Feb 2024 16:44:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGiuDJ094258; Mon, 19 Feb 2024 16:44:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGiusL094255; Mon, 19 Feb 2024 16:44:56 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:44:56 GMT Message-Id: <202402191644.41JGiusL094255@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 729a561cefc3 - stable/13 - arm64: Add PAC instruction macros List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 729a561cefc3890e99c2b721eab6f97849c25a1c Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=729a561cefc3890e99c2b721eab6f97849c25a1c commit 729a561cefc3890e99c2b721eab6f97849c25a1c Author: Andrew Turner AuthorDate: 2023-10-12 09:48:38 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 12:41:08 +0000 arm64: Add PAC instruction macros To support Pointer Authentication (PAC) in assembly files add a pair of macros that sign the link register. When used before storing to the stack it will allow hardware to detect if it has changed before using it in the return instruction. Reviewed by: markj, emaste Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42226 (cherry picked from commit 2b39a6f68c3839454cd255b91978202cd995182a) --- sys/arm64/include/asm.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/sys/arm64/include/asm.h b/sys/arm64/include/asm.h index 955fb51af030..a5ee5b1ef5b7 100644 --- a/sys/arm64/include/asm.h +++ b/sys/arm64/include/asm.h @@ -138,6 +138,28 @@ #define BTI_J #endif +/* + * To help protect against ROP attacks we can use Pointer Authentication + * to sign the return address before pushing it to the stack. + * + * PAC_LR_SIGN can be used at the start of a function to sign the link + * register with the stack pointer as the modifier. As this is in the hint + * space it is safe to use on CPUs that don't implement pointer + * authentication. It can be used in place of the BTI_C instruction above as + * a valid BTI landing pad instruction. + * + * PAC_LR_AUTH is used to authenticate the link register using the stack + * pointer as the modifier. It should be used in any function that uses + * PAC_LR_SIGN. The stack pointer must be identical in each case. + */ +#ifdef __ARM_FEATURE_PAC_DEFAULT +#define PAC_LR_SIGN hint #25 /* paciasp */ +#define PAC_LR_AUTH hint #29 /* autiasp */ +#else +#define PAC_LR_SIGN +#define PAC_LR_AUTH +#endif + /* * GNU_PROPERTY_AARCH64_FEATURE_1_NOTE can be used to insert a note that * the current assembly file is built with Pointer Authentication (PAC) or From nobody Mon Feb 19 16:44:56 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpL10tnpz5C9Dq; Mon, 19 Feb 2024 16:44:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpL06Gw7z4Zvg; Mon, 19 Feb 2024 16:44:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361096; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bjjk1K2hQG3kVAny0VNoL7z8/NHocajcK/YvBVHKU3c=; b=dtmzC9A9InQaSvPbVPODy01Y7glply+rgBj23oa4WSem/BPXPP1+wqH5OEm50+JzrR/3EM CYhBemAlrQv/x6Z1mWz5uiedz2PIQj7bBPzwoqYE5XgTmTPVo6y+Yic46rNXwfQPFSFhl3 S3kKzM0ckcti94K3CYebFw1G4QT0ihWUX9MEgnOPowH8aiGN7w7koi3cXMiJ9Wpc0rDunw uMpajKZOUPk7oG6AUgiAFTHbLDBRZ7y14iPTV/JHaFzlOWq1U/J5oKAL3yTV2wSRmH+KlS ERBu/Ryo0MslWv2V/A7uYXdto4YV/h1KKl/l5uLFxLjSF2rK6rKh9155JRQGXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361096; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bjjk1K2hQG3kVAny0VNoL7z8/NHocajcK/YvBVHKU3c=; b=OQRXfHmdZJVs2flv9P0xVo8sXGYy4nX9UFsjKrRRVRz1jY49SEoU8zSD4+L524Q2zfIoG8 CLJ5VTHC4z6LcVEmukAwbIrIo69XaDSpBOpQQiz8b25T3CvsD0xFySEIk9QNbhutzrz2WW 2xCaN2RobL6PbKtmzF9gxioPQKzVbzOF1ehMmdyfApIixb5DWrvJeXhe16TNXvBzoxLkeP Y810x23OFEVzHECXz1Sg9X2+ycuOgcjFVPYNlqlGA4P0RutZwiMr0Co18mMbU9o+pr63wd CxDeO54dvIJjovn1KxHaxWTDYAuBTe7dlEpHKP7VIVU4UNUGfJ9lWppUDSM0/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361096; a=rsa-sha256; cv=none; b=PeYcN3zHklEh1034A/WiQSqyrX0anxj/Kh6EkYLWlaMxzU3gZb13Adm4W3ir+F0GuI3pmp V+BHTbqK9iMTAz8mbWkTNgxSTFBGM6b0vbumfvFwzUk4NYZDlgbndlZ4gDcm1DH+dbJN+j tOsa3t79It9iFdNjkMQAbPe2MOndMSKRigzc39QNdMoC/1LJ8lVvSa4SLjsJBZ/aGD1he4 Mr0uOjLx854N0z9TbQNqr1PO1C8i3HbHfVgyUoBkxwBlF5v9fqOBdw2v/VEBDPLNfAgXJa LksKu9P9MSgX4j30jDpTsfyKuEFlvYMDOeaNJLq/gqtz6c3QFwIdTxxhu6b40w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpL05P5bzjDL; Mon, 19 Feb 2024 16:44:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGiukT094479; Mon, 19 Feb 2024 16:44:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGiuQi094476; Mon, 19 Feb 2024 16:44:56 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:44:56 GMT Message-Id: <202402191644.41JGiuQi094476@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: bcedcc2aad22 - stable/14 - arm64: Fix the TCR_EPD0 definition List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: bcedcc2aad22d7a8fd5a650f6197ff53bcbc1a55 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=bcedcc2aad22d7a8fd5a650f6197ff53bcbc1a55 commit bcedcc2aad22d7a8fd5a650f6197ff53bcbc1a55 Author: Andrew Turner AuthorDate: 2023-09-06 17:32:15 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 13:07:40 +0000 arm64: Fix the TCR_EPD0 definition Sponsored by: Arm Ltd (cherry picked from commit 8f26d01f53316c055cc1116eb56ff438da50d831) --- 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 5892a9b08502..034504727b39 100644 --- a/sys/arm64/include/armreg.h +++ b/sys/arm64/include/armreg.h @@ -2167,7 +2167,7 @@ #define TCR_IRGN0_SHIFT 8 #define TCR_IRGN0_WBWA (1UL << TCR_IRGN0_SHIFT) #define TCR_EPD0_SHIFT 7 -#define TCR_EPD0 (1UL << TCR_EPD1_SHIFT) +#define TCR_EPD0 (1UL << TCR_EPD0_SHIFT) /* Bit 6 is reserved */ #define TCR_T0SZ_SHIFT 0 #define TCR_T0SZ_MASK 0x3f From nobody Mon Feb 19 16:44:57 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpL14wRBz5C8yH; Mon, 19 Feb 2024 16:44:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpL13T9dz4b7w; Mon, 19 Feb 2024 16:44:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361097; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8V2Ily8qjqbe+9EUy+2QyGdOVkVmXI99wlsHLbHtbMc=; b=BhtFdkC6JsSrv19/qTFnAje5n1tViwE8WSY8uMxOguVy4UjGdSEFvKDABc54AEybMc4OcQ lewWafYBMo+tludzjNAYiqo3fCdDHhIbyp/+chyyWp4rNCrSqWAO9Yz3DW+kr2hshNPuZo bhxZycpCJNa0l+Mnc8/1KWWunAdCdB6H3gjz2Fp7Ngt2FAs1wHmdkMvnBn97JEmv2Jv8fN Kjz9yiav+822+CPRpFr6g0yq/H5J83oeuJcppb39uqRwhD5sj1Ov882zmb1UOhZzEsxzL6 RooeITYPOQP9ByvqVMQdDw1mVD5zTy5W40x8NiO0uZi8BItct3rm/G69TBlkpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361097; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8V2Ily8qjqbe+9EUy+2QyGdOVkVmXI99wlsHLbHtbMc=; b=Jw/ZcQV7qMLAfplLKL2EX9LHUoV9vwSwfcxaRq+oHWEhq8m4Tkx9jklqJ/xc/TO+nXmSYg 3nvXsir6+iXlplKAjJROjZLRKpe/BCJZayqiRuG/AB9tPMbhKzlsGC5rEsGu1+2sgkGrAX vE+XmmsPRMaslgkoLqegDUqFYo9ETPHXi5ynK3QjpJVRNx1NUpT6INHILTssXEDbUR+haG OU/ONCnjFYu5z4UYRah9jmHGxtI50TVk3/kfvo571qGpUoQKTGrHscLZyLPrekCquMV2gT 5WJEd+fZ44Xu2BjqCVMdKLdGnrZslXT1o3+cwFtJoYcMr0uyKQKVQeK8XxT9oQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361097; a=rsa-sha256; cv=none; b=rAvLlVudGlr6WMXOfi9qb6pQNn0NpNK3Ac1AmbBQjSWQI4T/ciWLMRW5BKMdrMXg/QE5h9 Id07dRAsw5/jdtdn8/jVi7wfxBgb0xARmjmZIo8k7tx2pcj+A6NjesMPYrtpb+3+y8kFZH QSq8pECoSxChsgGsNQR+hWAnkswZf2mTmGN3XpHoRmIymqBIjOKz5Pmh6wZzGyLQs7kncK IWD/Cp3d44ImMBI26jrTU7avqIBCXDknefCkal4jO3+VIrw85mIxYPAKnnZDnv344ZWTEK 3VkZY+qVvIZiwwVZw3iOffiJrzFfweHb/7MXMIj2C/OOO5f3/k/NQYtjKM6G6Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpL12ZQlzj6g; Mon, 19 Feb 2024 16:44:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGivkc094521; Mon, 19 Feb 2024 16:44:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGiv4W094518; Mon, 19 Feb 2024 16:44:57 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:44:57 GMT Message-Id: <202402191644.41JGiv4W094518@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 8eda23d822eb - stable/13 - arm64: Add a missing MRS_HWCAP_END List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 8eda23d822eb63ed35b76478530bfa286eb06686 Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=8eda23d822eb63ed35b76478530bfa286eb06686 commit 8eda23d822eb63ed35b76478530bfa286eb06686 Author: Andrew Turner AuthorDate: 2023-10-25 12:32:04 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 12:41:24 +0000 arm64: Add a missing MRS_HWCAP_END Add a missing end marker to stop the arm64 CPU ID code reading past the end of an array. Sponsored by: Arm Ltd (cherry picked from commit 1e05cf5f97dee6d7139aa64f14264fb4c2333455) --- sys/arm64/arm64/identcpu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c index ebd1abb67dcb..60c40c84f965 100644 --- a/sys/arm64/arm64/identcpu.c +++ b/sys/arm64/arm64/identcpu.c @@ -1617,6 +1617,7 @@ static const struct mrs_field_value mvfr0_fpdp[] = { static const struct mrs_field_hwcap mvfr0_fpdp_caps[] = { MRS_HWCAP(&elf32_hwcap, HWCAP32_VFP, MVFR0_FPDP_VFP_v2), MRS_HWCAP(&elf32_hwcap, HWCAP32_VFPv3, MVFR0_FPDP_VFP_v3_v4), + MRS_HWCAP_END }; static const struct mrs_field_value mvfr0_fpsp[] = { From nobody Mon Feb 19 16:44:57 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpL21n9Lz5C8vn; Mon, 19 Feb 2024 16:44:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpL16swlz4bGS; Mon, 19 Feb 2024 16:44:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361098; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8EGtVDLuZDypdZL5SKf7o8705877Rn3jOz+QwOLQQ6o=; b=HaNmVbs/2MdYUlqBw4/EbViDSWQmftGn0JXxcgP4ePV4I+nV4L0/SmqVAFLjlocn7y30dO mPplRNddKmhMVpkm6Cps9nulBaS4SU4eQyZhBEL/l+/1SSt6pODFswAQpUHYnhySuJZZsE sAW7pinci+MggcSPHHOLPe5bbMhsM52cpAc6Zn2e84uGG08Co+gyfV16pCouBGoAWhnVpV j7VigH7yLjACLFjOIgkod6epLB4lNycNg9M5HdVDmh1saPWdIW9CxJ2DHvmc8QA3j/5oYv VpjPeUEzWHEF6p1FnX8+wnWgaFjJzKED+nbSTofWTl1V8mxYzkCGlRCJF+xITg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361098; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8EGtVDLuZDypdZL5SKf7o8705877Rn3jOz+QwOLQQ6o=; b=bjbHSM64Oyo+RFjnngiUIs4VjauAeDW+i4PFJjdk9q6TxHOFhH21UInTxGtJ3Y/p7Ioqdt eEr5z/Y4cdBXZD8KxFlIW83vQD80fXwOHYsOhqF9hUa8n0KuW/1jo/E5lCKdXukzd91n/f IbmYJRahCeKc1O4x2T6pj1zrH5/elgyaYxD8VPjMfuRZcPIqLUAFzjeSacBS/Zo3lN5zH8 +GzCUZYD4DOm+WrN1hljIR7qzskki4ezXzwIK3E68V9AcxCfH4qp9sxjQJSLCo1+5+xVdw p2gKgtDEcdBgxIb9kA8Q2SNfR/6Dk4iUBa/lA0gxOiclZWjsKyve8vZmHkQ1Gw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361098; a=rsa-sha256; cv=none; b=HCBhKkeQRUzcbwRg95Y1k6oOuYDUR0vBSMy3BO5d/ogY7iY1AJZenQM+Mqejhom+S2pPcz GreuU64x4s/ZBVoAuXKdwjqCjQROONSDsx/TuWikUX0rlJWEGkU9m+urJD4cv/acK+zz5x 5CtRlTxITmWGtBta4LmxkkxBDUEvW18eA/oaplWOeat3ox+Fphd1PwLCezc9laHUhQeJ0H A+sQHG2eEGh3bPtgT7Y2ZCfGWhglMHDcNi7+TcVCH40IpK4PHD6TNqrA80grSv5JiW1y2O bMaxFif3RUx4dJzBIsQdBFCghFZj9PBDUZQA1dORt/D6GS4nJqxq5/HYxadc7w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpL15zNdzjfX; Mon, 19 Feb 2024 16:44:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGivNA094563; Mon, 19 Feb 2024 16:44:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGivA4094560; Mon, 19 Feb 2024 16:44:57 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:44:57 GMT Message-Id: <202402191644.41JGivA4094560@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 628fd849f55e - stable/14 - arm64: Enable FEAT_E0PD when supported List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 628fd849f55e9804331caf63584573dea7a36547 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=628fd849f55e9804331caf63584573dea7a36547 commit 628fd849f55e9804331caf63584573dea7a36547 Author: Andrew Turner AuthorDate: 2023-09-06 11:07:41 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 13:07:56 +0000 arm64: Enable FEAT_E0PD when supported FEAT_E0PD adds two fields to the tcr_el1 special register that, when set, cause userspace access to either the top or bottom half of the address spaces without a page walk. This can be used to stop userspace probing the kernel address space as the CPU will raise an exception in the same time if the probed address is in the TLB or not. Reviewed by: kevans Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D41760 (cherry picked from commit 9e2cafe4fb901214903484998adf51a6cc5e4ebb) --- sys/arm64/arm64/identcpu.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c index 698a98e3da1d..1e9ff32754f0 100644 --- a/sys/arm64/arm64/identcpu.c +++ b/sys/arm64/arm64/identcpu.c @@ -2259,6 +2259,31 @@ cpu_features_sysinit(void *dummy __unused) /* Log features before APs are released and start printing to the dmesg. */ SYSINIT(cpu_features, SI_SUB_SMP - 1, SI_ORDER_ANY, cpu_features_sysinit, NULL); +static void +tcr_set_e0pd1(void *arg __unused) +{ + uint64_t tcr; + + tcr = READ_SPECIALREG(tcr_el1); + tcr |= TCR_E0PD1; + WRITE_SPECIALREG(tcr_el1, tcr); + isb(); +} + +/* Enable support for more recent architecture features */ +static void +cpu_feat_support(void *arg __unused) +{ + /* + * If FEAT_E0PD is supported use it to cause faults without a page + * table walk if userspace tries to access kernel memory. + */ + if (ID_AA64MMFR2_E0PD_VAL(kern_cpu_desc.id_aa64mmfr2) != + ID_AA64MMFR2_E0PD_NONE) + smp_rendezvous(NULL, tcr_set_e0pd1, NULL, NULL); +} +SYSINIT(cpu_feat_support, SI_SUB_SMP, SI_ORDER_ANY, cpu_feat_support, NULL); + #ifdef COMPAT_FREEBSD32 static u_long parse_cpu_features_hwcap32(void) From nobody Mon Feb 19 16:44:58 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpL30cDKz5C9MS; Mon, 19 Feb 2024 16:44:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpL24TMYz4b3H; Mon, 19 Feb 2024 16:44:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361098; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vTPLiAnY0CC7HgqyZN49/aQd+1DaEXRgS+/SkOkxdxM=; b=sgtR4M8o3IrhGcphSZoG8/O6DjWJVAnuB/Jui0ECVbKWBheYFQJk+coqs21pAMsa76fbeJ nI6yUkOo516nsovEYgYQsgY08or1kacJ1w5tByfJAxnjKAycRswbCK/h/4NUx3Yccw2Ok1 RFwqAP9DdqkJYwNGtLLwlO0+4XwaYVa67rr0+Kjn0lL7DVh/NNKGbCzG0jhVp6j/iXhJKf FTGgYiQ2v+XG+CXvd5j6HeqjZ+5KHQTjPX2qkQydaeCKngkHqjfc83UjRejY2qNIYoFMYF gwrBRNxmWI+8oOP4aCPZ4FL2LF85h2r5LzVXlxdAj+EFVNYRsIuxwMVJ7/R5Pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361098; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vTPLiAnY0CC7HgqyZN49/aQd+1DaEXRgS+/SkOkxdxM=; b=IAZKRUuY4O4nLnTNAMpRxkcymXBtZRySI9TWIVJZ1MCYAF5YS52qeUjw8731DnFlEiGlV8 zLFWdvoOsV8v0MgSLcC+Irmpt9ELX8GT0xoJoqT5svbXqPVPAbJy069n6ps3tDV5NaI2V1 wRtlEIpV9j4OmLnD4vU0KUBGqM5y0RvvN4T15bcReBhx20A9cNaH4/g4CtVDaLKWZPXlV9 6tYhsV9mEwHQvUJHe4A9dSCbW+/bhA9nGvzRWl6i98uP2vNtwEs/3OvqK43570yDtW+iOD yE0PnRj463CiT+45srkqT5PFbRzy3OaOWAzLiQKi48kmlyM0IV5wbQn2sFMAZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361098; a=rsa-sha256; cv=none; b=S32pRYTYHS2XNPOytuJhjUzkGqACU5Bi9v/Sy5J+SOqO8QDkn29jd4no6vNWVfmMdmm5e/ OpB5NacFohExy6dAxISGBgbP1Y7hj3Q9MWsurkxeVZHtXinKEiaBWclH706RmncDyqOJoy IDfnmLkgWh9ukyskcE47zHqS7Te0yTHnP8zKibpebk/jLuCNAmpHUvziSAMi21Nu3nNsFJ FTyicZkdHUojQNNUvLm5O7oVL/WNeNXyI6/ylodo6gJM1k/EkKpS/WljAiaRtOyV6RLCp6 lLpAaUdG+VNJNtd/Aivsu4TnSqn+Q5ECP83Yh7gfUdYSIPzl7leV8WD5MKJFJw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpL23bFszjQ8; Mon, 19 Feb 2024 16:44:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGiwEd094615; Mon, 19 Feb 2024 16:44:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGiwBc094612; Mon, 19 Feb 2024 16:44:58 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:44:58 GMT Message-Id: <202402191644.41JGiwBc094612@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 72b242ac15af - stable/13 - arm64: Use the Linux sigframe to restore registers List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 72b242ac15af15bea2c6989bb911d2dd6ab11651 Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=72b242ac15af15bea2c6989bb911d2dd6ab11651 commit 72b242ac15af15bea2c6989bb911d2dd6ab11651 Author: Andrew Turner AuthorDate: 2023-10-25 09:50:11 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 12:41:40 +0000 arm64: Use the Linux sigframe to restore registers When returning from a Linux signal use the Linux sigframe to find the register values to restore. Remove the FreeBSD ucontext from the stack as it's now unneeded. Reviewed by: dchagin, emaste Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42360 (cherry picked from commit 070a4ff82a34652d533f9315ae9ad0aa8f1fdeb2) --- sys/arm64/linux/linux_sigframe.h | 1 - sys/arm64/linux/linux_sysvec.c | 96 ++++++++++++++++++++++++++++++++++++---- 2 files changed, 88 insertions(+), 9 deletions(-) diff --git a/sys/arm64/linux/linux_sigframe.h b/sys/arm64/linux/linux_sigframe.h index e903fea295dc..2a004f4db74d 100644 --- a/sys/arm64/linux/linux_sigframe.h +++ b/sys/arm64/linux/linux_sigframe.h @@ -76,7 +76,6 @@ struct l_sigframe { /* frame_record */ uint64_t fp; uint64_t lr; - ucontext_t uc; }; #define LINUX_MINSIGSTKSZ roundup(sizeof(struct l_sigframe), 16) diff --git a/sys/arm64/linux/linux_sysvec.c b/sys/arm64/linux/linux_sysvec.c index 4ceee760d80b..c6f9a934fc1d 100644 --- a/sys/arm64/linux/linux_sysvec.c +++ b/sys/arm64/linux/linux_sysvec.c @@ -205,28 +205,109 @@ linux_exec_setregs(struct thread *td, struct image_params *imgp, bzero(&pcb->pcb_dbg_regs, sizeof(pcb->pcb_dbg_regs)); } +static bool +linux_parse_sigreturn_ctx(struct thread *td, struct l_sigcontext *sc) +{ + struct l_fpsimd_context *fpsimd; + struct _l_aarch64_ctx *ctx; + int offset; + + offset = 0; + while (1) { + /* The offset must be 16 byte aligned */ + if ((offset & 15) != 0) + return (false); + + /* Check for buffer overflow of the ctx */ + if ((offset + sizeof(*ctx)) > + sizeof(sc->__reserved)) + return (false); + + ctx = (struct _l_aarch64_ctx *)&sc->__reserved[offset]; + + /* Check for buffer overflow of the data */ + if ((offset + ctx->size) > sizeof(sc->__reserved)) + return (false); + + switch(ctx->magic) { + case 0: + if (ctx->size != 0) + return (false); + return (true); + case L_ESR_MAGIC: + /* Ignore */ + break; +#ifdef VFP + case L_FPSIMD_MAGIC: + fpsimd = (struct l_fpsimd_context *)ctx; + + /* + * Discard any vfp state for the current thread, we + * are about to override it. + */ + critical_enter(); + vfp_discard(td); + critical_exit(); + + td->td_pcb->pcb_fpustate.vfp_fpcr = fpsimd->fpcr; + td->td_pcb->pcb_fpustate.vfp_fpsr = fpsimd->fpsr; + memcpy(td->td_pcb->pcb_fpustate.vfp_regs, + fpsimd->vregs, sizeof(fpsimd->vregs)); + + break; +#endif + default: + return (false); + } + + offset += ctx->size; + } + +} + int linux_rt_sigreturn(struct thread *td, struct linux_rt_sigreturn_args *args) { + struct l_rt_sigframe *sf; struct l_sigframe *frame; - ucontext_t uc; struct trapframe *tf; + sigset_t bmask; int error; + sf = malloc(sizeof(*sf), M_LINUX, M_WAITOK | M_ZERO); + tf = td->td_frame; frame = (struct l_sigframe *)tf->tf_sp; + error = copyin((void *)&frame->sf, sf, sizeof(*sf)); + if (error != 0) { + free(sf, M_LINUX); + return (error); + } - if (copyin((void *)&frame->uc, &uc, sizeof(uc))) - return (EFAULT); + memcpy(tf->tf_x, sf->sf_uc.uc_sc.regs, sizeof(tf->tf_x)); + tf->tf_lr = sf->sf_uc.uc_sc.regs[30]; + tf->tf_sp = sf->sf_uc.uc_sc.sp; + tf->tf_elr = sf->sf_uc.uc_sc.pc; - error = set_mcontext(td, &uc.uc_mcontext); - if (error != 0) - return (error); + if ((sf->sf_uc.uc_sc.pstate & PSR_M_MASK) != PSR_M_EL0t || + (sf->sf_uc.uc_sc.pstate & PSR_AARCH32) != 0 || + (sf->sf_uc.uc_sc.pstate & PSR_DAIF) != + (td->td_frame->tf_spsr & PSR_DAIF)) + goto einval; + tf->tf_spsr = sf->sf_uc.uc_sc.pstate; + + if (!linux_parse_sigreturn_ctx(td, &sf->sf_uc.uc_sc)) + goto einval; /* Restore signal mask. */ - kern_sigprocmask(td, SIG_SETMASK, &uc.uc_sigmask, NULL, 0); + linux_to_bsd_sigset(&sf->sf_uc.uc_sigmask, &bmask); + kern_sigprocmask(td, SIG_SETMASK, &bmask, NULL, 0); + free(sf, M_LINUX); return (EJUSTRETURN); +einval: + free(sf, M_LINUX); + return (EINVAL); } static void @@ -328,7 +409,6 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) } memcpy(&frame->sf.sf_uc.uc_stack, &uc_stack, sizeof(uc_stack)); - memcpy(&frame->uc, &uc, sizeof(uc)); /* Copy the sigframe out to the user's stack. */ if (copyout(frame, fp, sizeof(*fp)) != 0) { From nobody Mon Feb 19 16:44:58 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpL32kQJz5C9MT; Mon, 19 Feb 2024 16:44:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpL30fhwz4b3R; Mon, 19 Feb 2024 16:44:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361099; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GdfSLUejTRsaMsFva3YVEE6etnNpOdndTygx4KryYZw=; b=VM+iBFwtSa+ImDovAW01aYdMV+jThbD56JEEIwByfYr++7TNPSLeD6uiQ//2sKtRs7vnsK lPJc3su5Ra0dRa6sXMtWZVvk5uNOViM+4/NBYVwiaJJxRfHjFxGu17hNu9ee2HTuUua6Vx W4GO3dCp/FB91Nbq3BDtpV3TVF7dNDQVuGuieLL65cu6E5N8IVg93cixzKAE4l6lVo7a1N nl8rLT0KSB3Br7tCu6F921SvuseNF4TzAwO1Hy++YGk0NZ0WXjeyRZxfGYE5d7ivZXqKt4 /p53n9hbvU4ZqyXIMxxxwZBZbqGXGQQ5M9iR348ePLTRTErxXiLR+9K+vrtsjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361099; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GdfSLUejTRsaMsFva3YVEE6etnNpOdndTygx4KryYZw=; b=eb6bPtzjj3TN+pru6XalsTLEe5xLncbJsURTuV6VSHcXn2+g3sMuzOTyDOeR0ZQkhrLanU tSq/sMUVwJZFEx/whEGHP0UBTK87kASiL+W0/oJzRecPZvsvWhDSQ4+P9nljVfnxRGA7M2 Q7CwGSqWLSzFuL3U0uB+ybyGsQVi2YzpZnIqEWu3w2oPxavGPM4tuIDrKGhvDLRK9aRg5W 2BMozLcZfUJHTClst3U/tX4z0LMNF7ALCciAd8hICg6+ELyN8fdxOQaAjJfeYBrv0+sQtJ ha2A42PiNljUXjnf5x+r/08XnAYWnVDxlZrr1A4MQxIxg5cnF6y4JnphKwchhA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361099; a=rsa-sha256; cv=none; b=OjvKC/Lj3NSPd/9xXQ28qsTYhJj7Vnmqt6AtUGlyTsaUleEwuxPBbTJtwxXc0Gc81G04VC c2ITCMeeS1p8wNwgkmG3Q9Ix6QEyGmBvXuTsrqD2WVC8229SjZ1KPhEI9Ze3k2ekXUuQT7 5j4gvQYM+vgaQAmEsEYOd+Y7uKr96K65p9DV7xzHgEM6whnAJDaNujqN6lJXhR15CUT5cz Gwh0ylVMnQY0chqEl8YNolcAFwEtWh8MVzVPlQEt4dRbGmgl82ih5XQEHAPeInFO2+UDry HJl1D03Sjy7NBsXkSkPIhNgnXpD4gkx7RQIN/ib//YqCjjYE5bKW9ZGCy9hVbg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpL26t4kzjDM; Mon, 19 Feb 2024 16:44:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGiwmb094672; Mon, 19 Feb 2024 16:44:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGiwad094669; Mon, 19 Feb 2024 16:44:58 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:44:58 GMT Message-Id: <202402191644.41JGiwad094669@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 7a64b05196bb - stable/14 - arm64: Fix the TCR_TBI0 macro to use UL List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 7a64b05196bb713fb8ad48ebcbd251d0baae036e Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=7a64b05196bb713fb8ad48ebcbd251d0baae036e commit 7a64b05196bb713fb8ad48ebcbd251d0baae036e Author: Andrew Turner AuthorDate: 2023-09-08 13:27:15 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 13:08:12 +0000 arm64: Fix the TCR_TBI0 macro to use UL This needs to be 1UL to ensure the type is large enough for the shift. Sponsored by: Arm Ltd (cherry picked from commit aea540538991dd9e8cf21c6ca06e09f706bf2d18) --- 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 034504727b39..3ae2f24c2a56 100644 --- a/sys/arm64/include/armreg.h +++ b/sys/arm64/include/armreg.h @@ -2127,7 +2127,7 @@ #define TCR_TBI1_SHIFT 38 #define TCR_TBI1 (1UL << TCR_TBI1_SHIFT) #define TCR_TBI0_SHIFT 37 -#define TCR_TBI0 (1U << TCR_TBI0_SHIFT) +#define TCR_TBI0 (1UL << TCR_TBI0_SHIFT) #define TCR_ASID_SHIFT 36 #define TCR_ASID_WIDTH 1 #define TCR_ASID_16 (1UL << TCR_ASID_SHIFT) From nobody Mon Feb 19 16:44:59 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpL41G8rz5C93x; Mon, 19 Feb 2024 16:45:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpL35WRRz4bKB; Mon, 19 Feb 2024 16:44:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361099; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hvm1cX/vqcIpYmPShKQCQ93CwLXVZAkbgfOJ/bsJr7A=; b=fIxk3AkvQVwFBw1yqNqYMMjKsmMrkSVhnWbLK6HXNC1AT5IHZP2Gs8oSAMR9G4iCgQfnxq OIpd7uuenVO36EIU84/xdH2WcyQDd7boL61g+1q9RhqIbkvVpX0utuoDK2FFk3bu2wGHpB 6a3i1wNVveGA6xu/hINy6sYxBWwZU+QbmI2XF+0gTe+MoVef8+vzieyhG41Od/kvawv+e3 0DsaN8sJfrFiHreCgTxwNOyS3RHH/2A3IINhpU6GxGw2LN1btf7RkBC0LRKFyvOrETf8dJ 3MQQgk9uGN0GSQ3hx3Q91r8QH7NQ1qV7Ss8mEc0KcavcBjVXDMbkDVockAHlBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361099; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hvm1cX/vqcIpYmPShKQCQ93CwLXVZAkbgfOJ/bsJr7A=; b=FNhQRnyVL9Neeq3xS+MndCAfCEYS3EMVJa10WPaDOJ069v6VtiGKSL2mmwTlu1/w6U/SrH pD10obyHjDMus0vcI5OS9rdd+Z1kqcmXRZJXgg9VNVthOT/Xd3TWigiNFO6kd4HAD+yXP7 qNh5YzNLk785yXsCHp+WLx6OsRz5wIDI8qMdVmZicH7UYe47xNTE4lfDqcYCNzU3noEdMJ tXDMQQxRUx4HstpvMGuGF0vwW8Fyh8xBq7dV2gXLo6ZsQsd4wSsoQwSK+MHtfavoykyGaa bSk0RbQYmXpUXrw9eSjfAzry8NMakYK7x3qbBtk9k1E9okp8XC6BE0u9PCl/lA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361099; a=rsa-sha256; cv=none; b=StpKNWZNJe4jftsN63shlU/PH0AFzoMH1bY5C/d+Db9S0oQB99Ew7xxpfYYkCfx2Mkm7ZN EBVVwZR44XGAstnHnOGJBHulhG9IucGH4WhcCZrpXNW5gtLVKZTyqwcvL9VdyeHX3v4ig7 dGdwHMjWAYZUrYtBXZznoEgf8DNfbxJwPWH0Ll89Lb2ivQzf6/tkoUxMfENZR4emBQftoz 2o9iYiFkggJI/S7+kTh629HFMt1MlOfnKJC+jbFru+ugG/kgqVg/nDY6QXvZ6uGuAw7ysr UAXHUdzONBAq4ofV3WDVhxRd8Rarbje3vJqiV0bVj4GC8smOTzZYJ6EfUYHx2Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpL34bwRzjGq; Mon, 19 Feb 2024 16:44:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGixdo094726; Mon, 19 Feb 2024 16:44:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGixSf094723; Mon, 19 Feb 2024 16:44:59 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:44:59 GMT Message-Id: <202402191644.41JGixSf094723@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: adb7f221a25e - stable/13 - arm64: Add a BTI landing pad to .mcount List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: adb7f221a25e466371e6b098dc6dd72b8f28f2c1 Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=adb7f221a25e466371e6b098dc6dd72b8f28f2c1 commit adb7f221a25e466371e6b098dc6dd72b8f28f2c1 Author: Andrew Turner AuthorDate: 2023-10-16 14:34:19 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 12:41:50 +0000 arm64: Add a BTI landing pad to .mcount The .mcount function needs a BTI branch target. As we can't rely on asm.h being included use the hint version of a "bti c" instruction. This is a nop when BTI is not supported or not used. Reviewed by: markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42230 (cherry picked from commit 0590ed0967e025e1d155da9e06509f3fe9686feb) --- sys/arm64/include/profile.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/arm64/include/profile.h b/sys/arm64/include/profile.h index 972d4ba42607..db119973f820 100644 --- a/sys/arm64/include/profile.h +++ b/sys/arm64/include/profile.h @@ -93,6 +93,8 @@ static void _mcount " .globl .mcount \n" \ " .mcount: \n" \ " .cfi_startproc \n" \ + /* Allow this to work with BTI, see BTI_C in asm.h */ \ +" hint #34 \n" \ /* Load the caller return address as frompc */ \ " ldr x0, [x29, #8] \n" \ /* Use our return address as selfpc */ \ From nobody Mon Feb 19 16:45:00 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpL44hDSz5C9Cc; Mon, 19 Feb 2024 16:45:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpL41g4jz4bGw; Mon, 19 Feb 2024 16:45:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361100; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fE9fE968x5brVpZWFVmfF8gYq1IVxJVvgirmw7WUjww=; b=yebP7B53bpR6Vwnzh+8k2EvYxoT6dMTdAbQ84a5IJbpp+AkeqbcdiBU1twxWi2hH9JEFgL YHs0qpLVLfyhdLqIeJq7XE7P+F3RRPwJdRCFdeY77USE1gq2IjtEqNgFGQHm9CtZF/19uZ 8MiO21UuG9qYvNbgWLefvOVxwn9HYvWsnVlez7UljQB+JMCnpmSFBT9FydFiEfW1e8r3Dn ya10icX19Tw6eJFwsmimZ32Y7hDs03B/JRxBuiI0FkpL7f0C+TDCDjeKMf2VUT5d9hC0S5 +JyqW6UdQU8lGZyxf97GDdu+yP+dJt6YEaxOEW5ls3cIcRmcYhGonxVQqC6R7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361100; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fE9fE968x5brVpZWFVmfF8gYq1IVxJVvgirmw7WUjww=; b=PYBTxJFM2XtJxqd6ipwlhqnppfadUSby5bkz6ZzndIm+0kGhMwY2+J6B4t8cH73WaD32mk vhFJVx3ehfYaMgdEHb2F3ZguSfw25p7DzKNSqBqjgKw+kS2sjgmJL65NhmdlEXivzwZKfW IANQpVoKmDuYELqHYXOkAJNUPq2NqcGjsLEw3tG6PWpccliXlzBXPiLwgBTDm07cIG8ZpO AVmlczsRMRBBwwr2XhWiljCRC8aNOSDCKsniXZjIL1MdURzlelIIhpglgR55LdyQcDw20E ebhul4XJvvCrocKZ8pX2KIYygDyQenSUkMPmVy0FZVmYXnBKdaNnAxuBHw2pkA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361100; a=rsa-sha256; cv=none; b=xkNh8bZMgtMngZEPKSzxlVwwVonDc0EyjiipHMZdmo1nQX9hHmykzbnXVBpqmgSDYatxTV 6mTpvXa+u5R/RC5ywhfNukNzuJ81cE6WOSCPbBPt/n/g5xF3QYYDVsGzPGMiPTaWKYcj03 om1hhRyedCBngytYPAs/ZW0xdTyAalN6XBlaf069l6QTalcKZCrD/qf+kKGPty95PCcQhS 6+HR9+Cxofn1PauzonWW+3/YPeqzRnchV5+e8xWgkEq/odXLRnzMJnf1UpgLAof9CIqRES 6dUFivNh8t0qRDhSjsbjrX+F3nl2idIUes75ZdVbyEH5NJClssFtooez/Gz4yg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpL40lzRzjGr; Mon, 19 Feb 2024 16:45:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGj0N1094780; Mon, 19 Feb 2024 16:45:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGj02s094775; Mon, 19 Feb 2024 16:45:00 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:45:00 GMT Message-Id: <202402191645.41JGj02s094775@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 94f23ae15a80 - stable/14 - arm64: Add TCR register masks List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 94f23ae15a804a18ef719152d81bbe965feb3fed Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=94f23ae15a804a18ef719152d81bbe965feb3fed commit 94f23ae15a804a18ef719152d81bbe965feb3fed Author: Andrew Turner AuthorDate: 2023-09-08 13:29:19 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 13:08:27 +0000 arm64: Add TCR register masks These will be used by bhyve to implement page table walking. Sponsored by: Arm Ltd (cherry picked from commit a35e47369f88e8c2e14b7371a1a5e1152680551f) --- sys/arm64/include/armreg.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/arm64/include/armreg.h b/sys/arm64/include/armreg.h index 3ae2f24c2a56..8251a687a5d1 100644 --- a/sys/arm64/include/armreg.h +++ b/sys/arm64/include/armreg.h @@ -2141,6 +2141,7 @@ #define TCR_IPS_44BIT (4UL << TCR_IPS_SHIFT) #define TCR_IPS_48BIT (5UL << TCR_IPS_SHIFT) #define TCR_TG1_SHIFT 30 +#define TCR_TG1_MASK (3UL << TCR_TG1_SHIFT) #define TCR_TG1_16K (1UL << TCR_TG1_SHIFT) #define TCR_TG1_4K (2UL << TCR_TG1_SHIFT) #define TCR_TG1_64K (3UL << TCR_TG1_SHIFT) @@ -2155,8 +2156,10 @@ #define TCR_A1_SHIFT 22 #define TCR_A1 (0x1UL << TCR_A1_SHIFT) #define TCR_T1SZ_SHIFT 16 +#define TCR_T1SZ_MASK (0x3fUL << TCR_T1SZ_SHIFT) #define TCR_T1SZ(x) ((x) << TCR_T1SZ_SHIFT) #define TCR_TG0_SHIFT 14 +#define TCR_TG0_MASK (3UL << TCR_TG0_SHIFT) #define TCR_TG0_4K (0UL << TCR_TG0_SHIFT) #define TCR_TG0_64K (1UL << TCR_TG0_SHIFT) #define TCR_TG0_16K (2UL << TCR_TG0_SHIFT) @@ -2170,7 +2173,7 @@ #define TCR_EPD0 (1UL << TCR_EPD0_SHIFT) /* Bit 6 is reserved */ #define TCR_T0SZ_SHIFT 0 -#define TCR_T0SZ_MASK 0x3f +#define TCR_T0SZ_MASK (0x3fUL << TCR_T0SZ_SHIFT) #define TCR_T0SZ(x) ((x) << TCR_T0SZ_SHIFT) #define TCR_TxSZ(x) (TCR_T1SZ(x) | TCR_T0SZ(x)) From nobody Mon Feb 19 16:45:01 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpL56NHwz5C995; Mon, 19 Feb 2024 16:45:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpL52c0vz4bHB; Mon, 19 Feb 2024 16:45:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361101; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=41DyVDRVWmibXXmHxWtxCj7ndKCswhyR0AOpeoj+Mpw=; b=l6Q5/yHMMCy+Gyw9+oACirNZ5XRGdJcVElkwtYnludR7a3b163IUijNQQrFdVjPsxQ1sJq 5QBfH8Arx3gKmX9jFgWB2VIZmYHpS1O3XYZpkC2P4HuWFFzP/oscZqj8NL/LAumyPlW3Cv OiQtSKxMJaeY9XuiRwqjnzDG4crTVqT/RE+tOySPdCjERz1opJ8FC9Ptp653RdUhEuwz2T CPhmeGQvUXLrjx8xeG9pkYIjhnoozl/wMGHt1vS/taD5eTtLqP5i4GB4Lh6h0FwJbrtGp+ ZZz5uQo+FFt9LzfRYGOtWZIYZ0Nzrj6hKk4TREDecs3QGQ83BQtw0Ql+/285Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361101; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=41DyVDRVWmibXXmHxWtxCj7ndKCswhyR0AOpeoj+Mpw=; b=GvVpH3BnmQGTi/lSF5+1NmVRPHvaemcqpr4r786ca42v5fe46KmZu93EPHkh7CfUJ21S1c 4GTefelfQe3FJAczcvncp4Q4DOZvKl/RlgX4J+91sBYjmehIEDg/h2K+nc3UbYDcmP0klH f04JYzJCVmrzStK4Bo36164SYa+axCB4rQEGRNUElFsmKUTMcLDUgPcivGjE+CeB71Fo1a HuO0Kja0tXt5dvNBc/+lPy3EnY4ISmRLNN/rq+hvF5Drfhohagraf8aQb7RxIFuj4lmp+n am2eqzwW2R9sdF13004PRKYsM7abUn/4Zc12XTROCkRbp0QnJGUCfuZYXoYMBQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361101; a=rsa-sha256; cv=none; b=UQmOze8ZbUbNZHR/xqwf/D19/vi/ptuIV/N0cR78s3fPcvZAyOTGQDmNnaTajAErHCHVlR v2uF2dHkmK/ha5AgXm1/cwrb/SghUjBySWir6VVwaXgW6H6m44PlD2oe9RYDa5rBJOA0df 6V3KvsMM5cKyilGK8mA7CkVjuj5c6+fPHR6ymztsxkXxWt92I0gvs9NXezlsllgBzUyG9g I333gtqy1tww6tCDnddixtdI2AkQAOZimwKtW+oY1Pb6SEoy33xEYkHMEZ48IXuBDBJ/Jt l0jK6hGiJSXSil67zw2bFaiU8k81hS/Y8ME6SklXuyJyCepCazjvgNIS+yEh3Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpL51kBVzjVT; Mon, 19 Feb 2024 16:45:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGj1SV094868; Mon, 19 Feb 2024 16:45:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGj1WO094865; Mon, 19 Feb 2024 16:45:01 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:45:01 GMT Message-Id: <202402191645.41JGj1WO094865@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 15ef78831eb0 - stable/14 - arm64: Export HWCAP_CPUID List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 15ef78831eb01a0e42317f7b6f03a227fae89e9d Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=15ef78831eb01a0e42317f7b6f03a227fae89e9d commit 15ef78831eb01a0e42317f7b6f03a227fae89e9d Author: Andrew Turner AuthorDate: 2023-09-22 16:20:17 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 13:08:35 +0000 arm64: Export HWCAP_CPUID We have export the CPUID registers since 2018 but never set the HWCAP_CPUID flag to tell userspace it could use them. Fix this by setting it. Sponsored by: Arm Ltd (cherry picked from commit d61f9bfb0e5c119c97a559f187b1e9c73077307b) --- sys/arm64/arm64/identcpu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c index 1e9ff32754f0..4202cbe7878f 100644 --- a/sys/arm64/arm64/identcpu.c +++ b/sys/arm64/arm64/identcpu.c @@ -2203,6 +2203,8 @@ identify_cpu_sysinit(void *dummy __unused) /* Find the values to export to userspace as AT_HWCAP and AT_HWCAP2 */ parse_cpu_features(); + /* We export the CPUID registers */ + elf_hwcap |= HWCAP_CPUID; #ifdef COMPAT_FREEBSD32 /* Set the default caps and any that need to check multiple fields */ From nobody Mon Feb 19 16:45:00 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpL507hbz5C9F6; Mon, 19 Feb 2024 16:45:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpL46WqJz4b41; Mon, 19 Feb 2024 16:45:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361100; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xr7qUvAxM7QKJXUKfYQp/j9T6s8FyKtDLsPGH6nAAm8=; b=IazDMQEJJKr0kuP3ENfqPk32/UtpD0a89tcjA85K6bb3ba4whbIsDeH+lX/Vha8FTyNzdp Ksw8Jm3j3YG5YQEbotct2ooey+zz+YDMt3PVpMoeTM9MURIGW8q4lxVT7ARFCWl4brRBFs a5SUUhf6g27GAEsBUEIdYXLRc6D3LB7SFd95EBGO0YosFE5APJ4dFKyvr5Ru9Vjlae3tkP f/0Tj2BRATov7QflT1OFlff+M2wT3j4yShN6uoge33UQrUiur3k4oOQC/RRcnzoMZPXaz/ qzuh8KtdGE+Jm44jJJX+8WPU2Uq3pF94GcpGHCy+TxphN4RS1t93Wb6nMLukBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361100; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xr7qUvAxM7QKJXUKfYQp/j9T6s8FyKtDLsPGH6nAAm8=; b=EQmh5pfdNzsJdClO6sB/YA3YFdn6OvK3lj11tJBfb/yPia/NDFmrt+9VNxyZ08Ysbz3Jav 97XidgIv10I8RcZOLZfPc88AIFpmsR+ZaaQ1zKbNuruOUEQlDOdECYMwbwa7Z2mlMc+d5c oE7ddtVSqCQ+GSHTnUZZ4+rqxC4J4kZe8WHpESOJ4cW5Ul/P4GiZDjspJo9GhHXymmuL+m 36GVafSX4Zwj0/tjtZtMgcunjgHS9/oWkYTuEQ9xdTLo+uuuMa3pks4LvBksPexa15fFIw eeFbX5/X+Jtp9Ua0VXXU0bGjqruGdsy4RzWrDVUQl5wLp9uqQ8w1472wpX90Yg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361100; a=rsa-sha256; cv=none; b=nCyasNEjHmDe+5wsm0/A541mRactxKStgvpvcK/AFyMVe2ssX8lIwzldOCdIxXVQXafjSd L5gbtocJUjIRKYAKEuL8peCEZWC6vxF860fbeLe3dpOXl19OEFHiiuhE3e1MydpsjjhoFb Kq/jvYhr2VQyWPNgq61DpWPP1cqU+pvfolTuaPAqiUSiWOjzu07foaIX8BBks/fFTKj+bq x9bYsGG2IGOfQUwpBLB5GhyVcgiNzzLSPvJjyCF2FZ68yfiI2KZcaY2MthS21bJDZ2Yy75 6ShKYbLQdL08V/sLzCcAqDhWh6i5pPXrrUJM25qLLauFmX79I3biP/j/Uk3R4w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpL45c2YzjSP; Mon, 19 Feb 2024 16:45:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGj019094832; Mon, 19 Feb 2024 16:45:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGj0Pg094829; Mon, 19 Feb 2024 16:45:00 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:45:00 GMT Message-Id: <202402191645.41JGj0Pg094829@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: a2061845faf0 - stable/13 - imgact_elf: Move GNU_ABI_VENDOR to a common header List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: a2061845faf0711fd2437b7123acaa27d338cb3e Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=a2061845faf0711fd2437b7123acaa27d338cb3e commit a2061845faf0711fd2437b7123acaa27d338cb3e Author: Andrew Turner AuthorDate: 2023-11-01 15:05:58 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 12:43:42 +0000 imgact_elf: Move GNU_ABI_VENDOR to a common header Move the definition of GNU_ABI_VENDOR to a common location so it can be used in multiple files. Reviewed by: emaste, kib, imp Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42442 (cherry picked from commit 9d2612fc2a7e54719058c68b62ea035b029c954f) --- sys/kern/imgact_elf.c | 1 - sys/sys/imgact_elf.h | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index cae1889bc4c5..b27129a555c4 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -240,7 +240,6 @@ __elfN(freebsd_trans_osrel)(const Elf_Note *note, int32_t *osrel) return (true); } -static const char GNU_ABI_VENDOR[] = "GNU"; static int GNU_KFREEBSD_ABI_DESC = 3; Elf_Brandnote __elfN(kfreebsd_brandnote) = { diff --git a/sys/sys/imgact_elf.h b/sys/sys/imgact_elf.h index 349161a66c48..b0cb6f9fcce7 100644 --- a/sys/sys/imgact_elf.h +++ b/sys/sys/imgact_elf.h @@ -101,6 +101,7 @@ __ElfType(Brandinfo); #define MAX_BRANDS 8 #define FREEBSD_ABI_VENDOR "FreeBSD" +#define GNU_ABI_VENDOR "GNU" typedef void (*outfunc_t)(void *, struct sbuf *, size_t *); From nobody Mon Feb 19 16:45:02 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpL70Flnz5C9Mk; Mon, 19 Feb 2024 16:45:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpL63ZRwz4bKp; Mon, 19 Feb 2024 16: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=1708361102; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AeFqNIJND9OxWaD7TtAbvNws2RCRphvahP0xkwRHFdg=; b=tInWsyDCDkRwur+DFY9w2U+t21Hx+t3RCErs3dbAYpUMvUmTBGgXDVqc7MPTM51Z8/XjiK 4ZuzWFEaR77qKQwzKzg0bfAVqtqV8K0e9cqygN4nBPY3ZhRzY4j+6xcneSel+LZQXrzxMe KFvL9N+2kic+cYtyoG/oH2AR0KpCw0MzjOmFIBVItdFCjQZN+VCXaxsijtUm9qb/cm2G9N FioZ73dw+8Tg5pPUpAw7XA8Fo/NtxLKS5j1HvFolWzLvArbQ2Wz3mLwU4eY+osOHzb6cjQ pXT5fvwK1Gj8FN+kC+3UnbgD9bC34Vaj4BrAUSMVQWRAV5nX1qbWqzwFZxDrug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361102; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AeFqNIJND9OxWaD7TtAbvNws2RCRphvahP0xkwRHFdg=; b=dWWu5rYrcvFw5NURBlm3DjwXEsZcRZNP/Eorg9rlg/jbeF0yYz9Ys0ixSj6RtvzXEVnA0Y zTwT4EFyv3JFUAWI+QB+uJKRjZmQESza0Xzkefhzu/QLkGrzVnCfJpRjHuh2Cc16AO6/8n DZpF2U8Sr91TXIAM9uJTE8nFZCRB5VRttuD5kldDXqZYsVk8V6kyCxi/f0fv3Ar1momtzq YyvcycmPvj8k/GAzW2KnTEkykQEEquy52T95MC9OuX+w8//SrVsutMtWAoFMGnHYFTeDVT 5P881Abnvz3vQea6kY5tCYczuRJw1dxsCon6+BJN0NrGMB7tCiX9qvSxW6Wapg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361102; a=rsa-sha256; cv=none; b=uiimR48PnmuyCqr08+UnzBynPWLFMkfTuCo/fIWr3IJm9c+JIWxOhSvK4b5NgFk/TCgt14 Xr7eUfocBrmObHohu0GCV8gUUw1JdbAI2D/Sat1HSMg8zPbM5JdCk3KbQff1FpGNMS7o7q HmCJIwOX7H6K5hBVAntuvF7tny3U/+43HsrC4M8lOlb5B5EIJnVxrhGVNqbSsZShaw5kXj a8jbEBmyTLULkbkodiYEEIziVfKyea/CskrsYl7IA1NQjWp7+sA9rkR1WIjOYkwtyDpa2z kMZS8H69bYlmq9VPrBQ6QVIHNBL/MgCC6jr2aRWBgegqpxWrR+COBCyctO/ueA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpL62hXSzjVW; Mon, 19 Feb 2024 16:45:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGj2N4094960; Mon, 19 Feb 2024 16:45:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGj2lV094957; Mon, 19 Feb 2024 16:45:02 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:45:02 GMT Message-Id: <202402191645.41JGj2lV094957@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 3e3e2ce55be3 - stable/14 - Add BTI exceptions List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 3e3e2ce55be3c8c9d1f2f83523a403332e747e16 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=3e3e2ce55be3c8c9d1f2f83523a403332e747e16 commit 3e3e2ce55be3c8c9d1f2f83523a403332e747e16 Author: Andrew Turner AuthorDate: 2023-04-05 12:28:46 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 13:08:50 +0000 Add BTI exceptions We could hit these when executing code marked as using BTI but jumps to a non-branch target instruction. Sponsored by: Arm Ltd Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39450 (cherry picked from commit 450f731b7f2351d475b43bbc6234eea28adfd2b0) --- sys/arm64/arm64/locore.S | 2 +- sys/arm64/arm64/trap.c | 10 ++++++++++ sys/arm64/include/armreg.h | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index ac925f13f069..0c3a512cf671 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -879,7 +879,7 @@ sctlr_set: .quad (SCTLR_LSMAOE | SCTLR_nTLSMD | SCTLR_UCI | SCTLR_SPAN | \ SCTLR_nTWE | SCTLR_nTWI | SCTLR_UCT | SCTLR_DZE | \ SCTLR_I | SCTLR_SED | SCTLR_SA0 | SCTLR_SA | SCTLR_C | \ - SCTLR_M | SCTLR_CP15BEN) + SCTLR_M | SCTLR_CP15BEN | SCTLR_BT1 | SCTLR_BT0) sctlr_clear: /* Bits to clear */ .quad (SCTLR_EE | SCTLR_E0E | SCTLR_IESB | SCTLR_WXN | SCTLR_UMA | \ diff --git a/sys/arm64/arm64/trap.c b/sys/arm64/arm64/trap.c index 12f43e01630a..2dda8cfc4c20 100644 --- a/sys/arm64/arm64/trap.c +++ b/sys/arm64/arm64/trap.c @@ -559,6 +559,11 @@ do_el1h_sync(struct thread *td, struct trapframe *frame) panic("Undefined instruction: %08x", *(uint32_t *)frame->tf_elr); break; + case EXCP_BTI: + print_registers(frame); + print_gp_register("far", far); + panic("Branch Target exception"); + break; default: print_registers(frame); print_gp_register("far", far); @@ -699,6 +704,11 @@ do_el0_sync(struct thread *td, struct trapframe *frame) (void *)frame->tf_elr, exception); userret(td, frame); break; + case EXCP_BTI: + call_trapsignal(td, SIGILL, ILL_ILLOPC, (void *)frame->tf_elr, + exception); + userret(td, frame); + break; default: call_trapsignal(td, SIGBUS, BUS_OBJERR, (void *)frame->tf_elr, exception); diff --git a/sys/arm64/include/armreg.h b/sys/arm64/include/armreg.h index 8251a687a5d1..953c9af220b9 100644 --- a/sys/arm64/include/armreg.h +++ b/sys/arm64/include/armreg.h @@ -408,6 +408,7 @@ #define EXCP_UNKNOWN 0x00 /* Unkwn exception */ #define EXCP_TRAP_WFI_WFE 0x01 /* Trapped WFI or WFE */ #define EXCP_FP_SIMD 0x07 /* VFP/SIMD trap */ +#define EXCP_BTI 0x0d /* Branch Target Exception */ #define EXCP_ILL_STATE 0x0e /* Illegal execution state */ #define EXCP_SVC32 0x11 /* SVC trap for AArch32 */ #define EXCP_SVC64 0x15 /* SVC trap for AArch64 */ From nobody Mon Feb 19 16:45:01 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpL6116Fz5C9KB; Mon, 19 Feb 2024 16: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpL603m2z4b6f; Mon, 19 Feb 2024 16: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=1708361102; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qwYIr8JEg++5GcfHw52ZNoalxR2QxAAL3WCmlNWUqrg=; b=s9uidh9VA/gSMYtmlEbtMbm45CAMPXCZi/zW5bylWNYDl9RH+UVOHijd35Ox4XMweJc2Z6 WyEIs3OyjM5T9hqkNI0Z+zuQG//cpigH7S7yMGH/UlA8deE2+SNLZ3C424cPZ/TcA8+YjY 3bty1uWyHelZ6SYkRFwg2SO4JtSMrIxOVV0CQ4gAvsaGqNbf1Cm43AbzLh6uZoJ4jimGHd Jr88Ghv4fZM/oBemkt5mwRhdomAGuVCpBCE9YuJe9SVtFdz3PR8EKdwQwcVPL+lxNd62uo qmhE1Yf9bIZ3JPT5dpy9b6HXs9QlEPs38NoCIRqzazCSIYJZMh72+HBeQFmWTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361102; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qwYIr8JEg++5GcfHw52ZNoalxR2QxAAL3WCmlNWUqrg=; b=SE5btQ6oq+5fUcVktCV888GowmtTLZY1kEV6gqPdH30nffg5SfF3Aat4lg1oZOAMa2Boc9 nK9IXLs1sd+05W/kXcYN4nY2JoOkUCxRaS48kD4IKiEaMPVmhR3tPNuVh3NFF1R77MOk/q 7DuDx4YI1Q8p1NjDPyiLn1gXkzubS7badhtSoXo8TOYW+ITttOmhmFiS2Lm4bygUlFpf35 HJr44YB7g/l3mi3LiyIxatC6w9H0pHsCOIvtM9cxKbpjm2+u0DEbI6m9XwIkzYL7buA7LW tsWw7xtbVp6shoTrk9sm2JA/UnKah0i+NOFg4jaS/C3Je8rEReMYKrl7kfUEgQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361102; a=rsa-sha256; cv=none; b=jMWkpHmiDYp/1dBlGcA6ubVB+9p6pE6viNrbnyFCZQ+WcHl2WTcZavzVAPEWnNTeAaZm6A NLyKFzNC07UF2WVSkwhDDhMkNxtGDUad5F1LCepoFhy1aHfZdNKK6l4QBnPmXDDHV9BLY4 EkoYP0C3sYiVVv+wiCPzem6QOKJFHZhNyk1MyOLJdpfEuHhrdGiJglqlfQ/URMj8kyvFZA jQC7F5BOoqLi6+mpDiA0Iuk9biDhwP9HxZ0Rph+pCQpawbo3DYuQsvqQcE6w16gg9O+XF7 zwperk1HCB5yvPxe4++IF3G9e7HZuuZXPX9m9izKKvc1CgEotV11z336iuKg0w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpL56FXXzjVV; Mon, 19 Feb 2024 16:45:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGj1L6094924; Mon, 19 Feb 2024 16:45:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGj1fI094921; Mon, 19 Feb 2024 16:45:01 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:45:01 GMT Message-Id: <202402191645.41JGj1fI094921@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 9aa63df3dbe5 - stable/13 - arm64: Expand HWCAP2 to be 64 bit List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 9aa63df3dbe5a043d699043087ac8c01c5f28305 Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=9aa63df3dbe5a043d699043087ac8c01c5f28305 commit 9aa63df3dbe5a043d699043087ac8c01c5f28305 Author: Andrew Turner AuthorDate: 2023-10-27 10:24:55 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 12:43:55 +0000 arm64: Expand HWCAP2 to be 64 bit There are more than 32 arm64 HWCAP2 values. Expand the macros to include leading zeros and mark them as unsigned long. Reviewed by: manu, imp, emaste Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42378 (cherry picked from commit 0f0938800989dbf84a56c370db0b9379ee730a39) --- sys/arm64/include/elf.h | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/sys/arm64/include/elf.h b/sys/arm64/include/elf.h index 752c9e83ca19..81cee5700ed5 100644 --- a/sys/arm64/include/elf.h +++ b/sys/arm64/include/elf.h @@ -129,24 +129,24 @@ __ElfType(Auxinfo); #define HWCAP_PACG 0x80000000 /* HWCAP2 */ -#define HWCAP2_DCPODP 0x00000001 -#define HWCAP2_SVE2 0x00000002 -#define HWCAP2_SVEAES 0x00000004 -#define HWCAP2_SVEPMULL 0x00000008 -#define HWCAP2_SVEBITPERM 0x00000010 -#define HWCAP2_SVESHA3 0x00000020 -#define HWCAP2_SVESM4 0x00000040 -#define HWCAP2_FLAGM2 0x00000080 -#define HWCAP2_FRINT 0x00000100 -#define HWCAP2_SVEI8MM 0x00000200 -#define HWCAP2_SVEF32MM 0x00000400 -#define HWCAP2_SVEF64MM 0x00000800 -#define HWCAP2_SVEBF16 0x00001000 -#define HWCAP2_I8MM 0x00002000 -#define HWCAP2_BF16 0x00004000 -#define HWCAP2_DGH 0x00008000 -#define HWCAP2_RNG 0x00010000 -#define HWCAP2_BTI 0x00020000 +#define HWCAP2_DCPODP 0x0000000000000001ul +#define HWCAP2_SVE2 0x0000000000000002ul +#define HWCAP2_SVEAES 0x0000000000000004ul +#define HWCAP2_SVEPMULL 0x0000000000000008ul +#define HWCAP2_SVEBITPERM 0x0000000000000010ul +#define HWCAP2_SVESHA3 0x0000000000000020ul +#define HWCAP2_SVESM4 0x0000000000000040ul +#define HWCAP2_FLAGM2 0x0000000000000080ul +#define HWCAP2_FRINT 0x0000000000000100ul +#define HWCAP2_SVEI8MM 0x0000000000000200ul +#define HWCAP2_SVEF32MM 0x0000000000000400ul +#define HWCAP2_SVEF64MM 0x0000000000000800ul +#define HWCAP2_SVEBF16 0x0000000000001000ul +#define HWCAP2_I8MM 0x0000000000002000ul +#define HWCAP2_BF16 0x0000000000004000ul +#define HWCAP2_DGH 0x0000000000008000ul +#define HWCAP2_RNG 0x0000000000010000ul +#define HWCAP2_BTI 0x0000000000020000ul #ifdef COMPAT_FREEBSD32 /* ARM HWCAP */ From nobody Mon Feb 19 16:45:04 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpL85g5Bz5C9KH; Mon, 19 Feb 2024 16:45:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpL81wtXz4bVx; Mon, 19 Feb 2024 16:45:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361104; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=msJOQ2clXagAzcQmuP9w/c4Z3LbZntdtlXEMdeQW5N8=; b=EAJAGQZs7BUCD3sYhdIOn793u/iY65gFAzd2AEEblaFd8RFLvxIHlAuetAzHEzMpTKDcOE bET0UTh9LUS0572ApeHeWMQZZ2GoqW4MRHZemlmsdWu6KnXgO+nwqQ/mxhRbBFXuZt2Sll BX0yZQziA2Yo5MO+Kqubc1Gap/w5Msqe0wzTwG8EAWsoq5MWsJis0iGMaYeOJCv1wHQHgY pisaLZSsszAdvaP/V2485yMttIM9WSeVp8NY/UnNYc2P0ZjY/TUrenxeu3uj21J0C4kQrY +JbwT3R7FDwJx2mk3gCqPAmBwHKIjUG5WeW4dZ1q67nygZfStTGyrSWeFAoMDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361104; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=msJOQ2clXagAzcQmuP9w/c4Z3LbZntdtlXEMdeQW5N8=; b=U/w5ytBY0wJroYNnaLg+D1mFrMNVSOF6e934s8U9jNvUDQyXjbEoms6Qep4MrPGgVQ5x0D bFtr8WJSUJC+bzqcyMgO40SwKvisr5a9kqZzRhtw8C9eI/eWcW1Ca1w0e6M3kdEgfBXJwY j0ibLz/HAu1wu8LllKhKp4LbcNWo0GQiFAWqzQCzqelwXOYIlok//bmfTV5Fq5puHDBn+M BsNoDzUIT5LrQJ1dfS8ShnzrpqWY2IZU8FGY4dkcneWZdxcNGIypxP51MWWDivuMkL3OJK qbqTXT7PQSO3mHypqal9zMzGtzLU16EQ2t6L4goNsVmDb3fGzYRi8U2KGLHkkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361104; a=rsa-sha256; cv=none; b=bMcz5ybAdqaD3jw0lXV8rtY4SqySXMekxv4fVXj0hKf0SgsyWE0rHylE7dtptVFHe25ebB gu7iz0YAqAoIcD80XObdce4Iv9YMFJjM1Mw2QzXQytYO2L7HzZE+3+X4LpF7PpSjdqGJ1O M+ZdZwczxxr0SnmgannSD9dL6HIKEHC1YEFTHn1/ciHow7zdONoJDNa44Du+wKqwtLzYXV IUOk4LE8VVlH3Ll9fiyiMgCLhlA9KVcG7h7LtLxXg9+wRfpC+GvPsZc9M5GnUUiEVSNJd9 sXJkxpaLTmYG1wiIJiS/irSJPbhKL0+NHwekQ7AMGGnXNzfW8vxkKt/aVk+A1Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpL812vDzjfY; Mon, 19 Feb 2024 16:45:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGj4dD095101; Mon, 19 Feb 2024 16:45:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGj4wl095098; Mon, 19 Feb 2024 16:45:04 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:45:04 GMT Message-Id: <202402191645.41JGj4wl095098@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: b9b148609abd - stable/13 - arm64: Check if PSCI before calling SMCCC List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: b9b148609abde98b6cf4470f0486ec65137c7282 Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=b9b148609abde98b6cf4470f0486ec65137c7282 commit b9b148609abde98b6cf4470f0486ec65137c7282 Author: Andrew Turner AuthorDate: 2023-10-30 14:33:08 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 12:44:19 +0000 arm64: Check if PSCI before calling SMCCC As SMCCC depends on PSCI check if the latter is present before calling the former. This fixes an issue where we may call into SMCCC when there is no PSCI in the system causing a smccc_version assert to fail. Reported by: stevek Reviewed by: emaste, imp, stevek Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42404 (cherry picked from commit 5a8417c78f9d51bf1103353bee348eaac83e86e5) --- sys/arm64/arm64/cpu_errata.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/arm64/arm64/cpu_errata.c b/sys/arm64/arm64/cpu_errata.c index fee22240bb0e..a03303d83044 100644 --- a/sys/arm64/arm64/cpu_errata.c +++ b/sys/arm64/arm64/cpu_errata.c @@ -40,6 +40,7 @@ #include +#include #include typedef void (cpu_quirk_install)(void); @@ -117,6 +118,9 @@ static struct cpu_quirks cpu_quirks[] = { static void install_psci_bp_hardening(void) { + /* SMCCC depends on PSCI. If PSCI is missing so is SMCCC */ + if (!psci_present) + return; if (smccc_arch_features(SMCCC_ARCH_WORKAROUND_1) != SMCCC_RET_SUCCESS) return; @@ -140,6 +144,10 @@ install_ssbd_workaround(void) } } + /* SMCCC depends on PSCI. If PSCI is missing so is SMCCC */ + if (!psci_present) + return; + /* Enable the workaround on this CPU if it's enabled in the firmware */ if (smccc_arch_features(SMCCC_ARCH_WORKAROUND_2) != SMCCC_RET_SUCCESS) return; From nobody Mon Feb 19 16:45:02 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpL768F7z5C9KG; Mon, 19 Feb 2024 16:45:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpL73TzNz4bF3; Mon, 19 Feb 2024 16:45:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361103; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GdU6Ui06fkC6vMiorFu8pX8cRpVrzArFOmJGqHp0wnI=; b=Ns5vaOd14sdxACTAxPUVrXEVjiaOcLC383thAx3b1j8SFOY3m1VKrFbaqHxAaGm5V1w/Lk mUIjUFxgfJCvxwm868FxyT8xpO0nZ108vx+TA/PzzrFYwZFgGgBbSDBkaOvL118aV/K5j7 e6I7xINQrz99TrtpP4sbob+LYfeAkU+Q+nYOudPOX1h8vbn5yAaczL6JQJ+UkjEkrU3gcA jvgPpnOGLp01rrUApagU++fLp5DMYo1gcwhAW2VUAAKlY+ymod+fB0y+pOJ9C58WWyRhyk G4jdiOEgTcoWXvHujzE1Du4QmYM8Xzgx9Y28NZPQEZVGky365a4cKOVZobLX9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361103; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GdU6Ui06fkC6vMiorFu8pX8cRpVrzArFOmJGqHp0wnI=; b=pQRV7LLw/6A6++zoFzEa23tzIkvaVlwGVXbmr+uP0dmBHIons1ISyp5cZwDv/wTIr5lxZr vCV7qwcA89N+bKgl3hPQB8xDHVde1CNb0L8wNPABNgTxHTeobk3g4/sC4M6naufB//kPPA Wx6sipRr95jTt4Rv6t+ZN6BKJ6vvgzohSAMhV1YfWstwovk5nIf+wRMy97pEXpiGSu+5sU JX1K0By3/U4aAeiv0k9f8oM33mKeUKFk4Xgv3onZbTwkusUq3wZs75re2lNZ5sgWc8q69N NAL8dbMXBmOF5x7wpTllCJTwcOsrOU3ww3Uyi3uZ3VmChG0QKZp3T5n8399f+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361103; a=rsa-sha256; cv=none; b=UOgS+2PRs7CfnZ3ekIBanxVRwEOwJLvlEQefmDH52nL5eSdAhaCAvSOkzLH9xaUK4Qp5To pHX4GaTkl3efob9nHvxVQK4RH7RDUDULTmD/9w8MV2cyUjB+YfIsB8ZBEcTnFRWejxCT4F SmtSDZaK0MbXKHYonSiiuSo/3qILAPCWmhH8LKPgD48msamfey9AVbZbl+NkO6pfbgB/Ck fYWyFEwnxat7x4Or5ixJHsgHUsZcXsSd/apmii8Ucs+lIbEl/wIemsiDRvVZyUB+k6PgBl cnwdfwbfZ2RGeGzMP3tNYF7z3rfbirhzmLbwVFUUfyzXUEk6z9qwzueSpJpSeQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpL702gbzjGs; Mon, 19 Feb 2024 16:45:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGj2t9095002; Mon, 19 Feb 2024 16:45:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGj2fO094999; Mon, 19 Feb 2024 16:45:02 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:45:02 GMT Message-Id: <202402191645.41JGj2fO094999@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 975086258ce7 - stable/13 - arm64: Add more HWCAP2 values List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 975086258ce7b6fc6cf68d3941f0083d4bb1c575 Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=975086258ce7b6fc6cf68d3941f0083d4bb1c575 commit 975086258ce7b6fc6cf68d3941f0083d4bb1c575 Author: Andrew Turner AuthorDate: 2023-10-27 10:42:08 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 12:44:03 +0000 arm64: Add more HWCAP2 values Update the HWCAP2 values to align with Linux v6.6-rc7 Reviewed by: manu, imp, emaste Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42379 (cherry picked from commit 2ee649c1dd5c41e93f02fdca8bba9279371e4efd) --- sys/arm64/include/elf.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/sys/arm64/include/elf.h b/sys/arm64/include/elf.h index 81cee5700ed5..5a2ba1f95856 100644 --- a/sys/arm64/include/elf.h +++ b/sys/arm64/include/elf.h @@ -147,6 +147,33 @@ __ElfType(Auxinfo); #define HWCAP2_DGH 0x0000000000008000ul #define HWCAP2_RNG 0x0000000000010000ul #define HWCAP2_BTI 0x0000000000020000ul +#define HWCAP2_MTE 0x0000000000040000ul +#define HWCAP2_ECV 0x0000000000080000ul +#define HWCAP2_AFP 0x0000000000100000ul +#define HWCAP2_RPRES 0x0000000000200000ul +#define HWCAP2_MTE3 0x0000000000400000ul +#define HWCAP2_SME 0x0000000000800000ul +#define HWCAP2_SME_I16I64 0x0000000001000000ul +#define HWCAP2_SME_F64F64 0x0000000002000000ul +#define HWCAP2_SME_I8I32 0x0000000004000000ul +#define HWCAP2_SME_F16F32 0x0000000008000000ul +#define HWCAP2_SME_B16F32 0x0000000010000000ul +#define HWCAP2_SME_F32F32 0x0000000020000000ul +#define HWCAP2_SME_FA64 0x0000000040000000ul +#define HWCAP2_WFXT 0x0000000080000000ul +#define HWCAP2_EBF16 0x0000000100000000ul +#define HWCAP2_SVE_EBF16 0x0000000200000000ul +#define HWCAP2_CSSC 0x0000000400000000ul +#define HWCAP2_RPRFM 0x0000000800000000ul +#define HWCAP2_SVE2P1 0x0000001000000000ul +#define HWCAP2_SME2 0x0000002000000000ul +#define HWCAP2_SME2P1 0x0000004000000000ul +#define HWCAP2_SME_I16I32 0x0000008000000000ul +#define HWCAP2_SME_BI32I32 0x0000010000000000ul +#define HWCAP2_SME_B16B16 0x0000020000000000ul +#define HWCAP2_SME_F16F16 0x0000040000000000ul +#define HWCAP2_MOPS 0x0000080000000000ul +#define HWCAP2_HBC 0x0000100000000000ul #ifdef COMPAT_FREEBSD32 /* ARM HWCAP */ From nobody Mon Feb 19 16:45:03 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpL80T1Nz5C99G; Mon, 19 Feb 2024 16:45:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpL74Fnyz4b9F; Mon, 19 Feb 2024 16:45:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361103; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NVrlEeEse5GzFjLNFdBUJv/88SWm3FEatc6ecHy/Ys4=; b=MuWE+x4GzRofQYBe2/v1hjOBIG2bnFMukMirSXeYpCrNLxAYNE1sBj0ruSJEJB/VJkkn48 3v1cYq3EkmjmZK5QpS46lnMuW82fy74kTAIHAG/QIKpm0eij7PyEZFB1hJB/iGIaP4m9M1 SKZOW9URMe49Oz4/if0FZpJzQZSnVEkFJ95uGzaBDP7Jadxlqc9W7Von1K31UB4mQR3bwg PxqWQAytIybc7Hod7H3N6WYrVNQOo/jmF3msJziMk8kXQ8enuHzJW4Ag/BN23KM6R0pIor H9Fvu2u4iyAkN5CKIfJSaWpbp6bXHsvZNW+t+lqltpMYgZjmORlt2OcaI8Q1xA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361103; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NVrlEeEse5GzFjLNFdBUJv/88SWm3FEatc6ecHy/Ys4=; b=fkBjqM8zJz2Zq4/htU0gul/ARHxUfYiO0hAiuUrqSNIR2lImCUnInrxXz1QsW9NBmuDgxI /TpJEp4uv3yFvIHhpO1Nq1dEZvcgLuVkgJPdWeRG9OJpK0TfF5w5iipFwAdmjlqZnSw9Cq b9FDW9kisGoJAnUbJDCOomdUNXaewowua6uz3SzwLhVDYFgTsvac+/kJGrydiMl8fMB/O8 7VZ3Rhd5JuWhvoSvG8aXi1Qa24TG5gvPzf75VqT+Z0II7piR1DOWZGj7PmPBskuDyWL6wE H9UHOy4wFPevDzsetXONHrBPtxwsm9d8ahz98I9W29Ivx+eaYzCORFjS3NiCPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361103; a=rsa-sha256; cv=none; b=WCr5VyAnRk93oiPHcMhsR9gZwBAAjn42xgLWzWlvjsH7J0PPW13SqTvxECo7chmZhdDa4P sws47W/ZqSplgkgZH/O4yW3u3TJOsTKQJZlwX6hLxKA296i6GUvtT9XbImlLWIVLA8b4rV gasQ0+HLlM02OvjQsPwieMInKLcQnf5m5kd69UZ+X5lgolDk0PSDpdw5CLBhrzhR7r/Put xCqBTbHFBYvByLTHJAyAgWAZKBJWlSxYeGLsqzikjG+yX5moJIy1thUo0eE/7ViU5yBRA6 3cbh7B8gxtbxfjHJNIxQ7RCYiU3xpcdt/djGZKDWLOqMIYX5CSKpSH6aNet1Kg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpL73GCmzjVX; Mon, 19 Feb 2024 16:45:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGj3Tb095053; Mon, 19 Feb 2024 16:45:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGj34E095050; Mon, 19 Feb 2024 16:45:03 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:45:03 GMT Message-Id: <202402191645.41JGj34E095050@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 45ffdd4ea582 - stable/14 - arm64: Add BTI landing pads to assembly functions List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 45ffdd4ea5825c5bee19ed9b2d00457cfff2d84e Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=45ffdd4ea5825c5bee19ed9b2d00457cfff2d84e commit 45ffdd4ea5825c5bee19ed9b2d00457cfff2d84e Author: Andrew Turner AuthorDate: 2023-10-03 08:52:02 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 13:09:50 +0000 arm64: Add BTI landing pads to assembly functions When we enable BTI iboth the first instruction in a function that could be called indirectly, and a branch within a function need a valid landing pad instruction. There are three options for these instructions: 1. A breakpoint instruction 2. A pointer authentication PACIASP/PACIBSP 3. A BTI instruction Option 1 will raise a breakpoint exception so isn't useable in either cases. Option 2 could be used in some function entry cases, but needs to be paired with an authentication instruction, and is normally only used in non-leaf functions we can't use it in this case. This leaves option 3. There are four variants of the instruction, the C variant is used on function entry and the J variant is for jumping within a function. There is also a JC that works with both and one with no target that works with neither. Reviewed by: markj Sponsored by: Arm Ltd Sponsored by: The FreeBSD Foundation (earlier version) Differential Revision: https://reviews.freebsd.org/D42078 (cherry picked from commit e340882d3e49a98aa39b13041a2bf714c30dccdf) --- sys/arm64/arm64/locore.S | 4 ++++ sys/arm64/include/asm.h | 30 +++++++++++++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index 0c3a512cf671..ea5ce8e15ed2 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -112,6 +112,8 @@ ENTRY(_start) br x15 virtdone: + BTI_J + /* Set up the stack */ adrp x25, initstack_end add x25, x25, :lo12:initstack_end @@ -230,6 +232,8 @@ ENTRY(mpentry) br x15 mp_virtdone: + BTI_J + /* Start using the AP boot stack */ ldr x4, =bootstack ldr x4, [x4] diff --git a/sys/arm64/include/asm.h b/sys/arm64/include/asm.h index 5c1f874366fd..6ebfca6eaf0c 100644 --- a/sys/arm64/include/asm.h +++ b/sys/arm64/include/asm.h @@ -48,7 +48,7 @@ #define LENTRY(sym) \ .text; .align 2; .type sym,#function; sym: \ - .cfi_startproc; DTRACE_NOP + .cfi_startproc; BTI_C; DTRACE_NOP #define ENTRY(sym) \ .globl sym; LENTRY(sym) #define EENTRY(sym) \ @@ -114,6 +114,34 @@ dsb sy; \ isb +/* + * When a CPU that implements FEAT_BTI uses a BR/BLR instruction (or the + * pointer authentication variants, e.g. BLRAA) and the target location + * has the GP attribute in its page table, then the target of the BR/BLR + * needs to be a valid BTI landing pad. + * + * BTI_C should be used at the start of a function and is used in the + * ENTRY macro. It can be replaced by PACIASP or PACIBSP, however these + * also need an appropriate authenticate instruction before returning. + * + * BTI_J should be used as the target instruction when branching with a + * BR instruction within a function. + * + * When using a BR to branch to a new function, e.g. a tail call, then + * the target register should be x16 or x17 so it is compatible with + * the BRI_C instruction. + * + * As these instructions are in the hint space they are a NOP when + * the CPU doesn't implement FEAT_BTI so are safe to use. + */ +#ifdef __ARM_FEATURE_BTI_DEFAULT +#define BTI_C hint #34 +#define BTI_J hint #36 +#else +#define BTI_C +#define BTI_J +#endif + #endif /* _MACHINE_ASM_H_ */ #endif /* !__arm__ */ From nobody Mon Feb 19 16:45:05 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpL94b4kz5C99M; Mon, 19 Feb 2024 16:45:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpL92zjLz4bLd; Mon, 19 Feb 2024 16:45:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361105; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=urvVrChkNndZ7EMKGIy6WLj6+tpt4KLgH9zIPCkRI28=; b=Qtp4a8z8b89hqXybDxo2nU9xgtikXWd3ftxBgNM3Jj+HEmHG1/GtPTIvTCQQ+vRqB+qmJk wJyKq7L/7K8Gzl2YpPs0nfMmvDEsaxE22Bno7qiDcyE+VPHpoDeR3+x7pTFqSi+UU7LSr5 XAv1l5H4YJczjpnkoz18p95BDanT+o2m3t0o8q//YemU951GVzsVpfZ34YFIqCWl6DPDPp 131k+akizXw5koocLkeKxEViU5v5iHqfeEymiU6d1a9Nv44ijVZfuhaOlzJSlZRAmUWPWF 8FiGPr9rPP8zVj+b7FynJAc7eEL43KJtNJY9Dc6ePKfP1hVi9M4R7ZSsiDtTvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361105; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=urvVrChkNndZ7EMKGIy6WLj6+tpt4KLgH9zIPCkRI28=; b=Mp6uCyxc/pOaNA0zlQanzLN+5GR7Zn5nTLGkLGlYfF34xul2QhsF2p3AKiFX8AdhdvYu1D GmeMm706bS+dEm4qBA+RjbWwEIoKDxJVILyTKFYyH06KNUbUZI1Am0ZFsRUW5w0eHEJ6b2 mqGy/TNFbKpUUW2iL9A1GWZ0+8HMaNvID6FYig8+3CZcJVZKrY38C9A+NKFJuic7WwtWyv VUYFaEwm0yLXDzaUhlFfkfzUu9Ta5G+9/RB1CxYSJst1NTAwaCTGNDXrWTkPDitdeW3r7F itJByg7+oUbRYVqb+e8ItDTDE95SjFthhI/sCGgqrw+H4sS21vDT6SIKRNCQUQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361105; a=rsa-sha256; cv=none; b=s1P7Kt5xQH0I3u97xYhcgia8d4M1gF9AVlFJZOrdFoqV77pK3rc77hB27jO8fVY4pKb5FJ AqlekCtGAuCm+XUWK8H/XXxKifLoNux/yoCscglqAV3jAMAm4FGp5WvohxWDJufNxB0qi0 dy7VMIBYHWEPraJPmP3sSBsGhWMgVwu67AgFdGZtS1fMAvozDh6zJme23c/3xtSxrBnOv7 ZIbvuJRths1XK+BEd2csxLC81vIILFeFqWr7+mn37cxpCBJwy7Lm/jToPabI4iNBoAu4u1 PXBcygKtg5VuT1OIUPsy2T/MWOiqhyFpCmZWB9DdxBnMwEGGUho6OhEp6CdaWw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpL924cGzjfZ; Mon, 19 Feb 2024 16:45:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGj5IV095215; Mon, 19 Feb 2024 16:45:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGj5va095212; Mon, 19 Feb 2024 16:45:05 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:45:05 GMT Message-Id: <202402191645.41JGj5va095212@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: ab63af3ab3fd - stable/13 - arm64: Use adrp + :lo12: to load globals from asm List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: ab63af3ab3fdaee5dd934fa1d5eda981c28e2a87 Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=ab63af3ab3fdaee5dd934fa1d5eda981c28e2a87 commit ab63af3ab3fdaee5dd934fa1d5eda981c28e2a87 Author: Andrew Turner AuthorDate: 2023-11-11 09:27:30 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 12:44:31 +0000 arm64: Use adrp + :lo12: to load globals from asm When loading a global variable we can use a pseudo-instruction similar to "ldr, xn, =global" to load the address of the symbol. As this is unlikely to be supported by a mov instruction a pc-relative load is used, with the absolute address written at the end of the function so it will be loaded. This load can be partially replaced with an adrp instruction. This generates the address, aligned to a 4k boundary, using a pc-relative addition. Because the address is 4k-aligned we then update reading the global variable using a load with the offset of the load the low 12-bits of the global. Arm64 assemblers have :lo12: to support this, e.g. "ldr xn, [xn, :lo12:global]". The only remaining users of "ldr, xn, =global" that I can find are executed from the physical address space the kernel was loaded in and need an address in the kernels virtual address space. Because of this they can't use adrp. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42565 (cherry picked from commit 7eb26be9c8080686f64fdc0a28e5ae7839bbc82d) --- sys/arm64/arm64/cpufunc_asm.S | 7 ++++--- sys/arm64/arm64/locore.S | 4 ++-- sys/arm64/arm64/support.S | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/sys/arm64/arm64/cpufunc_asm.S b/sys/arm64/arm64/cpufunc_asm.S index 2b2ca6836530..8163e6c3d0d0 100644 --- a/sys/arm64/arm64/cpufunc_asm.S +++ b/sys/arm64/arm64/cpufunc_asm.S @@ -52,11 +52,12 @@ */ .macro cache_handle_range dcop = 0, ic = 0, icop = 0 .if \ic == 0 - ldr x3, =dcache_line_size /* Load the D cache line size */ + adrp x3, dcache_line_size /* Load the D cache line size */ + ldr x3, [x3, :lo12:dcache_line_size] .else - ldr x3, =idcache_line_size /* Load the I & D cache line size */ + adrp x3, idcache_line_size /* Load the I & D cache line size */ + ldr x3, [x3, :lo12:idcache_line_size] .endif - ldr x3, [x3] sub x4, x3, #1 /* Get the address mask */ and x2, x0, x4 /* Get the low bits of the address */ add x1, x1, x2 /* Add these to the size */ diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index 58f0ad8d85aa..7d93d1de30c0 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -204,8 +204,8 @@ mp_virtdone: BTI_J /* Start using the AP boot stack */ - ldr x4, =bootstack - ldr x4, [x4] + adrp x4, bootstack + ldr x4, [x4, :lo12:bootstack] mov sp, x4 #if defined(PERTHREAD_SSP) diff --git a/sys/arm64/arm64/support.S b/sys/arm64/arm64/support.S index 805867fd5d17..a2d422c31fea 100644 --- a/sys/arm64/arm64/support.S +++ b/sys/arm64/arm64/support.S @@ -284,8 +284,8 @@ END(pagezero_simple) ENTRY(pagezero_cache) add x1, x0, #PAGE_SIZE - ldr x2, =dczva_line_size - ldr x2, [x2] + adrp x2, dczva_line_size + ldr x2, [x2, :lo12:dczva_line_size] 1: dc zva, x0 From nobody Mon Feb 19 16:45:04 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpL864RCz5C9HG; Mon, 19 Feb 2024 16:45:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpL856zJz4bLP; Mon, 19 Feb 2024 16:45:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361104; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qJr4k4Ob5dboNAHBtoWwbG93sLGJgC4BlhU7cnP+ol0=; b=vXRrMPZqCPad7uiZhOp3yScRUocddEeTLKqah3C1rp48nZYsEHnNyPRYUqwJxBgJUbHoJH 0vsO0fe0C4hFiFF4Wz/oW5//DPr3EnB5PhqR84yfdm11cQrljXZKhvBcbLdOCCEz2bqf3i yAiAqMOXS8xYgx7/6ef20LDrHlNifbH68tb1klPm8LJvnWk64kVzDkcVAcntWfSrxgkfQx 7jHjcl9sCVgeLI+KOSqdVnh/5/gEYcjy6TeUS8KDQcHaJM8LsCXAKSfKq7YIlDVcvaNbkD 0vcuLsy/D4B8CsamuZqyjbTgdEaMzSrazAocL5xZ7VIODcE1U+WnAtPeImtWQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361104; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qJr4k4Ob5dboNAHBtoWwbG93sLGJgC4BlhU7cnP+ol0=; b=qdeGbLztRwIea/LcDmkODZ/8dCmsVr3dE5bbK+nkuSoJIxbszEZhVeBqohvrvStGPjz6gl t9fE1XnXGrxsBHz6pxYerjovMDRET4+niZ55OAwzYlqRBnp3E4KTV1Xag9JI9Bem85cmUb MzzcTE77U1zDjdPN2Z9wVf778tPvjkEQaMhqfVNOaxPEmLayyE92AkNUIaB3ebzCloBlfi IRQXECwHhAzeCg0Q+B9K6pfHsDoh0j/Zz4WYBKOd7OPxAx13TnSEGYIA+k6rbj92nMYQP8 HWI4pHbUF516X7OpHyt5XkNByabNwom45NViSbi1WzhcQDf+PGQrZYuJ7QMe/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361104; a=rsa-sha256; cv=none; b=Ro6Ot5Lftf0jinTVgKLenIYe7qJ5MUNrGGeEDjghzIVNO2eflbph8qQduE06W8vVUBa/HE fMtCt55vLzKBZf2Tkc0Tp/J0BOIdFnY4uuz/986b2oJBwYSl9uHYzciC8dlambyqLTr/R/ jGr8O3z86eWVrb0N9iJHEMzlDZ9mYpFBupkseyYwoaNGMDoXX9Tiw4f7M8n2qfEWpifbby 85RJGVVQzsKo/yukxLI8H5pTtaBRZZ+3k+jOwPDk/EDZF1rmnFYe1C2ljBzO0lTiXSNkcq CCvrg99OA6fjFyjR3wwRVaFlTHLxM0518207sy7Ef+8NA7qZpdyu2yywoau21A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpL84DxJzjVY; Mon, 19 Feb 2024 16:45:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGj4Rj095156; Mon, 19 Feb 2024 16:45:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGj4GQ095153; Mon, 19 Feb 2024 16:45:04 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:45:04 GMT Message-Id: <202402191645.41JGj4GQ095153@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 729576a3d540 - stable/14 - pci: Set the domain in the pci_generic driver List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 729576a3d540d914136c7faaa134ea25ae9c6636 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=729576a3d540d914136c7faaa134ea25ae9c6636 commit 729576a3d540d914136c7faaa134ea25ae9c6636 Author: Andrew Turner AuthorDate: 2023-10-13 10:08:21 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 13:10:27 +0000 pci: Set the domain in the pci_generic driver Tell bus_dma(9) which NUMA domain the PCI driver is closest to so it can allocate memory from there when possible. Reviewed by: markj, jhb Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42186 (cherry picked from commit 7098f3c7569c21ecdfc990772e96a416f1a94eee) --- sys/dev/pci/pci_host_generic.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/pci_host_generic.c b/sys/dev/pci/pci_host_generic.c index cef83069c371..90361a7258ed 100644 --- a/sys/dev/pci/pci_host_generic.c +++ b/sys/dev/pci/pci_host_generic.c @@ -83,7 +83,7 @@ pci_host_generic_core_attach(device_t dev) uint64_t phys_base; uint64_t pci_base; uint64_t size; - int error; + int domain, error; int rid, tuple; sc = device_get_softc(dev); @@ -104,6 +104,13 @@ pci_host_generic_core_attach(device_t dev) if (error != 0) return (error); + /* + * Attempt to set the domain. If it's missing, or we are unable to + * set it then memory allocations may be placed in the wrong domain. + */ + if (bus_get_domain(dev, &domain) == 0) + (void)bus_dma_tag_set_domain(sc->dmat, domain); + if ((sc->quirks & PCIE_CUSTOM_CONFIG_SPACE_QUIRK) == 0) { rid = 0; sc->res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, From nobody Mon Feb 19 16:45:05 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpLB0tGkz5C96d; Mon, 19 Feb 2024 16:45:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpL969Jxz4bC1; Mon, 19 Feb 2024 16:45:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361105; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+440LqA/lSYaFmYx7ImjwAUhTo2ztGToOMACniNOHp0=; b=S5Td5VwIot9SZUqgF9KoIX080YOcpAME071tV9t+ksTlgK2T6QsSe9cqVqY6PnodC0a76x QXIEI/3dSp0QfNuNVOajuIyd7uTJYuG3uX/QiYBaSEejg1mpdHgC+v0IvbvbZ5XfynVNRj IvPKukISqECwHSktoxyuMpumjjVR+5IqWHahoFKNSI+ddvzz506FLbItNbJlkFyYbzBdBa Wi3bsB/7aXLGpKG+pzbw1hTbVKl7BH5ATfmZB/HjN5DOhng+TIXfYKzffG77Md8nugb4B8 nzU/qzClsSE8DirPMhSAEbmzKMWMUP+pLoxQ5SZXaROSaJlafxu4BUjyahX1uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361105; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+440LqA/lSYaFmYx7ImjwAUhTo2ztGToOMACniNOHp0=; b=HgH1N1UCEH9RKgOvojcGCfB4R20vMGdUJe0ecO43pHsc1C+u9hmvvoolqY2PYH6x/TwfSX h/o1eBGAJCOw4UCz16SU8N8zInCAflm94jVT8kMBOlLYux15O0hcGnKp8wBNTaD9gBljZm W2Xl4AvpigDtiI8hiB0o2er6q7yTEU8Yi/8TZP0trv6T8aU76Rp2VrztnDqq5J9cUsQ2zd KOpu7YeNfBI7XM5WQMwDyRw1B1s3nR1gZEUfm4Su4abyQdO579EVAwWXvTGTLe7Yb9K1R6 pMysJQ+CTmPwZM4xTpT2gf8hKlGDVkJDRk3zPze1RbOqvzgwGcoQvQKx5BYfhA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361105; a=rsa-sha256; cv=none; b=fPBptAMMuLe6oV/1H+lp0BK0f3AhlMZYYKLniYgD9TLG5wlPrjINQIYHN08RKqcrE/glUd bCSdHwIi1LSZNK+ndEHFoFOS6DfbmjwX0H7pFY5QsPaUY2hp/j28FYsAH8pbMbSxvKyR3f iMAdFbMnuIyXWVs/zs5ptlNBs76tpXv692Qn2uU/346RczVRB86RemYNVN9Hh3uAwmheQQ DnXNjimMgCOA3mR0MtkGF8X7rrcv5MrQqWM2a1zVUMLF1zPCnL5QM3lJctoGa3TfDt9P67 pw8r9d674Qqmb/ql1HqO40AH5+dYj9GIrS4Duz4/C1RO5zqEqZrUdJ7EL15uTg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpL95GWVzjDN; Mon, 19 Feb 2024 16:45:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGj5jf095269; Mon, 19 Feb 2024 16:45:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGj5xe095266; Mon, 19 Feb 2024 16:45:05 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:45:05 GMT Message-Id: <202402191645.41JGj5xe095266@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 890008575a43 - stable/14 - arm64: Raise a SIGBUS on a user external abort List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 890008575a436c050a679e1d9e43d05489ee42ac Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=890008575a436c050a679e1d9e43d05489ee42ac commit 890008575a436c050a679e1d9e43d05489ee42ac Author: Andrew Turner AuthorDate: 2023-09-29 13:55:48 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 13:10:39 +0000 arm64: Raise a SIGBUS on a user external abort When userspace triggers an external abort allow it to handle the abort by raising a SIGBUS. Reviewed by: markj, kib Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42018 (cherry picked from commit a69450102ff1fe1466077a021a16bb265274d3a2) --- sys/arm64/arm64/trap.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/arm64/arm64/trap.c b/sys/arm64/arm64/trap.c index 2dda8cfc4c20..6534fd2283a1 100644 --- a/sys/arm64/arm64/trap.c +++ b/sys/arm64/arm64/trap.c @@ -225,19 +225,25 @@ static void external_abort(struct thread *td, struct trapframe *frame, uint64_t esr, uint64_t far, int lower) { + if (lower) { + call_trapsignal(td, SIGBUS, BUS_OBJERR, (void *)far, + ESR_ELx_EXCEPTION(frame->tf_esr)); + userret(td, frame); + return; + } /* * Try to handle synchronous external aborts caused by * bus_space_peek() and/or bus_space_poke() functions. */ - if (!lower && test_bs_fault((void *)frame->tf_elr)) { + if (test_bs_fault((void *)frame->tf_elr)) { frame->tf_elr = (uint64_t)generic_bs_fault; return; } print_registers(frame); print_gp_register("far", far); - panic("Unhandled EL%d external data abort", lower ? 0: 1); + panic("Unhandled external data abort"); } /* From nobody Mon Feb 19 16:45:06 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpLB5x96z5C9HM; Mon, 19 Feb 2024 16:45:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpLB3zpDz4bWW; Mon, 19 Feb 2024 16:45:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361106; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LQND/Na/sNXpBKW9N0M875gb+xwmfx6/8ldt85n9rxg=; b=DWQEq4KVw8ZJN4L4z4ROnDYb5JggQKrp4gE98bd2jp1U0y6rtGkqH/9ge/JtpyaonGcm/t UFIJ9cA5Ektrc5edyG5ianm4TWMLhQ6xt+YUiQlVH+pHW56uWmg3B8aHwPp7V+cGr4YOze BnFkKemzLS8XjcGGFQmTs3kP4rUa5AuJwUXEgaXIjQOncnKYksHujHroDXm8kYVVXcf3eB Z9oxXYdcEtuCld/zz+3cdBQK3VHq5q2FQryv82J/sPlAtDQMc15mqG26Qjmmbb5ulh1qnr dpvUZ5AGif93Z4Pw3kls/KNmqApM3djDCnjDvhZFTHBh1NDuf/fx05aV+WSdKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361106; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LQND/Na/sNXpBKW9N0M875gb+xwmfx6/8ldt85n9rxg=; b=dsT1YZ+UXltNNzbsPtloojtehFDPJ8fT4+kCvA7qudHx4a+jfplio6BQMt0AP5+KOZNmgx 2dQYbFT15Mu+Jj7LXWLuCMjuznECJ4SC3SbgRPMBny6i5QDbuvOJH30+2YyDrvkc5JV3fn yxMu3bhf5lBQMo3dNUPqtvUOMi1pTQr+ZcH8Zm7YmZ9WtOOwndS52vnZ9BIliaCDbHSkVn W+d/OgnpE1MrwEU2KId4LqlHi//m+XbdW5bjJznUJ9OXe1eDcZhPt3SeTMfcXAG1HZUx7l V4KcNZBT9Kyrmla98bhkvgiamsA8928tSFGn1EFEiYwwRqAJNOK+0Qx/yv+dMQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361106; a=rsa-sha256; cv=none; b=XsRE3gQDCuvyGNrY2bh1IwZ7cUoMmdHNHLDqIGxwsVLTd2kYojNNDMEi87zm7InuivXcic U6meFTrtjNHZhMI5qwNkHrbC3DFVEUH+cAFlqAgTjoRjOnjlAWJrqJmv7u7STVxmIFwyEi bqUwK1FY0HAFhAzpVMRrIW+wv6uMOOL1npuN/DAGg3UYnGUurKCxz5cYHxxs5XcYaiE2+W pI5Ap0fWbYEfhHaoKcCVDNZwI6NcnZwqykFovvTqpmLovGhDt79RqbHCKvoxdGJbBJ7DqI HnQPPTQwJ05HxPJFPAeX218FNpvvBh4hFV20ZgQRIHQluruZ+V1xQyGGZqNvtA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpLB35mPzjfb; Mon, 19 Feb 2024 16:45:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGj6Dk095320; Mon, 19 Feb 2024 16:45:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGj6Ld095317; Mon, 19 Feb 2024 16:45:06 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:45:06 GMT Message-Id: <202402191645.41JGj6Ld095317@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: de4ca58e2c2a - stable/13 - arm64: Mark the armv8 crc32c as supporting BTI List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: de4ca58e2c2ab260e0842bd6c233201a5caf55f2 Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=de4ca58e2c2ab260e0842bd6c233201a5caf55f2 commit de4ca58e2c2ab260e0842bd6c233201a5caf55f2 Author: Andrew Turner AuthorDate: 2023-11-14 15:01:58 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 12:44:42 +0000 arm64: Mark the armv8 crc32c as supporting BTI This is built into a test so needs the BTI elf note for the rest of the test to be built with BTI support enabled. As the assembly uses the ENTRY macro it already supports BTI, so mark it as such. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42595 (cherry picked from commit 25d0310ed881e86cec9ab5cf37dd8471e88ad554) --- sys/libkern/arm64/crc32c_armv8.S | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/libkern/arm64/crc32c_armv8.S b/sys/libkern/arm64/crc32c_armv8.S index 32bf00ee477d..649afff4b711 100644 --- a/sys/libkern/arm64/crc32c_armv8.S +++ b/sys/libkern/arm64/crc32c_armv8.S @@ -26,6 +26,8 @@ */ #include +#include + .arch_extension crc /* @@ -76,3 +78,5 @@ last_byte: end: ret END(armv8_crc32c) + +GNU_PROPERTY_AARCH64_FEATURE_1_NOTE(GNU_PROPERTY_AARCH64_FEATURE_1_VAL) From nobody Mon Feb 19 16:45:07 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpLD2RJzz5C9FZ; Mon, 19 Feb 2024 16:45:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpLC4zX1z4bTV; Mon, 19 Feb 2024 16:45:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3cpftWmdCRlj0V8pac1uNMPY4BwHJoLrTW2nlkJif7Q=; b=dQtClKFakLRKe+rjr0m4tTA3Sp3WZzkOk4ur7E2HHCd4IOhAcl5C3iBlW35L5SBEmslJj3 ClPGEJjAHAxcX3vDEuUAL1iH8Zia7XG+5nWvqSDB4DKfwOdfzZjqf5Dofr7PSPX40jTYZK Jc7XncZHonzloWC3Ryo6cHHfybjQGzaR6S0N4vRXc0glQXL+e4Ln8dMO9Cidv1sSgeL+Zm AYzUiypbl6d+1z2Ec5NpiAoEr0Ysytc+iD5X8Z6WL2uxfO6HBzA5+vrXo8ayunARnSEqDQ +cEsDKR+akpTKbbUlCk4I1gziheWCKzEPlutpJI/zXepoicrCtnZJm5UXGvm0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3cpftWmdCRlj0V8pac1uNMPY4BwHJoLrTW2nlkJif7Q=; b=JahVCowYjgx8Hc3UzlDs0oYn3zYvkVLOl8EPTmeEBUgJjfZasEA9z3Ov0a++eGH990ISUG 8cRHt6m+JaqMSsW22516CH3+1iv4GQvioF/p0NQowkHf2W5WQjLZRKhS6G1a+PI1WdBu8X NEtfWjWmw5qHMFFM4QWw2INvzKpChLxHOKXzGHGeTTwOGEq+1wPY2EC98Xgmr6SBEwblhQ Xv0J8EUGnfBDChbPKEUqhLXORqwJqcAs2F6JdShLOFH+c3gzCNGSQK3oYJ7IFiGKwvwWqs 9R10Hy4YWSYjEBbTP5F4KzpFoWX3Kq620x3arGzP3mdf03N3OtkNoFetA5PfzQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361107; a=rsa-sha256; cv=none; b=CHbUtCe5DzFWs7pJo4Czpb5JC9r1n+j3c9pf7cIMps+BcE+NDw9aUj+c6wgm3PnD6rb5gv nt30sOFeDVO55onRXZodfjg9Ec9p5P5d2Znxkc6/WUCzAk5IfXBpFr/p3OYuBwL8Ksfs2p iytTIg5DpRpOyw4zeDvvlpZS5E6+phLEe8OwR4fzSO4XbDBykzmo8s81km9aT3C+36KOIU eErBIJ6l0jKv1DJH5bmLprnF5w2VX3eZKH1UZ/r5cl+R97mu3dpIVWix/d4VhYfvsYSA8B HKGsXeQDErPRTryPeagvts8GYnktxjr+nYjDyZa4/vL4tkoqXCBOY/HOgMs71g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpLC45Vwzj9R; Mon, 19 Feb 2024 16:45:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGj7m2095407; Mon, 19 Feb 2024 16:45:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGj7bF095404; Mon, 19 Feb 2024 16:45:07 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:45:07 GMT Message-Id: <202402191645.41JGj7bF095404@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 2ea922e9e38f - stable/13 - dev/uart: Support 8-byte register access List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 2ea922e9e38f1a8e633617901492fb221305ad5a Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=2ea922e9e38f1a8e633617901492fb221305ad5a commit 2ea922e9e38f1a8e633617901492fb221305ad5a Author: Andrew Turner AuthorDate: 2024-01-09 13:29:47 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 12:45:51 +0000 dev/uart: Support 8-byte register access While we only support 4-byte registers in the uart code the physical access may be to an 8-byte register. Support this as an option on non-i386. On i386 we lack the needed 8-byte bus_space functions. ACPI has an option for 8-byte register io width, and FDT can be given any size. Support these sizes, even if we don't expect to see hardware with an 8-byte io width. Reviewed by: imp Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D43374 (cherry picked from commit a9fc9d6d15f006feb6d7ddb036e020d5f9d19fce) --- sys/dev/uart/uart.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sys/dev/uart/uart.h b/sys/dev/uart/uart.h index 8e31cd49fd52..31d58d829579 100644 --- a/sys/dev/uart/uart.h +++ b/sys/dev/uart/uart.h @@ -54,6 +54,11 @@ uart_getreg(struct uart_bas *bas, int reg) uint32_t ret; switch (uart_regiowidth(bas)) { +#if !defined(__i386__) + case 8: + ret = bus_space_read_8(bas->bst, bas->bsh, uart_regofs(bas, reg)); + break; +#endif case 4: ret = bus_space_read_4(bas->bst, bas->bsh, uart_regofs(bas, reg)); break; @@ -69,10 +74,15 @@ uart_getreg(struct uart_bas *bas, int reg) } static inline void -uart_setreg(struct uart_bas *bas, int reg, int value) +uart_setreg(struct uart_bas *bas, int reg, uint32_t value) { switch (uart_regiowidth(bas)) { +#if !defined(__i386__) + case 8: + bus_space_write_8(bas->bst, bas->bsh, uart_regofs(bas, reg), value); + break; +#endif case 4: bus_space_write_4(bas->bst, bas->bsh, uart_regofs(bas, reg), value); break; From nobody Mon Feb 19 16:45:06 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpLC383mz5C99P; Mon, 19 Feb 2024 16:45:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpLB6vwqz4bFg; Mon, 19 Feb 2024 16:45:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gAj1TevMJJFaqO4SMtJaicBw6EbJiJ9naWXzfrSFwzw=; b=Mn4/ciYAUI7HfOxwt5ucbIU+OfepciyX1ji1D7J2hzz6aSd2+vsHUvSMNIyIkxF78TG2HC 8v5nWi6lpL2i7jnZaEm+HjEOwIKMj7Mf19eRlSgaE0lYmUYRU+F6DBkWKCHzHIXFVZS2Km lAaHHCV2X5nxpaCsJ+xSNWHx0xLLFCxUWnE6cPthFQnyYzLgb9c99dTcaSkLwdWtHgxhrc f9KojjMFnEvZB6rLgC7soVJjtfpv/8pvAqn3hofe5J1OSDZkG1Cl3RK4GvBiUTvpFe+McW sefj4f1iDotCwcLobtzqg95XpV2MR3p3l2IxeDjI9WTAF3hL+p0svNJwZVon+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gAj1TevMJJFaqO4SMtJaicBw6EbJiJ9naWXzfrSFwzw=; b=n6JzqeR5cv5SSnZaku9yrm6rKF3pmGfaxY1e+U2hydbElLc2nrSo1A8/S/yLE9I1fIiYT6 UWGQpsrw04B8rZuipRDvcdHitKxO8rDGcVw6nbR8wW5zYpacqE+eVMhQ9KsOnlr684w3P0 W//LhqOD0czxUq55K4zoebe29IxFdVaBovASYmiQHqnmZNxGyKAjGQWDkbtxInGWfTfeYj 8PIdTpHBeJT71aUmmmkrL9g2jQtZ3UiSUnYc603563EAbqr7lEtLT92PZyiE2892lsUQKB Hi8ccu1H5F45ZcEEwsnFXAteoF+BFlgpB17U/F9WsiCd/2LDMabDfBy31IXJ3Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361107; a=rsa-sha256; cv=none; b=ATMlyNr0pYlS/Bje8jsEx8Rvs3vgbqcp4t7/UuMB602xg5yqfE6DDBPETGYv2O/dkQq7Am jFnaKGxPvURmoy9LMWCF6KU14dBxkQwg3Fd4imaipVmDjDPE2V4eN9UT0B0yaznYQ4DUDv E3sQTnFIk8O/wvuQt6dHWDMk9CMM1/emv4opzGhKJyCF4qxiiU3aunN5KAbqyU7XYm3xl2 2X30ekbEhassbpOsYwAGgUTgYUUCoqqA6VOl1+yKD0nUGgErh/nlSj501oItIXrXxiJboC IJZzgAU/H9nbFBQ2QauOMABor2m8JZMatuE5ssjAK+2g/+R2jylwH8+jCQ1eZQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpLB61d9zjfc; Mon, 19 Feb 2024 16:45:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGj6r3095365; Mon, 19 Feb 2024 16:45:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGj6Sb095362; Mon, 19 Feb 2024 16:45:06 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:45:06 GMT Message-Id: <202402191645.41JGj6Sb095362@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 9792d605235a - stable/14 - sys/sys: Check for __ASSEMBLER__ in elf_common.h List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 9792d605235ab09113053f845d52aeeff24a58e7 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=9792d605235ab09113053f845d52aeeff24a58e7 commit 9792d605235ab09113053f845d52aeeff24a58e7 Author: Andrew Turner AuthorDate: 2023-10-12 09:45:43 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 13:10:51 +0000 sys/sys: Check for __ASSEMBLER__ in elf_common.h When preprocessing assembly files with clang or gcc the __ASSEMBLER__ macro is defined. Check for this as an alternative to LOCORE in elf_common.h so it can be included by .S files. Reviewed by: imp Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42224 (cherry picked from commit f39010b1393d471f1c59195acde5d95cdb66847c) --- sys/sys/elf_common.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/sys/elf_common.h b/sys/sys/elf_common.h index ce82734833cf..934f66fee953 100644 --- a/sys/sys/elf_common.h +++ b/sys/sys/elf_common.h @@ -44,7 +44,7 @@ * not include the padding. */ -#ifndef LOCORE +#if !defined(LOCORE) && !defined(__ASSEMBLER__) typedef struct { u_int32_t n_namesz; /* Length of name. */ u_int32_t n_descsz; /* Length of descriptor. */ @@ -112,7 +112,7 @@ typedef Elf_Note Elf_Nhdr; * The header for GNU-style hash sections. */ -#ifndef LOCORE +#if !defined(LOCORE) && !defined(__ASSEMBLER__) typedef struct { u_int32_t gh_nbuckets; /* Number of hash buckets. */ u_int32_t gh_symndx; /* First visible symbol in .dynsym. */ From nobody Mon Feb 19 16:45:07 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpLD2XXfz5C9QB; Mon, 19 Feb 2024 16:45:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpLD12MYz4bJY; Mon, 19 Feb 2024 16:45:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361108; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WQ5QxqGRdXTBfvDtJHKePHt1fhZ8kX6MwdAil5gP6t8=; b=J4iYiUY1qDUTs5aIYX+R41AW8Mz3dtaqutMt70L0fsc+mE3/StUvVrc0RcNmLoOGiTTjnz lVFe9SnzNzjZwCQaHBrnCUnE3iGYlkRzIIYWwa6SOMvNj8Eq6haVqNB1JJAZ57qfQve+tt 6Bt4HeASDhWr4iQs5jdbTjXNN4M4uJovm62I6PnkEkHASkHaTHCkBGuT33vks16+FQPP4a ZtI1zPEFJoCM5PJg1hWJQrJvL5/TCpAtGBAS5hHohd2avRZ3MFRnOK5urrE82cbUwOUrQF OIyqRtQDSesP5uQEVIZLZFNTW2VTERYorTsB+odIfkKzNndAFaks6H9ApP+PBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361108; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WQ5QxqGRdXTBfvDtJHKePHt1fhZ8kX6MwdAil5gP6t8=; b=SeNomvOByDca+n0AffeRnw731xtFmOJyKkZqMXKqxsHosdtKgrMeLviIb856NlerM3KKAY to9TzGTEoo9TZ7MpucLrtK6/2V3j2GcRP0Oi+xodjfY9e95ycVTJ+QGIQuiuoEdZY4hnnV mAFd7K4+9j4pwLCazYqtLky4Tkfq2jnC9Q/3gdoaFk5ODzvQdsREm89shtIB897riPye5A Mc54djWJUwu4S7tUx/qkVVM51BoNn0fHFLmr8aeom26O4dNXP7JMRtY6vwZPv5qrpBUFGj 2Ke9wClDbOawQkOjdzPcyKDDbJ8WA3ZumPX6RbsN7xEzq0/bx/dMjEeinyJ75A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361108; a=rsa-sha256; cv=none; b=vCMWP/q8gCllaglxO6Sy2WuN3sk1gRD3ovPWY1FOQzst1FuXv7o0ks7x4Ot7bKV4csJ2nZ ToFuSOgyj5MBvBzyTY2JqRh+0d9dR8mCkFYgs4OL4WfvXOSU1bWmJT/Ltz6K3E3oOE/Xzv ha7wvBIcln70x9hPxm1WoOeowmUhBaBPjaxTXkVe4n1emYPRJtYT713oah9AprrV8Q7a2L qNML3W0wOXWVBgj4K7JbwJkGJLujtY4ByUUEpOaCgiPvFG+nYhv4OzDtcBY249zcnlT8Qm whMBapV/x6gVt1D5qlNbJfN2CT69XQMAutQD7liLhgp/ZMTWrIGOQz9+wg2EJA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpLD08F0zjVZ; Mon, 19 Feb 2024 16:45:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGj7rl095452; Mon, 19 Feb 2024 16:45:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGj7ah095449; Mon, 19 Feb 2024 16:45:07 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:45:07 GMT Message-Id: <202402191645.41JGj7ah095449@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 55e2bfab4485 - stable/14 - tools/build: Support building with glibc 2.38 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 55e2bfab448589d29cbd09bd97643a46a9735064 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=55e2bfab448589d29cbd09bd97643a46a9735064 commit 55e2bfab448589d29cbd09bd97643a46a9735064 Author: Andrew Turner AuthorDate: 2023-10-20 15:45:06 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 13:11:00 +0000 tools/build: Support building with glibc 2.38 Ubuntu 23.10 uses glibc 2.38. This adds strlcpy and strlcmp so we need to remove them from the cross build environment. Reviewed by: jrtc27 (earlier version), arichardson Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42303 (cherry picked from commit ceefd491c7f0490515fadca2f3740cb24e3f449e) --- tools/build/Makefile | 10 ++++++++-- tools/build/cross-build/include/linux/string.h | 3 +++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/tools/build/Makefile b/tools/build/Makefile index 92f7d396825c..aff664f2a68b 100644 --- a/tools/build/Makefile +++ b/tools/build/Makefile @@ -194,9 +194,15 @@ SRCS+= strtonum.c merge.c heapsort.c reallocf.c SRCS+= rpmatch.c .if ${.MAKE.OS} == "Linux" -# On Linux, glibc does not provide strlcpy,strlcat or strmode. +# On Linux, glibc does not provide strmode. It only provides strlcpy +# and strlcat from glibc 2.38. .PATH: ${LIBC_SRCTOP}/string -SRCS+= strlcpy.c strlcat.c strmode.c +SRCS+= strmode.c +# Assume if strlcpy exists so does strlcat +_WITH_EXPLICIT_STRLCPY!= cat ${HOST_INCLUDE_ROOT}/strings.h ${HOST_INCLUDE_ROOT}/string.h | grep -c strlcpy || true +.if ${_WITH_EXPLICIT_STRLCPY} == 0 +SRCS+= strlcpy.c strlcat.c +.endif # On Linux, glibc provides ffs* but not fls* SRCS+= fls.c flsl.c flsll.c # Compile the fgetln/fgetwln/closefrom fallback code from libbsd: diff --git a/tools/build/cross-build/include/linux/string.h b/tools/build/cross-build/include/linux/string.h index 87347df1e9bf..8fac9e0fe083 100644 --- a/tools/build/cross-build/include/linux/string.h +++ b/tools/build/cross-build/include/linux/string.h @@ -47,8 +47,11 @@ #include __BEGIN_DECLS +#if !defined(__GLIBC__) || \ + (defined(__GLIBC__) && (!__GLIBC_PREREQ(2, 38) || !defined(_GNU_SOURCE))) size_t strlcpy(char *dst, const char *src, size_t siz); size_t strlcat(char *dst, const char *src, size_t siz); +#endif char *strnstr(const char *str, const char *find, size_t str_len); void strmode(mode_t mode, char *str); From nobody Mon Feb 19 16:45:09 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpLF4wh2z5C9N4; Mon, 19 Feb 2024 16:45:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpLF1xCSz4bYm; Mon, 19 Feb 2024 16:45:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361109; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XyMF+vc1fz1Sx13vBr2CJlHO56PoRnkcfUBYO0T4dWE=; b=EPww4lSu/XKs7phSH3RrSd9ah3+//I6WbMoVyqvprivHve50iGWB2kQktsi3tcHvqXD9oS EWOYt94tX4dOrK0t+XCGfsgSOGFkXmZi/SMrBcECr+LcNkC+BsbJlod6qZbmRxvtK/DLIc IbvY3bmmGRM0p//MauKYaZ8HtdneZPDXp25yhRrwPDWE35tOkcjP0GFGu3E2XxZJvhlzUX sk0/rUHhKUjRYM1tjKHfIwQt6HWqkpR39PVp1R5wDxCaJ0PY9rOz893zhWY7iv/+FTRqFq QYRP+GcnP/ugFBp3VWXO4kv5m343w9AJSBYLnuHt/AlKlWWLRakdjLVOSa2Z9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361109; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XyMF+vc1fz1Sx13vBr2CJlHO56PoRnkcfUBYO0T4dWE=; b=RUKWREGPWLWI5DvYTRJSlVHlNMp/0X5FOQF9KZcRtRE2rWUFLl1ULslETYj9iYJbO27Qnp rJXHB9obbZfEt9sBAFzAX/Nkz2s4eX0XeVT7IpbqOgBOBKzW53Dj6/LOX7/1BaKjF5l7FN Eze2RUlmkOEggflqWuJTs8M3pJxDTNXoj8yE63CF51YjW3UmWz6z+Eb7mEDG+rPYatYCQl R/3SDdTljzaz4XSzLkGTbY+DyO7nHVmJHh9eQZN4fMJqPQ2b5vK91uJFVmLeaS/Vhauqre 4vHmw4BKm6r25FIQlmHkWJJItvAn/KMndk6GcygjaDDjO/cO1M5zm7nRG9p8WA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361109; a=rsa-sha256; cv=none; b=C+KCrOZ2mCCDPOtBlAMeFJVC6AB/0RD2m1NEWbHwSZtHKTUfdT9Lk1r/g029vE5DgA51Qm P9erdKyH0zNCYPPLG/HSn6zYLfmjAIqPMu1dcba6pLqC/AdYZYyiz0kVt17utYcstcJMt0 JRgjcIRlMX7W9VTDijAndwJg1fR2Iu2T63YE2bhiREv2mcC3Xi8uRLqVoRwLjnM7q1IOYR OZ6wdkic1GNWsyOvfphpdzm/s239FMZVeLPeGZ7dRzQIT7VByQm0Y45Je0n7jqidLQaWft 1yrTvgLQ4q6AMNMA93l1yc3MN48Oeykyq1w73hHuJH80GzAkl4F/2MQEXuvblg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpLF0yRvzjSQ; Mon, 19 Feb 2024 16:45:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGj9A3095626; Mon, 19 Feb 2024 16:45:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGj9HW095623; Mon, 19 Feb 2024 16:45:09 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:45:09 GMT Message-Id: <202402191645.41JGj9HW095623@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 0d44915e06e5 - stable/14 - arm64: Support creating a BTI & PAC note List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 0d44915e06e5ff94a3338249aaf23301fe542de5 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=0d44915e06e5ff94a3338249aaf23301fe542de5 commit 0d44915e06e5ff94a3338249aaf23301fe542de5 Author: Andrew Turner AuthorDate: 2023-10-10 13:00:59 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 13:11:11 +0000 arm64: Support creating a BTI & PAC note To detect when an object file is build with the Branch Target Identification (BTI) and Pointer Authentication Code (PAC) extensions there is an elf note the compiler will insert. It will only do so from a high level language, e.g. C or C++. To get the not in assembly add the GNU_PROPERTY_AARCH64_FEATURE_1_NOTE macro that can be used to create it, and the GNU_PROPERTY_AARCH64_FEATURE_1_VAL macro to insert the correct value based on which combination of BTI and PAC are enabled. Reviewed by: markj (earlier version), emaste Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42225 (cherry picked from commit 82597d2102a02c4e9e9355717c32867d34b77ef0) --- sys/arm64/include/asm.h | 52 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/sys/arm64/include/asm.h b/sys/arm64/include/asm.h index 6ebfca6eaf0c..da3c3df5f647 100644 --- a/sys/arm64/include/asm.h +++ b/sys/arm64/include/asm.h @@ -142,6 +142,58 @@ #define BTI_J #endif +/* + * GNU_PROPERTY_AARCH64_FEATURE_1_NOTE can be used to insert a note that + * the current assembly file is built with Pointer Authentication (PAC) or + * Branch Target Identification support (BTI). As the linker requires all + * object files in an executable or library to have the GNU property + * note to emit it in the created elf file we need to add a note to all + * assembly files that support BTI so the kernel and dynamic linker can + * mark memory used by the file as guarded. + * + * The GNU_PROPERTY_AARCH64_FEATURE_1_VAL macro encodes the combination + * of PAC and BTI that have been enabled. It can be used as follows: + * GNU_PROPERTY_AARCH64_FEATURE_1_NOTE(GNU_PROPERTY_AARCH64_FEATURE_1_VAL); + * + * To use this you need to include for + * GNU_PROPERTY_AARCH64_FEATURE_1_* + */ +#if defined(__ARM_FEATURE_BTI_DEFAULT) +#if defined(__ARM_FEATURE_PAC_DEFAULT) +/* BTI, PAC */ +#define GNU_PROPERTY_AARCH64_FEATURE_1_VAL \ + (GNU_PROPERTY_AARCH64_FEATURE_1_BTI | GNU_PROPERTY_AARCH64_FEATURE_1_PAC) +#else +/* BTI, no PAC */ +#define GNU_PROPERTY_AARCH64_FEATURE_1_VAL \ + (GNU_PROPERTY_AARCH64_FEATURE_1_BTI) +#endif +#elif defined(__ARM_FEATURE_PAC_DEFAULT) +/* No BTI, PAC */ +#define GNU_PROPERTY_AARCH64_FEATURE_1_VAL \ + (GNU_PROPERTY_AARCH64_FEATURE_1_PAC) +#else +/* No BTI, no PAC */ +#define GNU_PROPERTY_AARCH64_FEATURE_1_VAL 0 +#endif + +#if defined(__ARM_FEATURE_BTI_DEFAULT) || defined(__ARM_FEATURE_PAC_DEFAULT) +#define GNU_PROPERTY_AARCH64_FEATURE_1_NOTE(x) \ + .section .note.gnu.property, "a"; \ + .balign 8; \ + .4byte 0x4; /* sizeof(vendor) */ \ + .4byte 0x10; /* sizeof(note data) */ \ + .4byte (NT_GNU_PROPERTY_TYPE_0); \ + .asciz "GNU"; /* vendor */ \ + /* note data: */ \ + .4byte (GNU_PROPERTY_AARCH64_FEATURE_1_AND); \ + .4byte 0x4; /* sizeof(property) */ \ + .4byte (x); /* property */ \ + .4byte 0 +#else +#define GNU_PROPERTY_AARCH64_FEATURE_1_NOTE(x) +#endif + #endif /* _MACHINE_ASM_H_ */ #endif /* !__arm__ */ From nobody Mon Feb 19 16:45:10 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpLG5Bn1z5C9QH; Mon, 19 Feb 2024 16:45:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpLG2rckz4bcC; Mon, 19 Feb 2024 16:45:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361110; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9u9Yz2elmPKHINsdAhN93lEZGkr1s1SORkXI5Ky68c8=; b=N+vG8G0Tr6Mkw9kdiyDpzk9bn3EKIu30RaAXjD+Y6QyU6x4loUHutl98CX+G0q8SCyL+Df ULVd69SPoiyHJuP+BnQ7SaxMOLv/ZcZKKvpsfWlCdXvpJLA3rosgi/w3pQDO5yySeMpQk9 iwXv3yGdD9PiBqJkFvr+mU/2ijWk73m/hjp6izwrumaGFOXSjQWhSR5UtTwIenHctPmNZ0 FQAtSO7nGywVsmXSV9fopwNtq/dKcnUx0oLKZvs5MNguKwiIN1x0NLRXJKCEj764Eoi/lP 8gWXw+Km8KBH2eWfl0jbrcQligEfELJOThQr5ElGFWyWpihMD1b1K5OzZOnlUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361110; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9u9Yz2elmPKHINsdAhN93lEZGkr1s1SORkXI5Ky68c8=; b=XkfYOknToah18Wv2+ZOsQAH91oenHBRFuSTOle2EKrTlkNgizSAN+ZZqyD+liUQF1aDjcZ aRhNKqRf0Mt2gvgSJXRvlFJcfu6IgMs9cj7LJ5dY1nA6sADTGNLDPgGpI8hcYw61Usxb/L x9KtuiE+MYBY8w5tel1vw0yAo0W1BvCnRrvSHbWUYGPXXcKA5GFOuu8bg4QfLBjipD90YM LMVYIRUjzrasiXqC81/84SjcU1gWioSY8oM3QG0NoT6aO5PVapmEXWNDpzcm53BRYVHNTs MHKd1gbg39oVDcIi196RyMiQqZEBHXOodxXPuYdCpXq3Ys2k0c+yGSRvAbNjwg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361110; a=rsa-sha256; cv=none; b=qVfIxa2Q6hfRbRopB4FSJyDJ13UON5ZZtMtbCUAsKMM38rqrsOKqrHnVCBQi28lZNLyqt4 9rJS1XQovuhRxrfzFE8plwkb3bA5xvboDz8Laldq73GUD9xDxjKmsqKxm9ZXpISV5iuH7t dx4Idm8L3aVait42vTEk/Q4xXuFKh7feeV90H2evW3R3+V2F9AlZWPz1ClZAAfIFK3A7kV WVsTkFAxk/uIJdw3IY5jiv3wQ0BoV7BSzJ2fA8y7ALltgg5eWrdiiFn2l8ZFC5dOcchVP+ P0fwLl2Tc2OPx0Ji8nEdlv+WkFPTQLKrpzb+6cfMoKboJ7DRYS02BzzgEOUHZw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpLG1y5PzjDP; Mon, 19 Feb 2024 16:45:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGjAOO095671; Mon, 19 Feb 2024 16:45:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGjABd095668; Mon, 19 Feb 2024 16:45:10 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:45:10 GMT Message-Id: <202402191645.41JGjABd095668@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 977d1ded2991 - stable/14 - arm64: Add PAC instruction macros List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 977d1ded299177114c46f9f6d9a2001959f20996 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=977d1ded299177114c46f9f6d9a2001959f20996 commit 977d1ded299177114c46f9f6d9a2001959f20996 Author: Andrew Turner AuthorDate: 2023-10-12 09:48:38 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 13:11:21 +0000 arm64: Add PAC instruction macros To support Pointer Authentication (PAC) in assembly files add a pair of macros that sign the link register. When used before storing to the stack it will allow hardware to detect if it has changed before using it in the return instruction. Reviewed by: markj, emaste Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42226 (cherry picked from commit 2b39a6f68c3839454cd255b91978202cd995182a) --- sys/arm64/include/asm.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/sys/arm64/include/asm.h b/sys/arm64/include/asm.h index da3c3df5f647..16be39b3eae4 100644 --- a/sys/arm64/include/asm.h +++ b/sys/arm64/include/asm.h @@ -142,6 +142,28 @@ #define BTI_J #endif +/* + * To help protect against ROP attacks we can use Pointer Authentication + * to sign the return address before pushing it to the stack. + * + * PAC_LR_SIGN can be used at the start of a function to sign the link + * register with the stack pointer as the modifier. As this is in the hint + * space it is safe to use on CPUs that don't implement pointer + * authentication. It can be used in place of the BTI_C instruction above as + * a valid BTI landing pad instruction. + * + * PAC_LR_AUTH is used to authenticate the link register using the stack + * pointer as the modifier. It should be used in any function that uses + * PAC_LR_SIGN. The stack pointer must be identical in each case. + */ +#ifdef __ARM_FEATURE_PAC_DEFAULT +#define PAC_LR_SIGN hint #25 /* paciasp */ +#define PAC_LR_AUTH hint #29 /* autiasp */ +#else +#define PAC_LR_SIGN +#define PAC_LR_AUTH +#endif + /* * GNU_PROPERTY_AARCH64_FEATURE_1_NOTE can be used to insert a note that * the current assembly file is built with Pointer Authentication (PAC) or From nobody Mon Feb 19 16:45:11 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpLJ0kD8z5C9QK; Mon, 19 Feb 2024 16:45:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpLH45kVz4bZK; Mon, 19 Feb 2024 16:45:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361111; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xbnhotF42s6oWpBNTMY4VUiMZB2CB2r5H8S95zWTPuA=; b=KZwAr8K+ZvZa23fCNhgJYukatpZstkpD1NL9Nqxy0ZReq8q4zVHMfzu6yhw7reTN4Ey0YP 5ir8LTst7aqS7bw0NafCOIphQ83QSKkRXMa4hNdS1lI2Zo3QRdnSA0I1OsWzYFIsldirCA Lq43C10A9GdCLNnV5KT7EDwjTYjrTOVAOiLlUodXcDETW2ZbDxusXmGkIPmyO3nQk+R65X kTSniYpO9DYAahab47wJUeVq63xcw79xY5fNiOuknkOgtvX5xhtKiJrCw4cw/fFg958Zi8 d6JEcp8vZVin8xS7BmFcq9Sb88tLsJAYLDcOKTRPW38QXjRaytihkiGzY+4TCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361111; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xbnhotF42s6oWpBNTMY4VUiMZB2CB2r5H8S95zWTPuA=; b=hEBZpq2UkNvRhllX0oFg2dLbms77HK4wb+Yq8eIjAF9U33rUdeTaq4FrlfuDlvuI5bt9wU BIhrnGx84MxXuADplI6vi9XFva6Dbs5rDKZbaIF93xefPa7AvP1qGEWdMMam2lr8rDnFkj dGm3jgYK4RLSQTeO0eUi+bd2ROCp1Wc/ONeOW+oV8yrOZTgBXJUi4WtsMkgPCTfCLDFOYl f/oWQ/i/y8PPWQlZ/sJ3O2vmxmbLa53Xk767QW6njOblsfLfnULOI8xt1y1xzgFZOi1u4M 5+3AdPlZ1AI7aMW2BdnBeJdwQquHjrddFnLPSi/kkIPFQgFHEt3FBYyHYh3F0w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361111; a=rsa-sha256; cv=none; b=vO1KfZIsvB6WnZosVkOge3OI+YYxinUWkEe4TS9uAKoZZMkqewyUHwA7bZW26udcihh0Cj GEIHqR4Ygv3lNhBpk3k2SlIItio3Ea6jfuGCX76YzigBCYpaE/8TLdsI7rthago0RqzV3U WeuZBwdumRvGqA+DWztBKhrbbFLtNdg4msUnr4T1oBo+L0EJ0Ws0wxCYJdVKIkaGH4tkN/ hxlJMRsLxfVrny9p/gEYg3aIClXIqP3uTsjPkVLRcURnuKVs9ebPJD0H73FdoLVdEaNFzj lCNC/jJTyHbSN6YiWQ7C7EMfDr0obvKmi8/ebOWbPbYdlt97d3d8lE5ziditzA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpLH2lbkzjQ9; Mon, 19 Feb 2024 16:45:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGjBDM095719; Mon, 19 Feb 2024 16:45:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGjBvF095716; Mon, 19 Feb 2024 16:45:11 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:45:11 GMT Message-Id: <202402191645.41JGjBvF095716@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: d723cf210ded - stable/14 - arm64: Fix long lines in vm_machdep.c List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: d723cf210dedd9f2c8ff4d7166dd19c2db240b1a Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=d723cf210dedd9f2c8ff4d7166dd19c2db240b1a commit d723cf210dedd9f2c8ff4d7166dd19c2db240b1a Author: Andrew Turner AuthorDate: 2023-09-12 13:45:07 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 13:11:32 +0000 arm64: Fix long lines in vm_machdep.c Reviewed by: emaste Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D41828 (cherry picked from commit 26ac295c050d0cdaf9cc5b7e2bd1038bfcbec08e) --- sys/arm64/arm64/vm_machdep.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/arm64/arm64/vm_machdep.c b/sys/arm64/arm64/vm_machdep.c index 66528b8487e0..40f5e7da8f8c 100644 --- a/sys/arm64/arm64/vm_machdep.c +++ b/sys/arm64/arm64/vm_machdep.c @@ -214,11 +214,13 @@ cpu_set_upcall(struct thread *td, void (*entry)(void *), void *arg, /* 32bits processes use r13 for sp */ if (td->td_frame->tf_spsr & PSR_M_32) { - tf->tf_x[13] = STACKALIGN((uintptr_t)stack->ss_sp + stack->ss_size); + tf->tf_x[13] = STACKALIGN((uintptr_t)stack->ss_sp + + stack->ss_size); if ((register_t)entry & 1) tf->tf_spsr |= PSR_T; } else - tf->tf_sp = STACKALIGN((uintptr_t)stack->ss_sp + stack->ss_size); + tf->tf_sp = STACKALIGN((uintptr_t)stack->ss_sp + + stack->ss_size); tf->tf_elr = (register_t)entry; tf->tf_x[0] = (register_t)arg; tf->tf_x[29] = 0; From nobody Mon Feb 19 16:45:13 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpLL1ScHz5C9Kh; Mon, 19 Feb 2024 16:45:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpLK5Nj0z4bSH; Mon, 19 Feb 2024 16:45:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361113; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2nrNlCzb8cUeZ6fTdIFnnBzcscdH9vxq8eY2dW1t3eg=; b=nDtqgZDXuUpJ4Gwjrf9ATVxTDC3BUDqP6ahEXr6bXu1Hgr1wUwlV+Nt9mvifpv5s4iizCz yzi61v7GFWShlK+74+MXetDPVdLNhdFjoZF8h9OOiLXAn5cgD97gqRlL+hTjEBDAC7/cbS UhBeWrAJQiHpIAK2ceo7cLi6POISDBzn+gb7JIAY15TxvvvDtDSBdlOubgIR4eIT92cwAQ i1etb7ij5RrUlXVT2eMoK9K5NaZ8zeHXyq4LNr4CHIg6JWfV6MMSOpQ+84ZXMGYp5yTtxk VA789RcmM2UTKhGZbWpM7yDMhgY+DL7ZB4zhYo7ObDk/dA6JtzFolw074/M6dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361113; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2nrNlCzb8cUeZ6fTdIFnnBzcscdH9vxq8eY2dW1t3eg=; b=eoMXRfwD+5xB3MZO+M/sVpMkvGInSAbqYMAB9BthVU8LAzOBCdUqikSlbeVGu+Bfup4PIl PVoHjivm/j9gjvzAK/5SNI3aLTc4kM9z4A1X+JD/xNtUztUJ/Y9ztRZE+CEpFz1TbSha3O 9BMFql2GnO9pVF1t/WUg9oh7WyEfWs58+pXhP7dIRKD01BJRkgMAQAuDgbeWkV7rg/Rx+G m8/h1bMm+PB83CVzIDVDAcq0HGXRpN7zLJ8/aiKXdYhyuNohq62Vz+qh/a8ur+nFKOexXn SlaUN/4mlEYISWjv/5nOo6CzWh4jGLzITp+ivqG4UKysG5N1/xDXa2vl70NTRQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361113; a=rsa-sha256; cv=none; b=X0soLNc2pKrsvRtXp72ilY/GMtxgyIYOtdrF23rxbwLH6QV4a2auvzj2+Rr+sJmRxRQwtk MqXeZSFYwzG5Z8JiJXNg0EnP9I1tgIHQ57YpejAR8u7prqK/ouxL9+3+vLVrZkB8FOmMx6 Z9kkejbTp2yzuK/Le3sLLHHNryuYmISgQYMyJvZrtzV4Sf0AAla2BxVEsNxwzICfomKz6D mKQnJF0CQKZna5505J7caQ81rnPTItxrQM+ndi0P2BqOi4pIqeQgTdoHMghM82H1j8sr2p Bwjm3qGeIw4QlAan+Zt0NDNMJJD9DMr920QM7+tla6r33hk6MeAKujDxantJwQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpLK4VvdzjVb; Mon, 19 Feb 2024 16:45:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGjDiF095810; Mon, 19 Feb 2024 16:45:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGjDfH095807; Mon, 19 Feb 2024 16:45:13 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:45:13 GMT Message-Id: <202402191645.41JGjDfH095807@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 08569764e6c9 - stable/14 - arm64: Add a missing MRS_HWCAP_END List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 08569764e6c9272dd62ca2ad3ac109bd2fa93538 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=08569764e6c9272dd62ca2ad3ac109bd2fa93538 commit 08569764e6c9272dd62ca2ad3ac109bd2fa93538 Author: Andrew Turner AuthorDate: 2023-10-25 12:32:04 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 13:11:52 +0000 arm64: Add a missing MRS_HWCAP_END Add a missing end marker to stop the arm64 CPU ID code reading past the end of an array. Sponsored by: Arm Ltd (cherry picked from commit 1e05cf5f97dee6d7139aa64f14264fb4c2333455) --- sys/arm64/arm64/identcpu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c index 4202cbe7878f..a5c359547981 100644 --- a/sys/arm64/arm64/identcpu.c +++ b/sys/arm64/arm64/identcpu.c @@ -1723,6 +1723,7 @@ static const struct mrs_field_value mvfr0_fpdp[] = { static const struct mrs_field_hwcap mvfr0_fpdp_caps[] = { MRS_HWCAP(&elf32_hwcap, HWCAP32_VFP, MVFR0_FPDP_VFP_v2), MRS_HWCAP(&elf32_hwcap, HWCAP32_VFPv3, MVFR0_FPDP_VFP_v3_v4), + MRS_HWCAP_END }; static const struct mrs_field_value mvfr0_fpsp[] = { From nobody Mon Feb 19 16:45:12 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpLJ69MMz5C9NJ; Mon, 19 Feb 2024 16:45:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpLJ4Tsfz4bg5; Mon, 19 Feb 2024 16:45:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361112; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xYUy8hSI5FeRsEVWAvdL/oVpPTLwOxpMtv1W/RFsz4M=; b=u2I5zCjbyqJ9C88YWWxJrt/Ud9E66skeKYfu6CbtQQkG+A2OWXhT1YRVZKHFrrQAxiYTKR GCZOmc9EKXIha9vIAnq9I7j0led+73WFw68ybTMwF8v/qd6t9G+F+LHlZEpJv3ixx19WTR cmAfkEIalu2EQudRIbmSzKCkT6qkeNxNV7bllYjLeN5fz1L8fdBg/cmHCOGyE1JiOW2S4Z DYIsEJ2faKTRkQ6aCFCMrfY+0kn0E3Ke+swXr4B1mVtblYN2xvgPV9ql6TBJevewu/0yLk d+5f9XSc09+K6iqxLHzXbSwELw2yHufd+Pun9Lwy0/Iqgaj2rEUZ8nK5jl0bdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361112; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xYUy8hSI5FeRsEVWAvdL/oVpPTLwOxpMtv1W/RFsz4M=; b=DlxMe0IlyydGAlMAxNU3gXfk/GTLdm7UN0xTNoVKQKuFvufwn34IwEg6AzxIpSlAzZpyMa azK6jaamzF3nZj79Bsxjmuma1lBS4kA+rMtKmkKyuqgFlEgrIMu2s/fTW/0dji3W/mElHZ /HMQwM7ITIAwC6h2d8oQv1Lqkok8SDuQgFoCx0WDFsG3HghQr3BSonENbVqlRdaTgOsgF9 IV9+u/z1RLKcOyoVK2Esocg9PN69JjUo4WdYblsWJolBqIJy1ONqYeDFDYQ9heqjidqoI4 9lkw41pvLJD0V6vFA9UaBrJnQ5XJaGZXYMY1MaUfzkPbZWaahATUtJmP+VGiXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361112; a=rsa-sha256; cv=none; b=xoIcvZPvwrJHx1PAOkID5dxaitNi0SYTHN8it14VyQ1LTbYcC3gLN95mS9NTfE0JfkbT5Q +ng8Q8gV6LWSyq2ImkP52VTdnpFJ2Y1Ru8eobrTEhT2mPs4crmDS3ku7dxNaeqm6f/sVI9 n01ykmIOsfyq7hzvhe53D743cP1Z5XYXeHH/8yY4m/zhgNe8KQUbqV1ggbQJKRD1M54lJ9 L617VFYZMjGeCvg47xJl9ROaxdLYORdb8WaL77/93f4doKdyfKlV7wPkZfc4Ae8aWLMg8T iV/xewHPoGh+htN2os7ti0yxBbfnGPasqu8bz/jsUJVM6MOFZFPmx8uJEzFW7A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpLJ3XwJzjQB; Mon, 19 Feb 2024 16:45:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGjCB8095768; Mon, 19 Feb 2024 16:45:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGjCnU095765; Mon, 19 Feb 2024 16:45:12 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:45:12 GMT Message-Id: <202402191645.41JGjCnU095765@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 63b2b7cca22d - stable/14 - arm64: Teach bus_dma on arm64 about NUMA List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 63b2b7cca22d4c42ec546a0077481977e7b3dd24 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=63b2b7cca22d4c42ec546a0077481977e7b3dd24 commit 63b2b7cca22d4c42ec546a0077481977e7b3dd24 Author: Andrew Turner AuthorDate: 2023-10-12 16:01:01 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 13:11:45 +0000 arm64: Teach bus_dma on arm64 about NUMA When allocating memory we should try to allocate from the NUMA node closest to the device to reduce cross domain memory traffic. Teach the arm64 bus_dma code to do this. While here use mallocarray to guard against an unlikely integer overflow. Reviewed by: markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42187 (cherry picked from commit 271e669ed5e55c95075b0dafaa58fded5b7556d0) --- sys/arm64/arm64/busdma_bounce.c | 126 +++++++++++++++++++++++++-------------- sys/arm64/arm64/busdma_machdep.c | 13 +++- 2 files changed, 93 insertions(+), 46 deletions(-) diff --git a/sys/arm64/arm64/busdma_bounce.c b/sys/arm64/arm64/busdma_bounce.c index cfdfe62fecaf..c1028f35ba7f 100644 --- a/sys/arm64/arm64/busdma_bounce.c +++ b/sys/arm64/arm64/busdma_bounce.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -117,6 +118,7 @@ static void _bus_dmamap_count_phys(bus_dma_tag_t dmat, bus_dmamap_t map, static MALLOC_DEFINE(M_BUSDMA, "busdma", "busdma metadata"); #define dmat_alignment(dmat) ((dmat)->common.alignment) +#define dmat_domain(dmat) ((dmat)->common.domain) #define dmat_flags(dmat) ((dmat)->common.flags) #define dmat_lowaddr(dmat) ((dmat)->common.lowaddr) #define dmat_lockfunc(dmat) ((dmat)->common.lockfunc) @@ -124,6 +126,40 @@ static MALLOC_DEFINE(M_BUSDMA, "busdma", "busdma metadata"); #include "../../kern/subr_busdma_bounce.c" +static int +bounce_bus_dma_zone_setup(bus_dma_tag_t dmat) +{ + struct bounce_zone *bz; + bus_size_t maxsize; + int error; + + /* + * Round size up to a full page, and add one more page because + * there can always be one more boundary crossing than the + * number of pages in a transfer. + */ + maxsize = roundup2(dmat->common.maxsize, PAGE_SIZE) + PAGE_SIZE; + + /* Must bounce */ + if ((error = alloc_bounce_zone(dmat)) != 0) + return (error); + bz = dmat->bounce_zone; + + if (ptoa(bz->total_bpages) < maxsize) { + int pages; + + pages = atop(maxsize) + 1 - bz->total_bpages; + + /* Add pages to our bounce pool */ + if (alloc_bounce_pages(dmat, pages) < pages) + return (ENOMEM); + } + /* Performed initial allocation */ + dmat->bounce_flags |= BF_MIN_ALLOC_COMP; + + return (error); +} + /* * Return true if the DMA should bounce because the start or end does not fall * on a cacheline boundary (which would require a partial cacheline flush). @@ -257,34 +293,9 @@ bounce_bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment, newtag->common.alignment > 1) newtag->bounce_flags |= BF_COULD_BOUNCE; - if ((flags & BUS_DMA_ALLOCNOW) != 0) { - struct bounce_zone *bz; - /* - * Round size up to a full page, and add one more page because - * there can always be one more boundary crossing than the - * number of pages in a transfer. - */ - maxsize = roundup2(maxsize, PAGE_SIZE) + PAGE_SIZE; - - /* Must bounce */ - if ((error = alloc_bounce_zone(newtag)) != 0) { - free(newtag, M_DEVBUF); - return (error); - } - bz = newtag->bounce_zone; - - if (ptoa(bz->total_bpages) < maxsize) { - int pages; - - pages = atop(maxsize) + 1 - bz->total_bpages; - - /* Add pages to our bounce pool */ - if (alloc_bounce_pages(newtag, pages) < pages) - error = ENOMEM; - } - /* Performed initial allocation */ - newtag->bounce_flags |= BF_MIN_ALLOC_COMP; - } else + if ((flags & BUS_DMA_ALLOCNOW) != 0) + error = bounce_bus_dma_zone_setup(newtag); + else error = 0; if (error != 0) @@ -339,6 +350,23 @@ out: return (error); } +/* + * Update the domain for the tag. We may need to reallocate the zone and + * bounce pages. + */ +static int +bounce_bus_dma_tag_set_domain(bus_dma_tag_t dmat) +{ + + KASSERT(dmat->map_count == 0, + ("bounce_bus_dma_tag_set_domain: Domain set after use.\n")); + if ((dmat->bounce_flags & BF_COULD_BOUNCE) == 0 || + dmat->bounce_zone == NULL) + return (0); + dmat->bounce_flags &= ~BF_MIN_ALLOC_COMP; + return (bounce_bus_dma_zone_setup(dmat)); +} + static bool bounce_bus_dma_id_mapped(bus_dma_tag_t dmat, vm_paddr_t buf, bus_size_t buflen) { @@ -356,7 +384,8 @@ alloc_dmamap(bus_dma_tag_t dmat, int flags) mapsize = sizeof(*map); mapsize += sizeof(struct sync_list) * dmat->common.nsegments; - map = malloc(mapsize, M_DEVBUF, flags | M_ZERO); + map = malloc_domainset(mapsize, M_DEVBUF, + DOMAINSET_PREF(dmat->common.domain), flags | M_ZERO); if (map == NULL) return (NULL); @@ -379,9 +408,9 @@ bounce_bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp) error = 0; if (dmat->segments == NULL) { - dmat->segments = (bus_dma_segment_t *)malloc( - sizeof(bus_dma_segment_t) * dmat->common.nsegments, - M_DEVBUF, M_NOWAIT); + dmat->segments = mallocarray_domainset(dmat->common.nsegments, + sizeof(bus_dma_segment_t), M_DEVBUF, + DOMAINSET_PREF(dmat->common.domain), M_NOWAIT); if (dmat->segments == NULL) { CTR3(KTR_BUSDMA, "%s: tag %p error %d", __func__, dmat, ENOMEM); @@ -490,9 +519,9 @@ bounce_bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags, mflags = M_WAITOK; if (dmat->segments == NULL) { - dmat->segments = (bus_dma_segment_t *)malloc( - sizeof(bus_dma_segment_t) * dmat->common.nsegments, - M_DEVBUF, mflags); + dmat->segments = mallocarray_domainset(dmat->common.nsegments, + sizeof(bus_dma_segment_t), M_DEVBUF, + DOMAINSET_PREF(dmat->common.domain), mflags); if (dmat->segments == NULL) { CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", __func__, dmat, dmat->common.flags, ENOMEM); @@ -536,9 +565,10 @@ bounce_bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags, /* * Allocate the buffer from the malloc(9) allocator if... - * - It's small enough to fit into a single power of two sized bucket. - * - The alignment is less than or equal to the maximum size + * - It's small enough to fit into a single page. + * - Its alignment requirement is also smaller than the page size. * - The low address requirement is fulfilled. + * - Default cache attributes are requested (WB). * else allocate non-contiguous pages if... * - The page count that could get allocated doesn't exceed * nsegments also when the maximum segment size is less @@ -555,23 +585,28 @@ bounce_bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags, * * In the meantime warn the user if malloc gets it wrong. */ - if ((dmat->alloc_size <= PAGE_SIZE) && - (dmat->alloc_alignment <= dmat->alloc_size) && + if (dmat->alloc_size <= PAGE_SIZE && + dmat->alloc_alignment <= PAGE_SIZE && dmat->common.lowaddr >= ptoa((vm_paddr_t)Maxmem) && attr == VM_MEMATTR_DEFAULT) { - *vaddr = malloc(dmat->alloc_size, M_DEVBUF, mflags); + *vaddr = malloc_domainset_aligned(dmat->alloc_size, + dmat->alloc_alignment, M_DEVBUF, + DOMAINSET_PREF(dmat->common.domain), mflags); } else if (dmat->common.nsegments >= howmany(dmat->alloc_size, MIN(dmat->common.maxsegsz, PAGE_SIZE)) && dmat->alloc_alignment <= PAGE_SIZE && (dmat->common.boundary % PAGE_SIZE) == 0) { /* Page-based multi-segment allocations allowed */ - *vaddr = kmem_alloc_attr(dmat->alloc_size, mflags, - 0ul, dmat->common.lowaddr, attr); + *vaddr = kmem_alloc_attr_domainset( + DOMAINSET_PREF(dmat->common.domain), dmat->alloc_size, + mflags, 0ul, dmat->common.lowaddr, attr); dmat->bounce_flags |= BF_KMEM_ALLOC; } else { - *vaddr = kmem_alloc_contig(dmat->alloc_size, mflags, - 0ul, dmat->common.lowaddr, dmat->alloc_alignment != 0 ? - dmat->alloc_alignment : 1ul, dmat->common.boundary, attr); + *vaddr = kmem_alloc_contig_domainset( + DOMAINSET_PREF(dmat->common.domain), dmat->alloc_size, + mflags, 0ul, dmat->common.lowaddr, + dmat->alloc_alignment != 0 ? dmat->alloc_alignment : 1ul, + dmat->common.boundary, attr); dmat->bounce_flags |= BF_KMEM_ALLOC; } if (*vaddr == NULL) { @@ -1147,6 +1182,7 @@ bounce_bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map, struct bus_dma_impl bus_dma_bounce_impl = { .tag_create = bounce_bus_dma_tag_create, .tag_destroy = bounce_bus_dma_tag_destroy, + .tag_set_domain = bounce_bus_dma_tag_set_domain, .id_mapped = bounce_bus_dma_id_mapped, .map_create = bounce_bus_dmamap_create, .map_destroy = bounce_bus_dmamap_destroy, diff --git a/sys/arm64/arm64/busdma_machdep.c b/sys/arm64/arm64/busdma_machdep.c index c1b710e3538d..d36b9ff18ee4 100644 --- a/sys/arm64/arm64/busdma_machdep.c +++ b/sys/arm64/arm64/busdma_machdep.c @@ -44,6 +44,7 @@ #include #include #include +#include #include #include @@ -142,8 +143,11 @@ common_bus_dma_tag_create(struct bus_dma_tag_common *parent, common->filterarg = parent->filterarg; common->parent = parent->parent; } + common->domain = parent->domain; atomic_add_int(&parent->ref_count, 1); } + common->domain = vm_phys_domain_match(common->domain, 0ul, + common->lowaddr); *dmat = common; return (0); } @@ -213,6 +217,13 @@ bus_dma_tag_destroy(bus_dma_tag_t dmat) int bus_dma_tag_set_domain(bus_dma_tag_t dmat, int domain) { + struct bus_dma_tag_common *tc; - return (0); + tc = (struct bus_dma_tag_common *)dmat; + domain = vm_phys_domain_match(domain, 0ul, tc->lowaddr); + /* Only call the callback if it changes. */ + if (domain == tc->domain) + return (0); + tc->domain = domain; + return (tc->impl->tag_set_domain(dmat)); } From nobody Mon Feb 19 16:45:14 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpLM2Ltdz5C9Hn; Mon, 19 Feb 2024 16:45:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpLL6fn3z4bpB; Mon, 19 Feb 2024 16:45:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361114; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R2Ud5+5uK1JDA8CBwRZSDyEeML9tckeBaaMg308yZec=; b=Bek+safOkdAiZwUWFOddVxuRltu5gd2KiZ/IyemmnIQFaNmzElrPHPjudf2iIXNlPBznvC DVwOUkm+Bjp63dI9gZ2nMYLK3Mj4Gvr+sMVYEo2b4LCB9rfDJQzUSHAn+3SYD0bvXxw4UE UtEYXpDfSdGm80Q6zrsGPJaTdu4i5b8xXo2FSLu7h5vvzi5ed/kLFNdVWrIIak6EppBaEU a2OKZh9D9xiJgctVts5VNx69/E4Lrd+d62vFqVgqJic/28q2bdhYJqf6SyL0cCK2TqujPc 7Sbh342rBtzb5a1DFvKcuRBNsBeFW/TZNSYLiK8QiihPNlEgMJ0410oc904U0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361114; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R2Ud5+5uK1JDA8CBwRZSDyEeML9tckeBaaMg308yZec=; b=LI5OrQn3XjsIQJVB/yx7ftzeFByYEPlPgBH8N14dqTSy76eLByzFLvrTC7WOE9lZmW9Ymq dgP6OrRdlpKM3tviCGN6u7IDvrSiQS4xNnQAgtBj8XQwgaFa6CD76pdXWuKLLQdqvx+64z 8kub0bb9kaWdBciabZ385WK5muy6n7ztjFVsxboNIayDPHQGjFYJAEeKznSm2h4gZGcKXx 3nP6hXIT9QFoB2GIeJiI790DSf97gwQIFT2DuhHAohKmzfY+VwD7FF5XuIOBrJWQI7muD2 paLjog9xEH5/WfV9iuI7bAg5W69npClqqmb/n/pf71BqGG66R1TyByvUvPTWmA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361114; a=rsa-sha256; cv=none; b=sB5ieaVU2ghlXavzsb9hZ97mrgrIz96BrpDFREsNrhMOzdYR1uav1/vcqD1DUvj+EezM3h eNguy10glLSPZt9htnHc5pcGTRHx24JBxPeBCtmFHuMYJCnIcE2nW9TBfiBwazchwQPTyM /9Nnt9lGEnG3a87cZ7gNdljKrELuAqrBXaIkDiRMTui2uwVWrFRfcHfby1M34rLiToucBg f5c1hEEtoXaePfS6RGRFUq7+zDR5y4P/m0AE1ClMWcH6NaIv5MPrjAij4r69QdRVUgZ46a CrA1xKtlF5BkUkp6gsy6GXgpjcO0F/UVjEls7zOSAajDGeyOv5lh0sEl3QXD8w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpLL5n7DzjGt; Mon, 19 Feb 2024 16:45:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGjEnk095858; Mon, 19 Feb 2024 16:45:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGjEXP095855; Mon, 19 Feb 2024 16:45:14 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:45:14 GMT Message-Id: <202402191645.41JGjEXP095855@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: eb1dae1c40f2 - stable/14 - csu: Teach csu about PAC and BTI List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: eb1dae1c40f261f39f96db83d86b995985b5af7c Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=eb1dae1c40f261f39f96db83d86b995985b5af7c commit eb1dae1c40f261f39f96db83d86b995985b5af7c Author: Andrew Turner AuthorDate: 2023-10-12 10:03:37 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 13:12:08 +0000 csu: Teach csu about PAC and BTI Add the Branch Target Identification (BTI) note to libc assembly sources and Pointer Authentication Code (PAC) instructions to _init and _fini. _init and _fini may be called indirectly so need a BTI landing pad. As they are non-leaf functions use the appropriate PAC instruction that also guards against changing the link register. As all object files need the note for any binary using these object files we need to insert it in all asm files. Reviewed by: markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42227 (cherry picked from commit 522126fea72419fae344fbcb897b41588909308a) --- lib/csu/aarch64/crt1_s.S | 4 ++++ lib/csu/aarch64/crti.S | 5 +++++ lib/csu/aarch64/crtn.S | 6 ++++++ lib/csu/common/crtbrand.S | 5 +++++ lib/csu/common/feature_note.S | 5 +++++ lib/csu/common/ignore_init_note.S | 5 +++++ 6 files changed, 30 insertions(+) diff --git a/lib/csu/aarch64/crt1_s.S b/lib/csu/aarch64/crt1_s.S index 97b4bff35a0b..981cf4653efd 100644 --- a/lib/csu/aarch64/crt1_s.S +++ b/lib/csu/aarch64/crt1_s.S @@ -30,6 +30,8 @@ */ #include +#include + /* * The program entry point * void _start(char **ap, void (*cleanup)(void)) __dead2 @@ -62,3 +64,5 @@ eprol: END(_start) .section .note.GNU-stack,"",@progbits + +GNU_PROPERTY_AARCH64_FEATURE_1_NOTE(GNU_PROPERTY_AARCH64_FEATURE_1_VAL) diff --git a/lib/csu/aarch64/crti.S b/lib/csu/aarch64/crti.S index 0a20f4c5e314..8bd2dfac1494 100644 --- a/lib/csu/aarch64/crti.S +++ b/lib/csu/aarch64/crti.S @@ -28,11 +28,14 @@ */ #include +#include + .section .init,"ax",@progbits .align 4 .globl _init .type _init,@function _init: + PAC_LR_SIGN stp x29, x30, [sp, #-16]! mov x29, sp @@ -41,6 +44,8 @@ _init: .globl _fini .type _fini,@function _fini: + PAC_LR_SIGN stp x29, x30, [sp, #-16]! mov x29, sp +GNU_PROPERTY_AARCH64_FEATURE_1_NOTE(GNU_PROPERTY_AARCH64_FEATURE_1_VAL) diff --git a/lib/csu/aarch64/crtn.S b/lib/csu/aarch64/crtn.S index 924aa36aa045..441411f0ab83 100644 --- a/lib/csu/aarch64/crtn.S +++ b/lib/csu/aarch64/crtn.S @@ -28,13 +28,19 @@ */ #include +#include + .section .init,"ax",@progbits ldp x29, x30, [sp], #16 + PAC_LR_AUTH ret .section .fini,"ax",@progbits ldp x29, x30, [sp], #16 + PAC_LR_AUTH ret .section .note.GNU-stack,"",%progbits + +GNU_PROPERTY_AARCH64_FEATURE_1_NOTE(GNU_PROPERTY_AARCH64_FEATURE_1_VAL) diff --git a/lib/csu/common/crtbrand.S b/lib/csu/common/crtbrand.S index 0ed86bfba2b2..b59e2fd8056b 100644 --- a/lib/csu/common/crtbrand.S +++ b/lib/csu/common/crtbrand.S @@ -47,3 +47,8 @@ 4: .section .note.GNU-stack,"",%progbits + +#ifdef __aarch64__ +/* This is needed in all objects for BTI to be used in the linked elf file */ +GNU_PROPERTY_AARCH64_FEATURE_1_NOTE(GNU_PROPERTY_AARCH64_FEATURE_1_VAL) +#endif diff --git a/lib/csu/common/feature_note.S b/lib/csu/common/feature_note.S index 343d2a9262e2..5c1d56d4cde1 100644 --- a/lib/csu/common/feature_note.S +++ b/lib/csu/common/feature_note.S @@ -40,3 +40,8 @@ 4: .section .note.GNU-stack,"",%progbits + +#ifdef __aarch64__ +/* This is needed in all objects for BTI to be used in the linked elf file */ +GNU_PROPERTY_AARCH64_FEATURE_1_NOTE(GNU_PROPERTY_AARCH64_FEATURE_1_VAL) +#endif diff --git a/lib/csu/common/ignore_init_note.S b/lib/csu/common/ignore_init_note.S index fa37a8990538..57fb4e8f4d51 100644 --- a/lib/csu/common/ignore_init_note.S +++ b/lib/csu/common/ignore_init_note.S @@ -41,3 +41,8 @@ 4: .section .note.GNU-stack,"",%progbits + +#ifdef __aarch64__ +/* This is needed in all objects for BTI to be used in the linked elf file */ +GNU_PROPERTY_AARCH64_FEATURE_1_NOTE(GNU_PROPERTY_AARCH64_FEATURE_1_VAL) +#endif From nobody Mon Feb 19 16:45:15 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpLN2t4Sz5C9Hv; Mon, 19 Feb 2024 16:45:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpLN1007z4bpS; Mon, 19 Feb 2024 16:45:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361116; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JjPeGSQY2E/3tdjOmKBeWuUxaRQznVKvOc/UFJatiHM=; b=Wyic/liovu2Q+57w195/brh13B5RhArhSBvj5fr/yGKZoXymz59zb9Oj95GCdDLX8SdhK6 WavfnINdWS/PZsASfaOcJT8ADLe5l7sQEcRacbA4kBMtVB08Yjc1I5ToBjpHMnfPgrvuqO Ye+3LtqzZwfZxG1IM65OAbuUhIB3WCJn0tyCuJR+yd1qDcxnTmXeWCTBeSREj2iSg5xhl8 8xCoX+TUXuA9vWvfHAaRwJ6nrfDTurRfNYdRj6Gk+80g3EwsjNKyVa/lbe9A+ssXg3cBUU DVRyjG1jXtbHRTGE874KOIPMu+ln1WogHDvS87726ap4cw6zBvXmpLIMjWPYwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361116; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JjPeGSQY2E/3tdjOmKBeWuUxaRQznVKvOc/UFJatiHM=; b=OBorI2R9y5zAisymHbGlgewsQsDfdqM3y+nE4qpD4hvHJheuLrEumiGaTYjzP1vbkI1y/L qsA/nKfqb8aVeTlZk0y77KgFuU55+KDv+euqS8T4u+2qXPGD4TTt0tbJTMGqDHRPc3lcX4 IBKmyh1z0JrSWn0I1s9TbZ0h2vFM/IQKoMO67HarpHg8RMyeycigtKdy86ekIx3j0M8NTd JZuJZC8FVp2dqg56XZ1b8UAH/A2CDa6EX+vky7wBXdq2vEpHC+aaglnO4YhnFAJCYzl3rz 3vz6WpRTXELcYGXn2LMo/GagkCw5CywjhPpUlrpTYBv+iEwFKOA73cQsu1PTlA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361116; a=rsa-sha256; cv=none; b=Tk2r48Hk/wUp+Ojb3Jxhv2sROqH+U+Fc1LepbllmWALozfRywDPwaJFRjxGF8H8bwAptJ6 BPUGjKqQm1W8JEkBhdduaZKhlNiI+axivju4DNOoMXYzqZCT72wWwzBYD6yi5Van52nxbC KAa6s/usY3UpkgXKWm5Fa9x35/GPTG/UE0MTsFkXSqfHW/lGcMw08l3ET2YtYLke3F/z1U CTK+i2GyJ2r88m9a6s4LN0CsvA6Zh0u0zYFBxAW2i54kpizfGo8E8WvXgD+/MRLKdj+mrv t0mbvB3qegAzkfdTTniVh+yR07zDjWJrJQ6Ss/OZUXZWmVfBuf2ZO5eP3UwGYw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpLM6pSKzj9S; Mon, 19 Feb 2024 16:45:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGjF5W095915; Mon, 19 Feb 2024 16:45:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGjFKx095912; Mon, 19 Feb 2024 16:45:15 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:45:15 GMT Message-Id: <202402191645.41JGjFKx095912@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: d4163257401c - stable/14 - rtld: Teach rtld about the BTI elf note List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: d4163257401ce2fbf1023453992fbf15111beb48 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=d4163257401ce2fbf1023453992fbf15111beb48 commit d4163257401ce2fbf1023453992fbf15111beb48 Author: Andrew Turner AuthorDate: 2023-10-12 16:29:46 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 13:12:18 +0000 rtld: Teach rtld about the BTI elf note Add the Branch Target Identification (BTI) note to libc assembly sources. As all obect files need the note for rtld to have it we need to insert it in all asm files. Reviewed by: markj, emaste Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42228 (cherry picked from commit 5270cc9757fb4e0c1303ec44c2602b75acf3806d) --- libexec/rtld-elf/aarch64/rtld_start.S | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libexec/rtld-elf/aarch64/rtld_start.S b/libexec/rtld-elf/aarch64/rtld_start.S index 7dc87213b5fb..8de3e021d567 100644 --- a/libexec/rtld-elf/aarch64/rtld_start.S +++ b/libexec/rtld-elf/aarch64/rtld_start.S @@ -28,6 +28,8 @@ */ #include +#include + ENTRY(.rtld_start) .cfi_undefined x30 mov x19, x0 /* Put ps_strings in a callee-saved register */ @@ -249,3 +251,5 @@ ENTRY(_rtld_tlsdesc_dynamic) .cfi_adjust_cfa_offset -2 * 16 ret END(_rtld_tlsdesc_dynamic) + +GNU_PROPERTY_AARCH64_FEATURE_1_NOTE(GNU_PROPERTY_AARCH64_FEATURE_1_VAL) From nobody Mon Feb 19 16:45:16 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpLP3nXQz5C9Hx; Mon, 19 Feb 2024 16:45:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpLP1LH6z4bpq; Mon, 19 Feb 2024 16:45:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361117; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GLJMAlkvfIrWOaha7TuD9jKY+/Hk6rr+To1g5c6+xV4=; b=aeSp9s0zC4cSRqclaCEgNeyamfCd913prSlmDolTXJHmYbrJJ7uwKVvNdrbCP77mxepV4I xfXCpQdtAlDMmLjLDnyWWlEcAL4uYsUQ9ZakYFiWYKQ7ZF8r+KjcaBmWRJdK4lYX2mIVyn ebWo7FPhWReKuJhwy9eOyD/XR2IMYwa8VY6GvSh9dWjsv1q/nLt5pw1Qjy8LHoKGPOHT2a aoZvHA1YoVb9ly1gqJapQ3BCx4wwVXiQY47PV8vHHmiphVmCg7JQXJPUq2SX5CW9jpFHvc mevuHnRvaqzOlBorGDMf4R3yUTBKoh3OwuIUhpNjSMUDx2D3092hvRDmYHb3NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361117; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GLJMAlkvfIrWOaha7TuD9jKY+/Hk6rr+To1g5c6+xV4=; b=vL2oIdoBPFBmOxyS9OaNA/kj+Ev4DIek4LXrglwU15ORCuTWMUvWgUw3slb6970eR8xO6C EZCL/tPhVEJ3XzNB7EKh1yIHcyI6ETlspKgl7cRfptjCM6bVXzcxBJgPLnzsdwG5m4Td9V z/Y0GEo2312lFvR3yqb8YubUCOCy91tiLGuA1y2M55+kyaGFop5s7cK8NZplKHG2L+zw66 J1iFhT+4fHI/vp32vnnvEnEEkN/0nfkhhf0+nfcBfUNdrIoJshEumbV/fZZ9JaZlJs6Nmm 2pv7mwOD3iEDZLjY5JFKPxYcprlPYNODurrfBcQOd2fr1zw67NKOA0NhZahg4g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361117; a=rsa-sha256; cv=none; b=sPdLMylCSNDrakd+gaPmD3fjTN767WWgsLKE6GsFLhSw81dqc1WJziEjXH6Veqgj9/KqcQ bQCu11ex1req6CtmRcr1M71bRhEX6nwVWsK8/PMvbKDHjMdawtROymSvEKcF25ZWzyERnn 43oPPikYWWb3O51DxbX6jF14oLiDPeC4fhC16NBf04EcJoEVIZhPzYAEDlXZuGQqW0sRnz PeIuyQZFkPwd80Z0PoYEIlRX9kAYNTD2nrsa64DDmnSF0wM1qnDIHvn5VfmyfQAo7TBzwF XU9soSALwHz53s+S4PDrHITtxHpQ9uGtAiImBY0RwZsxYxGiWgBw+a029C4Qug== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpLP0RrGzj9T; Mon, 19 Feb 2024 16:45:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGjGAZ095968; Mon, 19 Feb 2024 16:45:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGjG4v095965; Mon, 19 Feb 2024 16:45:16 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:45:16 GMT Message-Id: <202402191645.41JGjG4v095965@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: aace2b59a835 - stable/14 - arm64: Add a BTI landing pad to .mcount List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: aace2b59a835bb6b90a134e370e6af63792f4a12 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=aace2b59a835bb6b90a134e370e6af63792f4a12 commit aace2b59a835bb6b90a134e370e6af63792f4a12 Author: Andrew Turner AuthorDate: 2023-10-16 14:34:19 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 13:12:30 +0000 arm64: Add a BTI landing pad to .mcount The .mcount function needs a BTI branch target. As we can't rely on asm.h being included use the hint version of a "bti c" instruction. This is a nop when BTI is not supported or not used. Reviewed by: markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42230 (cherry picked from commit 0590ed0967e025e1d155da9e06509f3fe9686feb) --- sys/arm64/include/profile.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/arm64/include/profile.h b/sys/arm64/include/profile.h index 3e4a34669360..8a61ff995d83 100644 --- a/sys/arm64/include/profile.h +++ b/sys/arm64/include/profile.h @@ -68,6 +68,8 @@ static void _mcount " .globl .mcount \n" \ " .mcount: \n" \ " .cfi_startproc \n" \ + /* Allow this to work with BTI, see BTI_C in asm.h */ \ +" hint #34 \n" \ /* Load the caller return address as frompc */ \ " ldr x0, [x29, #8] \n" \ /* Use our return address as selfpc */ \ From nobody Mon Feb 19 16:45:18 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpLQ4SK5z5C9WS; Mon, 19 Feb 2024 16:45:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpLQ297Kz4bh0; Mon, 19 Feb 2024 16:45:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gp3YYrn0UC6WZ0DofC1v8SsHExOQSyzHWpoCGdxE0gk=; b=NQ/3LmnH/q3HZw7p98BDvgMjzfIkqrkhkb2y9ptuuoxIy4J1G9bhlt6H6U0F7SakiGlLEH 41UjBVCes9hO5BqPOi00U7f8JjBIc6leZUGvkRTru4aaAva8gzuGzIG/W/RVwKcVw2pc5u tiLcwBJOAtTlPU8O99RgPRu7PGbP5T2Q44T5mDL8o8XnOUDTgOWfDsnzc1E3JwRE/k/nHz mn4MJ8jjGDJ24mOsVP939jjXCHkpCWVITio6HX9B62SWRbS5mFL7OB1hm1GV98/UCXicZb 2ICpPHLTnSXijbnx38MPlUweQlNk/De8Z1Apb49MHcCNT2MeRfBMfdha90yzYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gp3YYrn0UC6WZ0DofC1v8SsHExOQSyzHWpoCGdxE0gk=; b=cHOGKzOygp/c+6kmv6SuSToEets5fUXaaCV7aFzPizIJl7Z0k8blRC+lKMn1AuQynrr1Oo fqF/minJ7mfV8eI+BcQIrmBKzM/xF3VcSTja3b77Y2JMBfjZN1gVTNLujrrSY+N3ybWOIn PVKI2CpglD1G8whXk6ex32OIaKpxw3y+sMzQPS00I85jEid9sBa2cJUZ1/+Cp8Wg1bViyU HVkkMAvQiLJrNbqw2AlQhrpLaFDyScKiJJ+fgYoWoB52pjJhhOg+nGpuUheaqhW0Ya5N9Q BJHWB5r+APvubSjyYfwDmeTDWnjayslTB6ws97uUBZobx7cB3zucax4jqMtUng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361118; a=rsa-sha256; cv=none; b=RgibGeGwonHtvWa2HSB8EraYWVmlAhxZimA26mlxBnY4ATogVkLY8MSSwNVRpB1OC1usAZ W++NBSiXkK8fWRhNsYp6FOv//n03oFzfozdhhAF8m/q/dKmn4yE9vCDqQ7ijfS05eUK+DL 1UPMTT92sjiulLLABAVnH/l6HEpqAOrx6d61xNLJQh5187ARNgDFktyXdFyl83hSix34up M+VxEkhf23k4qr8Zt6NuNzwY0Z0n4pyEeui8iP4bPISYFNGjW58lY2SvUVZ5cW4/vDkXo5 NGEPdGXY5B67araTIIwyaGktBny8JwuK6yBSykcIM5by4NRKaM62m5tmut6ALQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpLQ1H6yzjVc; Mon, 19 Feb 2024 16:45:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGjIff096016; Mon, 19 Feb 2024 16:45:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGjI8c096013; Mon, 19 Feb 2024 16:45:18 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:45:18 GMT Message-Id: <202402191645.41JGjI8c096013@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: c424b194192e - stable/14 - imgact_elf: Move GNU_ABI_VENDOR to a common header List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: c424b194192ee818662ac83e8420a9c35f046f0a Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=c424b194192ee818662ac83e8420a9c35f046f0a commit c424b194192ee818662ac83e8420a9c35f046f0a Author: Andrew Turner AuthorDate: 2023-11-01 15:05:58 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 13:12:40 +0000 imgact_elf: Move GNU_ABI_VENDOR to a common header Move the definition of GNU_ABI_VENDOR to a common location so it can be used in multiple files. Reviewed by: emaste, kib, imp Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42442 (cherry picked from commit 9d2612fc2a7e54719058c68b62ea035b029c954f) --- sys/kern/imgact_elf.c | 1 - sys/sys/imgact_elf.h | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index 85f0602fe584..0b22e113b3d7 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -246,7 +246,6 @@ __elfN(freebsd_trans_osrel)(const Elf_Note *note, int32_t *osrel) return (true); } -static const char GNU_ABI_VENDOR[] = "GNU"; static int GNU_KFREEBSD_ABI_DESC = 3; Elf_Brandnote __elfN(kfreebsd_brandnote) = { diff --git a/sys/sys/imgact_elf.h b/sys/sys/imgact_elf.h index f3d9be027079..7210fc2187a9 100644 --- a/sys/sys/imgact_elf.h +++ b/sys/sys/imgact_elf.h @@ -100,6 +100,7 @@ __ElfType(Brandinfo); #define MAX_BRANDS 8 #define FREEBSD_ABI_VENDOR "FreeBSD" +#define GNU_ABI_VENDOR "GNU" typedef void (*outfunc_t)(void *, struct sbuf *, size_t *); From nobody Mon Feb 19 16:45:19 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpLR4hm6z5C9Kt; Mon, 19 Feb 2024 16:45:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpLR3VHdz4bvh; Mon, 19 Feb 2024 16:45:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361119; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f0duNByO1neTvF46FBxzF9TKfIhtsR/noE8O7QKAk2c=; b=r/JiYKHg5Ev52oh0G0M0zKgvU/fuIBU4uSGSwChSfLZYUKLvRbLXnPHR5ReMENkXI4a/RK bE+lFLBS0zq/DJmC3sFarUKj+j7zhp0nahsQeL1CZBZYQ0FIzrpxJPkbhEQE0R/JIlfAA1 zMTPi3DR1ZuVq7hYnmJm/C61HIURRd0FvLFk/1QHBNCNmZ9D+XqT7O7UxhQw3Khacrwi0F 9udo4BlruUbE80jktrSu0KqYkSs+u72IWggSqg3GtcufSy9hLVlXv1l5yPNGUq1swYmAyi Rwzlfp9bi7hk8nEJRSUf035N4AkU9dIyY+FrHIw/ZFCJbBisrmrgiuyMv4F9lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361119; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f0duNByO1neTvF46FBxzF9TKfIhtsR/noE8O7QKAk2c=; b=LoF+H4bpdb7+/6FSNhXZ3gawXSwqk+DxOi2a3mTmTDHLeTBaOOOLxiSmbn8cgHj4Na7FlM gcSE7GtPXXbEJptM6jcC+iOzpS2bB+aGJa3jq+iItJl7sVinlbr6sOBW+qYypYaKBEcFOB Ri2l84fyD+2B1TsgUtHqteKMrWMIfRq5z23kU3yrS7huKKEDhVJonzs8A3fXzOHBw73jI3 yvDBI49aiw8HpmxG0+vNgF95X9qnw/Cqffce0C/LTSexJH4VUO5WkzosFUA0WZC0Dm8MHb lz5G6Uo+Zc/blieaYILZjM/ne8YjHs7Njs8mjxJAvH6vCtrAnyBkiKURbjz+rg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361119; a=rsa-sha256; cv=none; b=pSNsD3ARi0HPIbq/fruztZsJ2O4LdN9xRCtbIGzLvIaoZafVxQzukSiZsOg6doeRXiuWHR WZrFehL1n6QQaHDyWH0VEZvp4a1L4kZCbUIHOGv5qlUukCbJoY0nQ2NF88DvjvrEyHPTEx c9xbdBtZCgJ7HnFUcrVwGJfF+VEpdiEUc6OPIsi0BaZFhq1EzGCqsMXzMks/Dy7oeS1tp8 E+HZSGzoTZY9ymqF02npFrI/wk1biG5iUN4AA51tYOlL+3VwgTLMo4n5yNkmPNYRIh7GbD TF0Js6ATpiExBmlL/eOxIvBEUY7xkqpWO4XHbCxvQm11sp9dD/tlGJ3bo+WZzw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpLR2c77zj9V; Mon, 19 Feb 2024 16:45:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGjJIp096054; Mon, 19 Feb 2024 16:45:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGjJXt096051; Mon, 19 Feb 2024 16:45:19 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:45:19 GMT Message-Id: <202402191645.41JGjJXt096051@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 403c7ef8e853 - stable/14 - imgact_elf: Export __elfN(parse_notes) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 403c7ef8e853544227fc18d41fed6a019d26cc52 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=403c7ef8e853544227fc18d41fed6a019d26cc52 commit 403c7ef8e853544227fc18d41fed6a019d26cc52 Author: Andrew Turner AuthorDate: 2023-11-01 15:18:12 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 13:12:51 +0000 imgact_elf: Export __elfN(parse_notes) This is useful to check if a note is present and contains an expected value, e.g. to read NT_GNU_PROPERTY_TYPE_0 on arm64 to see if we should enable BTI. Reviewed by: kib, markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42439 (cherry picked from commit a04633cef81e3b29da4eb214331bd472fc2e9238) --- sys/kern/imgact_elf.c | 2 +- sys/sys/imgact_elf.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index 0b22e113b3d7..23ddf3ac717a 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -2704,7 +2704,7 @@ __elfN(note_procstat_auxv)(void *arg, struct sbuf *sb, size_t *sizep) } #define MAX_NOTES_LOOP 4096 -static bool +bool __elfN(parse_notes)(struct image_params *imgp, Elf_Note *checknote, const char *note_vendor, const Elf_Phdr *pnote, bool (*cb)(const Elf_Note *, void *, bool *), void *cb_arg) diff --git a/sys/sys/imgact_elf.h b/sys/sys/imgact_elf.h index 7210fc2187a9..51e149476a28 100644 --- a/sys/sys/imgact_elf.h +++ b/sys/sys/imgact_elf.h @@ -123,6 +123,9 @@ void __elfN(prepare_notes)(struct thread *, struct note_info_list *, void __elfN(size_segments)(struct thread *, struct sseg_closure *, int); size_t __elfN(register_note)(struct thread *, struct note_info_list *, int, outfunc_t, void *); +bool __elfN(parse_notes)(struct image_params *, Elf_Note *, const char *, + const Elf_Phdr *, bool (*)(const Elf_Note *, void *, bool *), + void *); /* Machine specific function to dump per-thread information. */ void __elfN(dump_thread)(struct thread *, void *, size_t *); From nobody Mon Feb 19 16:45:20 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpLS6B7qz5C9NX; Mon, 19 Feb 2024 16:45:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpLS4S8Rz4bsw; Mon, 19 Feb 2024 16:45:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361120; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q12Bz8skvgnA8Q4FeHfh8KWbhnheHC62AIB0rS5+kvs=; b=r/XfqUXunG6ctqtjL3nqjzZRkDRCCdg3yHKqp/i//mdEJxEkN7A8f48Ae5FKSIzzzbaTsT +dp45erJmODndkh8TRRokTOZ8NtthUhAp7tr9THWT84RpHsdSdbuWPMadpPSw+KgkByTGS pSF03yKfyCgW3ANd2rEepxbYfjd3saBwmCQypoKeqOfhf18Vni3bzEC04cqowy91H4iO3M 7T+f3BDtHDf0EjRwf3v3M9LIvp1rKpd4PVpAyUC3lc8fHVW3ND1q/b7kdwtiOav2ikGRqE oMkWdL/IaAmTKqiuIt8sEIoLLZriF8Ytj+dpuGjQqYaKNltJAkyxFQalKiIbvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361120; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q12Bz8skvgnA8Q4FeHfh8KWbhnheHC62AIB0rS5+kvs=; b=SJbZkJBCAxW0oDVd5HvtR0Z2xTa50xSORFGI1rHDPNUrQd2sb3tED7vYevLcnDKcWwVlAo Sp5AE4XgXeJceeSk3TIzCPbNJond13jtkaFvP5CcnR/nnkMlM/L0D96fhrGf/6H8rlEOjo oS1mecBo7tL+1pLtZK74RfeHrIxnItnMGpBKTU8y9yI4n34WN6vYsKaPuhXbDVLax4Px99 S9mZgpkC4SGNfkiPchhnM/mo3+w3r6r/SmhEnbnHrG22eA2ml0/Diuv/4Ww/Z4bjbIQe8Q D8N/7FLXo0/uJ6NutLkSZd3hkeMK0Obl45eQbB39TAPcd3QGlnWc6vvxUkWhYQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361120; a=rsa-sha256; cv=none; b=X/KP+hANZDlytfv2mzFySdFiO0eIatDV3X2Q9gFyIHzkqE9A3OC1evA1pzlt9s6+ZXMjPj 1sqyT4QS8kiG5ijfzJf0yES1EKadSFMC1lU1dEQh3d5QooxskQgpApIaOV2wef1QlVOoEk dPvW03qArb4sjcdoiTJQaPNPT7v1NW+mYiy5hxAmCoXWqBtpRlRyY/oy2GlOXEfjNorVBS p2HLB6xiwwFkLczNKsDb+1sFFWMXKSMviXmOPJYhnRoFjGXVSSc8rnxEsPrAWEUUth9wNY RsP/JfQcsFrk5G0Ww2piONBY0ADQKhKCgxmbKVs5aHAjgrodCczz/iID6Mcv+A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpLS3Qp0zjSR; Mon, 19 Feb 2024 16:45:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGjKv4096113; Mon, 19 Feb 2024 16:45:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGjKxY096110; Mon, 19 Feb 2024 16:45:20 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:45:20 GMT Message-Id: <202402191645.41JGjKxY096110@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 829446911790 - stable/14 - arm64: Add an is64bit flag to user readable ID regs List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 829446911790ef33a1d81e6de4751af668afc843 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=829446911790ef33a1d81e6de4751af668afc843 commit 829446911790ef33a1d81e6de4751af668afc843 Author: Andrew Turner AuthorDate: 2023-10-25 10:47:30 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 13:13:16 +0000 arm64: Add an is64bit flag to user readable ID regs To tell if a register is for 32 or 64 bit userspace add a flag to the user reg struct. This will be used later to rework how the hwcaps are generated. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42370 (cherry picked from commit c2dc043c9757aad77bb1745e3b14dfa6b27e3fa4) --- sys/arm64/arm64/identcpu.c | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c index a5c359547981..b1d963c07630 100644 --- a/sys/arm64/arm64/identcpu.c +++ b/sys/arm64/arm64/identcpu.c @@ -1827,50 +1827,52 @@ struct mrs_user_reg { u_int reg; u_int CRm; u_int Op2; + bool is64bit; size_t offset; const struct mrs_field *fields; }; -#define USER_REG(name, field_name) \ +#define USER_REG(name, field_name, _is64bit) \ { \ .reg = name, \ .CRm = name##_CRm, \ .Op2 = name##_op2, \ .offset = __offsetof(struct cpu_desc, field_name), \ .fields = field_name##_fields, \ + .is64bit = _is64bit, \ } static const struct mrs_user_reg user_regs[] = { - USER_REG(ID_AA64AFR0_EL1, id_aa64afr0), - USER_REG(ID_AA64AFR1_EL1, id_aa64afr1), + USER_REG(ID_AA64AFR0_EL1, id_aa64afr0, true), + USER_REG(ID_AA64AFR1_EL1, id_aa64afr1, true), - USER_REG(ID_AA64DFR0_EL1, id_aa64dfr0), - USER_REG(ID_AA64DFR1_EL1, id_aa64dfr1), + USER_REG(ID_AA64DFR0_EL1, id_aa64dfr0, true), + USER_REG(ID_AA64DFR1_EL1, id_aa64dfr1, true), - USER_REG(ID_AA64ISAR0_EL1, id_aa64isar0), - USER_REG(ID_AA64ISAR1_EL1, id_aa64isar1), - USER_REG(ID_AA64ISAR2_EL1, id_aa64isar2), + USER_REG(ID_AA64ISAR0_EL1, id_aa64isar0, true), + USER_REG(ID_AA64ISAR1_EL1, id_aa64isar1, true), + USER_REG(ID_AA64ISAR2_EL1, id_aa64isar2, true), - USER_REG(ID_AA64MMFR0_EL1, id_aa64mmfr0), - USER_REG(ID_AA64MMFR1_EL1, id_aa64mmfr1), - USER_REG(ID_AA64MMFR2_EL1, id_aa64mmfr2), + USER_REG(ID_AA64MMFR0_EL1, id_aa64mmfr0, true), + USER_REG(ID_AA64MMFR1_EL1, id_aa64mmfr1, true), + USER_REG(ID_AA64MMFR2_EL1, id_aa64mmfr2, true), #ifdef NOTYET - USER_REG(ID_AA64MMFR3_EL1, id_aa64mmfr3), - USER_REG(ID_AA64MMFR4_EL1, id_aa64mmfr4), + USER_REG(ID_AA64MMFR3_EL1, id_aa64mmfr3, true), + USER_REG(ID_AA64MMFR4_EL1, id_aa64mmfr4, true), #endif - USER_REG(ID_AA64PFR0_EL1, id_aa64pfr0), - USER_REG(ID_AA64PFR1_EL1, id_aa64pfr1), + USER_REG(ID_AA64PFR0_EL1, id_aa64pfr0, true), + USER_REG(ID_AA64PFR1_EL1, id_aa64pfr1, true), #ifdef NOTYET - USER_REG(ID_AA64PFR2_EL1, id_aa64pfr2), + USER_REG(ID_AA64PFR2_EL1, id_aa64pfr2, true), #endif - USER_REG(ID_AA64ZFR0_EL1, id_aa64zfr0), + USER_REG(ID_AA64ZFR0_EL1, id_aa64zfr0, true), #ifdef COMPAT_FREEBSD32 - USER_REG(ID_ISAR5_EL1, id_isar5), + USER_REG(ID_ISAR5_EL1, id_isar5, false), - USER_REG(MVFR0_EL1, mvfr0), - USER_REG(MVFR1_EL1, mvfr1), + USER_REG(MVFR0_EL1, mvfr0, false), + USER_REG(MVFR1_EL1, mvfr1, false), #endif /* COMPAT_FREEBSD32 */ }; From nobody Mon Feb 19 16:45:21 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpLT6PWqz5C9NZ; Mon, 19 Feb 2024 16:45:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpLT4tNKz4bwQ; Mon, 19 Feb 2024 16:45:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361121; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Au1uybg9boXTxunhkD/3II2PAVHQ3UvGCaGGI90g1Xc=; b=NPDmQG6Qc456iN1KdwmesCdltEPkQFY3uj92GaQlhHeyZRjCStzrDKc7eXvcBb7xV19ujO NSxdp/OZEt/Ecn1bi09bXlr3a6gI52AkT+nc3uq0XiSoeVVMHVrZDYpfXnGiwXFuIA/hVW wWhyGo/1z6msog9R5YfdvPKZktnT+d2EyjAoeJx8pv8RAMH+bsy3DJIjVAVhS2Ls2YwfUX PGUeRKS7r8SZXcchUcsuN7cuTnADtFsUW5jkOL6SXm7Y04H2vxgecbyM87MB3QYeX+bxvc j+NB+aeADX/FzlpXmMvpdXvxBONAXUYLIPuscSeBqGn6G3DEJgRC2kCHEHAi3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361121; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Au1uybg9boXTxunhkD/3II2PAVHQ3UvGCaGGI90g1Xc=; b=R2ADVtOCihfAx8V70Iez0s1YhxBQCCiEr321Xkckv8zDeCp87j8C330coz44nhlZB6Mw8d p7/8hG7E6bSEWCJCHef5V3wC1Ry/dq1u0b5idESpoSRUprwkkdCQh19kaYIYqT0FTtHgLS FXTrGLmBh3szbbSWhZmeI8sbEF1jykSPBTOjSm5CULzhwbM2kfObhdwcGZeWGBNakKXrG5 2thisYniq8pFM03thKq25+srIqh6MpcpFd467QWmONHm2yhzo032gNG0wsjSprLy/E6p7a rDgF9IqXZBHJHp4gqPl+uIKg49WxBZx/oRPlj3lRwUb3QS//pNBZoYoqZB3Yrg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361121; a=rsa-sha256; cv=none; b=qrC4c+46jglENpxhZpplFqJ1bu0B4xoBJ40l8QJuiTFuPFq7u3KxIKpWUK9wfclLOm0fY9 QGWJCditzAfyVxp8Rmrpt885+0uiybuapBjh9wDD5ru1nYwHsAY5F0Ik6MxE457+lr/ASc adOWuny+ij9NDcYQou/HpZF4v0M5BJgeOABqojbeO1DBxKLXnECM0GeOQl33WdfUxLM+fk NUlngL867kGiiE/311lzUQ7LyW5iR2L7aM0qhrtkFHaITnLSLe+v2MjCCikoriASnM8Lfg e9IQSe0EGgrySbgClG/wMmnz8mHXl67daoRKMlZGwOgl9XgWU3XsTSG5tfZy4w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpLT3yDLzjDQ; Mon, 19 Feb 2024 16:45:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGjLSJ096171; Mon, 19 Feb 2024 16:45:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGjLcg096168; Mon, 19 Feb 2024 16:45:21 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:45:21 GMT Message-Id: <202402191645.41JGjLcg096168@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 148222e3a099 - stable/14 - arm64: Use a hwcap ID rather than pointer List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 148222e3a09965a7d8af72d00ee4584a0df16ca7 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=148222e3a09965a7d8af72d00ee4584a0df16ca7 commit 148222e3a09965a7d8af72d00ee4584a0df16ca7 Author: Andrew Turner AuthorDate: 2023-10-26 10:21:57 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 13:13:30 +0000 arm64: Use a hwcap ID rather than pointer To allow for a different Linux hwcap value store the hwcap ID rather than a pointer to elf{32,}_hwcap{2,}. This will be needed when creating a different view of the ID registers for FreeBSD and Linux. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42371 (cherry picked from commit c9e8b4b27966acf710f86d8c9f867f857f05f2c3) --- sys/arm64/arm64/identcpu.c | 133 +++++++++++++++++++++++++-------------------- 1 file changed, 74 insertions(+), 59 deletions(-) diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c index b1d963c07630..7acce7f5fc5b 100644 --- a/sys/arm64/arm64/identcpu.c +++ b/sys/arm64/arm64/identcpu.c @@ -317,19 +317,19 @@ struct mrs_field_value { #define MRS_FIELD_VALUE_END { .desc = NULL } struct mrs_field_hwcap { - u_long *hwcap; uint64_t min; u_long hwcap_val; + u_int hwcap_id; }; -#define MRS_HWCAP(_hwcap, _val, _min) \ +#define MRS_HWCAP(_hwcap_id, _val, _min) \ { \ - .hwcap = (_hwcap), \ + .hwcap_id = (_hwcap_id), \ .hwcap_val = (_val), \ .min = (_min), \ } -#define MRS_HWCAP_END { .hwcap = NULL } +#define MRS_HWCAP_END { .hwcap_id = 0 } struct mrs_field { const char *name; @@ -493,7 +493,7 @@ static const struct mrs_field_value id_aa64isar0_rndr[] = { }; static const struct mrs_field_hwcap id_aa64isar0_rndr_caps[] = { - MRS_HWCAP(&elf_hwcap2, HWCAP2_RNG, ID_AA64ISAR0_RNDR_IMPL), + MRS_HWCAP(2, HWCAP2_RNG, ID_AA64ISAR0_RNDR_IMPL), MRS_HWCAP_END }; @@ -512,8 +512,8 @@ static const struct mrs_field_value id_aa64isar0_ts[] = { }; static const struct mrs_field_hwcap id_aa64isar0_ts_caps[] = { - MRS_HWCAP(&elf_hwcap, HWCAP_FLAGM, ID_AA64ISAR0_TS_CondM_8_4), - MRS_HWCAP(&elf_hwcap2, HWCAP2_FLAGM2, ID_AA64ISAR0_TS_CondM_8_5), + MRS_HWCAP(1, HWCAP_FLAGM, ID_AA64ISAR0_TS_CondM_8_4), + MRS_HWCAP(2, HWCAP2_FLAGM2, ID_AA64ISAR0_TS_CondM_8_5), MRS_HWCAP_END }; @@ -523,7 +523,7 @@ static const struct mrs_field_value id_aa64isar0_fhm[] = { }; static const struct mrs_field_hwcap id_aa64isar0_fhm_caps[] = { - MRS_HWCAP(&elf_hwcap, HWCAP_ASIMDFHM, ID_AA64ISAR0_FHM_IMPL), + MRS_HWCAP(1, HWCAP_ASIMDFHM, ID_AA64ISAR0_FHM_IMPL), MRS_HWCAP_END }; @@ -533,7 +533,7 @@ static const struct mrs_field_value id_aa64isar0_dp[] = { }; static const struct mrs_field_hwcap id_aa64isar0_dp_caps[] = { - MRS_HWCAP(&elf_hwcap, HWCAP_ASIMDDP, ID_AA64ISAR0_DP_IMPL), + MRS_HWCAP(1, HWCAP_ASIMDDP, ID_AA64ISAR0_DP_IMPL), MRS_HWCAP_END }; @@ -543,7 +543,7 @@ static const struct mrs_field_value id_aa64isar0_sm4[] = { }; static const struct mrs_field_hwcap id_aa64isar0_sm4_caps[] = { - MRS_HWCAP(&elf_hwcap, HWCAP_SM4, ID_AA64ISAR0_SM4_IMPL), + MRS_HWCAP(1, HWCAP_SM4, ID_AA64ISAR0_SM4_IMPL), MRS_HWCAP_END }; @@ -553,7 +553,7 @@ static const struct mrs_field_value id_aa64isar0_sm3[] = { }; static const struct mrs_field_hwcap id_aa64isar0_sm3_caps[] = { - MRS_HWCAP(&elf_hwcap, HWCAP_SM3, ID_AA64ISAR0_SM3_IMPL), + MRS_HWCAP(1, HWCAP_SM3, ID_AA64ISAR0_SM3_IMPL), MRS_HWCAP_END }; @@ -563,7 +563,7 @@ static const struct mrs_field_value id_aa64isar0_sha3[] = { }; static const struct mrs_field_hwcap id_aa64isar0_sha3_caps[] = { - MRS_HWCAP(&elf_hwcap, HWCAP_SHA3, ID_AA64ISAR0_SHA3_IMPL), + MRS_HWCAP(1, HWCAP_SHA3, ID_AA64ISAR0_SHA3_IMPL), MRS_HWCAP_END }; @@ -573,7 +573,7 @@ static const struct mrs_field_value id_aa64isar0_rdm[] = { }; static const struct mrs_field_hwcap id_aa64isar0_rdm_caps[] = { - MRS_HWCAP(&elf_hwcap, HWCAP_ASIMDRDM, ID_AA64ISAR0_RDM_IMPL), + MRS_HWCAP(1, HWCAP_ASIMDRDM, ID_AA64ISAR0_RDM_IMPL), MRS_HWCAP_END }; @@ -588,7 +588,7 @@ static const struct mrs_field_value id_aa64isar0_atomic[] = { }; static const struct mrs_field_hwcap id_aa64isar0_atomic_caps[] = { - MRS_HWCAP(&elf_hwcap, HWCAP_ATOMICS, ID_AA64ISAR0_Atomic_IMPL), + MRS_HWCAP(1, HWCAP_ATOMICS, ID_AA64ISAR0_Atomic_IMPL), MRS_HWCAP_END }; @@ -598,7 +598,7 @@ static const struct mrs_field_value id_aa64isar0_crc32[] = { }; static const struct mrs_field_hwcap id_aa64isar0_crc32_caps[] = { - MRS_HWCAP(&elf_hwcap, HWCAP_CRC32, ID_AA64ISAR0_CRC32_BASE), + MRS_HWCAP(1, HWCAP_CRC32, ID_AA64ISAR0_CRC32_BASE), MRS_HWCAP_END }; @@ -609,8 +609,8 @@ static const struct mrs_field_value id_aa64isar0_sha2[] = { }; static const struct mrs_field_hwcap id_aa64isar0_sha2_caps[] = { - MRS_HWCAP(&elf_hwcap, HWCAP_SHA2, ID_AA64ISAR0_SHA2_BASE), - MRS_HWCAP(&elf_hwcap, HWCAP_SHA512, ID_AA64ISAR0_SHA2_512), + MRS_HWCAP(1, HWCAP_SHA2, ID_AA64ISAR0_SHA2_BASE), + MRS_HWCAP(1, HWCAP_SHA512, ID_AA64ISAR0_SHA2_512), MRS_HWCAP_END }; @@ -620,7 +620,7 @@ static const struct mrs_field_value id_aa64isar0_sha1[] = { }; static const struct mrs_field_hwcap id_aa64isar0_sha1_caps[] = { - MRS_HWCAP(&elf_hwcap, HWCAP_SHA1, ID_AA64ISAR0_SHA1_BASE), + MRS_HWCAP(1, HWCAP_SHA1, ID_AA64ISAR0_SHA1_BASE), MRS_HWCAP_END }; @@ -631,8 +631,8 @@ static const struct mrs_field_value id_aa64isar0_aes[] = { }; static const struct mrs_field_hwcap id_aa64isar0_aes_caps[] = { - MRS_HWCAP(&elf_hwcap, HWCAP_AES, ID_AA64ISAR0_AES_BASE), - MRS_HWCAP(&elf_hwcap, HWCAP_PMULL, ID_AA64ISAR0_AES_PMULL), + MRS_HWCAP(1, HWCAP_AES, ID_AA64ISAR0_AES_BASE), + MRS_HWCAP(1, HWCAP_PMULL, ID_AA64ISAR0_AES_PMULL), MRS_HWCAP_END }; @@ -688,7 +688,7 @@ static const struct mrs_field_value id_aa64isar1_i8mm[] = { }; static const struct mrs_field_hwcap id_aa64isar1_i8mm_caps[] = { - MRS_HWCAP(&elf_hwcap2, HWCAP2_I8MM, ID_AA64ISAR1_I8MM_IMPL), + MRS_HWCAP(2, HWCAP2_I8MM, ID_AA64ISAR1_I8MM_IMPL), MRS_HWCAP_END }; @@ -698,7 +698,7 @@ static const struct mrs_field_value id_aa64isar1_dgh[] = { }; static const struct mrs_field_hwcap id_aa64isar1_dgh_caps[] = { - MRS_HWCAP(&elf_hwcap2, HWCAP2_DGH, ID_AA64ISAR1_DGH_IMPL), + MRS_HWCAP(2, HWCAP2_DGH, ID_AA64ISAR1_DGH_IMPL), MRS_HWCAP_END }; @@ -709,7 +709,7 @@ static const struct mrs_field_value id_aa64isar1_bf16[] = { }; static const struct mrs_field_hwcap id_aa64isar1_bf16_caps[] = { - MRS_HWCAP(&elf_hwcap2, HWCAP2_BF16, ID_AA64ISAR1_BF16_IMPL), + MRS_HWCAP(2, HWCAP2_BF16, ID_AA64ISAR1_BF16_IMPL), MRS_HWCAP_END }; @@ -725,7 +725,7 @@ static const struct mrs_field_value id_aa64isar1_sb[] = { }; static const struct mrs_field_hwcap id_aa64isar1_sb_caps[] = { - MRS_HWCAP(&elf_hwcap, HWCAP_SB, ID_AA64ISAR1_SB_IMPL), + MRS_HWCAP(1, HWCAP_SB, ID_AA64ISAR1_SB_IMPL), MRS_HWCAP_END }; @@ -735,7 +735,7 @@ static const struct mrs_field_value id_aa64isar1_frintts[] = { }; static const struct mrs_field_hwcap id_aa64isar1_frintts_caps[] = { - MRS_HWCAP(&elf_hwcap2, HWCAP2_FRINT, ID_AA64ISAR1_FRINTTS_IMPL), + MRS_HWCAP(2, HWCAP2_FRINT, ID_AA64ISAR1_FRINTTS_IMPL), MRS_HWCAP_END }; @@ -745,7 +745,7 @@ static const struct mrs_field_value id_aa64isar1_gpi[] = { }; static const struct mrs_field_hwcap id_aa64isar1_gpi_caps[] = { - MRS_HWCAP(&elf_hwcap, HWCAP_PACG, ID_AA64ISAR1_GPI_IMPL), + MRS_HWCAP(1, HWCAP_PACG, ID_AA64ISAR1_GPI_IMPL), MRS_HWCAP_END }; @@ -755,7 +755,7 @@ static const struct mrs_field_value id_aa64isar1_gpa[] = { }; static const struct mrs_field_hwcap id_aa64isar1_gpa_caps[] = { - MRS_HWCAP(&elf_hwcap, HWCAP_PACG, ID_AA64ISAR1_GPA_IMPL), + MRS_HWCAP(1, HWCAP_PACG, ID_AA64ISAR1_GPA_IMPL), MRS_HWCAP_END }; @@ -767,8 +767,8 @@ static const struct mrs_field_value id_aa64isar1_lrcpc[] = { }; static const struct mrs_field_hwcap id_aa64isar1_lrcpc_caps[] = { - MRS_HWCAP(&elf_hwcap, HWCAP_LRCPC, ID_AA64ISAR1_LRCPC_RCPC_8_3), - MRS_HWCAP(&elf_hwcap, HWCAP_ILRCPC, ID_AA64ISAR1_LRCPC_RCPC_8_4), + MRS_HWCAP(1, HWCAP_LRCPC, ID_AA64ISAR1_LRCPC_RCPC_8_3), + MRS_HWCAP(1, HWCAP_ILRCPC, ID_AA64ISAR1_LRCPC_RCPC_8_4), MRS_HWCAP_END }; @@ -778,7 +778,7 @@ static const struct mrs_field_value id_aa64isar1_fcma[] = { }; static const struct mrs_field_hwcap id_aa64isar1_fcma_caps[] = { - MRS_HWCAP(&elf_hwcap, HWCAP_FCMA, ID_AA64ISAR1_FCMA_IMPL), + MRS_HWCAP(1, HWCAP_FCMA, ID_AA64ISAR1_FCMA_IMPL), MRS_HWCAP_END }; @@ -788,7 +788,7 @@ static const struct mrs_field_value id_aa64isar1_jscvt[] = { }; static const struct mrs_field_hwcap id_aa64isar1_jscvt_caps[] = { - MRS_HWCAP(&elf_hwcap, HWCAP_JSCVT, ID_AA64ISAR1_JSCVT_IMPL), + MRS_HWCAP(1, HWCAP_JSCVT, ID_AA64ISAR1_JSCVT_IMPL), MRS_HWCAP_END }; @@ -804,7 +804,7 @@ static const struct mrs_field_value id_aa64isar1_api[] = { }; static const struct mrs_field_hwcap id_aa64isar1_api_caps[] = { - MRS_HWCAP(&elf_hwcap, HWCAP_PACA, ID_AA64ISAR1_API_PAC), + MRS_HWCAP(1, HWCAP_PACA, ID_AA64ISAR1_API_PAC), MRS_HWCAP_END }; @@ -820,7 +820,7 @@ static const struct mrs_field_value id_aa64isar1_apa[] = { }; static const struct mrs_field_hwcap id_aa64isar1_apa_caps[] = { - MRS_HWCAP(&elf_hwcap, HWCAP_PACA, ID_AA64ISAR1_APA_PAC), + MRS_HWCAP(1, HWCAP_PACA, ID_AA64ISAR1_APA_PAC), MRS_HWCAP_END }; @@ -832,8 +832,8 @@ static const struct mrs_field_value id_aa64isar1_dpb[] = { }; static const struct mrs_field_hwcap id_aa64isar1_dpb_caps[] = { - MRS_HWCAP(&elf_hwcap, HWCAP_DCPOP, ID_AA64ISAR1_DPB_DCCVAP), - MRS_HWCAP(&elf_hwcap2, HWCAP2_DCPODP, ID_AA64ISAR1_DPB_DCCVADP), + MRS_HWCAP(1, HWCAP_DCPOP, ID_AA64ISAR1_DPB_DCCVAP), + MRS_HWCAP(2, HWCAP2_DCPODP, ID_AA64ISAR1_DPB_DCCVADP), MRS_HWCAP_END }; @@ -900,7 +900,7 @@ static const struct mrs_field_value id_aa64isar2_apa3[] = { }; static const struct mrs_field_hwcap id_aa64isar2_apa3_caps[] = { - MRS_HWCAP(&elf_hwcap, HWCAP_PACA, ID_AA64ISAR2_APA3_PAC), + MRS_HWCAP(1, HWCAP_PACA, ID_AA64ISAR2_APA3_PAC), MRS_HWCAP_END }; @@ -910,7 +910,7 @@ static const struct mrs_field_value id_aa64isar2_gpa3[] = { }; static const struct mrs_field_hwcap id_aa64isar2_gpa3_caps[] = { - MRS_HWCAP(&elf_hwcap, HWCAP_PACG, ID_AA64ISAR2_GPA3_IMPL), + MRS_HWCAP(1, HWCAP_PACG, ID_AA64ISAR2_GPA3_IMPL), MRS_HWCAP_END }; @@ -1201,7 +1201,7 @@ static const struct mrs_field_value id_aa64mmfr2_at[] = { }; static const struct mrs_field_hwcap id_aa64mmfr2_at_caps[] = { - MRS_HWCAP(&elf_hwcap, HWCAP_USCAT, ID_AA64MMFR2_AT_IMPL), + MRS_HWCAP(1, HWCAP_USCAT, ID_AA64MMFR2_AT_IMPL), MRS_HWCAP_END }; @@ -1336,7 +1336,7 @@ static const struct mrs_field_value id_aa64pfr0_dit[] = { }; static const struct mrs_field_hwcap id_aa64pfr0_dit_caps[] = { - MRS_HWCAP(&elf_hwcap, HWCAP_DIT, ID_AA64PFR0_DIT_PSTATE), + MRS_HWCAP(1, HWCAP_DIT, ID_AA64PFR0_DIT_PSTATE), MRS_HWCAP_END }; @@ -1365,7 +1365,7 @@ static const struct mrs_field_value id_aa64pfr0_sve[] = { #if 0 /* Enable when we add SVE support */ static const struct mrs_field_hwcap id_aa64pfr0_sve_caps[] = { - MRS_HWCAP(&elf_hwcap, HWCAP_SVE, ID_AA64PFR0_SVE_IMPL), + MRS_HWCAP(1, HWCAP_SVE, ID_AA64PFR0_SVE_IMPL), MRS_HWCAP_END }; #endif @@ -1392,8 +1392,8 @@ static const struct mrs_field_value id_aa64pfr0_advsimd[] = { }; static const struct mrs_field_hwcap id_aa64pfr0_advsimd_caps[] = { - MRS_HWCAP(&elf_hwcap, HWCAP_ASIMD, ID_AA64PFR0_AdvSIMD_IMPL), - MRS_HWCAP(&elf_hwcap, HWCAP_ASIMDHP, ID_AA64PFR0_AdvSIMD_HP), + MRS_HWCAP(1, HWCAP_ASIMD, ID_AA64PFR0_AdvSIMD_IMPL), + MRS_HWCAP(1, HWCAP_ASIMDHP, ID_AA64PFR0_AdvSIMD_HP), MRS_HWCAP_END }; @@ -1404,8 +1404,8 @@ static const struct mrs_field_value id_aa64pfr0_fp[] = { }; static const struct mrs_field_hwcap id_aa64pfr0_fp_caps[] = { - MRS_HWCAP(&elf_hwcap, HWCAP_FP, ID_AA64PFR0_FP_IMPL), - MRS_HWCAP(&elf_hwcap, HWCAP_FPHP, ID_AA64PFR0_FP_HP), + MRS_HWCAP(1, HWCAP_FP, ID_AA64PFR0_FP_IMPL), + MRS_HWCAP(1, HWCAP_FPHP, ID_AA64PFR0_FP_HP), MRS_HWCAP_END }; @@ -1510,7 +1510,7 @@ static const struct mrs_field_value id_aa64pfr1_ssbs[] = { }; static const struct mrs_field_hwcap id_aa64pfr1_ssbs_caps[] = { - MRS_HWCAP(&elf_hwcap, HWCAP_SSBS, ID_AA64PFR1_SSBS_PSTATE), + MRS_HWCAP(1, HWCAP_SSBS, ID_AA64PFR1_SSBS_PSTATE), MRS_HWCAP_END }; @@ -1523,7 +1523,7 @@ static const struct mrs_field_value id_aa64pfr1_bt[] = { #if 0 /* Enable when we add BTI support */ static const struct mrs_field_hwcap id_aa64pfr1_bt_caps[] = { - MRS_HWCAP(&elf_hwcap2, HWCAP2_BTI, ID_AA64PFR1_BT_IMPL), + MRS_HWCAP(2, HWCAP2_BTI, ID_AA64PFR1_BT_IMPL), MRS_HWCAP_END }; #endif @@ -1636,7 +1636,7 @@ static const struct mrs_field_value id_isar5_crc32[] = { }; static const struct mrs_field_hwcap id_isar5_crc32_caps[] = { - MRS_HWCAP(&elf32_hwcap2, HWCAP32_2_CRC32, ID_ISAR5_CRC32_IMPL), + MRS_HWCAP(2, HWCAP32_2_CRC32, ID_ISAR5_CRC32_IMPL), MRS_HWCAP_END }; @@ -1646,7 +1646,7 @@ static const struct mrs_field_value id_isar5_sha2[] = { }; static const struct mrs_field_hwcap id_isar5_sha2_caps[] = { - MRS_HWCAP(&elf32_hwcap2, HWCAP32_2_SHA2, ID_ISAR5_SHA2_IMPL), + MRS_HWCAP(2, HWCAP32_2_SHA2, ID_ISAR5_SHA2_IMPL), MRS_HWCAP_END }; @@ -1656,7 +1656,7 @@ static const struct mrs_field_value id_isar5_sha1[] = { }; static const struct mrs_field_hwcap id_isar5_sha1_caps[] = { - MRS_HWCAP(&elf32_hwcap2, HWCAP32_2_SHA1, ID_ISAR5_SHA1_IMPL), + MRS_HWCAP(2, HWCAP32_2_SHA1, ID_ISAR5_SHA1_IMPL), MRS_HWCAP_END }; @@ -1667,8 +1667,8 @@ static const struct mrs_field_value id_isar5_aes[] = { }; static const struct mrs_field_hwcap id_isar5_aes_caps[] = { - MRS_HWCAP(&elf32_hwcap2, HWCAP32_2_AES, ID_ISAR5_AES_BASE), - MRS_HWCAP(&elf32_hwcap2, HWCAP32_2_PMULL, ID_ISAR5_AES_VMULL), + MRS_HWCAP(2, HWCAP32_2_AES, ID_ISAR5_AES_BASE), + MRS_HWCAP(2, HWCAP32_2_PMULL, ID_ISAR5_AES_VMULL), MRS_HWCAP_END }; @@ -1721,8 +1721,8 @@ static const struct mrs_field_value mvfr0_fpdp[] = { }; static const struct mrs_field_hwcap mvfr0_fpdp_caps[] = { - MRS_HWCAP(&elf32_hwcap, HWCAP32_VFP, MVFR0_FPDP_VFP_v2), - MRS_HWCAP(&elf32_hwcap, HWCAP32_VFPv3, MVFR0_FPDP_VFP_v3_v4), + MRS_HWCAP(1, HWCAP32_VFP, MVFR0_FPDP_VFP_v2), + MRS_HWCAP(1, HWCAP32_VFPv3, MVFR0_FPDP_VFP_v3_v4), MRS_HWCAP_END }; @@ -1759,7 +1759,7 @@ static const struct mrs_field_value mvfr1_simdfmac[] = { }; static const struct mrs_field_hwcap mvfr1_simdfmac_caps[] = { - MRS_HWCAP(&elf32_hwcap, HWCAP32_VFPv4, MVFR1_SIMDFMAC_IMPL), + MRS_HWCAP(1, HWCAP32_VFPv4, MVFR1_SIMDFMAC_IMPL), MRS_HWCAP_END }; @@ -1794,7 +1794,7 @@ static const struct mrs_field_value mvfr1_simdls[] = { }; static const struct mrs_field_hwcap mvfr1_simdls_caps[] = { - MRS_HWCAP(&elf32_hwcap, HWCAP32_VFPv4, MVFR1_SIMDFMAC_IMPL), + MRS_HWCAP(1, HWCAP32_VFPv4, MVFR1_SIMDFMAC_IMPL), MRS_HWCAP_END }; @@ -2148,14 +2148,18 @@ int64_t idcache_line_size; /* The minimum cache line size */ * Find the values to export to userspace as AT_HWCAP and AT_HWCAP2. */ static void -parse_cpu_features(void) +parse_cpu_features(bool is64bit, u_long *hwcap, u_long *hwcap2) { const struct mrs_field_hwcap *hwcaps; const struct mrs_field *fields; uint64_t min, reg; + u_long *cur_hwcap; int i, j, k; for (i = 0; i < nitems(user_regs); i++) { + if (user_regs[i].is64bit != is64bit) + continue; + reg = CPU_DESC_FIELD(user_cpu_desc, i); fields = user_regs[i].fields; for (j = 0; fields[j].type != 0; j++) { @@ -2163,7 +2167,14 @@ parse_cpu_features(void) if (hwcaps == NULL) continue; - for (k = 0; hwcaps[k].hwcap != NULL; k++) { + for (k = 0; hwcaps[k].hwcap_id != 0; k++) { + KASSERT(hwcaps[k].hwcap_id == 1 || + hwcaps[k].hwcap_id == 2, + ("%s: Invalid HWCAP ID %d", __func__, + hwcaps[k].hwcap_id)); + + cur_hwcap = hwcaps[k].hwcap_id == 1 ? + hwcap : hwcap2; min = hwcaps[k].min; /* @@ -2172,7 +2183,7 @@ parse_cpu_features(void) */ if (mrs_field_cmp(reg, min, fields[j].shift, 4, fields[j].sign) >= 0) { - *hwcaps[k].hwcap |= hwcaps[k].hwcap_val; + *cur_hwcap |= hwcaps[k].hwcap_val; } } } @@ -2205,7 +2216,11 @@ identify_cpu_sysinit(void *dummy __unused) } /* Find the values to export to userspace as AT_HWCAP and AT_HWCAP2 */ - parse_cpu_features(); + parse_cpu_features(true, &elf_hwcap, &elf_hwcap2); +#ifdef COMPAT_FREEBSD32 + parse_cpu_features(false, &elf32_hwcap, &elf32_hwcap2); +#endif + /* We export the CPUID registers */ elf_hwcap |= HWCAP_CPUID; From nobody Mon Feb 19 16:45:22 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpLW1FFDz5C9G4; Mon, 19 Feb 2024 16:45:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpLW0HBfz4bwj; Mon, 19 Feb 2024 16:45:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361123; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V7DTNlFUsapXa/cdRuedil4O8Frm677gS5+qn0ZiA5s=; b=xIAnIIwjypp8pzpL3oWZiYSbx8w7w4vDnxQqqDDXsHnwHTjN/6Ob5Oz2llqWJF5Yx/3Gkw VohAAFYp0C1Ae8YcaitPKkID79ZaiHUePzpwFl0HD0jYUI76x8y2J3Kym8FMo9ZsWbuCvL pIInMjviXK4tHkb3iKrouVp9pls8nr6prwGqvs2Av3FQQhY2t74O8vVqdsDaaPCEvuVeCl RsEUCGX+RXxGL6foXjPHsvdO4qAXARPVw7EMELjn3VIFeX5yJ2t0YeY7HIYga8Q7NQTGT/ GeCcXKmblyDTlTsz8awbqKSpuECG4YAfJ3viissRQDN3ZkWo6wHVUGNf2BtR0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361123; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V7DTNlFUsapXa/cdRuedil4O8Frm677gS5+qn0ZiA5s=; b=XF50DS2+3NSGa3FK7SawdyhvqbhfrkuNPB97yqOQVcOl2jYM1LkfBdzH/eX7rKYZS4RSno ixutaI6jivva3TI/s9XPedcpPQWu8DbgfuRKqjFcVa8WHRjLhdG1NBw47jXAd4E6ZJWv+j 9KwXVpnzaA+0ZAjFx2oWYFx5W0qVvckaZQHULizU8FCwNgfZHzdEWyZZllgA2AIu5l0Hvn 2xi6MxAKDagk4ABbRJ4q0YfopFk8ciPjlW7pWPPP+8p0eiGmZlGK1/nsjuMYQI1/Lp15pJ sWePp5AEWAg4KMX8FDVd64JSXgzquLZZMUCuDQyzJKHIcHdYFWypU6eWiAERkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361123; a=rsa-sha256; cv=none; b=GtscSMSb+hefpKwRyzdtpTJOYAh0GWjvgevqUAzlaC50Du+azffY1KalkJoh8cQRFJiJ1W BFAKY41hC2eUmooxoJAQzBhR/ty1VPAWZ1NKDZEKRPgN/VFaBABu/j56lL7/msGs4crYez SlurSVI0fi/jndyh93u6f0ERRJuxRF3D9v7d77JKzTKb84es9P5Ak625C/7Nc+ailjHBlu eJRdY3uhhtQkfe4hbaxyNPy5NWziAtPLHR6DjuGbnq95dPVbe7RImA3OT3/U1l7EEVmIyO +YeStIREM5E6FobHTzKBxkWpzuJSNDWRqXhMX9PwgZul4Zq4SQb3kMe0jvRKUw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpLV4ztFzjQC; Mon, 19 Feb 2024 16:45:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGjMRs096227; Mon, 19 Feb 2024 16:45:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGjMAN096224; Mon, 19 Feb 2024 16:45:22 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:45:22 GMT Message-Id: <202402191645.41JGjMAN096224@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 082bc380936e - stable/14 - arm64: Create a Linux view of the ID registers List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 082bc380936e68e0fa37b3daa4269dc34c0735a9 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=082bc380936e68e0fa37b3daa4269dc34c0735a9 commit 082bc380936e68e0fa37b3daa4269dc34c0735a9 Author: Andrew Turner AuthorDate: 2023-10-25 12:34:38 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 13:13:49 +0000 arm64: Create a Linux view of the ID registers When adding support for new hardware extensions we may not want to enable support for the FreeBSD and Linux ABIs at the same time. To support this split the Linux ID register and hwcaps so they can be configured separately. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42372 (cherry picked from commit e6dbc99d47ddb254d75822817592bb82b5ce4d97) --- sys/arm64/arm64/elf_machdep.c | 3 ++ sys/arm64/arm64/identcpu.c | 86 +++++++++++++++++++++++++++++++----------- sys/arm64/include/md_var.h | 2 + sys/arm64/linux/linux_sysvec.c | 4 +- 4 files changed, 70 insertions(+), 25 deletions(-) diff --git a/sys/arm64/arm64/elf_machdep.c b/sys/arm64/arm64/elf_machdep.c index dd053d4d7847..66377464111f 100644 --- a/sys/arm64/arm64/elf_machdep.c +++ b/sys/arm64/arm64/elf_machdep.c @@ -56,6 +56,9 @@ u_long __read_frequently elf_hwcap; u_long __read_frequently elf_hwcap2; +/* TODO: Move to a better location */ +u_long __read_frequently linux_elf_hwcap; +u_long __read_frequently linux_elf_hwcap2; struct arm64_addr_mask elf64_addr_mask; diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c index 7acce7f5fc5b..d02be636ad50 100644 --- a/sys/arm64/arm64/identcpu.c +++ b/sys/arm64/arm64/identcpu.c @@ -33,10 +33,12 @@ #include #include #include +#include #include #include #include #include +#include #include #include @@ -162,6 +164,7 @@ static struct cpu_desc cpu_desc0; static struct cpu_desc *cpu_desc; static struct cpu_desc kern_cpu_desc; static struct cpu_desc user_cpu_desc; +static struct cpu_desc l_user_cpu_desc; static struct cpu_desc * get_cpu_desc(u_int cpu) @@ -275,10 +278,12 @@ const struct cpu_implementers cpu_implementers[] = { }; #define MRS_TYPE_MASK 0xf +#define MRS_TYPE_FBSD_SHIFT 0 +#define MRS_TYPE_LNX_SHIFT 8 #define MRS_INVALID 0 #define MRS_EXACT 1 #define MRS_EXACT_VAL(x) (MRS_EXACT | ((x) << 4)) -#define MRS_EXACT_FIELD(x) ((x) >> 4) +#define MRS_EXACT_FIELD(x) (((x) >> 4) & 0xf) #define MRS_LOWER 2 struct mrs_field_value { @@ -341,17 +346,23 @@ struct mrs_field { u_int shift; }; -#define MRS_FIELD_HWCAP(_register, _name, _sign, _type, _values, _hwcap) \ +#define MRS_FIELD_HWCAP_SPLIT(_register, _name, _sign, _fbsd_type, \ + _lnx_type, _values, _hwcap) \ { \ .name = #_name, \ .sign = (_sign), \ - .type = (_type), \ + .type = ((_fbsd_type) << MRS_TYPE_FBSD_SHIFT) | \ + ((_lnx_type) << MRS_TYPE_LNX_SHIFT), \ .shift = _register ## _ ## _name ## _SHIFT, \ .mask = _register ## _ ## _name ## _MASK, \ .values = (_values), \ .hwcaps = (_hwcap), \ } +#define MRS_FIELD_HWCAP(_register, _name, _sign, _type, _values, _hwcap) \ + MRS_FIELD_HWCAP_SPLIT(_register, _name, _sign, _type, _type, \ + _values, _hwcap) + #define MRS_FIELD(_register, _name, _sign, _type, _values) \ MRS_FIELD_HWCAP(_register, _name, _sign, _type, _values, NULL) @@ -1911,7 +1922,10 @@ user_mrs_handler(vm_offset_t va, uint32_t insn, struct trapframe *frame, for (i = 0; i < nitems(user_regs); i++) { if (user_regs[i].CRm == CRm && user_regs[i].Op2 == Op2) { - value = CPU_DESC_FIELD(user_cpu_desc, i); + if (SV_CURPROC_ABI() == SV_ABI_FREEBSD) + value = CPU_DESC_FIELD(user_cpu_desc, i); + else + value = CPU_DESC_FIELD(l_user_cpu_desc, i); break; } } @@ -2064,12 +2078,32 @@ get_kernel_reg_masked(u_int reg, uint64_t *valp, uint64_t mask) return (false); } +static uint64_t +update_special_reg_field(uint64_t user_reg, u_int type, uint64_t value, + u_int shift, bool sign) +{ + switch (type & MRS_TYPE_MASK) { + case MRS_EXACT: + user_reg &= ~(0xful << shift); + user_reg |= (uint64_t)MRS_EXACT_FIELD(type) << shift; + break; + case MRS_LOWER: + user_reg = update_lower_register(user_reg, value, shift, 4, + sign); + break; + default: + panic("Invalid field type: %d", type); + } + + return (user_reg); +} + void update_special_regs(u_int cpu) { struct cpu_desc *desc; const struct mrs_field *fields; - uint64_t user_reg, kern_reg, value; + uint64_t l_user_reg, user_reg, kern_reg, value; int i, j; if (cpu == 0) { @@ -2080,6 +2114,8 @@ update_special_regs(u_int cpu) ID_AA64PFR0_FP_NONE | ID_AA64PFR0_EL1_64 | ID_AA64PFR0_EL0_64; user_cpu_desc.id_aa64dfr0 = ID_AA64DFR0_DebugVer_8; + /* Create the Linux user visible cpu description */ + memcpy(&l_user_cpu_desc, &user_cpu_desc, sizeof(user_cpu_desc)); } desc = get_cpu_desc(cpu); @@ -2088,33 +2124,33 @@ update_special_regs(u_int cpu) if (cpu == 0) { kern_reg = value; user_reg = value; + l_user_reg = value; } else { kern_reg = CPU_DESC_FIELD(kern_cpu_desc, i); user_reg = CPU_DESC_FIELD(user_cpu_desc, i); + l_user_reg = CPU_DESC_FIELD(l_user_cpu_desc, i); } fields = user_regs[i].fields; for (j = 0; fields[j].type != 0; j++) { - switch (fields[j].type & MRS_TYPE_MASK) { - case MRS_EXACT: - user_reg &= ~(0xful << fields[j].shift); - user_reg |= - (uint64_t)MRS_EXACT_FIELD(fields[j].type) << - fields[j].shift; - break; - case MRS_LOWER: - user_reg = update_lower_register(user_reg, - value, fields[j].shift, 4, fields[j].sign); - break; - default: - panic("Invalid field type: %d", fields[j].type); - } + /* Update the FreeBSD userspace ID register view */ + user_reg = update_special_reg_field(user_reg, + fields[j].type >> MRS_TYPE_FBSD_SHIFT, value, + fields[j].shift, fields[j].sign); + + /* Update the Linux userspace ID register view */ + l_user_reg = update_special_reg_field(l_user_reg, + fields[j].type >> MRS_TYPE_LNX_SHIFT, value, + fields[j].shift, fields[j].sign); + + /* Update the kernel ID register view */ kern_reg = update_lower_register(kern_reg, value, fields[j].shift, 4, fields[j].sign); } CPU_DESC_FIELD(kern_cpu_desc, i) = kern_reg; CPU_DESC_FIELD(user_cpu_desc, i) = user_reg; + CPU_DESC_FIELD(l_user_cpu_desc, i) = l_user_reg; } } @@ -2148,7 +2184,8 @@ int64_t idcache_line_size; /* The minimum cache line size */ * Find the values to export to userspace as AT_HWCAP and AT_HWCAP2. */ static void -parse_cpu_features(bool is64bit, u_long *hwcap, u_long *hwcap2) +parse_cpu_features(bool is64bit, struct cpu_desc *cpu_desc, u_long *hwcap, + u_long *hwcap2) { const struct mrs_field_hwcap *hwcaps; const struct mrs_field *fields; @@ -2160,7 +2197,7 @@ parse_cpu_features(bool is64bit, u_long *hwcap, u_long *hwcap2) if (user_regs[i].is64bit != is64bit) continue; - reg = CPU_DESC_FIELD(user_cpu_desc, i); + reg = CPU_DESC_FIELD(*cpu_desc, i); fields = user_regs[i].fields; for (j = 0; fields[j].type != 0; j++) { hwcaps = fields[j].hwcaps; @@ -2216,13 +2253,16 @@ identify_cpu_sysinit(void *dummy __unused) } /* Find the values to export to userspace as AT_HWCAP and AT_HWCAP2 */ - parse_cpu_features(true, &elf_hwcap, &elf_hwcap2); + parse_cpu_features(true, &user_cpu_desc, &elf_hwcap, &elf_hwcap2); + parse_cpu_features(true, &l_user_cpu_desc, &linux_elf_hwcap, + &linux_elf_hwcap2); #ifdef COMPAT_FREEBSD32 - parse_cpu_features(false, &elf32_hwcap, &elf32_hwcap2); + parse_cpu_features(false, &user_cpu_desc, &elf32_hwcap, &elf32_hwcap2); #endif /* We export the CPUID registers */ elf_hwcap |= HWCAP_CPUID; + linux_elf_hwcap |= HWCAP_CPUID; #ifdef COMPAT_FREEBSD32 /* Set the default caps and any that need to check multiple fields */ diff --git a/sys/arm64/include/md_var.h b/sys/arm64/include/md_var.h index e0f707f3d881..f9aaaeba7306 100644 --- a/sys/arm64/include/md_var.h +++ b/sys/arm64/include/md_var.h @@ -37,6 +37,8 @@ extern char sigcode[]; extern int szsigcode; extern u_long elf_hwcap; extern u_long elf_hwcap2; +extern u_long linux_elf_hwcap; +extern u_long linux_elf_hwcap2; #ifdef COMPAT_FREEBSD32 extern u_long elf32_hwcap; extern u_long elf32_hwcap2; diff --git a/sys/arm64/linux/linux_sysvec.c b/sys/arm64/linux/linux_sysvec.c index 4b5544841313..185c4f3044b1 100644 --- a/sys/arm64/linux/linux_sysvec.c +++ b/sys/arm64/linux/linux_sysvec.c @@ -456,8 +456,8 @@ struct sysentvec elf_linux_sysvec = { .sv_schedtail = linux_schedtail, .sv_thread_detach = linux_thread_detach, .sv_trap = NULL, - .sv_hwcap = &elf_hwcap, - .sv_hwcap2 = &elf_hwcap2, + .sv_hwcap = &linux_elf_hwcap, + .sv_hwcap2 = &linux_elf_hwcap2, .sv_onexec = linux_on_exec_vmspace, .sv_onexit = linux_on_exit, .sv_ontdexit = linux_thread_dtor, From nobody Mon Feb 19 16:45:23 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpLX484sz5C9Nc; Mon, 19 Feb 2024 16:45:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpLX0254z4bqw; Mon, 19 Feb 2024 16:45:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361124; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sEmKfUdomJDwcViqsQNIPMYKLBFvg/cq+mooQRS5YeA=; b=UckflE9fg8XqPDMnzummgmz0/asvHfHWZhgQOrc91W1FS3gOkKO2jPlwI+FQdWqQl63Jrb qq3sCWQwR04i/tlzkHXF7eoNdvV4GL6Ejdky+nQepjmQ1L/Vr3AJ8Igue8lq68PYXct/m2 Rd1gl6MDCKfc2TYjZn7Zy1q/i7jQyslqCRa+n2bRZ9wjBb2VD8omc6hCjJaqfPACZ7KgTk cz2BbC8qSIBHU+VE2BRbOlJrf0vlpXEqRIoWih9igeYsDp0GiHo0nRio1Qk9SD0S7TBmqM hxTcHw8zjbh1EjakzIc4kFZyoiQDwNVEgH5Em81dA15gev/GFq2O11leOdGgLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361124; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sEmKfUdomJDwcViqsQNIPMYKLBFvg/cq+mooQRS5YeA=; b=pDPWR1gedRs76lzM9PJdJkFdi7vgTAZdY4NDlXqDBzt60zyCgANlm87gpoMM/zc0W/UJjM 4xOQdN8Q9D1oWxO33b+Lcy0ZjFMEwogHP55Z4CLk9qdKazYP+LuJKksaRpXxipZ04pewXI J8gRWzY2F9Q89KH5T7fNB475UoqGI+CSw6NOEcV56Qw1Zk8xesRi6vW27lO5M9PSq7SO1v CzkK50GIvYMvIT5zNlqLMLVNvsZjQVuZUkCkF/mkytucJ7DXYTgi969ufMcUR2b7aHDNtK 25WNh2amHISJk+3lQNdcDD7z/nHQdWwd0fjT1Q6LZ+Ko0FE0+u241RZ8truzKg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361124; a=rsa-sha256; cv=none; b=TP26PMegX1v+K22AM4wpdpuDhRwXHLlkZCblS140zIbfmRg1t3eZaR4s+xdkXBkcaOURpV PFxn8Vw2z5nd6jZT9iZIFcvnnN0XeGuHsnqcRr9d7Tr3MkTj35J14q1vwHAzw6WqYpuYpe IRfw2ixfRYooBLOKWwfJ0kff7taX8sJp+PeNd5IZ/373FavPiDyjuZqn8DXJatkflfkjit nVY13oCepH1JPpT9Jb2U77PxhM6EBsQstiO2aec9ueF97V/mGbl6f9/TDRxd5Vinmt3Fia HcvfwvsuoQsRG0zYRDkrFk7s5ugJn7GHzX3Sgw0OG6VI4JB4SWqA6Jon/uCc4A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpLW6F2VzjSS; Mon, 19 Feb 2024 16:45:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGjNvZ096279; Mon, 19 Feb 2024 16:45:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGjNYh096276; Mon, 19 Feb 2024 16:45:23 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:45:23 GMT Message-Id: <202402191645.41JGjNYh096276@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 0cdf69c10504 - stable/14 - arm64: Expand HWCAP2 to be 64 bit List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 0cdf69c105040c8883f5fe467e6ce49f7df7b84b Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=0cdf69c105040c8883f5fe467e6ce49f7df7b84b commit 0cdf69c105040c8883f5fe467e6ce49f7df7b84b Author: Andrew Turner AuthorDate: 2023-10-27 10:24:55 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 13:13:56 +0000 arm64: Expand HWCAP2 to be 64 bit There are more than 32 arm64 HWCAP2 values. Expand the macros to include leading zeros and mark them as unsigned long. Reviewed by: manu, imp, emaste Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42378 (cherry picked from commit 0f0938800989dbf84a56c370db0b9379ee730a39) --- sys/arm64/include/elf.h | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/sys/arm64/include/elf.h b/sys/arm64/include/elf.h index 5a7698f0324d..04449b20a194 100644 --- a/sys/arm64/include/elf.h +++ b/sys/arm64/include/elf.h @@ -133,24 +133,24 @@ __ElfType(Auxinfo); #define HWCAP_PACG 0x80000000 /* HWCAP2 */ -#define HWCAP2_DCPODP 0x00000001 -#define HWCAP2_SVE2 0x00000002 -#define HWCAP2_SVEAES 0x00000004 -#define HWCAP2_SVEPMULL 0x00000008 -#define HWCAP2_SVEBITPERM 0x00000010 -#define HWCAP2_SVESHA3 0x00000020 -#define HWCAP2_SVESM4 0x00000040 -#define HWCAP2_FLAGM2 0x00000080 -#define HWCAP2_FRINT 0x00000100 -#define HWCAP2_SVEI8MM 0x00000200 -#define HWCAP2_SVEF32MM 0x00000400 -#define HWCAP2_SVEF64MM 0x00000800 -#define HWCAP2_SVEBF16 0x00001000 -#define HWCAP2_I8MM 0x00002000 -#define HWCAP2_BF16 0x00004000 -#define HWCAP2_DGH 0x00008000 -#define HWCAP2_RNG 0x00010000 -#define HWCAP2_BTI 0x00020000 +#define HWCAP2_DCPODP 0x0000000000000001ul +#define HWCAP2_SVE2 0x0000000000000002ul +#define HWCAP2_SVEAES 0x0000000000000004ul +#define HWCAP2_SVEPMULL 0x0000000000000008ul +#define HWCAP2_SVEBITPERM 0x0000000000000010ul +#define HWCAP2_SVESHA3 0x0000000000000020ul +#define HWCAP2_SVESM4 0x0000000000000040ul +#define HWCAP2_FLAGM2 0x0000000000000080ul +#define HWCAP2_FRINT 0x0000000000000100ul +#define HWCAP2_SVEI8MM 0x0000000000000200ul +#define HWCAP2_SVEF32MM 0x0000000000000400ul +#define HWCAP2_SVEF64MM 0x0000000000000800ul +#define HWCAP2_SVEBF16 0x0000000000001000ul +#define HWCAP2_I8MM 0x0000000000002000ul +#define HWCAP2_BF16 0x0000000000004000ul +#define HWCAP2_DGH 0x0000000000008000ul +#define HWCAP2_RNG 0x0000000000010000ul +#define HWCAP2_BTI 0x0000000000020000ul #ifdef COMPAT_FREEBSD32 /* ARM HWCAP */ From nobody Mon Feb 19 16:45:24 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpLY3H7Dz5C9JC; Mon, 19 Feb 2024 16:45:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpLY0lslz4btn; Mon, 19 Feb 2024 16:45:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361125; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w5OV3jwNvmzvQlK7NXS9CUdO9DElkAEuNmMVsCGSwVs=; b=XoCk6OMZQpZ8EDwvfkIgBZhXU4FXEWfxYsKZ7JhQdLR5tpNj+olVaDnY2+Ld9/Aw41Xo90 7E1dLLGbWz5qXadLhgYbltqsqxUyekFIEi1OcoKrNXHyoJ0OrDFRXkTLoTAvv1tKQepGDe Q7fBLASEKvIXjUVqTG9hQWOSOksbBFiFRw380OMDG6QDbx8ZcbJPb4lkHdBWjpezdjfocR Tvv/H/VGf13FSzyV5UVXKTYLo2yPsMnwt9vPsCR1Z4QXSOrI8lkB9T8e9/pdc2aX//Ahd4 YA95JiJzX1e+J7c1kzstnoIAed2+2ZQ/orYaIlpJBrFEl7peoLS5jT4MqITphA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361125; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w5OV3jwNvmzvQlK7NXS9CUdO9DElkAEuNmMVsCGSwVs=; b=DfA5LT74DkC0PDCqK05YD3FktvgzfJ/jl9U8+i3WL28jZaYU6A6OB0+d4doys7XgFc/15x ygrOnnA5egaxF/I31M8mVnCrK8uFaTHADU0rpFAKYx5NPpv605mcF+wVRkct5g5CpjiZVQ 3ZzjNJePSJjTyn8T0Rd7apRAIjWT2r8KD2fb9qCEIaiw7BHRmP1Ivv+YIoNlb4oSn4Ni32 DbzrrrgnLGjDYz2XZ5PnuXklRqYbmxYdzcSMd6L6dZFX+I+PNymhwSdOmYnCIM4EjWGTTT /1QFE821uENbg0nRtxziwx8WJp3pMNMnnY0a3WqyoGhIw3a5/jMwl3G55qlhKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361125; a=rsa-sha256; cv=none; b=IRGQJSnLvmMk5y1bzrub7bQKpnK2lpp2WSFpMNe6B9lnqrrY+Y4/AGmOuNB0ZXx6RtCJmQ NQBIveQzJQNLwz1RQsmVJDU9qOKHwrtANjGj4QoArhlz7v8tE4WOdKdfbDL+aZNdmSV8VW YP9WuJPDhdParqeBhftAlSM6iKpMXX9695pNDOkQQZ+JnAeZ4XCP/eR7OEpskvK/4hqyqG rj/k6wRreuAK7wANoRQSGAhpIu4/Hzgp1LfUBt5bnhzVd0nOjJRSsFV82olW1KUTAiHjw0 HhNnwY2o4ReeY7dUq0J7s1W0qVCDddMun18DTG7BQHI+afb336AIZ9/9j7LbrA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpLX6zdQzj9W; Mon, 19 Feb 2024 16:45:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGjOGv096321; Mon, 19 Feb 2024 16:45:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGjOjb096318; Mon, 19 Feb 2024 16:45:24 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:45:24 GMT Message-Id: <202402191645.41JGjOjb096318@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: a10099545e29 - stable/14 - arm64: Add more HWCAP2 values List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: a10099545e29ee19b55b409177afbd6d8c4f4373 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=a10099545e29ee19b55b409177afbd6d8c4f4373 commit a10099545e29ee19b55b409177afbd6d8c4f4373 Author: Andrew Turner AuthorDate: 2023-10-27 10:42:08 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 13:14:03 +0000 arm64: Add more HWCAP2 values Update the HWCAP2 values to align with Linux v6.6-rc7 Reviewed by: manu, imp, emaste Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42379 (cherry picked from commit 2ee649c1dd5c41e93f02fdca8bba9279371e4efd) --- sys/arm64/include/elf.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/sys/arm64/include/elf.h b/sys/arm64/include/elf.h index 04449b20a194..9f9cd44ac9f7 100644 --- a/sys/arm64/include/elf.h +++ b/sys/arm64/include/elf.h @@ -151,6 +151,33 @@ __ElfType(Auxinfo); #define HWCAP2_DGH 0x0000000000008000ul #define HWCAP2_RNG 0x0000000000010000ul #define HWCAP2_BTI 0x0000000000020000ul +#define HWCAP2_MTE 0x0000000000040000ul +#define HWCAP2_ECV 0x0000000000080000ul +#define HWCAP2_AFP 0x0000000000100000ul +#define HWCAP2_RPRES 0x0000000000200000ul +#define HWCAP2_MTE3 0x0000000000400000ul +#define HWCAP2_SME 0x0000000000800000ul +#define HWCAP2_SME_I16I64 0x0000000001000000ul +#define HWCAP2_SME_F64F64 0x0000000002000000ul +#define HWCAP2_SME_I8I32 0x0000000004000000ul +#define HWCAP2_SME_F16F32 0x0000000008000000ul +#define HWCAP2_SME_B16F32 0x0000000010000000ul +#define HWCAP2_SME_F32F32 0x0000000020000000ul +#define HWCAP2_SME_FA64 0x0000000040000000ul +#define HWCAP2_WFXT 0x0000000080000000ul +#define HWCAP2_EBF16 0x0000000100000000ul +#define HWCAP2_SVE_EBF16 0x0000000200000000ul +#define HWCAP2_CSSC 0x0000000400000000ul +#define HWCAP2_RPRFM 0x0000000800000000ul +#define HWCAP2_SVE2P1 0x0000001000000000ul +#define HWCAP2_SME2 0x0000002000000000ul +#define HWCAP2_SME2P1 0x0000004000000000ul +#define HWCAP2_SME_I16I32 0x0000008000000000ul +#define HWCAP2_SME_BI32I32 0x0000010000000000ul +#define HWCAP2_SME_B16B16 0x0000020000000000ul +#define HWCAP2_SME_F16F16 0x0000040000000000ul +#define HWCAP2_MOPS 0x0000080000000000ul +#define HWCAP2_HBC 0x0000100000000000ul #ifdef COMPAT_FREEBSD32 /* ARM HWCAP */ From nobody Mon Feb 19 16:45:26 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpLZ3WHZz5C9JD; Mon, 19 Feb 2024 16:45:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpLZ1lcbz4c4L; Mon, 19 Feb 2024 16:45:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361126; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=upi38Ep4yrZTPQGBcUwE2TVnjHxo1P2IXM9M8KYtGDk=; b=abY/+P91pdCk8+akT082RmK3XjBFktPg+GXS+hZD8kyK+q4U5D8SlJ1l9n5G3Bchx5+stx D9Pcclxq9NUJ9ZQG0XaIcO36DSMpYJrPYcmUkMZfYI4m8kQB5DLXjQMSBqVKAicWfRUlib zU0zC7cEvBVrbYu0M5eUPn/OpLL94BtfknMb4IkOdkLlDFGnbCUlLTo7HhRqaWw6t7fsxI voM3s39EzUIbrEpFwZFIx3bT4bySToQ5+93Yr+ZcY9tkaxlG2C2Qj5Qy7VvCvpxyAZ18GO tGBgSr2cC96mc7WfQXDVdVWxkC4jKd7BinkKdBXkq0WoagEf51VxBkMG887cNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361126; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=upi38Ep4yrZTPQGBcUwE2TVnjHxo1P2IXM9M8KYtGDk=; b=Dxp0FtI4caXrOws5K01eMSS7vOEuD7u+YmRyP5WlI/POC2yu5K5FUcDmvHKpmbvsrMJL7n wU/lSMsZFisfgCB7LOE2ECAfNSoUrzlm75OgwdF3XmU+9b9CFcVpWLgEnGrwQSGs67CRsV cI8YhvL4egferQgZwLzRt/sXzveCNKQJXexROnk61w8HkFrR3++JmucTR4FEtzJMXlPaOG MCGp84oXmRDyeIFr2HeE38trFyYoVO4+rbEnizX/InwaoysH4kHB7WkOKAN6wLVuUctQcl xkI7j4CVvc+gfCAO2s7v3kmE+TgQLO0WR0as5EtPNuAX61Zp4vZa8hK3zkEktg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361126; a=rsa-sha256; cv=none; b=y3Gx4iM5vNaXZXG6Fv6huVP0dcIe3iWuzXOa8zPFWKSG08yN7jXZHIy5Yci77K5VRzNPAu v2IWnAnQtIbsQDh4wwBCH2wSYyxFqU75BSJMdIqUiYm0QqeyGcoeBSvu4+I1GKxBk6ppXg ik5t4nHLYfn/Qh+muSTbwq9IYDOQDKgXGw4Bshz770y3woSYcOoSTUOqchE7NNwmL+EPL+ OZOa88hQVwo5PeB3v/9kDEYxaMoRx3pvoyNparfU236FsEfN+H4Qop1WCK0wbg/klFRGzR oc9hz5dbsrJO+wZ0QmYQMTB8X8XlBvgY4FROWmIxZKzKy08FY+0ot65SIWrQBw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpLZ0sf9zjDR; Mon, 19 Feb 2024 16:45:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGjQ7i096374; Mon, 19 Feb 2024 16:45:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGjQFE096371; Mon, 19 Feb 2024 16:45:26 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:45:26 GMT Message-Id: <202402191645.41JGjQFE096371@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: eaa247c7f3df - stable/14 - arm64: Check if PSCI before calling SMCCC List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: eaa247c7f3dfe36cfe6a251019d416b418659cde Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=eaa247c7f3dfe36cfe6a251019d416b418659cde commit eaa247c7f3dfe36cfe6a251019d416b418659cde Author: Andrew Turner AuthorDate: 2023-10-30 14:33:08 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 13:14:10 +0000 arm64: Check if PSCI before calling SMCCC As SMCCC depends on PSCI check if the latter is present before calling the former. This fixes an issue where we may call into SMCCC when there is no PSCI in the system causing a smccc_version assert to fail. Reported by: stevek Reviewed by: emaste, imp, stevek Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42404 (cherry picked from commit 5a8417c78f9d51bf1103353bee348eaac83e86e5) --- sys/arm64/arm64/cpu_errata.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/arm64/arm64/cpu_errata.c b/sys/arm64/arm64/cpu_errata.c index fee22240bb0e..a03303d83044 100644 --- a/sys/arm64/arm64/cpu_errata.c +++ b/sys/arm64/arm64/cpu_errata.c @@ -40,6 +40,7 @@ #include +#include #include typedef void (cpu_quirk_install)(void); @@ -117,6 +118,9 @@ static struct cpu_quirks cpu_quirks[] = { static void install_psci_bp_hardening(void) { + /* SMCCC depends on PSCI. If PSCI is missing so is SMCCC */ + if (!psci_present) + return; if (smccc_arch_features(SMCCC_ARCH_WORKAROUND_1) != SMCCC_RET_SUCCESS) return; @@ -140,6 +144,10 @@ install_ssbd_workaround(void) } } + /* SMCCC depends on PSCI. If PSCI is missing so is SMCCC */ + if (!psci_present) + return; + /* Enable the workaround on this CPU if it's enabled in the firmware */ if (smccc_arch_features(SMCCC_ARCH_WORKAROUND_2) != SMCCC_RET_SUCCESS) return; From nobody Mon Feb 19 16:45:27 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpLb6Tkvz5C9Qv; Mon, 19 Feb 2024 16:45:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpLb34B2z4cFh; Mon, 19 Feb 2024 16:45:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361127; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=i4KTdyqQpJVh23Ra2TwxAxZaTjjNXsYXtLTgdHUgxRs=; b=eNcfyceUlaQklfOSnI5gXXXcLMmyJKLiR5HbilmX/nvVGpzE5ErN3XsaNCw8GpO4IJSBT+ jNdVG1lJZ9icBCYo0jLW7QJBQNryVnzSXSOAT6Umk2XDoAVznSei6nunrEc2u3f4VuVJma DiQ/wjYSku+5Nh5GHTtvgkqLcBl06gA8GbXPs/QjuHlvAERCM4NmwcLWqpX9COqKT3QbMO Aj3rn7BJg61BC0zaohX91HPIAWu7jOreshgPTxKZfCHnHWVovMlMCqdzFqopcGe/ESBTUp 8y8dTr2KFff0NCx8N2rXo6iIX2sN/QQZAjqkxhBsymQPuGevv1JPPUc2EqihJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361127; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=i4KTdyqQpJVh23Ra2TwxAxZaTjjNXsYXtLTgdHUgxRs=; b=DIOx8+Jm1XzA1L/PUmxHfbaJW229c8ejehAfKrrWMvsWNNTO+TFmXHQj3SkxaKsg4Htxwr 7dhfQp8WiKdxBMEjz1pLwNPdxjeDucJP+wLIeVsNfCk6MXO/p+b5CdmUEfqJ+hulYrtynq RViB6Q+eCeVw/4trJG+9YgVJultItrV2nXDUuWL+MJqcVMyogIcm267ulPG1T8/I1jGAe5 ZsZbEoZVQsBuAahkED0TbRzYnwHY/x4IZFVGYXoFeo6sc8ud1I4vZrEGzP3lPRg5FFL7Qo KkE7/n0bzKhGDhfV4c+FnF5jT9zjnDw/THB5JZPhQNpRIM9PflkHSQPUccTU7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361127; a=rsa-sha256; cv=none; b=e1XRlDfiwdjMvqX1O1b+zCb5kzc4PnNWZFxxgEYcsIlkGI7mqv3jB9k6KmN3k0ZG7F0iVk UJoU8WvzGqwDNKuOlqX7aVMnZV9WDq/FQM1L4U2Ito/5VrdlYCJReZCc0Zh9pOGk0mynCo t7veoJnNKSqDF2t0rk24KUNWTlW9KWS6RFylzz7aGXQLwKba/yYcUVIxfShXIgZ+HsSxWL 7peZ+VSkeqULKih0J6me+corVGLWP9+X1vY95vykrrRkJKoJzb+U9rtOViKXDgTrPk4BCu 5qnnDcy4DyA07jKF7E4tIKlfDQMikcyNr8tXPD+tjFRjxDJp1dArlSXGd/jX+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 4TdpLb27WnzjGv; Mon, 19 Feb 2024 16:45:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGjR6T096435; Mon, 19 Feb 2024 16:45:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGjRrS096432; Mon, 19 Feb 2024 16:45:27 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:45:27 GMT Message-Id: <202402191645.41JGjRrS096432@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 4dd61b21f9a0 - stable/14 - arm64: Use adrp + :lo12: to load globals from asm List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 4dd61b21f9a0d2c49bb95e93a54333421070e41e Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=4dd61b21f9a0d2c49bb95e93a54333421070e41e commit 4dd61b21f9a0d2c49bb95e93a54333421070e41e Author: Andrew Turner AuthorDate: 2023-11-11 09:27:30 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 13:14:16 +0000 arm64: Use adrp + :lo12: to load globals from asm When loading a global variable we can use a pseudo-instruction similar to "ldr, xn, =global" to load the address of the symbol. As this is unlikely to be supported by a mov instruction a pc-relative load is used, with the absolute address written at the end of the function so it will be loaded. This load can be partially replaced with an adrp instruction. This generates the address, aligned to a 4k boundary, using a pc-relative addition. Because the address is 4k-aligned we then update reading the global variable using a load with the offset of the load the low 12-bits of the global. Arm64 assemblers have :lo12: to support this, e.g. "ldr xn, [xn, :lo12:global]". The only remaining users of "ldr, xn, =global" that I can find are executed from the physical address space the kernel was loaded in and need an address in the kernels virtual address space. Because of this they can't use adrp. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42565 (cherry picked from commit 7eb26be9c8080686f64fdc0a28e5ae7839bbc82d) --- sys/arm64/arm64/cpufunc_asm.S | 7 ++++--- sys/arm64/arm64/locore.S | 4 ++-- sys/arm64/arm64/support.S | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/sys/arm64/arm64/cpufunc_asm.S b/sys/arm64/arm64/cpufunc_asm.S index 2b2ca6836530..8163e6c3d0d0 100644 --- a/sys/arm64/arm64/cpufunc_asm.S +++ b/sys/arm64/arm64/cpufunc_asm.S @@ -52,11 +52,12 @@ */ .macro cache_handle_range dcop = 0, ic = 0, icop = 0 .if \ic == 0 - ldr x3, =dcache_line_size /* Load the D cache line size */ + adrp x3, dcache_line_size /* Load the D cache line size */ + ldr x3, [x3, :lo12:dcache_line_size] .else - ldr x3, =idcache_line_size /* Load the I & D cache line size */ + adrp x3, idcache_line_size /* Load the I & D cache line size */ + ldr x3, [x3, :lo12:idcache_line_size] .endif - ldr x3, [x3] sub x4, x3, #1 /* Get the address mask */ and x2, x0, x4 /* Get the low bits of the address */ add x1, x1, x2 /* Add these to the size */ diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index ea5ce8e15ed2..f36ee5e75185 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -235,8 +235,8 @@ mp_virtdone: BTI_J /* Start using the AP boot stack */ - ldr x4, =bootstack - ldr x4, [x4] + adrp x4, bootstack + ldr x4, [x4, :lo12:bootstack] mov sp, x4 #if defined(PERTHREAD_SSP) diff --git a/sys/arm64/arm64/support.S b/sys/arm64/arm64/support.S index f4b35da88638..bb93cfd521e1 100644 --- a/sys/arm64/arm64/support.S +++ b/sys/arm64/arm64/support.S @@ -376,8 +376,8 @@ END(pagezero_simple) ENTRY(pagezero_cache) add x1, x0, #PAGE_SIZE - ldr x2, =dczva_line_size - ldr x2, [x2] + adrp x2, dczva_line_size + ldr x2, [x2, :lo12:dczva_line_size] 1: dc zva, x0 From nobody Mon Feb 19 16:45:29 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpLf0Fzpz5C9Nm; Mon, 19 Feb 2024 16:45:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpLd5QSZz4c2y; Mon, 19 Feb 2024 16:45:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361129; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eSJ5FBOYLCcpH0ocosWQ/1LtcKFZSO9KEUL92C7FZRU=; b=TdP1o2BkpaNgsb7JJI5+KQSCIIESDmRbnFUoyRBCi+znYumpNdyw2X4dply7+CFvSnftlL R1heRHap0h+akt8JAm/SaK8gdzYd5v2be++B5FWvcyYPGwL+3ixIzdQGj9/LlXCFzqscQF 4EUAACzJhVmCguwIngK9uW98NX2ZBSrJfjHsSyGhdFXL4KoKncXKtEbFDINl+lBRfRTeaG 3JaNb0C8Ssblz57XMQrzvR7hpmws3Ic8vK9CThNMIpdFrfpv6RV1sfZkmB/zYtNdJcVFhw D1npRzOYwRiGSnEK0rnSDVA1iISar2xCipwNCVrtt2u87FnxV7wROmlXXXLhtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361129; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eSJ5FBOYLCcpH0ocosWQ/1LtcKFZSO9KEUL92C7FZRU=; b=aFBOrvpHTKngj2PA5Lmn4bQodOAiEI5SPDNWDFt7Pn8TksacpKFvPFgehvCekWp4mbdien kr/bc+bvVdruQxk5rYbQa7vjZl0Mj4Kpotnty0iAJ2J/TzNTs/bdmuFR0Tv2gjUduig+rk et8mELQ5XyAkv5tH2JFyZcO/qjkNrYcKQka0AO7WlWymvZoefBaVgQVEi73uLn8gdQUMz3 2h//IgFBRgyfcKwendzE+GwmCLLtuoVl7IV/NhvFkmmJe1DQG2HXF1jpobQmGcaiKvpKeZ g9D3GAscyJd4RjuMA8j8dA2OEYQecCtHvPaICtaezGDqxa1C4a53ih+cOBKxgw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361129; a=rsa-sha256; cv=none; b=O/ZU7/LAwN38P8Q2gKXG0UK8eawZoC6ZThXsqsm9/Kkt7nawoUZbuVNsTyVXCnfy4kjAh+ Gbodj8k7vnmV+mgF4ricrA48vbRE+gxeZXiOWzQXjK7AZcyakSZVWY67pl4/d20VAbwEM6 SgNzUwKtpOkWG/Watc/2mIGX35LH4Y8vgeyQiEjkgG9jxkwpQHSMoMoTD3VVzRDgkyQRSX 5yEFbO+HV8x0D8ClW0i37wYoC9VtHjtQC/RmAASq+V9kjgizx6hhaeywcbfXJD3OjAHUO8 LwoN+CaV/FWI8tV89+S9RAbxsRAC63fT36+wQNQbTP6AmJMmdNlbhxR05iIyfQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpLd4XMgzjQD; Mon, 19 Feb 2024 16:45:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGjTM7096534; Mon, 19 Feb 2024 16:45:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGjTpJ096531; Mon, 19 Feb 2024 16:45:29 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:45:29 GMT Message-Id: <202402191645.41JGjTpJ096531@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: a46059e45f4a - stable/14 - arm64: Make kern_delta unneeded in the boot params List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: a46059e45f4a6c3001468774e10af9d41c9f4966 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=a46059e45f4a6c3001468774e10af9d41c9f4966 commit a46059e45f4a6c3001468774e10af9d41c9f4966 Author: Andrew Turner AuthorDate: 2023-11-13 15:29:30 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 13:17:09 +0000 arm64: Make kern_delta unneeded in the boot params Use pmap_early_vtophys to translate from a virtual to physical where we were previously using the calculated delta. This means that, while we still calculate it, we don't need to pass it to initarm or either pmap bootstrap functions. While here remove an unneeded printf that indirectly used it or was related to the previous printf. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42567 (cherry picked from commit ba31362694fe465b88a025ac7c35ad7f378efc86) (cherry picked from commit f3a83b3a6257ea0fd5aba66ff42218350228b321) --- sys/arm64/arm64/genassym.c | 1 - sys/arm64/arm64/locore.S | 15 ++++----------- sys/arm64/arm64/machdep.c | 2 +- sys/arm64/arm64/pmap.c | 12 +++--------- sys/arm64/include/machdep.h | 1 - sys/arm64/include/pmap.h | 2 +- 6 files changed, 9 insertions(+), 24 deletions(-) diff --git a/sys/arm64/arm64/genassym.c b/sys/arm64/arm64/genassym.c index 0fb00d8aceba..d4970177ab71 100644 --- a/sys/arm64/arm64/genassym.c +++ b/sys/arm64/arm64/genassym.c @@ -40,7 +40,6 @@ ASSYM(BOOTPARAMS_SIZE, roundup2(sizeof(struct arm64_bootparams), STACKALIGNBYTES + 1)); ASSYM(BP_MODULEP, offsetof(struct arm64_bootparams, modulep)); -ASSYM(BP_KERN_DELTA, offsetof(struct arm64_bootparams, kern_delta)); ASSYM(BP_KERN_STACK, offsetof(struct arm64_bootparams, kern_stack)); ASSYM(BP_KERN_TTBR0, offsetof(struct arm64_bootparams, kern_ttbr0)); ASSYM(BP_BOOT_EL, offsetof(struct arm64_bootparams, boot_el)); diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index f36ee5e75185..ee3404958789 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -82,11 +82,10 @@ ENTRY(_start) msr contextidr_el1, xzr /* Get the virt -> phys offset */ - bl get_virt_delta + bl get_load_phys_addr /* * At this point: - * x29 = PA - VA * x28 = Our physical load address */ @@ -141,11 +140,7 @@ virtdone: sub sp, sp, #BOOTPARAMS_SIZE mov x0, sp - /* Negate the delta so it is VA -> PA */ - neg x29, x29 - str x1, [x0, #BP_MODULEP] - str x29, [x0, #BP_KERN_DELTA] adrp x25, initstack add x25, x25, :lo12:initstack str x25, [x0, #BP_KERN_STACK] @@ -367,11 +362,9 @@ LENTRY(drop_to_el1) LEND(drop_to_el1) /* - * Get the delta between the physical address we were loaded to and the - * virtual address we expect to run from. This is used when building the - * initial page table. + * Get the physical address the kernel was loaded at. */ -LENTRY(get_virt_delta) +LENTRY(get_load_phys_addr) /* Load the physical address of virt_map */ adrp x29, virt_map add x29, x29, :lo12:virt_map @@ -387,7 +380,7 @@ LENTRY(get_virt_delta) .align 3 virt_map: .quad virt_map -LEND(get_virt_delta) +LEND(get_load_phys_addr) /* * This builds the page tables containing the identity map, and the kernel diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c index 7aa20357acf4..01896c15e650 100644 --- a/sys/arm64/arm64/machdep.c +++ b/sys/arm64/arm64/machdep.c @@ -957,7 +957,7 @@ initarm(struct arm64_bootparams *abp) pan_setup(); /* Bootstrap enough of pmap to enter the kernel proper */ - pmap_bootstrap(KERNBASE - abp->kern_delta, lastaddr - KERNBASE); + pmap_bootstrap(lastaddr - KERNBASE); /* Exclude entries needed in the DMAP region, but not phys_avail */ if (efihdr != NULL) exclude_efi_map_entries(efihdr); diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index d9d224f44fb6..b372295d5d43 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -1258,22 +1258,16 @@ pmap_bootstrap_allocate_kasan_l2(vm_paddr_t start_pa, vm_paddr_t end_pa, * Bootstrap the system enough to run with virtual memory. */ void -pmap_bootstrap(vm_paddr_t kernstart, vm_size_t kernlen) +pmap_bootstrap(vm_size_t kernlen) { vm_offset_t dpcpu, msgbufpv; vm_paddr_t start_pa, pa, min_pa; - uint64_t kern_delta; int i; /* Verify that the ASID is set through TTBR0. */ KASSERT((READ_SPECIALREG(tcr_el1) & TCR_A1) == 0, ("pmap_bootstrap: TCR_EL1.A1 != 0")); - kern_delta = KERNBASE - kernstart; - - printf("pmap_bootstrap %lx %lx\n", kernstart, kernlen); - printf("%lx\n", (KERNBASE >> L1_SHIFT) & Ln_ADDR_MASK); - /* Set this early so we can use the pagetable walking functions */ kernel_pmap_store.pm_l0 = pagetable_l0_ttbr1; PMAP_LOCK_INIT(kernel_pmap); @@ -1288,7 +1282,7 @@ pmap_bootstrap(vm_paddr_t kernstart, vm_size_t kernlen) kernel_pmap->pm_asid_set = &asids; /* Assume the address we were loaded to is a valid physical address */ - min_pa = KERNBASE - kern_delta; + min_pa = pmap_early_vtophys(KERNBASE); physmap_idx = physmem_avail(physmap, nitems(physmap)); physmap_idx /= 2; @@ -1316,7 +1310,7 @@ pmap_bootstrap(vm_paddr_t kernstart, vm_size_t kernlen) */ bs_state.table_attrs &= ~TATTR_PXN_TABLE; - start_pa = pa = KERNBASE - kern_delta; + start_pa = pa = pmap_early_vtophys(KERNBASE); /* * Create the l2 tables up to VM_MAX_KERNEL_ADDRESS. We assume that the diff --git a/sys/arm64/include/machdep.h b/sys/arm64/include/machdep.h index 026a64e0a350..80cb28bcfbeb 100644 --- a/sys/arm64/include/machdep.h +++ b/sys/arm64/include/machdep.h @@ -31,7 +31,6 @@ struct arm64_bootparams { vm_offset_t modulep; - uint64_t kern_delta; vm_offset_t kern_stack; vm_paddr_t kern_ttbr0; uint64_t hcr_el2; diff --git a/sys/arm64/include/pmap.h b/sys/arm64/include/pmap.h index e7d23dfb2844..4b4d47ccc7af 100644 --- a/sys/arm64/include/pmap.h +++ b/sys/arm64/include/pmap.h @@ -144,7 +144,7 @@ extern vm_offset_t virtual_end; #define pmap_vm_page_alloc_check(m) void pmap_activate_vm(pmap_t); -void pmap_bootstrap(vm_paddr_t, vm_size_t); +void pmap_bootstrap(vm_size_t); int pmap_change_attr(vm_offset_t va, vm_size_t size, int mode); int pmap_change_prot(vm_offset_t va, vm_size_t size, vm_prot_t prot); void pmap_kenter(vm_offset_t sva, vm_size_t size, vm_paddr_t pa, int mode); From nobody Mon Feb 19 16:45:28 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpLc6Sptz5C9JH; Mon, 19 Feb 2024 16: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpLc4BBlz4cG5; Mon, 19 Feb 2024 16: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=1708361128; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dw6t8aetYbIkVzF6AjeuksO/kJI1ZGhuIDh9jWRmNgQ=; b=YbUWoEGFBJkYfHCDnsPpRRzWr9Z7YqVc6GmcoMzoZIpAZMZ0utmRv+gOftIZ+N7IkqNSf3 r1vIOWQxLWdYk2HOQhld0bo60IzbHXx2bRpgcSe55TdidgOGfNHfsWuaS3afaqEClcP+ns BJ5GgENoQuE/uHmQCkM+cz/CV0IgDH9Mx/mhD2yZORw6JeW1wtynP4vOdNo06MLwMNFFTc YfZjGT6baXc1BxPxhqGVD9cshuVLHlXhKM8bkHlozwuX0nExk0VfQJWUhNv9P4jCZTZhu/ N/cQik+qcS8mIepLKhxPhpSKHsgkABVDkutj+SiWe1WHjE70R3j+B6jXs7zUXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361128; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dw6t8aetYbIkVzF6AjeuksO/kJI1ZGhuIDh9jWRmNgQ=; b=wi4tlv1LNkjokL9K8GoPtyMxEcVX7E1OSUiFj5c/P2eZyeB8zvznRvvzl+A2X+fgyEeccK JpAheC9qUyYPfDTY2vTx3kMf7jOcVqko+snSH0SN2XtlTnUG6nPNkECzp3JfYMDLBjlRFY UVfXoN7j9AoSqYGQlT7t3jmbu5iKakIPA6358qkhafBLLTI4O/tIMoGFv1NQLcc5LSwYqL +o9DYEL1OEZBtpli2LDD/kOwDwOP8rSfm95bY9omEk6K3FPGcYGuxgX2D8xuA616TokHEX oesAUQ7r9WQmdc2GlXKp066XKGkZqQM0dcnlLUjFCkmGXjps56a+ANqXfVER5g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361128; a=rsa-sha256; cv=none; b=KP5Enejhj2IAqoemvE0NR3K9IQfTlMLZlUqQO8jO4lKJAYRiKv806sbtjrRnQHb6teS686 PmF4cYkYSyKxfaCFV6r3JiWoBq3GivRX83LLjrxduo385219O+DYMw1NNIQXHsChy/CUnH hXvLZuV2NNeEc5xMYOxb/BNKpw8MhuZIuK7IuT9Zo6LHtJ2PCQNPRj9DGpgYAo5jSEemJL bF6cdXMH8cViQBZiNu/oCIqQsXDQEQTJNJ3QkUo7nUkcSZ5XwYNsvvW/R71ytrMdAqsBUt DXUTxrE1qwnqJELqdvBY80h/aMLgXsReeGbpCSthfqiL+RGwaIuVqpkTRGH34g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpLc3Hjyzj6h; Mon, 19 Feb 2024 16:45:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGjS3w096480; Mon, 19 Feb 2024 16:45:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGjSB3096477; Mon, 19 Feb 2024 16:45:28 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:45:28 GMT Message-Id: <202402191645.41JGjSB3096477@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 88227ddc7536 - stable/14 - arm64: Use pmap_early_vtophys in pmap_bootstrap_san List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 88227ddc7536db86a8dd8896061c5e2e8da84cb3 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=88227ddc7536db86a8dd8896061c5e2e8da84cb3 commit 88227ddc7536db86a8dd8896061c5e2e8da84cb3 Author: Andrew Turner AuthorDate: 2023-11-13 16:34:56 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 13:14:59 +0000 arm64: Use pmap_early_vtophys in pmap_bootstrap_san Use pmap_early_vtophys to find the physical address of the kernel base rather than using the calculated offset as it will be removed in a latter commit. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42566 (cherry picked from commit 5fae53589eacbf65855419922c881b3a25a68e03) --- sys/arm64/arm64/machdep.c | 2 +- sys/arm64/arm64/pmap.c | 5 ++++- sys/arm64/include/pmap.h | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c index bb7689c19101..7aa20357acf4 100644 --- a/sys/arm64/arm64/machdep.c +++ b/sys/arm64/arm64/machdep.c @@ -973,7 +973,7 @@ initarm(struct arm64_bootparams *abp) * segments also get excluded from phys_avail. */ #if defined(KASAN) - pmap_bootstrap_san(KERNBASE - abp->kern_delta); + pmap_bootstrap_san(); #endif physmem_init_kernel_globals(); diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index 9849a58dd070..d9d224f44fb6 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -1365,11 +1365,14 @@ pmap_bootstrap(vm_paddr_t kernstart, vm_size_t kernlen) * - Map that entire range using L2 superpages. */ void -pmap_bootstrap_san(vm_paddr_t kernstart) +pmap_bootstrap_san(void) { vm_offset_t va; + vm_paddr_t kernstart; int i, shadow_npages, nkasan_l2; + kernstart = pmap_early_vtophys(KERNBASE); + /* * Rebuild physmap one more time, we may have excluded more regions from * allocation since pmap_bootstrap(). diff --git a/sys/arm64/include/pmap.h b/sys/arm64/include/pmap.h index bb226df2099c..e7d23dfb2844 100644 --- a/sys/arm64/include/pmap.h +++ b/sys/arm64/include/pmap.h @@ -192,7 +192,7 @@ pmap_vmspace_copy(pmap_t dst_pmap __unused, pmap_t src_pmap __unused) #if defined(KASAN) || defined(KMSAN) struct arm64_bootparams; -void pmap_bootstrap_san(vm_paddr_t); +void pmap_bootstrap_san(void); void pmap_san_enter(vm_offset_t); #endif From nobody Mon Feb 19 16:45:31 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpLh4QMhz5C9Nr; Mon, 19 Feb 2024 16:45:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpLh0ZwTz4c9v; Mon, 19 Feb 2024 16:45:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361132; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9WIASPYbXjP9rFUdM8rwOxtQvYhGIBCXfDLXqYIF31A=; b=F2IFfICMWwl/u1t0L199AGI6F7jHWb9L5kCz7Q+qdwI23km0UAc5Wm+GZX36T0JuUnp2ed uHBw1iYzEQPczUwLapNdN8Uue8LcOChPSXNCpqmaiMGLfZ+6CsWa33tgX05ggPPNRwK2J1 Y+SeDbfK//L3bb7Le00BPxcSNox1HChfnHmkedrUTN+zAg/I9GxWTl2vfWhOhUvrZj3Sxs p+L2dYeNdJdj760PRiayFx4QoTMRlpsu81Oxk9q9q13Co6QkRwWK7KKV2YKjBIsiafyykE 03Au61B8feghxuiltqjrhf+hC3QFLlv4uyXfzFSIUq4Gz2yr4GGvexcghNS/kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361132; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9WIASPYbXjP9rFUdM8rwOxtQvYhGIBCXfDLXqYIF31A=; b=dZ49QKDg73Oz4iV6P7PuJQz7BX1kJXUkryFzLuDBBAmsS9Rxv9nJIW47mWdzI2GOh1gR8n LGBJZ48OuXVgDqHD59i3lzdc6gsdsrTzhjseehEobigPvbdp1JiBDbkWFQZ4Ghg4Pbyl3b Cl0P2q7YmOpDBtliiWxc5SYlHw9zRK3FddHexOm4pMNWQPCzir95c8rjTnNAF07Phqu2KH xwdQsiei1qVpFERnBAhtGgWz7lSeXTKrwAnhn9uBS/t7qh1Tq2W5VjvTprHXjYJUWjl76c m88m3Ssc8KvweEZDtT/O0PcprRNAUSxd8hlj8VR8KerB/8xR1jyBaqan6782PA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361132; a=rsa-sha256; cv=none; b=DgA6KDDb/Zb/S+Icb4jZb2+YMncIaVtQg8+k0sYp0gma7PINNAOtcUupVmbpUKljcUeK5n SOXAmCXAjLkqtUygeMlDOwrHaQ5y86JM4BiCYCSDp2lxC0GToYpyhN4n/1qJ33+S+Qz2N4 d6AgPWJrDaYIH+LkK8s3Nt3klSHFC//9Pjz9q08+6XDr54pYUjs28Lf2jZcu5EbmrUc0Sj Iv/NWNhzPXwap0C6t5ZsF32qCtbAkK1y7XommXlCO2yGaMfRprCyQQwEOqbqoSqs6yiCjI JxVGL1GWWZ4l1xVyrKyPAttYh8mEeXmGhv9tBF56wzXJOO8YyWHAbISbkxlGvg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpLg6nrqzjDS; Mon, 19 Feb 2024 16:45:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGjVR3096633; Mon, 19 Feb 2024 16:45:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGjV9F096630; Mon, 19 Feb 2024 16:45:31 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:45:31 GMT Message-Id: <202402191645.41JGjV9F096630@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: bce8a0ba1506 - stable/14 - libc: Teach libc about the BTI elf note List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: bce8a0ba15063186774aeb8207587884e68c38dd Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=bce8a0ba15063186774aeb8207587884e68c38dd commit bce8a0ba15063186774aeb8207587884e68c38dd Author: Andrew Turner AuthorDate: 2023-10-12 14:22:18 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 13:17:37 +0000 libc: Teach libc about the BTI elf note Add the Branch Target Identification (BTI) note to libc assembly sources. As all obect files need the note for the library to have it we need to insert it in all asm files. Reviewed by: emaste, markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42228 (cherry picked from commit fd5aaf2ea0178b03aa93c35245053247e5d3840c) --- lib/libc/aarch64/gen/_ctx_start.S | 4 ++++ lib/libc/aarch64/gen/_setjmp.S | 3 +++ lib/libc/aarch64/gen/fabs.S | 4 ++++ lib/libc/aarch64/gen/setjmp.S | 3 +++ lib/libc/aarch64/gen/sigsetjmp.S | 3 +++ lib/libc/aarch64/string/memmove.S | 4 ++++ lib/libc/aarch64/sys/cerror.S | 4 ++++ lib/libc/aarch64/sys/syscall.S | 3 +++ lib/libc/aarch64/sys/vfork.S | 3 +++ lib/libc/sys/Makefile.inc | 7 +++++++ 10 files changed, 38 insertions(+) diff --git a/lib/libc/aarch64/gen/_ctx_start.S b/lib/libc/aarch64/gen/_ctx_start.S index 15edcf21d463..a4049e6c241a 100644 --- a/lib/libc/aarch64/gen/_ctx_start.S +++ b/lib/libc/aarch64/gen/_ctx_start.S @@ -27,9 +27,13 @@ */ #include +#include + ENTRY(_ctx_start) blr x19 /* Call func from makecontext */ mov x0, x20 /* Load ucp saved in makecontext */ bl _C_LABEL(ctx_done) bl _C_LABEL(abort) END(_ctx_start) + +GNU_PROPERTY_AARCH64_FEATURE_1_NOTE(GNU_PROPERTY_AARCH64_FEATURE_1_VAL) diff --git a/lib/libc/aarch64/gen/_setjmp.S b/lib/libc/aarch64/gen/_setjmp.S index 4fc9ce304893..037eccf1a48a 100644 --- a/lib/libc/aarch64/gen/_setjmp.S +++ b/lib/libc/aarch64/gen/_setjmp.S @@ -30,6 +30,7 @@ #include #include +#include ENTRY(_setjmp) /* Store the magic value and stack pointer */ @@ -101,3 +102,5 @@ botch: bl _C_LABEL(abort) #endif END(_longjmp) + +GNU_PROPERTY_AARCH64_FEATURE_1_NOTE(GNU_PROPERTY_AARCH64_FEATURE_1_VAL) diff --git a/lib/libc/aarch64/gen/fabs.S b/lib/libc/aarch64/gen/fabs.S index 29e4b89d5ee1..91967a10299b 100644 --- a/lib/libc/aarch64/gen/fabs.S +++ b/lib/libc/aarch64/gen/fabs.S @@ -24,7 +24,11 @@ */ #include +#include + ENTRY(fabs) fabs d0, d0 ret END(fabs) + +GNU_PROPERTY_AARCH64_FEATURE_1_NOTE(GNU_PROPERTY_AARCH64_FEATURE_1_VAL) diff --git a/lib/libc/aarch64/gen/setjmp.S b/lib/libc/aarch64/gen/setjmp.S index ecc677de2620..97d98ae2fb52 100644 --- a/lib/libc/aarch64/gen/setjmp.S +++ b/lib/libc/aarch64/gen/setjmp.S @@ -30,6 +30,7 @@ #include #include +#include ENTRY(setjmp) sub sp, sp, #16 @@ -119,3 +120,5 @@ botch: bl _C_LABEL(longjmperror) bl _C_LABEL(abort) END(longjmp) + +GNU_PROPERTY_AARCH64_FEATURE_1_NOTE(GNU_PROPERTY_AARCH64_FEATURE_1_VAL) diff --git a/lib/libc/aarch64/gen/sigsetjmp.S b/lib/libc/aarch64/gen/sigsetjmp.S index cdff7a46c85b..daf3914b6278 100644 --- a/lib/libc/aarch64/gen/sigsetjmp.S +++ b/lib/libc/aarch64/gen/sigsetjmp.S @@ -28,6 +28,7 @@ #include #include +#include ENTRY(sigsetjmp) cmp x1, #0 @@ -52,3 +53,5 @@ ENTRY(siglongjmp) .Lmagic: .quad _JB_MAGIC__SETJMP END(siglongjmp) + +GNU_PROPERTY_AARCH64_FEATURE_1_NOTE(GNU_PROPERTY_AARCH64_FEATURE_1_VAL) diff --git a/lib/libc/aarch64/string/memmove.S b/lib/libc/aarch64/string/memmove.S index e2f99790e0da..6ca014b3a565 100644 --- a/lib/libc/aarch64/string/memmove.S +++ b/lib/libc/aarch64/string/memmove.S @@ -3,3 +3,7 @@ * as it stops MISRCS from picking up the C implementation and rtld expects * to copy the memmove object file into its object directory. */ + +#include +#include +GNU_PROPERTY_AARCH64_FEATURE_1_NOTE(GNU_PROPERTY_AARCH64_FEATURE_1_VAL) diff --git a/lib/libc/aarch64/sys/cerror.S b/lib/libc/aarch64/sys/cerror.S index a83514bc2511..85e75af8ec0d 100644 --- a/lib/libc/aarch64/sys/cerror.S +++ b/lib/libc/aarch64/sys/cerror.S @@ -25,6 +25,8 @@ */ #include +#include + ENTRY(cerror) .hidden cerror sub sp, sp, #16 @@ -37,3 +39,5 @@ ENTRY(cerror) add sp, sp, #16 ret END(cerror) + +GNU_PROPERTY_AARCH64_FEATURE_1_NOTE(GNU_PROPERTY_AARCH64_FEATURE_1_VAL) diff --git a/lib/libc/aarch64/sys/syscall.S b/lib/libc/aarch64/sys/syscall.S index 2c7e207f82f7..037c4b12ddae 100644 --- a/lib/libc/aarch64/sys/syscall.S +++ b/lib/libc/aarch64/sys/syscall.S @@ -27,6 +27,9 @@ */ #include +#include #include "SYS.h" RSYSCALL(syscall) + +GNU_PROPERTY_AARCH64_FEATURE_1_NOTE(GNU_PROPERTY_AARCH64_FEATURE_1_VAL) diff --git a/lib/libc/aarch64/sys/vfork.S b/lib/libc/aarch64/sys/vfork.S index f9489738a3c7..03ae5a6325ba 100644 --- a/lib/libc/aarch64/sys/vfork.S +++ b/lib/libc/aarch64/sys/vfork.S @@ -25,6 +25,7 @@ */ #include +#include #include "SYS.h" ENTRY(__sys_vfork) @@ -38,3 +39,5 @@ ENTRY(__sys_vfork) mov lr, x2 ret END(__sys_vfork) + +GNU_PROPERTY_AARCH64_FEATURE_1_NOTE(GNU_PROPERTY_AARCH64_FEATURE_1_VAL) diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc index 8cb5f54e2969..4e3ac43b2b80 100644 --- a/lib/libc/sys/Makefile.inc +++ b/lib/libc/sys/Makefile.inc @@ -131,12 +131,18 @@ NOTE_GNU_STACK='\t.section .note.GNU-stack,"",%%progbits\n' .else NOTE_GNU_STACK='' .endif +.if ${MACHINE_CPUARCH} == "aarch64" +FEATURE_NOTE='\#include \nGNU_PROPERTY_AARCH64_FEATURE_1_NOTE(GNU_PROPERTY_AARCH64_FEATURE_1_VAL)' +.else +FEATURE_NOTE='' +.endif ${SASM}: printf '/* %sgenerated by libc/sys/Makefile.inc */\n' @ > ${.TARGET} printf '#include "compat.h"\n' >> ${.TARGET} printf '#include "SYS.h"\nRSYSCALL(${.PREFIX})\n' >> ${.TARGET} printf ${NOTE_GNU_STACK} >>${.TARGET} + printf ${FEATURE_NOTE} >> ${.TARGET} ${SPSEUDO}: printf '/* %sgenerated by libc/sys/Makefile.inc */\n' @ > ${.TARGET} @@ -144,6 +150,7 @@ ${SPSEUDO}: printf '#include "SYS.h"\nPSEUDO(${.PREFIX:S/_//})\n' \ >> ${.TARGET} printf ${NOTE_GNU_STACK} >>${.TARGET} + printf ${FEATURE_NOTE} >> ${.TARGET} MAN+= abort2.2 \ accept.2 \ From nobody Mon Feb 19 16:45:30 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpLg2Dllz5C9GG; Mon, 19 Feb 2024 16:45:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpLf6Zpbz4cD0; Mon, 19 Feb 2024 16:45:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361130; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ljeSXx62t4QDqpt59qybtBAzNqwDL5ms9Acgw1+M21M=; b=EICl4nkX+7Oi73tY5i1LnuZVP7qCxHbWtOowK059X++OkHPJGKSMXTSHdVwt6dh2S2s1Fk 0rNYaxBlUMdf6wm6xAuPV9em7+gVD14clSbnISgO5xrAJD552eUC6w3FiWEhYeKYTjW4e0 AjhO7/gQtA5kEMDwpKVHHySy69QVLoxFoQKjzY2kMeTp4JUyx9Q44dfzvfzd7IdZydliW2 VA1C4YTHBffPShQ8ENN1j8AT/w1nWeiQx2CwDhXErzNMIoeAhWvM5a2mzIJ5KpNJHUoTkJ n2XjNm9qq3HMXngw9cR3vFGk52knz9SdNufp/bLUgaTeka25hWE2SBbH0cFfgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361130; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ljeSXx62t4QDqpt59qybtBAzNqwDL5ms9Acgw1+M21M=; b=btfMF7D3/aJUbaYHGW6Q96HI3es+xJmvkd2/7Npy2sMkUq+WU6NyULfvUHnQUIG9683Y/9 /OLH7n6H1lspiDGpIXNaE7StJbkMnv2J+15KXToj5qJzHkr41QxqcQ4dPVlmMUtJlqGca7 cVOAAR0k7AlZ9Qgu4R1JFLYplQt6h2x9dyuNQNFyDnSJXcXLH6qgZ3/RQdWegWEDL0MnJY c/Kw/s8bHf3uQSW5QEFOgi5N9UpUBnnEvDJcjdEO9IRtNiztmQyz8LZhg2OzM0SMc5T6J/ X1EqyMTpjFtpvXepAgPNkRK1tiUN2zSYFKV4PvQp1H8JDusmyP3eYXdo15RzIg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361130; a=rsa-sha256; cv=none; b=eVu2CjQo6sMD55KQTZ/85EYiCXyftxZ6xhD+PyII928iNUttwPNZLguPQTnskSOcp0MZUO hXwAR7xzRn6pNYl/eyxqrCWDlia29OIkzWD1M41Jc4JCe9i3R/W+weprk6r3QEUOPE6+l/ 8YtUvQAAfUURNOkdIisj1Ws1SCP+IubAUYg1ARZ7XzfJ3CWHuXLszn/EdRH75auytoTuX6 /bndlrx5S8cLzAsh0P/dfQCrfkRprVm63B6HBwMltIjL8auBy2iJaLB672RyANcUx25ns9 DVMBQAUVoELX3Cq79zU4oPGM6o4khlt2IkM268z3IO6vnMxYVE5TIvfT9z7Upg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpLf5WblzjST; Mon, 19 Feb 2024 16:45:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGjURZ096582; Mon, 19 Feb 2024 16:45:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGjUkn096579; Mon, 19 Feb 2024 16:45:30 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:45:30 GMT Message-Id: <202402191645.41JGjUkn096579@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 54cf1499a33a - stable/14 - arm64: Clean up finding our load address List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 54cf1499a33af463c656a2fb6555cfb5a1f2afa0 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=54cf1499a33af463c656a2fb6555cfb5a1f2afa0 commit 54cf1499a33af463c656a2fb6555cfb5a1f2afa0 Author: Andrew Turner AuthorDate: 2023-11-13 15:39:06 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 13:17:18 +0000 arm64: Clean up finding our load address Use the linker to pre-calculate the offset of a known symbol from KERNBASE, and use this to find the physical address KERNBASE should map to. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42568 (cherry picked from commit 61f14f1da37b4e6db8f9efe40c6b544c855fb9bd) (cherry picked from commit 257b04454818c80d9b85a840e3ea8db1ea891265) --- sys/arm64/arm64/locore.S | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index ee3404958789..f7e0b4023aed 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -365,21 +365,13 @@ LEND(drop_to_el1) * Get the physical address the kernel was loaded at. */ LENTRY(get_load_phys_addr) - /* Load the physical address of virt_map */ - adrp x29, virt_map - add x29, x29, :lo12:virt_map - /* Load the virtual address of virt_map stored in virt_map */ - ldr x28, [x29] - /* Find PA - VA as PA' = VA' - VA + PA = VA' + (PA - VA) = VA' + x29 */ - sub x29, x29, x28 - /* Find the load address for the kernel */ - mov x28, #(KERNBASE) - add x28, x28, x29 + /* Load the offset of get_load_phys_addr from KERNBASE */ + ldr x28, =(get_load_phys_addr - KERNBASE) + /* Load the physical address of get_load_phys_addr */ + adr x29, get_load_phys_addr + /* Find the physical address of KERNBASE, i.e. our load address */ + sub x28, x29, x28 ret - - .align 3 -virt_map: - .quad virt_map LEND(get_load_phys_addr) /* From nobody Mon Feb 19 16:45:34 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpLk4y51z5C9Wn; Mon, 19 Feb 2024 16:45: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpLk31b6z4cH4; Mon, 19 Feb 2024 16:45:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361134; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lH3Whj39SQn9EOFPJGjPZkGa0U1ww6Tsp6QXKUbmPRU=; b=s6wGjgXv7rQAGV5eBwFjJ4DFJdvS3lXW7V9QmZa2EAbc/epMvlakg3UbyJYjjrxmLX2lLj DaaxHF/ruXlA93qeMlga7z4/B1nD+LLuSFzLttchllPyarpzh7Cm8i/cjemmOfU0S+mrxG ZHTM3CiCPU05ZJ9nTv8IrmnafFGOvkx+eYRac9J1958t6lW3+0xnvsyJ4QmUMiMOqjuYeP LoKFnTYbO4TE8yosYGjVx36bofnLiv2iUFDXEA9nSDiHZ4k0WifcxX6AeBobNld1j7evAT mdmzOmXCSsgAbpaoYQYvqz2LVdpa6kcH2WTHduiyf36t6uye+my9YjrhDZfpTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361134; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lH3Whj39SQn9EOFPJGjPZkGa0U1ww6Tsp6QXKUbmPRU=; b=jAkNmAG0iUJEKPuDzGgGs5udgqLF7Qn3s35MQAVAnq/nOb+5rbpd01Yz+MWLy/lyO6DCc3 tOdtXmKIPA+D1OoBeIPU1VdwQVPWyjQBlDPDiJB5XcLxaFxAe3wtuktCZ7Hz7rPKUNcGAa rzwF3q3+rZeqloARtT2PFcETFDZAPqnBiUZN9zdn5kHYj3DGIo8KMalww+Rkd984RKbysn +beS5vE0siCXH6clbu+oNnWFVCHgzA5M34VlfmedSiMXzRsJDm0Ha5j9ze7YxJ9ulkXlDT wQhz6SXxlLSBcl2lp8QKVmitGFj7jXlHf+RoXN3WY3dFxExfveomWKog9DAu6Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361134; a=rsa-sha256; cv=none; b=fnRo8upF3tiivr9RsrkZ+MWSjd7xiEmOCRThuITFMYfPD0FppovSR6vHSyOa9YzUvjF/CJ HuJ12VQjW0+9pellrB59JwJZBvkqoZbtRaeYbRw6DIfrh3R9tNx5/i/PyP3oJcIY5vns/G UEOyBsyo3wiQXHOitDC7yJ3BwbNGYT9/GnEUq+i2vnOmFskvZoEcCqCXBY2sEUa4Aqdi0E c1d0J67R40fQghcCaUfw+6qQnJhkRqZarEfhQP8NiVcEy1X0L3a60IeVvWAC7+uzHHbokz 8z4bvNhZALsm74k2gxoDvNB+wAL1jCB2f7hiQKTOyEoTSbwsTaAd0zCrhD8F0A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpLk26dczjGx; Mon, 19 Feb 2024 16:45:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGjYvC096737; Mon, 19 Feb 2024 16:45:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGjYg1096734; Mon, 19 Feb 2024 16:45:34 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:45:34 GMT Message-Id: <202402191645.41JGjYg1096734@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: f8c7bbd1c93f - stable/14 - dev/uart: Support 8-byte register access List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: f8c7bbd1c93fc46610e2757760a0b55a31371780 Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=f8c7bbd1c93fc46610e2757760a0b55a31371780 commit f8c7bbd1c93fc46610e2757760a0b55a31371780 Author: Andrew Turner AuthorDate: 2024-01-09 13:29:47 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 13:17:56 +0000 dev/uart: Support 8-byte register access While we only support 4-byte registers in the uart code the physical access may be to an 8-byte register. Support this as an option on non-i386. On i386 we lack the needed 8-byte bus_space functions. ACPI has an option for 8-byte register io width, and FDT can be given any size. Support these sizes, even if we don't expect to see hardware with an 8-byte io width. Reviewed by: imp Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D43374 (cherry picked from commit a9fc9d6d15f006feb6d7ddb036e020d5f9d19fce) --- sys/dev/uart/uart.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sys/dev/uart/uart.h b/sys/dev/uart/uart.h index 5eae06ceba6f..213f8eca457c 100644 --- a/sys/dev/uart/uart.h +++ b/sys/dev/uart/uart.h @@ -54,6 +54,11 @@ uart_getreg(struct uart_bas *bas, int reg) uint32_t ret; switch (uart_regiowidth(bas)) { +#if !defined(__i386__) + case 8: + ret = bus_space_read_8(bas->bst, bas->bsh, uart_regofs(bas, reg)); + break; +#endif case 4: ret = bus_space_read_4(bas->bst, bas->bsh, uart_regofs(bas, reg)); break; @@ -69,10 +74,15 @@ uart_getreg(struct uart_bas *bas, int reg) } static inline void -uart_setreg(struct uart_bas *bas, int reg, int value) +uart_setreg(struct uart_bas *bas, int reg, uint32_t value) { switch (uart_regiowidth(bas)) { +#if !defined(__i386__) + case 8: + bus_space_write_8(bas->bst, bas->bsh, uart_regofs(bas, reg), value); + break; +#endif case 4: bus_space_write_4(bas->bst, bas->bsh, uart_regofs(bas, reg), value); break; From nobody Mon Feb 19 16:45:33 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdpLj3rCwz5C9ZN; Mon, 19 Feb 2024 16:45:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdpLj1fCQz4cML; Mon, 19 Feb 2024 16:45:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361133; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pKUfjCs1z7qBVnF6OF5N9sqI8Lxsjl72qtuhal2e0WY=; b=x9D4oPPpsgn/UqihhN/3RGhYS3syHWvuYHkUZGs2GUwUqrgpmiJMcX/MWSrpwLFXjyCr0L MPdhQjCWOwkvQRx0Ntbn2PkjFB34RxZz3MVJ4ZZaqUXVlcro3S2jcc+B+7fsuWE0PCDMfu nKgllwlAxQg+YiCmqQOvHZk6OJl+g2ZGXCIdavL6QfODOpJKImPPFNLNKp/OSF+Hi4vtA+ OMtkmf+J9CER0qn5rUC4l5+PUeMv3o4jWF5Nl+TXxus0o6KraMYnvJH36cytztFYUexJo9 TGxOGLJQJTsL6PSrlDeQAudY+IQEXzozInAptBDN6IIkyICd44QvEsVm335ygw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361133; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pKUfjCs1z7qBVnF6OF5N9sqI8Lxsjl72qtuhal2e0WY=; b=SvJ97hxTyTYeUTQNs+pv/JC/fbzb2KEweMrHB9MCJabH0ghrE4BAuqcxkg2U+o4KRp65FE XaXgnfhY0MSBqzeb7/yAlxSVD60QXzEppm4u+ZJ0VmKDkAKqP1MiFIhUrInnSF2SnrtgK5 FkAhfvDaMgU1KBVeJMdTpsP4f1QBOTfKqfKUuPImL0eRgfNuEsvBEKEL69JM6tjEGTsq6+ 6VVRBq/UKC5Et+ZQGCIdaceLyRztNZAcOJW99nAJtfnMy60IWwVB5MXQ9CxHhIKZHH9LYt i5OsXq18jB2sY2FMjxdYUTaTl/dY+/GpAFdSNqtGuRERdP5vznnU9Wxde9pw8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361133; a=rsa-sha256; cv=none; b=Lg4vzMvicC2diXNv/qYBW5YMpjbnWOlHEc5wZ/X/7bQXNrxlWAFzHVgEe9lAvyOsz62pTE A+FbD36ZMrVt+gX4/1/919hljDp3dExud1/CT2uQoGu02Y0NKRO9q9rzoQHtIm4UaPmUk1 T0+kFHCrcV72v4AP+rVq41V6swg5wgRZQIIhC/O7xJGkEo4rgWli3J4X/NozY30r50+1Xn T5gw6xktr/VmJ9GtnzuWs7bwzsFeKaOpW5Cf6sLICK6+WDBRFeEBME43tyUgskk0o7bLLv qs9izFHseKAUbq4TfbkgLErYFZ2PbB0BawTfpQxl6RoeuCpFJy5wrDfRIC3bLQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TdpLj0kRrzjGw; Mon, 19 Feb 2024 16:45:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGjX39096690; Mon, 19 Feb 2024 16:45:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGjXL1096687; Mon, 19 Feb 2024 16:45:33 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:45:33 GMT Message-Id: <202402191645.41JGjXL1096687@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: e7d2a96f4f9b - stable/14 - arm64: Mark the armv8 crc32c as supporting BTI List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: e7d2a96f4f9bf579e5fde5870772a39fb6ffac2a Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=e7d2a96f4f9bf579e5fde5870772a39fb6ffac2a commit e7d2a96f4f9bf579e5fde5870772a39fb6ffac2a Author: Andrew Turner AuthorDate: 2023-11-14 15:01:58 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 13:17:47 +0000 arm64: Mark the armv8 crc32c as supporting BTI This is built into a test so needs the BTI elf note for the rest of the test to be built with BTI support enabled. As the assembly uses the ENTRY macro it already supports BTI, so mark it as such. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42595 (cherry picked from commit 25d0310ed881e86cec9ab5cf37dd8471e88ad554) --- sys/libkern/arm64/crc32c_armv8.S | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/libkern/arm64/crc32c_armv8.S b/sys/libkern/arm64/crc32c_armv8.S index 32bf00ee477d..649afff4b711 100644 --- a/sys/libkern/arm64/crc32c_armv8.S +++ b/sys/libkern/arm64/crc32c_armv8.S @@ -26,6 +26,8 @@ */ #include +#include + .arch_extension crc /* @@ -76,3 +78,5 @@ last_byte: end: ret END(armv8_crc32c) + +GNU_PROPERTY_AARCH64_FEATURE_1_NOTE(GNU_PROPERTY_AARCH64_FEATURE_1_VAL) From nobody Mon Feb 19 22:40:32 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TdyDR511Bz59drQ; Mon, 19 Feb 2024 22:40:39 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4TdyDQ6V31z4XY3; Mon, 19 Feb 2024 22:40:38 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Authentication-Results: mx1.freebsd.org; dkim=none; spf=none (mx1.freebsd.org: domain of brooks@spindle.one-eyed-alien.net has no SPF policy when checking 199.48.129.229) smtp.mailfrom=brooks@spindle.one-eyed-alien.net; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=freebsd.org (policy=none) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 7A25B3C019A; Mon, 19 Feb 2024 22:40:32 +0000 (UTC) Date: Mon, 19 Feb 2024 22:40:32 +0000 From: Brooks Davis To: Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-branches@freebsd.org Subject: Re: git: bda0c0dc87c5 - stable/14 - Remove redundand prototype, fixing the build. Message-ID: References: <202402181246.41ICkO86055179@gitrepo.freebsd.org> List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202402181246.41ICkO86055179@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4TdyDQ6V31z4XY3 X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.60 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FORGED_SENDER(0.30)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : No valid SPF, No valid DKIM,none]; ONCE_RECEIVED(0.10)[]; MIME_GOOD(-0.10)[text/plain]; FREEFALL_USER(0.00)[brooks]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_ONE(0.00)[1]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; R_SPF_NA(0.00)[no SPF record]; R_DKIM_NA(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-branches@freebsd.org]; FROM_HAS_DN(0.00)[]; MISSING_XM_UA(0.00)[]; FROM_NEQ_ENVFROM(0.00)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; RCVD_TLS_LAST(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCPT_COUNT_THREE(0.00)[4] On Sun, Feb 18, 2024 at 12:46:24PM +0000, Konstantin Belousov wrote: > The branch stable/14 has been updated by kib: > > URL: https://cgit.FreeBSD.org/src/commit/?id=bda0c0dc87c54b611d96b6d0dc1947819ffec083 > > commit bda0c0dc87c54b611d96b6d0dc1947819ffec083 > Author: Konstantin Belousov > AuthorDate: 2024-02-18 12:45:49 +0000 > Commit: Konstantin Belousov > CommitDate: 2024-02-18 12:45:49 +0000 > > Remove redundand prototype, fixing the build. > > This is a direct commit to stable/14. It would be best to revert this and cherry-pick the upstream commit 3e4bef52b084d (also in our vendor tree) to avoid conflicts in future merges of openzfs. -- Brooks From nobody Tue Feb 20 08:27:57 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TfCG62W1Rz5BdF5; Tue, 20 Feb 2024 08:27:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TfCG61vFTz4Z9K; Tue, 20 Feb 2024 08:27:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708417678; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QBPKwos+Tw1ToRYBo5UPn3WaYB7EXPOfhasUPOBkOa0=; b=GCCMB4ETu8fo61+GOzBzpxh9k0V4lAeR2QiZgKL+ECQ+ydcTFjOgdvc8yWqQxlptpsvrZu qJzBUQB8ihE19axpQI04o9CYyjpV/oWGLAx7X5cYPc51IZ1q464zzkbwS0qA7xSQqya8ep 6UHfegTKkOEQlZyNSTMEYs67oL4p6VWnXfq4GuFrV/PvjanE5+TzAYmVcno5fuKIKj6M20 CZ/iSUMU769O6dtyy34pTKorhOUHEWE8KIEqH4iYXPkSRFigCyWpLHaSzvQ03I5dYbzbjB xz67q2CoiREp3k8aO4Ye9F/TdxSUCuifaHN3jXHQlK9hgQ0XSESSeALiMZsWdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708417678; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QBPKwos+Tw1ToRYBo5UPn3WaYB7EXPOfhasUPOBkOa0=; b=bpl8f9I9yGReIvW8Qu1NorA3NO/4Leh+ZrhpTJ0epArGkug9Tvm4mXo6V2tmhGXH7KmL3f kaIn90s5PTJj/DF4Llwv7w8GJy6YapZq2GUTZKhxkMpaj5oPusVLHjU39XhEMPLrBv3MNo tN1XSm2Gr03hbhqyC1FkdHV5cjFOyK8b19Mh218ott5iJE9jSlILFe74PKsY/DhA2+qcrR XW0Wo9SyIwHqS5KIF8DA72iH2vVPIOsfYWPm+frN/SnT8Ttv88ckwhHFhgrHjwjlKQDxJR w9eMWFZCQygK0TouAMMmkOEg2ktz1DW7uckKZ+/viZJV9zxyRaazNQEDBswCuQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708417678; a=rsa-sha256; cv=none; b=J2rvMWfXknKqwA8/f5cJrMhiERm1ma+/mPUHmqEv2m3cTXPg6QJlNH4oetb3zxhnKF35+b eLK8Ecg5+evcfPknmb0jQH+qQXrTMW24Ixx7ej/eZWtIs4FJG0WA6sM4KZziF4xiOO/Efw +1AZqaJySt4NH1GN0MIfcVO2SJ+l4nnzFHrKslU/t4NoZgPTdUBgtMgbVAZZYOG5iL61W+ jYZzrXSmWzqWI9XCWQ3CL3BH6IGtfD9Bo8Ll3cTomNwunxu7mUvFygAyS0EblyWfVoLvBP Tit8OsSk14T7XcxOle1vNcTo+bmD3mjIMDRngqu8tVCFQ7Kw8BqBWubPzoZepA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TfCG60rSxz1B10; Tue, 20 Feb 2024 08:27:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41K8RvSX081177; Tue, 20 Feb 2024 08:27:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41K8RvL5081174; Tue, 20 Feb 2024 08:27:57 GMT (envelope-from git) Date: Tue, 20 Feb 2024 08:27:57 GMT Message-Id: <202402200827.41K8RvL5081174@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 261f70ffc8a8 - stable/14 - Annotate 'rebooting' with __read_mostly List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 261f70ffc8a85085c4bc3632818f77e60d4d076e Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=261f70ffc8a85085c4bc3632818f77e60d4d076e commit 261f70ffc8a85085c4bc3632818f77e60d4d076e Author: Olivier Certner AuthorDate: 2024-01-18 10:22:28 +0000 Commit: Olivier Certner CommitDate: 2024-02-20 08:27:03 +0000 Annotate 'rebooting' with __read_mostly While here, put such annotation after the variable for 'dumping', since it concerns the variable and not the type. Reviewed by: markj Approved by: markj (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D43570 (cherry picked from commit 12d6a032dff10fad72f7d3f1bb5cb4c53b9c4284) Approved by: markj (mentor) --- sys/kern/kern_shutdown.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c index 149a9456173f..d1fe560c5c9b 100644 --- a/sys/kern/kern_shutdown.c +++ b/sys/kern/kern_shutdown.c @@ -229,8 +229,8 @@ SYSCTL_INT(_kern, OID_AUTO, kerneldump_gzlevel, CTLFLAG_RWTUN, const char *panicstr; bool __read_frequently panicked; -int __read_mostly dumping; /* system is dumping */ -int rebooting; /* system is rebooting */ +int dumping __read_mostly; /* system is dumping */ +int rebooting __read_mostly; /* system is rebooting */ /* * Used to serialize between sysctl kern.shutdown.dumpdevname and list * modifications via ioctl. From nobody Tue Feb 20 08:27:59 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TfCG72xQRz5BdX2; Tue, 20 Feb 2024 08:27:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TfCG72Q7wz4ZCp; Tue, 20 Feb 2024 08:27:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708417679; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zamdiJNUvICk8c1+y3rsKzN00HxvsO1nTDFar2Zg3iw=; b=Gg9nIgDYaulJq+Rle22qmPuYGHSj0iHT9KwbUQ3PZpwqGDEenDM81wBiNQP3VSKuK7QRUc AHv+Tm+De37+9x47eyQWDlDt3Rvjj5D7QVg0TbDrOEScZT5jG2/rGX4wfUtlOl7lT6r3mD f+wfCNohdE8/0jPwcCMMgBo2dzKF0LOtTQGiCqhxWpNG6lnDMZvZYCP1w+8nd7lEVcH22P h4u8GlR1CdVq3Pj1AKM+mw9VoaAkkHosK81l4DcpftMYp4RpXJqn7ZuFY5AvMUEVN/9aMp yiZRaivhYf+Z4qJ89GG/Jf/sEhlsl44BB4kMDd2HtspBDXUXdlxLJ4xVPou9Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708417679; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zamdiJNUvICk8c1+y3rsKzN00HxvsO1nTDFar2Zg3iw=; b=QsTeSiHyNBnJut4FKUjkEXeIlgvHz4pJL+yhn4Z83dgc/tEc7mEN4HNbcoG/+uLcJkX2zv L74HlrBWZj965LOj1YPrUtftJOrVO/Daab8L7oBP58Cr8L6rndMMcoyNGL5Ocrr6ftIUDc eDeblEB84lpsG28qL3PXefzixJW5NkaMpdkGfsXPioNID9t09u8Ydotpjygw7yexsgjF54 Xa6nUWkth+mucd+aX6rUfNiPht+f4TNqx2R3hlXT5Wxufz8WlQ1M562JBVUpipoB4IwYmZ 1nLqQHnxpQHbaz6d0vy57EVvaaNegXaDDexCwfTDA/aO6xmO2kaHIWbOoxb58g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708417679; a=rsa-sha256; cv=none; b=Tx6YtlTb3gcFT2hmIDm91MR3Ax+k5YkfueF/4hzSggsbgyiPwY0qTjoM43B/li3qPDTC/l FuCUBDaXUn9DfcU2Q/8xN8IhvHTlW17KQFRe09oRBG9OUY+cLbkP7pGaSNXDkwWqyfhGgb loacDAiciCmqRdBZj3sM4PvvCoDY2rvPqKJC723BEZRzeEPou6T3gIVmpgo+cE2jCtb0L+ jMHHYLnfc8NHLKLxAU960X9pIiYl9DQ0HIp5zj1Al5SIo7dbRAqRT66umIdj4WAk3RifY4 hEYsKHWnG93vS8zaBYo7QhQjElc2RWyyGVHhsOU/NRFJCORsOWp4QU7aVETziQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TfCG71VK3z19pS; Tue, 20 Feb 2024 08:27:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41K8RxZI081227; Tue, 20 Feb 2024 08:27:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41K8Rx6x081224; Tue, 20 Feb 2024 08:27:59 GMT (envelope-from git) Date: Tue, 20 Feb 2024 08:27:59 GMT Message-Id: <202402200827.41K8Rx6x081224@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: a6d066d0120f - stable/14 - SCHEDULER_STOPPED(): Move it (back) to 'systm.h' List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: a6d066d0120f0b83efca4e618050557a91259a30 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=a6d066d0120f0b83efca4e618050557a91259a30 commit a6d066d0120f0b83efca4e618050557a91259a30 Author: Olivier Certner AuthorDate: 2024-01-18 10:31:59 +0000 Commit: Olivier Certner CommitDate: 2024-02-20 08:27:07 +0000 SCHEDULER_STOPPED(): Move it (back) to 'systm.h' It's not an assertion, so doesn't logically belong to 'kassert.h'. Moreover, a subsequent commit will make it rely on a variable whose declaration also belongs to 'systm.h'. Approved by: markj (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D43571 (cherry picked from commit cd0c52e50bc17f4c3fab998f9f33b1d3ada6c90e) Approved by: markj (mentor) --- sys/sys/kassert.h | 11 ----------- sys/sys/systm.h | 12 ++++++++++++ 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/sys/sys/kassert.h b/sys/sys/kassert.h index d7c1a21385f9..da7b66854a14 100644 --- a/sys/sys/kassert.h +++ b/sys/sys/kassert.h @@ -149,17 +149,6 @@ void kassert_panic(const char *fmt, ...) __printflike(1, 2); #define CRITICAL_ASSERT(td) \ KASSERT((td)->td_critnest >= 1, ("Not in critical section")) -/* - * If we have already panic'd and this is the thread that called - * panic(), then don't block on any mutexes but silently succeed. - * Otherwise, the kernel will deadlock since the scheduler isn't - * going to run the thread that holds any lock we need. - */ -#define SCHEDULER_STOPPED_TD(td) ({ \ - MPASS((td) == curthread); \ - __predict_false((td)->td_stopsched); \ -}) -#define SCHEDULER_STOPPED() SCHEDULER_STOPPED_TD(curthread) #endif /* _KERNEL */ #endif /* _SYS_KASSERT_H_ */ diff --git a/sys/sys/systm.h b/sys/sys/systm.h index 9a0932e50dc9..3721db649a3d 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -101,6 +101,18 @@ struct ucred; #include /* curthread */ #include +/* + * If we have already panic'd and this is the thread that called + * panic(), then don't block on any mutexes but silently succeed. + * Otherwise, the kernel will deadlock since the scheduler isn't + * going to run the thread that holds any lock we need. + */ +#define SCHEDULER_STOPPED_TD(td) ({ \ + MPASS((td) == curthread); \ + __predict_false((td)->td_stopsched); \ +}) +#define SCHEDULER_STOPPED() SCHEDULER_STOPPED_TD(curthread) + extern int osreldate; extern const void *zero_region; /* address space maps to a zeroed page */ From nobody Tue Feb 20 08:28:00 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TfCG86DQLz5BdZQ; Tue, 20 Feb 2024 08: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TfCG83C6yz4ZJ7; Tue, 20 Feb 2024 08: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=1708417680; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/D6snvRAIZUrexrSuDcTsbCPSTUWLnKFAdgoZ+R5bZE=; b=nXMvmut+Tm1ZDrjQksZBOmODKFsCHGQP/gYOntoYyIovfmSc5GMNJQ0r5rJQpDbv0UMXOc mdv2fQLQ4qmeWLzl1YUp6sV23CGJijGqaCJF7XrS/3HAthZEuB+vkY1EnKg7MUf72ogEXt iorYdbtEkWYUAMMmszT9Eu7svPjFQ1WUmkNjZlj4AbzrVvvkqG80pGTo0iPDEDVV8Rmmpo 3OHvVfZiO21KTfI8ShakM6NErsXguAHwvGPVc6eTYVtE+xW8AqhD7xTd99P+IC23WDIUrG rECTT/XbGJYBwwfcgDgam52GeBGrFH04R0RNMPySfstBXyk9gsnRZBB2jEdgeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708417680; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/D6snvRAIZUrexrSuDcTsbCPSTUWLnKFAdgoZ+R5bZE=; b=FhHRHFvSfpNtUZXPnJLhWqPWySqmLFjVWNYtg6Fj+4Pu5ggjpKqEQi3kmj9o5dRZkWXtxf 8Rr8sjseH5b80k11WAxMOCzCXzsikr8ukZSLOEhPFEGsHsY4vl4ZvTW1hlb01zL1hYN6b1 ukP7PnbIS+hksXzpgg4I/Ez8l7qhhZorM7FJCcrf7oGiuZAkOqWk6wrtzNWI+KsTlF2kY/ i3KUjqxKUdnY5BkJVCjCkZo78vdpHZnzogFKQy51iVY3m7onRgeLVML8voFMzTMilkRk5Q 6rBdCPHCpfCZXJGyi0mKZ6qcZ6Se6fY6x74NyPSps7o8BPwP9pUa8rolC8GMoA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708417680; a=rsa-sha256; cv=none; b=bEooa1KRg1Dr5yWJgu8LPrFQRf4KxmkTZTBKfRy1bG4c83CUMpFqrwPTaxE7+MAWpZ4Dvq Rjh+7wEP8M+lGEyCvE8AGpRs2UV6U1wNk/muCYTuIwEAe6K19TVCTMNz0JXkMEtHaa+1qo YZxcjnPz0ZeIAPAkwg9QmgULVE9P881PzSJL2Tbs38KCHgNR9VpYuSA8u1u0lJHe87/PAd MadpOqR/YHQpbCnD1ze3aOsHdzXsRmes41Ja4jaA5eJV6bNyJGfUPHx955C7wa5hvmKtx/ 6kcBAxJCF38MV7+NsnslJAttRDDqV4sJAbMk+7pEdO2dUHkwlpL7AaRIt59ZPQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TfCG82Fxrz19ks; Tue, 20 Feb 2024 08:28:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41K8S0wu081276; Tue, 20 Feb 2024 08:28:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41K8S0Rq081273; Tue, 20 Feb 2024 08:28:00 GMT (envelope-from git) Date: Tue, 20 Feb 2024 08:28:00 GMT Message-Id: <202402200828.41K8S0Rq081273@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 0f0bf1e880c6 - stable/14 - sched_setscheduler(2): Change realtime privilege check List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 0f0bf1e880c6854859a6e8c2ad97b46a688ee025 Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=0f0bf1e880c6854859a6e8c2ad97b46a688ee025 commit 0f0bf1e880c6854859a6e8c2ad97b46a688ee025 Author: Florian Walpen AuthorDate: 2024-02-14 13:50:44 +0000 Commit: Olivier Certner CommitDate: 2024-02-20 08:27:08 +0000 sched_setscheduler(2): Change realtime privilege check Check for privilege PRIV_SCHED_SETPOLICY instead of PRIV_SCHED_SET, to at least make it coherent with what is done at thread creation when a realtime policy is requested, and have users authorized by mac_priority(4) pass it. This change is good enough in practice since it only allows 'root' (as before) and mac_priority(4)'s authorized users in (the point of this change), without other side effects. More changes in this area, to generally ensure that all privilege checks are consistent, are going to come as olce's priority revamp project lands. (olce: Expanded the explanations.) PR: 276962 Reported by: jbeich Reviewed by: olce Approved by: emaste (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D43835 (cherry picked from commit 2198221bd9df0ceb69945120bc477309a5729241) Approved by: markj (mentor) --- sys/kern/p1003_1b.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/p1003_1b.c b/sys/kern/p1003_1b.c index 21c9e3a27039..6259f7092487 100644 --- a/sys/kern/p1003_1b.c +++ b/sys/kern/p1003_1b.c @@ -233,8 +233,8 @@ kern_sched_setscheduler(struct thread *td, struct thread *targettd, targetp = targettd->td_proc; PROC_LOCK_ASSERT(targetp, MA_OWNED); - /* Don't allow non root user to set a scheduler policy. */ - error = priv_check(td, PRIV_SCHED_SET); + /* Only privileged users are allowed to set a scheduler policy. */ + error = priv_check(td, PRIV_SCHED_SETPOLICY); if (error) return (error); From nobody Tue Feb 20 09:01:11 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TfD0R5GH9z5Bh1L; Tue, 20 Feb 2024 09: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TfD0R4mHyz4cpK; Tue, 20 Feb 2024 09: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=1708419671; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mX3BT9u6oaOpkVEnPKUu7gNtg3StgaFORycRWpIRJzs=; b=FHeHmG9lxY4z5lIVC/sFqeK7IduUKabTbcVj4KUN2Hq/VA+Ioh+J66cyiPkhQ5LC6zhffN UoSmd2MZZfSKNMm+4JftD0R/NzrbGSJD6HD3efpOJL6ji44oQ1eZw/exPiG91RwEdpwfj2 RLYu1WadsitXxvpCRAFk4NZtsj70ee+xxr2otOP897q1wuQAPgYSu756hMehIwjKSiD0w6 t92uEn4lpGupkEYq2bmv4iXmvhnZ1kyDl+3ClKgWHcF3jg72u9nUTJpGRkpfYIOOAOoE6G toXTMgcdSFpYOh6CUxvDAEduNdue4JAcbj/Gfs/4FoehAv9yE4YCZT9VHKra/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708419671; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mX3BT9u6oaOpkVEnPKUu7gNtg3StgaFORycRWpIRJzs=; b=uihc9n7iEGSWRJAlagAuViteCECJkrRWHK7G60ozuipGY9Jg1c+qY00Ae+XATb4MxkeADy 4LjIkx42z51fgJo2a+ZklaQNnRSBnSkZ1k+8r64Zy+hZZpjxZPrOvUMBX4y3D5wNrK/qro 89us09Ouw3C2tFpjs/uMRvQicQi2vtnJcvScu12lifL91RqO+YgY8eEDbvVEoKghBLJTzC GAjnUsGcYG54E8ZVYjmxTHgQbhIjSu6LFZdm0MFLTdaQFCY1hzUuZ/9CJdfiCv28cFi3px gLcX4ED7pmw5b2ugBpI73F4SD25l9jHSLSK9BdolpUA7plLqgEvPLkrWFJ8Wxg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708419671; a=rsa-sha256; cv=none; b=CKLniysgYb9Jz2NEsV05O1+FUFlTtL05iiJQNox7D7ti9ViO0e80pX0HxDtY8WWgnRPgpq kpnd2ZjlBZ1RjohcE38Sf0EspKpq+7bCDx79b1YbnhkYH+OaFl1+gJ+WHSBG7fxyn6gYpl LpqS3+PB515ZkXWzmCNNZhh9Fuqkq8btB+eXOFWIE/dDOga/YBZDpq5cFRW1wm9jSwYaFq 2aAmX8ZVzwXm7tBeX3AIravfB0t09OGxUluyoJZpd1570OIZYJCDduwtmIHdafdfeHhiB/ LHgEE5fqebDRY+SJ7lVdPf5Eo8MRqjnPs2ww0sLkuM2wzhvwJxZ86+2rnoYHLg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TfD0R3pvVz1B8W; Tue, 20 Feb 2024 09:01:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41K91BSP042899; Tue, 20 Feb 2024 09:01:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41K91BFX042896; Tue, 20 Feb 2024 09:01:11 GMT (envelope-from git) Date: Tue, 20 Feb 2024 09:01:11 GMT Message-Id: <202402200901.41K91BFX042896@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: 2c8244485795 - stable/13 - Annotate 'rebooting' with __read_mostly List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 2c8244485795f84bab27ffa0172d87a7fe867a27 Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=2c8244485795f84bab27ffa0172d87a7fe867a27 commit 2c8244485795f84bab27ffa0172d87a7fe867a27 Author: Olivier Certner AuthorDate: 2024-01-18 10:22:28 +0000 Commit: Olivier Certner CommitDate: 2024-02-20 09:00:36 +0000 Annotate 'rebooting' with __read_mostly While here, put such annotation after the variable for 'dumping', since it concerns the variable and not the type. Reviewed by: markj Approved by: markj (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D43570 (cherry picked from commit 12d6a032dff10fad72f7d3f1bb5cb4c53b9c4284) Approved by: markj (mentor) --- sys/kern/kern_shutdown.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c index 4e168df25301..c899c4a6f10e 100644 --- a/sys/kern/kern_shutdown.c +++ b/sys/kern/kern_shutdown.c @@ -224,8 +224,8 @@ SYSCTL_INT(_kern, OID_AUTO, kerneldump_gzlevel, CTLFLAG_RWTUN, const char *panicstr; bool __read_frequently panicked; -int __read_mostly dumping; /* system is dumping */ -int rebooting; /* system is rebooting */ +int dumping __read_mostly; /* system is dumping */ +int rebooting __read_mostly; /* system is rebooting */ /* * Used to serialize between sysctl kern.shutdown.dumpdevname and list * modifications via ioctl. From nobody Tue Feb 20 09:01:12 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TfD0S6nLXz5Bgn0; Tue, 20 Feb 2024 09:01:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TfD0S61gDz4dGV; Tue, 20 Feb 2024 09:01:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708419672; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OtUaeT35NeR5vh4Jwz/K7+uKnYe4MN3pY2EouWbmsgQ=; b=XhhtHYjuIb4BqndHPITFjexbqEIp+POKB2ONKU3Q9CvXkq/c48KLIBlEjgCrLruILyYhDM xIDf34n8H4flcubO+dvJIzbYwO4jsWa+FXDyBn2O4Vdwe7ohaJbDFXQIWvtowDe5fld7FQ XRsxp0XeZ5DuiO/AyA4ZXsGzlPBC/AAGIPH0Zgv1b899B+OLJuLJO2xkYHKAMD2O+lGsGe 9TjVdWzsuBiVkOWKLMbAfTKSxFjD98GdbgNmkuz3/gxW15rV5h4ZZlL8XX6EltYCl7zNKK ub6qD5K3hDmh3N153YRyNq2SPChlYWEwr9voGxbgwr5BpqVky0YIZoWFt4FmsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708419672; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OtUaeT35NeR5vh4Jwz/K7+uKnYe4MN3pY2EouWbmsgQ=; b=GQ7751LLuR7gU18wM2NoELhszeL6qThLo+YhtRK+CIwzDxrjNgPHxp9EygGI5RVv4gBM9w ANeCTdItZgKKc8FUcUArB+8ZYhiSmS7YuE1XVScQlf5WXJMMJJ+UIvlJCLNaWdRsM7MQuv qWRLnVbNJmGXDekq+vAaR1HiR31JpMZOI8IRSs7aZEWUBReYTLFWLMT6VTlNeNCBKiNfmg /lmbdk+2AyvHWwyyDe3WAtIhtS95FD/TWWLZb8+Rp+A9Ql+Lwj69JXVkWds8JdKYb1M9mR ifIqlHYgx833mniwQeTQZ0Ii6ED1LkzqVckPls3TVwfv+q+/k9Bzxb8xrRJfug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708419672; a=rsa-sha256; cv=none; b=GQZFqejAOgbWEeJNPINRbTyuE9MdbHZBAcOkaveBHnfTx5Tvb5NMvn36OBFblPPpnLHRfM MWw6tk9WrNKn9IwmcvnZ0U0Q5lBvRoP7Vk40dbUFkGus0L27FahrUewRDnXfLaTkGowWj7 tPzs8PWjpaWMxYlxu5FHJgwFsbQskh9toXGCsfFPL+uNGNxQTBfidVTVPMoesnX+gP8+Xz e8VKNKyS5WSYN57DIF0WrH/5UiD/AvHHPAP2jj6TVxOGCVzChLSTlCm59xz5KdbK2xq1RO qoKcfGBUGGGfoMMXXe/x6SN6A9DX4kenQBBtDK+h05Yx5v3ZqzE1DRIPPEUAsw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TfD0S4p2Wz1BHy; Tue, 20 Feb 2024 09:01:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41K91CQR042944; Tue, 20 Feb 2024 09:01:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41K91Cng042941; Tue, 20 Feb 2024 09:01:12 GMT (envelope-from git) Date: Tue, 20 Feb 2024 09:01:12 GMT Message-Id: <202402200901.41K91Cng042941@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: ab978c432e4d - stable/13 - SCHEDULER_STOPPED(): Move it (back) to 'systm.h' List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: ab978c432e4d3495f2720a485992ee523dbc582c Auto-Submitted: auto-generated The branch stable/13 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=ab978c432e4d3495f2720a485992ee523dbc582c commit ab978c432e4d3495f2720a485992ee523dbc582c Author: Olivier Certner AuthorDate: 2024-01-18 10:31:59 +0000 Commit: Olivier Certner CommitDate: 2024-02-20 09:00:41 +0000 SCHEDULER_STOPPED(): Move it (back) to 'systm.h' It's not an assertion, so doesn't logically belong to 'kassert.h'. Moreover, a subsequent commit will make it rely on a variable whose declaration also belongs to 'systm.h'. Approved by: markj (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D43571 (cherry picked from commit cd0c52e50bc17f4c3fab998f9f33b1d3ada6c90e) Approved by: markj (mentor) --- sys/sys/kassert.h | 11 ----------- sys/sys/systm.h | 12 ++++++++++++ 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/sys/sys/kassert.h b/sys/sys/kassert.h index d7c1a21385f9..da7b66854a14 100644 --- a/sys/sys/kassert.h +++ b/sys/sys/kassert.h @@ -149,17 +149,6 @@ void kassert_panic(const char *fmt, ...) __printflike(1, 2); #define CRITICAL_ASSERT(td) \ KASSERT((td)->td_critnest >= 1, ("Not in critical section")) -/* - * If we have already panic'd and this is the thread that called - * panic(), then don't block on any mutexes but silently succeed. - * Otherwise, the kernel will deadlock since the scheduler isn't - * going to run the thread that holds any lock we need. - */ -#define SCHEDULER_STOPPED_TD(td) ({ \ - MPASS((td) == curthread); \ - __predict_false((td)->td_stopsched); \ -}) -#define SCHEDULER_STOPPED() SCHEDULER_STOPPED_TD(curthread) #endif /* _KERNEL */ #endif /* _SYS_KASSERT_H_ */ diff --git a/sys/sys/systm.h b/sys/sys/systm.h index dcfe84e91cc2..d073c87af163 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -101,6 +101,18 @@ struct ucred; #include /* curthread */ #include +/* + * If we have already panic'd and this is the thread that called + * panic(), then don't block on any mutexes but silently succeed. + * Otherwise, the kernel will deadlock since the scheduler isn't + * going to run the thread that holds any lock we need. + */ +#define SCHEDULER_STOPPED_TD(td) ({ \ + MPASS((td) == curthread); \ + __predict_false((td)->td_stopsched); \ +}) +#define SCHEDULER_STOPPED() SCHEDULER_STOPPED_TD(curthread) + extern int osreldate; extern const void *zero_region; /* address space maps to a zeroed page */ From nobody Tue Feb 20 10:45:49 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TfGKT3N2sz5BqfJ; Tue, 20 Feb 2024 10:46:05 +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 4TfGKT0BfSz4mKb; Tue, 20 Feb 2024 10:46:04 +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 41KAjn7H044165; Tue, 20 Feb 2024 12:45:52 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 41KAjn7H044165 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 41KAjnKx044164; Tue, 20 Feb 2024 12:45:49 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 20 Feb 2024 12:45:49 +0200 From: Konstantin Belousov To: Brooks Davis Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-branches@freebsd.org Subject: Re: git: bda0c0dc87c5 - stable/14 - Remove redundand prototype, fixing the build. Message-ID: References: <202402181246.41ICkO86055179@gitrepo.freebsd.org> List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-14) on tom.home X-Spamd-Bar: ---- X-Rspamd-Queue-Id: 4TfGKT0BfSz4mKb X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] On Mon, Feb 19, 2024 at 10:40:32PM +0000, Brooks Davis wrote: > On Sun, Feb 18, 2024 at 12:46:24PM +0000, Konstantin Belousov wrote: > > The branch stable/14 has been updated by kib: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=bda0c0dc87c54b611d96b6d0dc1947819ffec083 > > > > commit bda0c0dc87c54b611d96b6d0dc1947819ffec083 > > Author: Konstantin Belousov > > AuthorDate: 2024-02-18 12:45:49 +0000 > > Commit: Konstantin Belousov > > CommitDate: 2024-02-18 12:45:49 +0000 > > > > Remove redundand prototype, fixing the build. > > > > This is a direct commit to stable/14. > > It would be best to revert this and cherry-pick the upstream commit > 3e4bef52b084d (also in our vendor tree) to avoid conflicts in future > merges of openzfs. Then some config.h needs to be regenerated. Can you provide me a pointer how to do that? From nobody Tue Feb 20 14:23:26 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TfM8G4mdFz5C8KC; Tue, 20 Feb 2024 14:23:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TfM8G3DjTz56d3; Tue, 20 Feb 2024 14:23:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708439006; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wZMJAJlBwFb2bqjw2YPxWmFitPzXebKPNOCXN62n2NY=; b=xoM1gSuUNrYXU4dTsCp/rjGXfyEDw58SDVPaQZqo8A8hmHEJ1CXPdw/aieb3wgjubN6aye 3goLTWdvUcKlAZkOWkxE72exLR0LVUqNhy1v6uZJeACZsKJuFhLBiUW54HWqhmVURaWCf/ 7zA0DrqllYdLMB6J5mKKomSV3NQAOjQrnJHksZKfOTHifUfziCCvutUonN8tEvl3CrYNtG KBHcDR3ymw/c8HgjgzFD2TuEIxqBgISsX9CNZdAfC91neLBx8YLN0hcBBsMqJBZ2lHX1WT tndTYICOM2qFr3zscnmdxBDP1Q1E54IDv6cbglD8KgGkmIc4srkWunXDvoaLZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708439006; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wZMJAJlBwFb2bqjw2YPxWmFitPzXebKPNOCXN62n2NY=; b=BWpiGfQR8oaAb//wodvVMT8tmZcN6eiOzYC3Tb1obiGVbIS1GBmPpIOwcMjL8SP1a5ozPl pTawpo6YFFJFole+kBhPVNDHGr5NnhN3EHn3hO1SBCV65NSHAKZPYZFrelPSdg5MbqQY0s Dpwjzq9h5cA1BX9Qqt8vV/M2662V55zYp30og8K3dYbIx2q5oiTfgB5ol0qNgETBky+PXH LCXMj0S7Nq7OuWGFb3nAPOqr4MMFSmZujA69fZDDYhnfb+SL6js2JM/sIQxVHCapWk3YlJ 6BzOIfM0FK0jZlyxvJDOv0IAatMcdchU0BIFWYS1jyhX1NoQ9Jb2J01vkJRXLw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708439006; a=rsa-sha256; cv=none; b=iIvJrPOmG8YvHOlJ7xqyi93yPNtwrEIcxoYPu3yN2Og9lGmVATtKUSIC9jL2+gVGZWHF0f i2Fzx+is61gqJ/yxYHnaRGO4z5/yZmTkwia2wc3T9ZsYvTSshsWZGBRp/n7C5KHLhjsb0H 9kjFJcVCkJp4MJmHrOB+IhBMnS6u0CxzihmkI/TvhJiJDGymboR32tyeISzZZeO7jx8HpH T0B5aRddszJKhrgp9AfSxSOD2II0aQJKvcH4ZoXBcMkxmPDBdMUGC1/zEscAXlg58tbYBN 5Hy2FQDQwoaTBUJ/JMZzHyQaihG5UTXaNYKzEBBHcpV5aJhpl4TSt4xZlXoMqQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TfM8G2H1hzLx9; Tue, 20 Feb 2024 14:23:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41KENQpe086197; Tue, 20 Feb 2024 14:23:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41KENQOI086194; Tue, 20 Feb 2024 14:23:26 GMT (envelope-from git) Date: Tue, 20 Feb 2024 14:23:26 GMT Message-Id: <202402201423.41KENQOI086194@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 14e782708d37 - stable/14 - vmm: Fix compiling error with BHYVE_SNAPSHOT List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 14e782708d375f19a8e19a4c7a42c5032f9997ee Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=14e782708d375f19a8e19a4c7a42c5032f9997ee commit 14e782708d375f19a8e19a4c7a42c5032f9997ee Author: Vitaliy Gusev AuthorDate: 2024-02-06 15:36:17 +0000 Commit: Mark Johnston CommitDate: 2024-02-20 14:21:14 +0000 vmm: Fix compiling error with BHYVE_SNAPSHOT The return values of copyin() and copyout() must be checked. vm_snapshot_buf_cmp() is unused by the kernel and was incorrectly implemented, so just remove it. Reviewed by: markj Sponsored by: vStack MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D43754 (cherry picked from commit 7572fe89ada63719b558c6b844e2743cd3ff6b6a) --- sys/amd64/include/vmm_snapshot.h | 7 +++++-- sys/amd64/vmm/vmm_snapshot.c | 44 +++++++--------------------------------- 2 files changed, 12 insertions(+), 39 deletions(-) diff --git a/sys/amd64/include/vmm_snapshot.h b/sys/amd64/include/vmm_snapshot.h index 5ed00c71d58a..b39c342bf6d9 100644 --- a/sys/amd64/include/vmm_snapshot.h +++ b/sys/amd64/include/vmm_snapshot.h @@ -98,8 +98,6 @@ void vm_snapshot_buf_err(const char *bufname, const enum vm_snapshot_op op); int vm_snapshot_buf(void *data, size_t data_size, struct vm_snapshot_meta *meta); size_t vm_get_snapshot_size(struct vm_snapshot_meta *meta); -int vm_snapshot_buf_cmp(void *data, size_t data_size, - struct vm_snapshot_meta *meta); #define SNAPSHOT_BUF_OR_LEAVE(DATA, LEN, META, RES, LABEL) \ do { \ @@ -113,6 +111,10 @@ do { \ #define SNAPSHOT_VAR_OR_LEAVE(DATA, META, RES, LABEL) \ SNAPSHOT_BUF_OR_LEAVE(&(DATA), sizeof(DATA), (META), (RES), LABEL) +#ifndef _KERNEL +int vm_snapshot_buf_cmp(void *data, size_t data_size, + struct vm_snapshot_meta *meta); + /* compare the value in the meta buffer with the data */ #define SNAPSHOT_BUF_CMP_OR_LEAVE(DATA, LEN, META, RES, LABEL) \ do { \ @@ -126,4 +128,5 @@ do { \ #define SNAPSHOT_VAR_CMP_OR_LEAVE(DATA, META, RES, LABEL) \ SNAPSHOT_BUF_CMP_OR_LEAVE(&(DATA), sizeof(DATA), (META), (RES), LABEL) +#endif /* _KERNEL */ #endif diff --git a/sys/amd64/vmm/vmm_snapshot.c b/sys/amd64/vmm/vmm_snapshot.c index dae4b1001182..5f078397eb95 100644 --- a/sys/amd64/vmm/vmm_snapshot.c +++ b/sys/amd64/vmm/vmm_snapshot.c @@ -58,7 +58,7 @@ int vm_snapshot_buf(void *data, size_t data_size, struct vm_snapshot_meta *meta) { struct vm_snapshot_buffer *buffer; - int op; + int op, error; buffer = &meta->buffer; op = meta->op; @@ -69,11 +69,14 @@ vm_snapshot_buf(void *data, size_t data_size, struct vm_snapshot_meta *meta) } if (op == VM_SNAPSHOT_SAVE) - copyout(data, buffer->buf, data_size); + error = copyout(data, buffer->buf, data_size); else if (op == VM_SNAPSHOT_RESTORE) - copyin(buffer->buf, data, data_size); + error = copyin(buffer->buf, data, data_size); else - return (EINVAL); + error = EINVAL; + + if (error) + return (error); buffer->buf += data_size; buffer->buf_rem -= data_size; @@ -99,36 +102,3 @@ vm_get_snapshot_size(struct vm_snapshot_meta *meta) return (length); } - -int -vm_snapshot_buf_cmp(void *data, size_t data_size, struct vm_snapshot_meta *meta) -{ - struct vm_snapshot_buffer *buffer; - int op; - int ret; - - buffer = &meta->buffer; - op = meta->op; - - if (buffer->buf_rem < data_size) { - printf("%s: buffer too small\r\n", __func__); - ret = E2BIG; - goto done; - } - - if (op == VM_SNAPSHOT_SAVE) { - ret = 0; - copyout(data, buffer->buf, data_size); - } else if (op == VM_SNAPSHOT_RESTORE) { - ret = memcmp(data, buffer->buf, data_size); - } else { - ret = EINVAL; - goto done; - } - - buffer->buf += data_size; - buffer->buf_rem -= data_size; - -done: - return (ret); -} From nobody Tue Feb 20 15:13:44 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TfNGJ5Jslz5CDFS; Tue, 20 Feb 2024 15:13:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TfNGJ4pVMz400f; Tue, 20 Feb 2024 15:13:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708442024; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kXhW1g1SGZipHfyeUnLYesZuRCgjfs/f+XCbcGVE04I=; b=HrovHs4nM/xOrsRv8K4KS4UP60Jdv6EO6VhGTVIHBzumqI8EtV1ynv6RgmqANbFFxG5c4s SXZzfdl9itwjYGTP7ODvX7EDQ/ydO4hJRZ3x4+CSP0RDo+ulkbTVLppyDoV6MV7JgUTAkF /nt0Xpji84eX4+es9xk3jwEdGZZxjYHJwXBD72Fhm9vMy/M/gi5bKop2izKTPp+5HK5+k1 sHPZzGDprqUt8VJry7J1HnU8Up6+ZBqZGQn02ndeeLC5zX/M+fXY5LHoLNopqta/byHNkm nFSJ6IcIGeQtvVtKQ+V1s7oInSI46SpIKBDe6PV9RblJmEqPgkddseJrqMD4vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708442024; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kXhW1g1SGZipHfyeUnLYesZuRCgjfs/f+XCbcGVE04I=; b=PGQFuA/FHmwAc94haraV70ae6dZY9LB0E+eHcXdAn2Qvna6k6buQTbOcnVkBBDs1amZTBY ACRJ4pyOm5KeCkElWf2dLSQmEY135KY7cOV0J3V/7FZhMBE5+8Xh6EBey6WyeDWk/uVRNx 92CeONYS1varTxLh/wtkmgareTK9/je6OlCdVFGU1NBvaTXAj6ko4JrRAnxudmqym/G0A2 yli0pUtLmBBzN9wQ+QwWMRP6PVmwAc7wbfZ5gPwTj1Ngb726dpQ5nKBdlk/07HWpW9U31m fcA5eAxsnQfK7uliMzUVc84cc8M1NUJ/nN1GJdLFWgRry3ep2+b0y4FMDp6HTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708442024; a=rsa-sha256; cv=none; b=k0anoPNMnOvTMprYso4pb7PF2ewwe3l9VNWYD1ywNOSy2cGrnTAtFeiZIu0oZW5iBhezod f1ElVJbs0b0Aq/pL5JfDymFzKsooeznezmzj2rUmkLeKZCNqX4tJXrgNPn8mY3m+gmaRH2 JTEfV/62ktTlm9KThMISSuFTlGeWtVoneK5lIpahV58rSBdi42syAD8JxvUGWZUFMnw+Yl 1DUqAialQleI97W8gkT1MDC4o1X0OQ7fKuoezTTpUFVY0okv1SjuuotIAmU03eO82PwnA1 qBnmFt2JE7mQbS19dS+rZHfKiJuV/9hHbp6LYaYeItaS0+nOpUHGyEJY5yjkkg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TfNGJ3tP2zNN2; Tue, 20 Feb 2024 15:13:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41KFDicE070932; Tue, 20 Feb 2024 15:13:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41KFDiY1070929; Tue, 20 Feb 2024 15:13:44 GMT (envelope-from git) Date: Tue, 20 Feb 2024 15:13:44 GMT Message-Id: <202402201513.41KFDiY1070929@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: 0ed5a203925e - stable/14 - mfc-candidates: search by committer only, not author List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 0ed5a203925e3bbe757c5952677d75a78114db21 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=0ed5a203925e3bbe757c5952677d75a78114db21 commit 0ed5a203925e3bbe757c5952677d75a78114db21 Author: Ed Maste AuthorDate: 2023-09-24 13:13:15 +0000 Commit: Ed Maste CommitDate: 2024-02-20 15:13:33 +0000 mfc-candidates: search by committer only, not author When both --author and --committer are specified, `git log` requires both to match. Search only by committer, as it is typically the FreeBSD committer who will perform the MFC. Reviewed by: jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D41964 (cherry picked from commit 61f8df6a13a357e1d45c22a2016b87491f10de87) --- tools/tools/git/mfc-candidates.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/tools/git/mfc-candidates.sh b/tools/tools/git/mfc-candidates.sh index 9e120d451beb..76ff9b4d53c6 100644 --- a/tools/tools/git/mfc-candidates.sh +++ b/tools/tools/git/mfc-candidates.sh @@ -118,7 +118,7 @@ fi authorarg= if [ -n "$author" ]; then # Match user ID in the email portion of author or committer - authorarg="--author <${author}@ --committer <${author}@" + authorarg="--committer <${author}@" fi # Commits in from_branch after branch point From nobody Tue Feb 20 15:16:53 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TfNKx3Wcdz5CDV9; Tue, 20 Feb 2024 15:16:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TfNKx2v6dz40FJ; Tue, 20 Feb 2024 15:16:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708442213; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mmWJ9kjkQRrZJmBxkncLtwV/FXnf2NDUgdcyTxK8L4k=; b=GIp2ET0JN10Ikh/VQdmSVQGHc3yADObBLej+8AoQKZ+i+0XTuS3ULyXyL1/ETcoQYpK9Y5 jNfeqOfKDbS0YlgApR0WYiBIVVsPeT31wZAR30Bf3nheyYsoW1W7knCeWz80us/v/bvLk9 70kMIXKuMryjEHGbzaia8N9Ck8vd85oHFOxrLkVwwEEzbGbo1zvTbxGT/fxWdlspj39uAG LVYD2E41qUsAQbMYBCj2wPQhazSmWiyLVPSL1rYRrOVIgjhB7JGF4AlXLjD/wJLFpxFQRk Oq+aug2N8NjMohkfRSHpXJilvk3lapM7Jqv5rnVz/vZRjPq1k+LPJWjZc5Cnzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708442213; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mmWJ9kjkQRrZJmBxkncLtwV/FXnf2NDUgdcyTxK8L4k=; b=AyrFFRAGKatVc0T+oqTshTGrUqMznfeF5WqL8EX0hlEim/c9gvGOr4LvC0XANrhEn03wgT EM6098CzZzQCoQu14K/ZQHULuhuVsJwgS+Up3II2ra3r0XqTigKKORt2UW0tEGqacn7x74 OG7N9sWF2zMy4CafEm7mI5Ul7HcwXro9sYbECE+i8k7IPcvACwGmeGEvxZl3S06DYqm+62 6vbtiw/NO9s5NSTDuDIoqo4NQueu6V+l0oIMojM2OfjPN0fKg8ZFfoS0kUjsSK9c5PWEvD EbKWZKk8MAj8xk3u2HLVe6keiDXvnQkRsL/zXiBl+rhvfBvASJDv8c7H5FqryQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708442213; a=rsa-sha256; cv=none; b=rFXDMT4vuuwCzxWY1IPRo41XH0H66YUvFNEFAZk9tg8bVdXTGXKRRV8OCuIlLY1NYVbaJU 8ksHPwVtpeyB2q+9bR3c3hS6D+hKC71oGUfYTMVYCd+2LopR5o3nQdJebkpK7UuYKg5VoH mZW/VFFSucvNijQSK7prICxp74L/i7Ff3dmstcfqg+MipHSTeJABeH0iGldSj5UhbNGwwp DXyAMl+rqBI37zsCy1k+ksScaJvQM5RwDOJhlZ9pskpmu+rNiUnZzGmMhWOJ9VdicFNDHS IZ+gFBdvL2WzuAkl6xumbjAtFkf02kPG6HZ6G/pVv4simCTkZrVXMQO9EYZ8cA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TfNKx1rYxzNhP; Tue, 20 Feb 2024 15:16:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41KFGrSm071537; Tue, 20 Feb 2024 15:16:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41KFGrP4071534; Tue, 20 Feb 2024 15:16:53 GMT (envelope-from git) Date: Tue, 20 Feb 2024 15:16:53 GMT Message-Id: <202402201516.41KFGrP4071534@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: c8c5d91f48c4 - stable/14 - pkgbase: pass --recurse-submodules to `git ls-files` List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: c8c5d91f48c4e4496fb2554489198a8817656e1e Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=c8c5d91f48c4e4496fb2554489198a8817656e1e commit c8c5d91f48c4e4496fb2554489198a8817656e1e Author: Ed Maste AuthorDate: 2023-12-09 00:59:58 +0000 Commit: Ed Maste CommitDate: 2024-02-20 15:14:29 +0000 pkgbase: pass --recurse-submodules to `git ls-files` When generating source packages. Although submodules are not used by FreeBSD itself they may be used by downstream projects. By default for submodules `git ls-files` just emits the submodule directory name, which resulted in: pkg: pkg_checksum_hash_sha256_file(read failed): Is a directory Passing --recurse-submodules lists all of the files in each submodule (which is desired when submodules are in use), and has no effect when submodules are not present. Reviewed by: bapt, manu Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D42983 (cherry picked from commit 3b1904d9eb0468a49be3cd1d97de6d7ecaa66a43) --- Makefile.inc1 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 3537cf5ac579..2177ffb7cb27 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2092,10 +2092,12 @@ create-source-packages: _pkgbootstrap .PHONY .if !empty(GIT_CMD) && exists(${GIT_CMD}) && exists(${SRCDIR}/.git) @cd ${SRCDIR}; \ ( echo "@override_prefix /usr/src" ; \ - ${GIT_CMD} ls-files ":!:sys/" ) > ${SSTAGEDIR}/src.plist + ${GIT_CMD} ls-files --recurse-submodules ":!:sys/" ) \ + > ${SSTAGEDIR}/src.plist @cd ${SRCDIR}; \ ( echo "@override_prefix /usr/src" ; \ - ${GIT_CMD} ls-files "sys/" ) > ${SSTAGEDIR}/src-sys.plist + ${GIT_CMD} ls-files --recurse-submodules "sys/" ) \ + > ${SSTAGEDIR}/src-sys.plist sed -e "s/%VERSION%/${PKG_VERSION}/" \ -e "s/%DESC%/FreeBSD sources/" \ -e "s/ %VCS_REVISION%/${VCS_REVISION}/" \ From nobody Tue Feb 20 18:23:34 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TfSTL49HXz55N14; Tue, 20 Feb 2024 18:23: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TfSTL3G4Jz4PdP; Tue, 20 Feb 2024 18:23:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708453414; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UOdVJrEAVHXnVIipKyv9cXk+XIu6rlU2N3Q8X89y6M4=; b=BntOZBPMaFp96R2B8P5BGNZ5M8hYaYRcHGgtaAgfYDvTwjX7ABYzVYjx5NOTCszKyUmYcg v7o/Kmt/YidGh4KLGx3yyo6d9zjseiPR5AGlnPxWt03y3mk0OfRVIsOLsp8JxOI3QSH5bz 4AcFpXcTKFTbD7+rDi1ZkGTqF1dIrnzuKre+yOHbhUMPaWlsqOuTDXoGVwAycXMkxwDEDA Y1xuZasDv5FISa2C4J5pCAzxhKr578eq93mmjT0Je4UKT/bqEtC2/WVyw8u1hg9gjZFAuv MPCq9WSmZliZI4cng0BGJsxJ8HnpynqUf3aSnFxf0VANSKMLcGWXqb4a4iOeAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708453414; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UOdVJrEAVHXnVIipKyv9cXk+XIu6rlU2N3Q8X89y6M4=; b=kU6R5fPJ4PFb2qgAOgQqvulQQbs3mtrc4BwFROoyNzfpFhDYPxicMYj5OmzqchwjbhEWD1 yivBJaNRHwqrXOb6IL8B5nL1b6yum3pFReC42puydtuwfNNSKmeyWtGQOZdCQS8p7E+2RM LN+hVCc9nejNqSJpG+//0ytoJgRTOyZv4gxv5dFEh8Bw7hMh/hOOxCK7GtPH3nhRL5xidM dw+vC3vlzNZ5iwFBLQ5ZwPB4C0Lyf1GGFQwBrDrumUofPHO1ZVSp2amAU9TKPcUyCHgomv KiL41d/H+jSze72QPxRPRL3h+W6Ueyzq3eAtqM2CoNlJ0/GB4N2yOCh+5GUECw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708453414; a=rsa-sha256; cv=none; b=VYNfdJnCDyaiYS1Yr2xZSB3fRs0hRR+wdXnCVp81a8CEaeCQCsbTk9KOzpFNX1u0Et7niq N8w+IjhVmR4uWpYdz3EvEJbhEFiQHMhsLP53vRBIp9IOWd7xC6yQ3xHr7VeeTa6O9myl9+ KEfzNS7aY3UzvLuyovXda/7+6lm7cdrNAVKr4sc8pGptMm1aaZ/6p1BohMWFhCnY7o8bkk mPr5WUjBDvWGwb+R92SgjtYTg9hMl0vaBdYKlss9Ya9sHkz2A5+S2MBA8NSPr6bkut0q3a uqW7R3YaV96+rBRwbv7WhAnN3URYXZ6NAgG5AZu08r6XYJV4zlbcizQqFTofNQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TfSTL2Kc1zT9s; Tue, 20 Feb 2024 18:23:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41KINYw4092049; Tue, 20 Feb 2024 18:23:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41KINYDc092046; Tue, 20 Feb 2024 18:23:34 GMT (envelope-from git) Date: Tue, 20 Feb 2024 18:23:34 GMT Message-Id: <202402201823.41KINYDc092046@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: db43cefe080f - stable/14 - Proactively remove /usr/lib/kgdb file that became a directory List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: db43cefe080f7da93c5be1173b526855df65f6b1 Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=db43cefe080f7da93c5be1173b526855df65f6b1 commit db43cefe080f7da93c5be1173b526855df65f6b1 Author: Dimitry Andric AuthorDate: 2024-02-17 11:27:33 +0000 Commit: Dimitry Andric CommitDate: 2024-02-20 18:22:06 +0000 Proactively remove /usr/lib/kgdb file that became a directory This was already handled in ObsoleteFiles.inc (see the 20201215 entry), but some people never run "make delete-old", or want to upgrade directly from a revision that still had the file to the most recent revision. They would then encounter a failure during installworld, similar to: install: /usr/libexec/kgdb exists but is not a directory Therefore, clean it up in the distrib-cleanup phase, similar to the earlier instances of libc++ header files that became a directory. MFC after: 3 days (cherry picked from commit e368e9b756772264acdbc11f3cc1d223bcd48dee) --- etc/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/etc/Makefile b/etc/Makefile index 057bfe4fa7e7..a680572f66bf 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -126,6 +126,7 @@ MTREES+= ../${mtree} / # scenario. DISTRIB_CLEANUP_FILES+= ${INCLUDEDIR}/c++/v1/__string DISTRIB_CLEANUP_FILES+= ${INCLUDEDIR}/c++/v1/__tuple +DISTRIB_CLEANUP_FILES+= ${LIBEXECDIR}/kgdb distrib-cleanup: .PHONY for file in ${DISTRIB_CLEANUP_FILES}; do \ if [ -f ${DESTDIR}/$${file} ]; then \ From nobody Tue Feb 20 18:25:31 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TfSWc1RQVz55N9X; Tue, 20 Feb 2024 18:25:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TfSWc0zVGz4Pvj; Tue, 20 Feb 2024 18:25:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708453532; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LANmphCSS3dh+LD5GlKgOVYpp+FlbrrTDUNdI/mH3FU=; b=YZ4NPLO6ysiTlMCu+cj0PflxnIur40vP2l5nmPYpqkbbriG37BcxkII9HBLAudQn1D5eaz crBcgkNFFuMH+J13MBKhBiSlM2acCh3IvJkgjfGX4J0VzmqpJc8Brohjgq2PV8+MhCNi9i xpC+sN/GIYSlKy7lkQ+bEr6PrYN+kc5GVU6Rx0MrGE1oBlfNOWIdaB79JJpGBdBkL+5Z7S MAyfgPlBTgwWd6RNPl16hufpHnRi3P+shdL1FZ08ZAhi/S4N0aN49nem+ASO1DegnAdVWf kWRnTDdRiWdewXRPd2GRXvzIpMiOGQd2FPoXzXTKdlSfZEq813ahTIQrRkohLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708453532; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LANmphCSS3dh+LD5GlKgOVYpp+FlbrrTDUNdI/mH3FU=; b=jsuO3TZb+yn5Fpz1WbRNGGoBwmiiYKF+2BKfFsAjEdwB6LNMEofMPaY0P6J9zce0XyuH7M 3iZU8zqG6tDKHDOP8apVPG/DtDkDC6CEXPHPi/Z5qDUYGqzMTurjrlaq7XCUN2fY0kjUea l8lfHeBwXDFKIdqdDNWlN4OCM3RzUgEBzcvB7HjzOl47IudEA2P5jf9fcYSmxm9AqQaDxV Sl/zD6Zezpvf0W4iuxGbC+8dFFub41Dde+6nwzzK5bJSWFgDS5bNQGStk5k3pcREC2qaXV SAIK326UcBgLS5deO7rw9d54o6zr4wOYzfwtlmlw9ytcVJ5UbM/L4N2D/od0AQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708453532; a=rsa-sha256; cv=none; b=kG/PC5gQkFvcj90Abi+bc7hgt/yynGgAGalXDbqxPe2YCUYBdvfItTDCP6yhjXhUpeI6AR xTPvEIOejnJQfIdr82DGyfmXPD9KD9g3u8o67Wrbdo/TbUYatRVJpiHYXKunoFKFMO4hkF bu7LpCdVPEgP9wi6NlKDbVDGx9vjlwcy+GPOg5rM+z7E1mKDtz1aRlM3bF7bmGb2FeXRTt tTQGT2TqAkVLJ0NOYKQsa6Yep6SrWC8fKdOq+yhPSF1QpAV11dsW0oC6LmUyeN5Cn38E/y YH6n6yH308LuPIInHhi5j3OyA3XzYS2QapqIYYM/CV26AcUPnGcJyg2HUoSutA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TfSWc02sgzTll; Tue, 20 Feb 2024 18:25:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41KIPVdJ092444; Tue, 20 Feb 2024 18:25:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41KIPVtj092441; Tue, 20 Feb 2024 18:25:31 GMT (envelope-from git) Date: Tue, 20 Feb 2024 18:25:31 GMT Message-Id: <202402201825.41KIPVtj092441@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: f96dd1e361f8 - stable/13 - Proactively remove /usr/lib/kgdb file that became a directory List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: f96dd1e361f8e452a31b9928d1c0959eb6be6f27 Auto-Submitted: auto-generated The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=f96dd1e361f8e452a31b9928d1c0959eb6be6f27 commit f96dd1e361f8e452a31b9928d1c0959eb6be6f27 Author: Dimitry Andric AuthorDate: 2024-02-17 11:27:33 +0000 Commit: Dimitry Andric CommitDate: 2024-02-20 18:22:57 +0000 Proactively remove /usr/lib/kgdb file that became a directory This was already handled in ObsoleteFiles.inc (see the 20201215 entry), but some people never run "make delete-old", or want to upgrade directly from a revision that still had the file to the most recent revision. They would then encounter a failure during installworld, similar to: install: /usr/libexec/kgdb exists but is not a directory Therefore, clean it up in the distrib-cleanup phase, similar to the earlier instances of libc++ header files that became a directory. MFC after: 3 days (cherry picked from commit e368e9b756772264acdbc11f3cc1d223bcd48dee) --- etc/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/etc/Makefile b/etc/Makefile index 9b4b7c93d10a..05632e8ce710 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -125,6 +125,7 @@ MTREES+= ../${mtree} / # scenario. DISTRIB_CLEANUP_FILES+= ${INCLUDEDIR}/c++/v1/__string DISTRIB_CLEANUP_FILES+= ${INCLUDEDIR}/c++/v1/__tuple +DISTRIB_CLEANUP_FILES+= ${LIBEXECDIR}/kgdb distrib-cleanup: .PHONY for file in ${DISTRIB_CLEANUP_FILES}; do \ if [ -f ${DESTDIR}/$${file} ]; then \ From nobody Tue Feb 20 21:46:41 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TfXzj40mQz59hbG; Tue, 20 Feb 2024 21:46:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TfXzj3W6Fz4qrB; Tue, 20 Feb 2024 21:46:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708465601; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K3RIt4zOm1PEBxIpRY/DdqiTehg97jmYYw7426GJyXo=; b=yXK3EMf2Un4GS2d6xTyEtv3HRF2ARMzz5IMXTlM7NVFC9Nd2ktEb2E36nPAXNfmuwrZMrZ x4SJ3FG4OaDMWpkmgrUkof45yanfS3Q0eSLOZxrxOtcdFltmYIh07D80+YI7CYzths9uga tScvcN9gI9JgivNU7bynn6dyr0HBnJECe84aqj/+FwnOBMEvkgwyKY5uljR0hBcmW5QiSQ /CqXnQ15La0zwU/L12reF1aT5ZKovfF4hQ+Y4Dp6ZedfdmuTbjoYKGcnkjUmRHrRVw0USC eGFZrzsusDQ2HeswpCqM3Tioh+stsmlVrY87cE/3CxLfazrqKqLg7YKRCzRlKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708465601; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K3RIt4zOm1PEBxIpRY/DdqiTehg97jmYYw7426GJyXo=; b=Ypf6YFl2WfisHBAKD7o9p48HK7qvrUM65TMdOcjFr2DeZkRQUBB3gUEe5KmIEV7QbPVeQ6 52K1+uYt0uWEaeGCWCfD5pgOzQK/+TaQ8r4vrdFkDj5mYGoewB8+cs+OMBGneRssf5FbqW O6tvz7BO/M9rbVxXk3Y5zF8+MlTokRphnu2tsZ7lHJXkg6OZn+hXZpmCicLqcf0rNUa+/P NnYKshFMVt9b0hG7MKw6RCwmmQLfCRaXBg96Qq/T/0f6LJmjij2ePQ/jnvNSQgfPunMmbJ hYTeTikas5JNPi527a+3+DQMGW7z1hZl/LGqT0P4uJUuFao4l7ORjYVGz1hyoQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708465601; a=rsa-sha256; cv=none; b=n/NP9O7qndKAyO5ru0DXSDw3iaTKUAXbGTmE+yeme+3Ugq+Q75HJuOv6kipdoxImBlKKaE omV7A7X6X197k/0690QmKv3lFLdYURNTJnI0yA+ogo7jkaQ2p9Au9FoE0u+OCLEjWWUchk 0NU5bnioq7TczFD3PQfzTqygNCnM4Pi5zrD9D0oE7tkKqbw5nG8JH0RntzFAnfZE6rBqsB +9BAb2EpD9PUPt2f2U9JAH9oW3UxkiyP1wHR6zpkJ8cOqXdlvMZ9P0kw3aQFUZjSx0Ru6m Ev7gRYXl4v//aJ1sWSkt56uZdHtcwK9yb78unJJpFTEPTyeQwoy6fabDGdX0Lw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TfXzj2YWGzc2G; Tue, 20 Feb 2024 21:46:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41KLkfVn029132; Tue, 20 Feb 2024 21:46:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41KLkfsw029129; Tue, 20 Feb 2024 21:46:41 GMT (envelope-from git) Date: Tue, 20 Feb 2024 21:46:41 GMT Message-Id: <202402202146.41KLkfsw029129@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Stefan =?utf-8?Q?E=C3=9Fer?= Subject: git: 5f4753501e9c - stable/13 - msdosfs: fix directory corruption after rename operation List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 5f4753501e9cc59e0d15f849c9459478ea5c8dc7 Auto-Submitted: auto-generated The branch stable/13 has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=5f4753501e9cc59e0d15f849c9459478ea5c8dc7 commit 5f4753501e9cc59e0d15f849c9459478ea5c8dc7 Author: Stefan Eßer AuthorDate: 2024-02-17 21:04:49 +0000 Commit: Stefan Eßer CommitDate: 2024-02-20 21:45:53 +0000 msdosfs: fix directory corruption after rename operation (cherry picked from commit 8b67c670a49b4efe7e1557121b5bbae682ea3bc7) --- sys/fs/msdosfs/msdosfs_vnops.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c index 1d296c019331..7d18ac623af4 100644 --- a/sys/fs/msdosfs/msdosfs_vnops.c +++ b/sys/fs/msdosfs/msdosfs_vnops.c @@ -1192,8 +1192,10 @@ relock: memcpy(oldname, fip->de_Name, 11); memcpy(fip->de_Name, toname, 11); /* update denode */ error = msdosfs_lookup_ino(tdvp, NULL, tcnp, &scn, &blkoff); - if (error == EJUSTRETURN) + if (error == EJUSTRETURN) { + tdip->de_fndoffset = to_diroffset; error = createde(fip, tdip, NULL, tcnp); + } if (error != 0) { memcpy(fip->de_Name, oldname, 11); goto unlock; From nobody Tue Feb 20 21:48:55 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TfY2H2Jf7z59hvP; Tue, 20 Feb 2024 21:48:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TfY2H1lNJz4rKD; Tue, 20 Feb 2024 21:48:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708465735; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1k68At+J6QkYHjnzEiGzg7fWw05IL/IJEJCBabgzkzA=; b=UpqzguDSyfMoBg27gIdUtg3V0RDLbFPIHc0BWF1ckWy4Bhe3dqQQuftNIRT6fY5ZSiw+Gr SJB1w4fcdTap0+vebb4ZANOal0Z7iiYJKErkb3rrOmMxyZR6QizKXrjlKA1+RzYpEmoQsg hvTGS8IKquHEZMQfKvH/LZLnRVsAPwWDHJep6jGIqnilaAOWrntNp2latyn5u30BOhgbPM Fj/R+ShFpe2F/ExrbfEmZZAzTpee5Ie+zOVzwetOs42tJtMF7UXqO7PrANwuytejJxm0EV vPoROqTYDlfUIg6qQ58i9TeJ53SBQ++RCBta5LRLuNZIyNh6MkWJJCkRdVU1nQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708465735; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1k68At+J6QkYHjnzEiGzg7fWw05IL/IJEJCBabgzkzA=; b=VN54xhKTSXSzPp+7lDFl4Tlaz4Rzxh2UufS8/L9Wzc7NG9uJU362TkS4YKizUI0v9z1056 qHbLavQDo/CxqLjF/KGRJulW7XZWy/po4mJwsFjgxJiDxNel3hHxLrUraM0GcSEBTbJrA6 4Of/ybOwLO/Ux4ymE2PjQZ5tpo2hLL/HXTWVztU55XqNCZMYdNbSb5nYvtxilacgjCOPLb yph6iwB3CYOb7PR7BiVoAblRp7sni4W+1Mp/ZZGscwjWYKQGppjjzHeX5ZnPOBnOTshsYc gdbf8q4TzAxQ1uF1KhLwuDiWqXRzwOH+BcnwBZS1h9f28ESisk9XpQqT0NB3LA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708465735; a=rsa-sha256; cv=none; b=Cbv4AFQoU0cHOmYBqYbQhiiwyv/1WwH43qwHC7zImrJVcpfK+mnSjAPza3WPtAh+aJnJoi ZDkQyd4Xq20q3FkqReCRluWHlUPq6x3t42E8FXBB7XZl/HIEQ8xPpzWeKePi2DipZSdFKp 8M86SqxBxwH22XrrXlwNco5l8YImPJhYQ1uZyQqmijzb8ET7j6kaBpzgADRh16Crho+taQ 9NLI0mLZzYabH9U3qd3uURK5HMfR2M52APwy93nuBN9moH2G/uurwJ9XJHsnnxf+wwOpyN ij2DXz28rYVos1VFvCxkr5ussKOp/dbseBg9/Xl3qEx3P9ZW80ngoiMZhGwZZg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TfY2H0q2Pzc0v; Tue, 20 Feb 2024 21:48:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41KLmt6N029579; Tue, 20 Feb 2024 21:48:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41KLmt9Y029576; Tue, 20 Feb 2024 21:48:55 GMT (envelope-from git) Date: Tue, 20 Feb 2024 21:48:55 GMT Message-Id: <202402202148.41KLmt9Y029576@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Stefan =?utf-8?Q?E=C3=9Fer?= Subject: git: 5f41ed8d0978 - stable/14 - msdosfs: fix directory corruption after rename operation List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 5f41ed8d0978ec9760c901958aec77f2acd803ec Auto-Submitted: auto-generated The branch stable/14 has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=5f41ed8d0978ec9760c901958aec77f2acd803ec commit 5f41ed8d0978ec9760c901958aec77f2acd803ec Author: Stefan Eßer AuthorDate: 2024-02-17 21:04:49 +0000 Commit: Stefan Eßer CommitDate: 2024-02-20 21:48:08 +0000 msdosfs: fix directory corruption after rename operation (cherry picked from commit 8b67c670a49b4efe7e1557121b5bbae682ea3bc7) --- sys/fs/msdosfs/msdosfs_vnops.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c index 31d9b003a6fa..078ea5e52312 100644 --- a/sys/fs/msdosfs/msdosfs_vnops.c +++ b/sys/fs/msdosfs/msdosfs_vnops.c @@ -1180,8 +1180,10 @@ relock: memcpy(oldname, fip->de_Name, 11); memcpy(fip->de_Name, toname, 11); /* update denode */ error = msdosfs_lookup_ino(tdvp, NULL, tcnp, &scn, &blkoff); - if (error == EJUSTRETURN) + if (error == EJUSTRETURN) { + tdip->de_fndoffset = to_diroffset; error = createde(fip, tdip, NULL, tcnp); + } if (error != 0) { memcpy(fip->de_Name, oldname, 11); goto unlock; From nobody Wed Feb 21 05:47:07 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Tflf4079tz5BWJW; Wed, 21 Feb 2024 05:47:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Tflf370GSz4l5f; Wed, 21 Feb 2024 05:47:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708494427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OZi6w/5P2OOehCGAE4vCF4ZcbtMX79bUo3lbicKTu4c=; b=lfHutdyKYt0VBn7y6+j8tB8/7h0xNLoAck9ntKQTZAQXmOyU15guaBG8qx7BpFAtmwDNvp Qj8yOFds58+YBnx395lzT8UqGdk5LbyQYEFTHxwWa4aUjQn6f2MjtQ34j2frhRH0w2M7rJ 2KLaRnngGK5p5zqaF5XLv4D33uYMp40XC6I1SepC6Gk5KQooTaE22PQ8uof+WdE7+tIsK3 FnLdXiMgQuX1a82qjliqGi+wi49ifdyEaSI/syVXkBKtBJD8uMCAlVQ5h+MT8YyFay7IoH CTlsC6aYlnUFqV4hb7ENACHIk/wSnjVh96axBmeOY9aGxCkMEAFUG+HRAQO7jQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708494427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OZi6w/5P2OOehCGAE4vCF4ZcbtMX79bUo3lbicKTu4c=; b=h2yx//eoI/6geolsC/KbKo14XzFM9z/qleo7S7dYoS63vMHRz2zmRvAdDYeYxqlIhuI4Ol AdQmMKQI+LY7y+q7syujLDjt3IvUsIohGGPa60E74+KhM+ajEli1eYCpaeng/9/NfN2jkS 1Pt1J6PT7m/DGy4UByoatDvv7EBV35g6eobV6Ady2QPIj15j3bysWOPGwwBlFiWmDjGTAj I62nSLjCr48FgKanBeHAXn8W193pi+k9UQDWwZFVuqPv4PmnGfom/wWbtRhMv2ZPXlDXaE Q0wD6KErN9Uhk3XjlKdKSr6T58LFg9gExCaMgKYrPHQkyv+ggJ5Di7S1n4HhOA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708494427; a=rsa-sha256; cv=none; b=sgjcVyc0F3im9+SbvWjt+teHTp3i6cqE+x5ub0qrQbsyeFvVEIhE7BdbM3ZVQt5FI5hv/q LntyysqhX6IQNSsDvSsvHiRlrrrjWpme9Zsip6Yk+4lE44lab0JQb7KT8IdnS28zCViptp fL1KLVatYUBXHxQ24D+qKFTp7KU9Kd4nom7S5FyIo1IBf3tPeHzED/UTHb41qtWlSOAOaB akNazC3CF+R0zIWiFfN4N6+scrVU9uPNXqQfp1Ys1AcD6C/NRGwHiz2lCve50144LlZ840 pRC/bTKy6b7B7dCarQDq4NeaK8DGFc8azCrjmrairvD1y6WT7laYuAY5LlDU+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 4Tflf362mrzqrB; Wed, 21 Feb 2024 05:47:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41L5l7lY039580; Wed, 21 Feb 2024 05:47:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41L5l703039577; Wed, 21 Feb 2024 05:47:07 GMT (envelope-from git) Date: Wed, 21 Feb 2024 05:47:07 GMT Message-Id: <202402210547.41L5l703039577@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: 43b03b8895ad - stable/14 - irdma(4): Upgrade to 1.2.36-k List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 43b03b8895ad3d1655cd5f418544e3bec1595a65 Auto-Submitted: auto-generated The branch stable/14 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=43b03b8895ad3d1655cd5f418544e3bec1595a65 commit 43b03b8895ad3d1655cd5f418544e3bec1595a65 Author: Bartosz Sobczak AuthorDate: 2024-02-16 21:55:08 +0000 Commit: Eric Joyner CommitDate: 2024-02-21 05:45:32 +0000 irdma(4): Upgrade to 1.2.36-k Update Intel irdma driver to version 1.2.36-k. Notable changes: - Start using ib_sge directly instead of irdma_sge - Turn off flush completion generator for libirdma - Minor formatting changes Signed-off-by: Bartosz Sobczak Signed-off-by: Eric Joyner Reviewed by: erj@ Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D43567 (cherry picked from commit 5b5f7d0e77a9eee73eb5d596f43aef4e1a3674d8) --- contrib/ofed/libirdma/abi.h | 9 +- contrib/ofed/libirdma/i40e_devids.h | 1 - contrib/ofed/libirdma/i40iw_hw.h | 3 +- contrib/ofed/libirdma/ice_devids.h | 1 - contrib/ofed/libirdma/irdma-abi.h | 12 +- contrib/ofed/libirdma/irdma.h | 2 - contrib/ofed/libirdma/irdma_defs.h | 14 - contrib/ofed/libirdma/irdma_uk.c | 108 +++--- contrib/ofed/libirdma/irdma_umain.c | 5 +- contrib/ofed/libirdma/irdma_umain.h | 3 - contrib/ofed/libirdma/irdma_uquery.h | 1 - contrib/ofed/libirdma/irdma_user.h | 197 +--------- contrib/ofed/libirdma/irdma_uverbs.c | 90 ++--- contrib/ofed/libirdma/osdep.h | 5 - sys/dev/irdma/fbsd_kcompat.c | 3 +- sys/dev/irdma/fbsd_kcompat.h | 76 +--- sys/dev/irdma/icrdma.c | 4 +- sys/dev/irdma/icrdma_hw.c | 9 +- sys/dev/irdma/icrdma_hw.h | 3 +- sys/dev/irdma/irdma-abi.h | 11 + sys/dev/irdma/irdma.h | 4 +- sys/dev/irdma/irdma_cm.c | 49 ++- sys/dev/irdma/irdma_ctrl.c | 104 +++--- sys/dev/irdma/irdma_defs.h | 3 - sys/dev/irdma/irdma_hw.c | 46 ++- sys/dev/irdma/irdma_kcompat.c | 688 ++--------------------------------- sys/dev/irdma/irdma_main.h | 15 +- sys/dev/irdma/irdma_puda.c | 9 +- sys/dev/irdma/irdma_puda.h | 2 +- sys/dev/irdma/irdma_type.h | 29 +- sys/dev/irdma/irdma_uda.h | 1 + sys/dev/irdma/irdma_uk.c | 80 ++-- sys/dev/irdma/irdma_user.h | 33 +- sys/dev/irdma/irdma_utils.c | 52 +-- sys/dev/irdma/irdma_verbs.c | 389 +++----------------- sys/dev/irdma/irdma_verbs.h | 26 +- sys/dev/irdma/irdma_ws.c | 4 +- sys/dev/irdma/irdma_ws.h | 2 +- sys/dev/irdma/osdep.h | 8 +- 39 files changed, 428 insertions(+), 1673 deletions(-) diff --git a/contrib/ofed/libirdma/abi.h b/contrib/ofed/libirdma/abi.h index 6553ebcbcaca..a3e159828bec 100644 --- a/contrib/ofed/libirdma/abi.h +++ b/contrib/ofed/libirdma/abi.h @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB * - * Copyright (C) 2019 - 2022 Intel Corporation + * Copyright (C) 2019 - 2023 Intel Corporation * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU @@ -31,7 +31,6 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/*$FreeBSD$*/ #ifndef PROVIDER_IRDMA_ABI_H #define PROVIDER_IRDMA_ABI_H @@ -86,6 +85,7 @@ struct irdma_ucreate_qp { struct ibv_create_qp ibv_cmd; __aligned_u64 user_wqe_bufs; __aligned_u64 user_compl_ctx; + __aligned_u64 comp_mask; }; struct irdma_ucreate_qp_resp { @@ -98,6 +98,9 @@ struct irdma_ucreate_qp_resp { __u8 lsmm; __u8 rsvd; __u32 qp_caps; + __aligned_u64 comp_mask; + __u8 start_wqe_idx; + __u8 rsvd2[7]; }; struct irdma_umodify_qp_resp { @@ -138,6 +141,8 @@ struct irdma_get_context_resp { __u8 hw_rev; __u8 rsvd2; __aligned_u64 comp_mask; + __u16 min_hw_wq_size; + __u8 rsvd3[6]; }; struct irdma_ureg_mr { diff --git a/contrib/ofed/libirdma/i40e_devids.h b/contrib/ofed/libirdma/i40e_devids.h index 1b0eaae95b82..e775a75bade5 100644 --- a/contrib/ofed/libirdma/i40e_devids.h +++ b/contrib/ofed/libirdma/i40e_devids.h @@ -31,7 +31,6 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/*$FreeBSD$*/ #ifndef I40E_DEVIDS_H #define I40E_DEVIDS_H diff --git a/contrib/ofed/libirdma/i40iw_hw.h b/contrib/ofed/libirdma/i40iw_hw.h index d04c37d689cb..fcbfea8dfe09 100644 --- a/contrib/ofed/libirdma/i40iw_hw.h +++ b/contrib/ofed/libirdma/i40iw_hw.h @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB * - * Copyright (c) 2015 - 2022 Intel Corporation + * Copyright (c) 2015 - 2023 Intel Corporation * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU @@ -31,7 +31,6 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/*$FreeBSD$*/ #ifndef I40IW_HW_H #define I40IW_HW_H diff --git a/contrib/ofed/libirdma/ice_devids.h b/contrib/ofed/libirdma/ice_devids.h index 57f26bc33260..57a7f2f7c2af 100644 --- a/contrib/ofed/libirdma/ice_devids.h +++ b/contrib/ofed/libirdma/ice_devids.h @@ -31,7 +31,6 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/*$FreeBSD$*/ #ifndef ICE_DEVIDS_H #define ICE_DEVIDS_H diff --git a/contrib/ofed/libirdma/irdma-abi.h b/contrib/ofed/libirdma/irdma-abi.h index b7d4b61c162d..ae805919ea55 100644 --- a/contrib/ofed/libirdma/irdma-abi.h +++ b/contrib/ofed/libirdma/irdma-abi.h @@ -35,7 +35,6 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/*$FreeBSD$*/ #ifndef IRDMA_ABI_H #define IRDMA_ABI_H @@ -55,6 +54,11 @@ enum irdma_memreg_type { enum { IRDMA_ALLOC_UCTX_USE_RAW_ATTR = 1 << 0, + IRDMA_ALLOC_UCTX_MIN_HW_WQ_SIZE = 1 << 1, +}; + +enum { + IRDMA_CREATE_QP_USE_START_WQE_IDX = 1 << 0, }; struct irdma_alloc_ucontext_req { @@ -83,6 +87,8 @@ struct irdma_alloc_ucontext_resp { __u8 hw_rev; __u8 rsvd2; __aligned_u64 comp_mask; + __u16 min_hw_wq_size; + __u8 rsvd3[6]; }; struct irdma_alloc_pd_resp { @@ -102,6 +108,7 @@ struct irdma_create_cq_req { struct irdma_create_qp_req { __aligned_u64 user_wqe_bufs; __aligned_u64 user_compl_ctx; + __aligned_u64 comp_mask; }; struct irdma_mem_reg_req { @@ -131,6 +138,9 @@ struct irdma_create_qp_resp { __u8 lsmm; __u8 rsvd; __u32 qp_caps; + __aligned_u64 comp_mask; + __u8 start_wqe_idx; + __u8 rsvd2[7]; }; struct irdma_modify_qp_resp { diff --git a/contrib/ofed/libirdma/irdma.h b/contrib/ofed/libirdma/irdma.h index 1dd09c36c7ea..f4a5a4796f82 100644 --- a/contrib/ofed/libirdma/irdma.h +++ b/contrib/ofed/libirdma/irdma.h @@ -31,7 +31,6 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/*$FreeBSD$*/ #ifndef IRDMA_H #define IRDMA_H @@ -47,7 +46,6 @@ enum irdma_vers { IRDMA_GEN_RSVD = 0, IRDMA_GEN_1 = 1, IRDMA_GEN_2 = 2, - IRDMA_GEN_MAX = 2, }; struct irdma_uk_attrs { diff --git a/contrib/ofed/libirdma/irdma_defs.h b/contrib/ofed/libirdma/irdma_defs.h index 9276490793a0..39d4e7772c31 100644 --- a/contrib/ofed/libirdma/irdma_defs.h +++ b/contrib/ofed/libirdma/irdma_defs.h @@ -31,7 +31,6 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/*$FreeBSD$*/ #ifndef IRDMA_DEFS_H #define IRDMA_DEFS_H @@ -457,19 +456,6 @@ enum irdma_qp_wqe_size { IRDMA_WQE_SIZE_256 = 256, }; -enum irdma_ws_op_type { - IRDMA_WS_OP_TYPE_NODE = 0, - IRDMA_WS_OP_TYPE_LEAF_NODE_GROUP, -}; - -enum irdma_ws_rate_limit_flags { - IRDMA_WS_RATE_LIMIT_FLAGS_VALID = 0x1, - IRDMA_WS_NO_RDMA_RATE_LIMIT = 0x2, - IRDMA_WS_LEAF_NODE_IS_PART_GROUP = 0x4, - IRDMA_WS_TREE_RATE_LIMITING = 0x8, - IRDMA_WS_PACING_CONTROL = 0x10, -}; - /** * set_64bit_val - set 64 bit value to hw wqe * @wqe_words: wqe addr to write diff --git a/contrib/ofed/libirdma/irdma_uk.c b/contrib/ofed/libirdma/irdma_uk.c index a1b796b318f4..115c5f0a27f0 100644 --- a/contrib/ofed/libirdma/irdma_uk.c +++ b/contrib/ofed/libirdma/irdma_uk.c @@ -31,7 +31,6 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/*$FreeBSD$*/ #include "osdep.h" #include "irdma_defs.h" @@ -46,16 +45,16 @@ * @valid: The wqe valid */ static void -irdma_set_fragment(__le64 * wqe, u32 offset, struct irdma_sge *sge, +irdma_set_fragment(__le64 * wqe, u32 offset, struct ibv_sge *sge, u8 valid) { if (sge) { set_64bit_val(wqe, offset, - FIELD_PREP(IRDMAQPSQ_FRAG_TO, sge->tag_off)); + FIELD_PREP(IRDMAQPSQ_FRAG_TO, sge->addr)); set_64bit_val(wqe, offset + IRDMA_BYTE_8, FIELD_PREP(IRDMAQPSQ_VALID, valid) | - FIELD_PREP(IRDMAQPSQ_FRAG_LEN, sge->len) | - FIELD_PREP(IRDMAQPSQ_FRAG_STAG, sge->stag)); + FIELD_PREP(IRDMAQPSQ_FRAG_LEN, sge->length) | + FIELD_PREP(IRDMAQPSQ_FRAG_STAG, sge->lkey)); } else { set_64bit_val(wqe, offset, 0); set_64bit_val(wqe, offset + IRDMA_BYTE_8, @@ -72,14 +71,14 @@ irdma_set_fragment(__le64 * wqe, u32 offset, struct irdma_sge *sge, */ static void irdma_set_fragment_gen_1(__le64 * wqe, u32 offset, - struct irdma_sge *sge, u8 valid) + struct ibv_sge *sge, u8 valid) { if (sge) { set_64bit_val(wqe, offset, - FIELD_PREP(IRDMAQPSQ_FRAG_TO, sge->tag_off)); + FIELD_PREP(IRDMAQPSQ_FRAG_TO, sge->addr)); set_64bit_val(wqe, offset + IRDMA_BYTE_8, - FIELD_PREP(IRDMAQPSQ_GEN1_FRAG_LEN, sge->len) | - FIELD_PREP(IRDMAQPSQ_GEN1_FRAG_STAG, sge->stag)); + FIELD_PREP(IRDMAQPSQ_GEN1_FRAG_LEN, sge->length) | + FIELD_PREP(IRDMAQPSQ_GEN1_FRAG_STAG, sge->lkey)); } else { set_64bit_val(wqe, offset, 0); set_64bit_val(wqe, offset + IRDMA_BYTE_8, 0); @@ -210,8 +209,7 @@ irdma_qp_push_wqe(struct irdma_qp_uk *qp, __le64 * wqe, u16 quanta, if (IRDMA_RING_CURRENT_HEAD(qp->initial_ring) != IRDMA_RING_CURRENT_TAIL(qp->sq_ring) && !qp->push_mode) { - if (post_sq) - irdma_uk_qp_post_wr(qp); + irdma_uk_qp_post_wr(qp); } else { push = (__le64 *) ((uintptr_t)qp->push_wqe + (wqe_idx & 0x7) * 0x20); @@ -339,7 +337,7 @@ irdma_uk_rdma_write(struct irdma_qp_uk *qp, struct irdma_post_sq_info *info, return EINVAL; for (i = 0; i < op_info->num_lo_sges; i++) - total_size += op_info->lo_sg_list[i].len; + total_size += op_info->lo_sg_list[i].length; read_fence |= info->read_fence; @@ -358,7 +356,7 @@ irdma_uk_rdma_write(struct irdma_qp_uk *qp, struct irdma_post_sq_info *info, qp->sq_wrtrk_array[wqe_idx].signaled = info->signaled; set_64bit_val(wqe, IRDMA_BYTE_16, - FIELD_PREP(IRDMAQPSQ_FRAG_TO, op_info->rem_addr.tag_off)); + FIELD_PREP(IRDMAQPSQ_FRAG_TO, op_info->rem_addr.addr)); if (info->imm_data_valid) { set_64bit_val(wqe, IRDMA_BYTE_0, @@ -387,7 +385,7 @@ irdma_uk_rdma_write(struct irdma_qp_uk *qp, struct irdma_post_sq_info *info, ++addl_frag_cnt; } - hdr = FIELD_PREP(IRDMAQPSQ_REMSTAG, op_info->rem_addr.stag) | + hdr = FIELD_PREP(IRDMAQPSQ_REMSTAG, op_info->rem_addr.lkey) | FIELD_PREP(IRDMAQPSQ_OPCODE, info->op_type) | FIELD_PREP(IRDMAQPSQ_IMMDATAFLAG, info->imm_data_valid) | FIELD_PREP(IRDMAQPSQ_REPORTRTT, info->report_rtt) | @@ -438,7 +436,7 @@ irdma_uk_rdma_read(struct irdma_qp_uk *qp, struct irdma_post_sq_info *info, return EINVAL; for (i = 0; i < op_info->num_lo_sges; i++) - total_size += op_info->lo_sg_list[i].len; + total_size += op_info->lo_sg_list[i].length; ret_code = irdma_fragcnt_to_quanta_sq(op_info->num_lo_sges, &quanta); if (ret_code) @@ -476,8 +474,8 @@ irdma_uk_rdma_read(struct irdma_qp_uk *qp, struct irdma_post_sq_info *info, ++addl_frag_cnt; } set_64bit_val(wqe, IRDMA_BYTE_16, - FIELD_PREP(IRDMAQPSQ_FRAG_TO, op_info->rem_addr.tag_off)); - hdr = FIELD_PREP(IRDMAQPSQ_REMSTAG, op_info->rem_addr.stag) | + FIELD_PREP(IRDMAQPSQ_FRAG_TO, op_info->rem_addr.addr)); + hdr = FIELD_PREP(IRDMAQPSQ_REMSTAG, op_info->rem_addr.lkey) | FIELD_PREP(IRDMAQPSQ_REPORTRTT, (info->report_rtt ? 1 : 0)) | FIELD_PREP(IRDMAQPSQ_ADDFRAGCNT, addl_frag_cnt) | FIELD_PREP(IRDMAQPSQ_OPCODE, @@ -526,7 +524,7 @@ irdma_uk_send(struct irdma_qp_uk *qp, struct irdma_post_sq_info *info, return EINVAL; for (i = 0; i < op_info->num_sges; i++) - total_size += op_info->sg_list[i].len; + total_size += op_info->sg_list[i].length; if (info->imm_data_valid) frag_cnt = op_info->num_sges + 1; @@ -621,15 +619,15 @@ irdma_set_mw_bind_wqe_gen_1(__le64 * wqe, * @polarity: compatibility parameter */ static void -irdma_copy_inline_data_gen_1(u8 *wqe, struct irdma_sge *sge_list, +irdma_copy_inline_data_gen_1(u8 *wqe, struct ibv_sge *sge_list, u32 num_sges, u8 polarity) { u32 quanta_bytes_remaining = 16; u32 i; for (i = 0; i < num_sges; i++) { - u8 *cur_sge = (u8 *)(uintptr_t)sge_list[i].tag_off; - u32 sge_len = sge_list[i].len; + u8 *cur_sge = (u8 *)(uintptr_t)sge_list[i].addr; + u32 sge_len = sge_list[i].length; while (sge_len) { u32 bytes_copied; @@ -684,7 +682,7 @@ irdma_set_mw_bind_wqe(__le64 * wqe, * @polarity: polarity of wqe valid bit */ static void -irdma_copy_inline_data(u8 *wqe, struct irdma_sge *sge_list, +irdma_copy_inline_data(u8 *wqe, struct ibv_sge *sge_list, u32 num_sges, u8 polarity) { u8 inline_valid = polarity << IRDMA_INLINE_VALID_S; @@ -695,8 +693,8 @@ irdma_copy_inline_data(u8 *wqe, struct irdma_sge *sge_list, wqe += 8; for (i = 0; i < num_sges; i++) { - u8 *cur_sge = (u8 *)(uintptr_t)sge_list[i].tag_off; - u32 sge_len = sge_list[i].len; + u8 *cur_sge = (u8 *)(uintptr_t)sge_list[i].addr; + u32 sge_len = sge_list[i].length; while (sge_len) { u32 bytes_copied; @@ -776,7 +774,7 @@ irdma_uk_inline_rdma_write(struct irdma_qp_uk *qp, return EINVAL; for (i = 0; i < op_info->num_lo_sges; i++) - total_size += op_info->lo_sg_list[i].len; + total_size += op_info->lo_sg_list[i].length; if (unlikely(total_size > qp->max_inline_data)) return EINVAL; @@ -789,9 +787,9 @@ irdma_uk_inline_rdma_write(struct irdma_qp_uk *qp, qp->sq_wrtrk_array[wqe_idx].signaled = info->signaled; read_fence |= info->read_fence; set_64bit_val(wqe, IRDMA_BYTE_16, - FIELD_PREP(IRDMAQPSQ_FRAG_TO, op_info->rem_addr.tag_off)); + FIELD_PREP(IRDMAQPSQ_FRAG_TO, op_info->rem_addr.addr)); - hdr = FIELD_PREP(IRDMAQPSQ_REMSTAG, op_info->rem_addr.stag) | + hdr = FIELD_PREP(IRDMAQPSQ_REMSTAG, op_info->rem_addr.lkey) | FIELD_PREP(IRDMAQPSQ_OPCODE, info->op_type) | FIELD_PREP(IRDMAQPSQ_INLINEDATALEN, total_size) | FIELD_PREP(IRDMAQPSQ_REPORTRTT, info->report_rtt ? 1 : 0) | @@ -847,7 +845,7 @@ irdma_uk_inline_send(struct irdma_qp_uk *qp, return EINVAL; for (i = 0; i < op_info->num_sges; i++) - total_size += op_info->sg_list[i].len; + total_size += op_info->sg_list[i].length; if (unlikely(total_size > qp->max_inline_data)) return EINVAL; @@ -912,7 +910,7 @@ irdma_uk_stag_local_invalidate(struct irdma_qp_uk *qp, u64 hdr; u32 wqe_idx; bool local_fence = false; - struct irdma_sge sge = {0}; + struct ibv_sge sge = {0}; u16 quanta = IRDMA_QP_WQE_MIN_QUANTA; info->push_wqe = qp->push_db ? true : false; @@ -923,7 +921,7 @@ irdma_uk_stag_local_invalidate(struct irdma_qp_uk *qp, if (!wqe) return ENOSPC; - sge.stag = op_info->target_stag; + sge.lkey = op_info->target_stag; qp->wqe_ops.iw_set_fragment(wqe, IRDMA_BYTE_0, &sge, 0); set_64bit_val(wqe, IRDMA_BYTE_16, 0); @@ -1437,8 +1435,7 @@ irdma_uk_cq_poll_cmpl(struct irdma_cq_uk *cq, IRDMA_RING_MOVE_TAIL(cq->cq_ring); set_64bit_val(cq->shadow_area, IRDMA_BYTE_0, IRDMA_RING_CURRENT_HEAD(cq->cq_ring)); - memset(info, 0, - sizeof(struct irdma_cq_poll_info)); + memset(info, 0, sizeof(*info)); return irdma_uk_cq_poll_cmpl(cq, info); } } @@ -1511,7 +1508,6 @@ exit: if (pring && IRDMA_RING_MORE_WORK(*pring)) move_cq_head = false; } - if (move_cq_head) { IRDMA_RING_MOVE_HEAD_NOCHECK(cq->cq_ring); if (!IRDMA_RING_CURRENT_HEAD(cq->cq_ring)) @@ -1592,10 +1588,12 @@ irdma_get_wqe_shift(struct irdma_uk_attrs *uk_attrs, u32 sge, int irdma_get_sqdepth(struct irdma_uk_attrs *uk_attrs, u32 sq_size, u8 shift, u32 *sqdepth) { + u32 min_size = (u32)uk_attrs->min_hw_wq_size << shift; + *sqdepth = irdma_round_up_wq((sq_size << shift) + IRDMA_SQ_RSVD); - if (*sqdepth < ((u32)uk_attrs->min_hw_wq_size << shift)) - *sqdepth = uk_attrs->min_hw_wq_size << shift; + if (*sqdepth < min_size) + *sqdepth = min_size; else if (*sqdepth > uk_attrs->max_hw_wq_quanta) return EINVAL; @@ -1609,10 +1607,12 @@ irdma_get_sqdepth(struct irdma_uk_attrs *uk_attrs, u32 sq_size, u8 shift, u32 *s int irdma_get_rqdepth(struct irdma_uk_attrs *uk_attrs, u32 rq_size, u8 shift, u32 *rqdepth) { + u32 min_size = (u32)uk_attrs->min_hw_wq_size << shift; + *rqdepth = irdma_round_up_wq((rq_size << shift) + IRDMA_RQ_RSVD); - if (*rqdepth < ((u32)uk_attrs->min_hw_wq_size << shift)) - *rqdepth = uk_attrs->min_hw_wq_size << shift; + if (*rqdepth < min_size) + *rqdepth = min_size; else if (*rqdepth > uk_attrs->max_hw_rq_quanta) return EINVAL; @@ -1645,41 +1645,16 @@ irdma_setup_connection_wqes(struct irdma_qp_uk *qp, { u16 move_cnt = 1; - if (qp->uk_attrs->feature_flags & IRDMA_FEATURE_RTS_AE) + if (info->start_wqe_idx) + move_cnt = info->start_wqe_idx; + else if (qp->uk_attrs->feature_flags & IRDMA_FEATURE_RTS_AE) move_cnt = 3; - qp->conn_wqes = move_cnt; IRDMA_RING_MOVE_HEAD_BY_COUNT_NOCHECK(qp->sq_ring, move_cnt); IRDMA_RING_MOVE_TAIL_BY_COUNT(qp->sq_ring, move_cnt); IRDMA_RING_MOVE_HEAD_BY_COUNT_NOCHECK(qp->initial_ring, move_cnt); } -/** - * irdma_uk_calc_shift_wq - calculate WQE shift for both SQ and RQ - * @ukinfo: qp initialization info - * @sq_shift: Returns shift of SQ - * @rq_shift: Returns shift of RQ - */ -void -irdma_uk_calc_shift_wq(struct irdma_qp_uk_init_info *ukinfo, u8 *sq_shift, - u8 *rq_shift) -{ - bool imm_support = ukinfo->uk_attrs->hw_rev >= IRDMA_GEN_2 ? true : false; - - irdma_get_wqe_shift(ukinfo->uk_attrs, - imm_support ? ukinfo->max_sq_frag_cnt + 1 : - ukinfo->max_sq_frag_cnt, - ukinfo->max_inline_data, sq_shift); - - irdma_get_wqe_shift(ukinfo->uk_attrs, ukinfo->max_rq_frag_cnt, 0, - rq_shift); - - if (ukinfo->uk_attrs->hw_rev == IRDMA_GEN_1) { - if (ukinfo->abi_ver > 4) - *rq_shift = IRDMA_MAX_RQ_WQE_SHIFT_GEN1; - } -} - /** * irdma_uk_calc_depth_shift_sq - calculate depth and shift for SQ size. * @ukinfo: qp initialization info @@ -1692,6 +1667,7 @@ irdma_uk_calc_depth_shift_sq(struct irdma_qp_uk_init_info *ukinfo, { bool imm_support = ukinfo->uk_attrs->hw_rev >= IRDMA_GEN_2 ? true : false; int status; + irdma_get_wqe_shift(ukinfo->uk_attrs, imm_support ? ukinfo->max_sq_frag_cnt + 1 : ukinfo->max_sq_frag_cnt, @@ -1786,6 +1762,8 @@ irdma_uk_qp_init(struct irdma_qp_uk *qp, struct irdma_qp_uk_init_info *info) qp->wqe_ops = iw_wqe_uk_ops_gen_1; else qp->wqe_ops = iw_wqe_uk_ops; + qp->start_wqe_idx = info->start_wqe_idx; + return ret_code; } diff --git a/contrib/ofed/libirdma/irdma_umain.c b/contrib/ofed/libirdma/irdma_umain.c index 9e223cae429f..e8d27c31a0dc 100644 --- a/contrib/ofed/libirdma/irdma_umain.c +++ b/contrib/ofed/libirdma/irdma_umain.c @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB * - * Copyright (c) 2021 - 2023 Intel Corporation + * Copyright (c) 2021 - 2022 Intel Corporation * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU @@ -31,7 +31,6 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/*$FreeBSD$*/ #include @@ -49,7 +48,7 @@ /** * Driver version */ -char libirdma_version[] = "1.2.17-k"; +char libirdma_version[] = "1.2.36-k"; unsigned int irdma_dbg; diff --git a/contrib/ofed/libirdma/irdma_umain.h b/contrib/ofed/libirdma/irdma_umain.h index 7ff850c46b72..269609f8c77f 100644 --- a/contrib/ofed/libirdma/irdma_umain.h +++ b/contrib/ofed/libirdma/irdma_umain.h @@ -31,7 +31,6 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/*$FreeBSD$*/ #ifndef IRDMA_UMAIN_H #define IRDMA_UMAIN_H @@ -97,7 +96,6 @@ struct irdma_cq_buf { LIST_ENTRY(irdma_cq_buf) list; struct irdma_cq_uk cq; struct verbs_mr vmr; - size_t buf_size; }; extern pthread_mutex_t sigusr1_wait_mutex; @@ -143,7 +141,6 @@ struct irdma_uqp { struct ibv_recv_wr *pend_rx_wr; struct irdma_qp_uk qp; enum ibv_qp_type qp_type; - struct irdma_sge *recv_sges; }; /* irdma_uverbs.c */ diff --git a/contrib/ofed/libirdma/irdma_uquery.h b/contrib/ofed/libirdma/irdma_uquery.h index cf56818e4d51..4660c05f0a91 100644 --- a/contrib/ofed/libirdma/irdma_uquery.h +++ b/contrib/ofed/libirdma/irdma_uquery.h @@ -31,7 +31,6 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/*$FreeBSD$*/ #ifndef IRDMA_UQUERY_H diff --git a/contrib/ofed/libirdma/irdma_user.h b/contrib/ofed/libirdma/irdma_user.h index 8d71a37d7bf4..aeb6aa9feebd 100644 --- a/contrib/ofed/libirdma/irdma_user.h +++ b/contrib/ofed/libirdma/irdma_user.h @@ -31,7 +31,6 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/*$FreeBSD$*/ #ifndef IRDMA_USER_H #define IRDMA_USER_H @@ -51,7 +50,7 @@ #define irdma_access_privileges u32 #define irdma_physical_fragment u64 #define irdma_address_list u64 * -#define irdma_sgl struct irdma_sge * +#define irdma_sgl struct ibv_sge * #define IRDMA_MAX_MR_SIZE 0x200000000000ULL @@ -81,96 +80,6 @@ #define IRDMA_OP_TYPE_REC_IMM 0x3f #define IRDMA_FLUSH_MAJOR_ERR 1 -#define IRDMA_SRQFLUSH_RSVD_MAJOR_ERR 0xfffe - -/* Async Events codes */ -#define IRDMA_AE_AMP_UNALLOCATED_STAG 0x0102 -#define IRDMA_AE_AMP_INVALID_STAG 0x0103 -#define IRDMA_AE_AMP_BAD_QP 0x0104 -#define IRDMA_AE_AMP_BAD_PD 0x0105 -#define IRDMA_AE_AMP_BAD_STAG_KEY 0x0106 -#define IRDMA_AE_AMP_BAD_STAG_INDEX 0x0107 -#define IRDMA_AE_AMP_BOUNDS_VIOLATION 0x0108 -#define IRDMA_AE_AMP_RIGHTS_VIOLATION 0x0109 -#define IRDMA_AE_AMP_TO_WRAP 0x010a -#define IRDMA_AE_AMP_FASTREG_VALID_STAG 0x010c -#define IRDMA_AE_AMP_FASTREG_MW_STAG 0x010d -#define IRDMA_AE_AMP_FASTREG_INVALID_RIGHTS 0x010e -#define IRDMA_AE_AMP_FASTREG_INVALID_LENGTH 0x0110 -#define IRDMA_AE_AMP_INVALIDATE_SHARED 0x0111 -#define IRDMA_AE_AMP_INVALIDATE_NO_REMOTE_ACCESS_RIGHTS 0x0112 -#define IRDMA_AE_AMP_INVALIDATE_MR_WITH_BOUND_WINDOWS 0x0113 -#define IRDMA_AE_AMP_MWBIND_VALID_STAG 0x0114 -#define IRDMA_AE_AMP_MWBIND_OF_MR_STAG 0x0115 -#define IRDMA_AE_AMP_MWBIND_TO_ZERO_BASED_STAG 0x0116 -#define IRDMA_AE_AMP_MWBIND_TO_MW_STAG 0x0117 -#define IRDMA_AE_AMP_MWBIND_INVALID_RIGHTS 0x0118 -#define IRDMA_AE_AMP_MWBIND_INVALID_BOUNDS 0x0119 -#define IRDMA_AE_AMP_MWBIND_TO_INVALID_PARENT 0x011a -#define IRDMA_AE_AMP_MWBIND_BIND_DISABLED 0x011b -#define IRDMA_AE_PRIV_OPERATION_DENIED 0x011c -#define IRDMA_AE_AMP_INVALIDATE_TYPE1_MW 0x011d -#define IRDMA_AE_AMP_MWBIND_ZERO_BASED_TYPE1_MW 0x011e -#define IRDMA_AE_AMP_FASTREG_INVALID_PBL_HPS_CFG 0x011f -#define IRDMA_AE_AMP_MWBIND_WRONG_TYPE 0x0120 -#define IRDMA_AE_AMP_FASTREG_PBLE_MISMATCH 0x0121 -#define IRDMA_AE_UDA_XMIT_DGRAM_TOO_LONG 0x0132 -#define IRDMA_AE_UDA_XMIT_BAD_PD 0x0133 -#define IRDMA_AE_UDA_XMIT_DGRAM_TOO_SHORT 0x0134 -#define IRDMA_AE_UDA_L4LEN_INVALID 0x0135 -#define IRDMA_AE_BAD_CLOSE 0x0201 -#define IRDMA_AE_RDMAP_ROE_BAD_LLP_CLOSE 0x0202 -#define IRDMA_AE_CQ_OPERATION_ERROR 0x0203 -#define IRDMA_AE_RDMA_READ_WHILE_ORD_ZERO 0x0205 -#define IRDMA_AE_STAG_ZERO_INVALID 0x0206 -#define IRDMA_AE_IB_RREQ_AND_Q1_FULL 0x0207 -#define IRDMA_AE_IB_INVALID_REQUEST 0x0208 -#define IRDMA_AE_WQE_UNEXPECTED_OPCODE 0x020a -#define IRDMA_AE_WQE_INVALID_PARAMETER 0x020b -#define IRDMA_AE_WQE_INVALID_FRAG_DATA 0x020c -#define IRDMA_AE_IB_REMOTE_ACCESS_ERROR 0x020d -#define IRDMA_AE_IB_REMOTE_OP_ERROR 0x020e -#define IRDMA_AE_WQE_LSMM_TOO_LONG 0x0220 -#define IRDMA_AE_DDP_INVALID_MSN_GAP_IN_MSN 0x0301 -#define IRDMA_AE_DDP_UBE_DDP_MESSAGE_TOO_LONG_FOR_AVAILABLE_BUFFER 0x0303 -#define IRDMA_AE_DDP_UBE_INVALID_DDP_VERSION 0x0304 -#define IRDMA_AE_DDP_UBE_INVALID_MO 0x0305 -#define IRDMA_AE_DDP_UBE_INVALID_MSN_NO_BUFFER_AVAILABLE 0x0306 -#define IRDMA_AE_DDP_UBE_INVALID_QN 0x0307 -#define IRDMA_AE_DDP_NO_L_BIT 0x0308 -#define IRDMA_AE_RDMAP_ROE_INVALID_RDMAP_VERSION 0x0311 -#define IRDMA_AE_RDMAP_ROE_UNEXPECTED_OPCODE 0x0312 -#define IRDMA_AE_ROE_INVALID_RDMA_READ_REQUEST 0x0313 -#define IRDMA_AE_ROE_INVALID_RDMA_WRITE_OR_READ_RESP 0x0314 -#define IRDMA_AE_ROCE_RSP_LENGTH_ERROR 0x0316 -#define IRDMA_AE_ROCE_EMPTY_MCG 0x0380 -#define IRDMA_AE_ROCE_BAD_MC_IP_ADDR 0x0381 -#define IRDMA_AE_ROCE_BAD_MC_QPID 0x0382 -#define IRDMA_AE_MCG_QP_PROTOCOL_MISMATCH 0x0383 -#define IRDMA_AE_INVALID_ARP_ENTRY 0x0401 -#define IRDMA_AE_INVALID_TCP_OPTION_RCVD 0x0402 -#define IRDMA_AE_STALE_ARP_ENTRY 0x0403 -#define IRDMA_AE_INVALID_AH_ENTRY 0x0406 -#define IRDMA_AE_LLP_CLOSE_COMPLETE 0x0501 -#define IRDMA_AE_LLP_CONNECTION_RESET 0x0502 -#define IRDMA_AE_LLP_FIN_RECEIVED 0x0503 -#define IRDMA_AE_LLP_RECEIVED_MARKER_AND_LENGTH_FIELDS_DONT_MATCH 0x0504 -#define IRDMA_AE_LLP_RECEIVED_MPA_CRC_ERROR 0x0505 -#define IRDMA_AE_LLP_SEGMENT_TOO_SMALL 0x0507 -#define IRDMA_AE_LLP_SYN_RECEIVED 0x0508 -#define IRDMA_AE_LLP_TERMINATE_RECEIVED 0x0509 -#define IRDMA_AE_LLP_TOO_MANY_RETRIES 0x050a -#define IRDMA_AE_LLP_TOO_MANY_KEEPALIVE_RETRIES 0x050b -#define IRDMA_AE_LLP_DOUBT_REACHABILITY 0x050c -#define IRDMA_AE_LLP_CONNECTION_ESTABLISHED 0x050e -#define IRDMA_AE_RESOURCE_EXHAUSTION 0x0520 -#define IRDMA_AE_RESET_SENT 0x0601 -#define IRDMA_AE_TERMINATE_SENT 0x0602 -#define IRDMA_AE_RESET_NOT_SENT 0x0603 -#define IRDMA_AE_LCE_QP_CATASTROPHIC 0x0700 -#define IRDMA_AE_LCE_FUNCTION_CATASTROPHIC 0x0701 -#define IRDMA_AE_LCE_CQ_CATASTROPHIC 0x0702 -#define IRDMA_AE_QP_SUSPEND_COMPLETE 0x0900 enum irdma_device_caps_const { IRDMA_WQE_SIZE = 4, @@ -202,8 +111,7 @@ enum irdma_device_caps_const { IRDMA_MAX_OUTBOUND_MSG_SIZE = 65537, /* 64K +1 */ IRDMA_MAX_INBOUND_MSG_SIZE = 65537, - IRDMA_MAX_PUSH_PAGE_COUNT = 1024, - IRDMA_MAX_PE_ENA_VF_COUNT = 32, + IRDMA_MAX_PE_ENA_VF_COUNT = 32, IRDMA_MAX_VF_FPM_ID = 47, IRDMA_MAX_SQ_PAYLOAD_SIZE = 2145386496, IRDMA_MAX_INLINE_DATA_SIZE = 101, @@ -230,12 +138,7 @@ enum irdma_flush_opcode { FLUSH_RETRY_EXC_ERR, FLUSH_MW_BIND_ERR, FLUSH_REM_INV_REQ_ERR, -}; - -enum irdma_qp_event_type { - IRDMA_QP_EVENT_CATASTROPHIC, - IRDMA_QP_EVENT_ACCESS_ERR, - IRDMA_QP_EVENT_REQ_ERR, + FLUSH_RNR_RETRY_EXC_ERR, }; enum irdma_cmpl_status { @@ -283,12 +186,6 @@ struct irdma_cq_uk; struct irdma_qp_uk_init_info; struct irdma_cq_uk_init_info; -struct irdma_sge { - irdma_tagged_offset tag_off; - u32 len; - irdma_stag stag; -}; - struct irdma_ring { volatile u32 head; volatile u32 tail; /* effective tail */ @@ -320,13 +217,13 @@ struct irdma_post_rq_info { struct irdma_rdma_write { irdma_sgl lo_sg_list; u32 num_lo_sges; - struct irdma_sge rem_addr; + struct ibv_sge rem_addr; }; struct irdma_rdma_read { irdma_sgl lo_sg_list; u32 num_lo_sges; - struct irdma_sge rem_addr; + struct ibv_sge rem_addr; }; struct irdma_bind_window { @@ -400,11 +297,6 @@ struct irdma_cq_poll_info { } stat; }; -struct qp_err_code { - enum irdma_flush_opcode flush_code; - enum irdma_qp_event_type event_type; -}; - int irdma_uk_inline_rdma_write(struct irdma_qp_uk *qp, struct irdma_post_sq_info *info, bool post_sq); int irdma_uk_inline_send(struct irdma_qp_uk *qp, @@ -427,9 +319,9 @@ int irdma_uk_stag_local_invalidate(struct irdma_qp_uk *qp, bool post_sq); struct irdma_wqe_uk_ops { - void (*iw_copy_inline_data)(u8 *dest, struct irdma_sge *sge_list, u32 num_sges, u8 polarity); + void (*iw_copy_inline_data)(u8 *dest, struct ibv_sge *sge_list, u32 num_sges, u8 polarity); u16 (*iw_inline_data_size_to_quanta)(u32 data_size); - void (*iw_set_fragment)(__le64 *wqe, u32 offset, struct irdma_sge *sge, + void (*iw_set_fragment)(__le64 *wqe, u32 offset, struct ibv_sge *sge, u8 valid); void (*iw_set_mw_bind_wqe)(__le64 *wqe, struct irdma_bind_window *op_info); @@ -445,8 +337,6 @@ int irdma_uk_cq_init(struct irdma_cq_uk *cq, struct irdma_cq_uk_init_info *info); int irdma_uk_qp_init(struct irdma_qp_uk *qp, struct irdma_qp_uk_init_info *info); -void irdma_uk_calc_shift_wq(struct irdma_qp_uk_init_info *ukinfo, u8 *sq_shift, - u8 *rq_shift); int irdma_uk_calc_depth_shift_sq(struct irdma_qp_uk_init_info *ukinfo, u32 *sq_depth, u8 *sq_shift); int irdma_uk_calc_depth_shift_rq(struct irdma_qp_uk_init_info *ukinfo, @@ -495,6 +385,7 @@ struct irdma_qp_uk { u8 rwqe_polarity; u8 rq_wqe_size; u8 rq_wqe_size_multiplier; + u8 start_wqe_idx; bool deferred_flag:1; bool push_mode:1; /* whether the last post wqe was pushed */ bool push_dropped:1; @@ -542,6 +433,7 @@ struct irdma_qp_uk_init_info { u32 sq_depth; u32 rq_depth; u8 first_sq_wq; + u8 start_wqe_idx; u8 type; u8 sq_shift; u8 rq_shift; @@ -575,75 +467,4 @@ int irdma_get_rqdepth(struct irdma_uk_attrs *uk_attrs, u32 rq_size, u8 shift, u3 void irdma_qp_push_wqe(struct irdma_qp_uk *qp, __le64 *wqe, u16 quanta, u32 wqe_idx, bool post_sq); void irdma_clr_wqes(struct irdma_qp_uk *qp, u32 qp_wqe_idx); - -static inline struct qp_err_code irdma_ae_to_qp_err_code(u16 ae_id) -{ - struct qp_err_code qp_err = { 0 }; - - switch (ae_id) { - case IRDMA_AE_AMP_BOUNDS_VIOLATION: - case IRDMA_AE_AMP_INVALID_STAG: - case IRDMA_AE_AMP_RIGHTS_VIOLATION: - case IRDMA_AE_AMP_UNALLOCATED_STAG: - case IRDMA_AE_AMP_BAD_PD: - case IRDMA_AE_AMP_BAD_QP: - case IRDMA_AE_AMP_BAD_STAG_KEY: - case IRDMA_AE_AMP_BAD_STAG_INDEX: - case IRDMA_AE_AMP_TO_WRAP: - case IRDMA_AE_PRIV_OPERATION_DENIED: - qp_err.flush_code = FLUSH_PROT_ERR; - qp_err.event_type = IRDMA_QP_EVENT_ACCESS_ERR; - break; - case IRDMA_AE_UDA_XMIT_BAD_PD: - case IRDMA_AE_WQE_UNEXPECTED_OPCODE: - qp_err.flush_code = FLUSH_LOC_QP_OP_ERR; - qp_err.event_type = IRDMA_QP_EVENT_CATASTROPHIC; - break; - case IRDMA_AE_UDA_XMIT_DGRAM_TOO_SHORT: - case IRDMA_AE_UDA_XMIT_DGRAM_TOO_LONG: - case IRDMA_AE_UDA_L4LEN_INVALID: - case IRDMA_AE_DDP_UBE_INVALID_MO: - case IRDMA_AE_DDP_UBE_DDP_MESSAGE_TOO_LONG_FOR_AVAILABLE_BUFFER: - qp_err.flush_code = FLUSH_LOC_LEN_ERR; - qp_err.event_type = IRDMA_QP_EVENT_CATASTROPHIC; - break; - case IRDMA_AE_AMP_INVALIDATE_NO_REMOTE_ACCESS_RIGHTS: - case IRDMA_AE_IB_REMOTE_ACCESS_ERROR: - qp_err.flush_code = FLUSH_REM_ACCESS_ERR; - qp_err.event_type = IRDMA_QP_EVENT_ACCESS_ERR; - break; - case IRDMA_AE_AMP_MWBIND_INVALID_RIGHTS: - case IRDMA_AE_AMP_MWBIND_BIND_DISABLED: - case IRDMA_AE_AMP_MWBIND_INVALID_BOUNDS: - case IRDMA_AE_AMP_MWBIND_VALID_STAG: - qp_err.flush_code = FLUSH_MW_BIND_ERR; - qp_err.event_type = IRDMA_QP_EVENT_ACCESS_ERR; - break; - case IRDMA_AE_LLP_TOO_MANY_RETRIES: - qp_err.flush_code = FLUSH_RETRY_EXC_ERR; - qp_err.event_type = IRDMA_QP_EVENT_CATASTROPHIC; - break; - case IRDMA_AE_IB_INVALID_REQUEST: - qp_err.flush_code = FLUSH_REM_INV_REQ_ERR; - qp_err.event_type = IRDMA_QP_EVENT_REQ_ERR; - break; - case IRDMA_AE_LLP_SEGMENT_TOO_SMALL: - case IRDMA_AE_LLP_RECEIVED_MPA_CRC_ERROR: - case IRDMA_AE_ROCE_RSP_LENGTH_ERROR: - case IRDMA_AE_IB_REMOTE_OP_ERROR: - qp_err.flush_code = FLUSH_REM_OP_ERR; - qp_err.event_type = IRDMA_QP_EVENT_CATASTROPHIC; - break; - case IRDMA_AE_LCE_QP_CATASTROPHIC: - qp_err.flush_code = FLUSH_FATAL_ERR; - qp_err.event_type = IRDMA_QP_EVENT_CATASTROPHIC; - break; - default: - qp_err.flush_code = FLUSH_GENERAL_ERR; - qp_err.event_type = IRDMA_QP_EVENT_CATASTROPHIC; - break; - } - - return qp_err; -} #endif /* IRDMA_USER_H */ diff --git a/contrib/ofed/libirdma/irdma_uverbs.c b/contrib/ofed/libirdma/irdma_uverbs.c index bc6bec34e6cd..e52ce1cfa229 100644 --- a/contrib/ofed/libirdma/irdma_uverbs.c +++ b/contrib/ofed/libirdma/irdma_uverbs.c @@ -31,7 +31,6 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/*$FreeBSD$*/ #include #include @@ -153,6 +152,7 @@ irdma_ualloc_pd(struct ibv_context *context) err_free: free(iwupd); + errno = err; return NULL; } @@ -164,7 +164,6 @@ err_free: int irdma_ufree_pd(struct ibv_pd *pd) { - struct irdma_uvcontext *iwvctx = container_of(pd->context, struct irdma_uvcontext, ibv_ctx); struct irdma_upd *iwupd; int ret; @@ -375,12 +374,12 @@ irdma_free_hw_buf(void *buf, size_t size) * @cqe_64byte_ena: enable 64byte cqe */ static inline int -get_cq_size(int ncqe, u8 hw_rev, bool cqe_64byte_ena) +get_cq_size(int ncqe, u8 hw_rev) { ncqe++; /* Completions with immediate require 1 extra entry */ - if (!cqe_64byte_ena && hw_rev > IRDMA_GEN_1) *** 4009 LINES SKIPPED *** From nobody Wed Feb 21 06:01:07 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TflyC45Ymz5BX7d; Wed, 21 Feb 2024 06:01:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TflyC3LYmz4m6Q; Wed, 21 Feb 2024 06:01:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708495267; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=F+yLiVnR/gGdmx7wP7K1VC9BADDAlT3ZB+rss7IV09c=; b=fFIODAjHA9JI2/CHShSPj7Bw8trY8TNdR5nJBbkUoCrjc+ejD510PRJ9rB+0dbB1pge0im voZhQnRZtdulpcwl9s7xjQOy8GzWte/E9w51GnhYzVE9A/2cWo4sZdtLPzLefqXr68KhSV c8I8a389IIrJx9q5E57WDhVUWdUrwh/IBDgQ801lPbGx3i5lqbn0RbxQRNmvmhlseQWkLk caBbu4Yump9pc2cb+00/de0u9/caC2R6iGXigppPXSCLH6ww6LSUmDKSO57GWj5Ao2at7O U6TL9PRaadbhHO2sYSvfNggDs4p3+ugIMIneoNpp7xwE+vwPcoYOJ4asLhH75A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708495267; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=F+yLiVnR/gGdmx7wP7K1VC9BADDAlT3ZB+rss7IV09c=; b=P5bGpGgk+GbHqIBoLJ9tHPfNyYbNLx+l4e0mzvxrcvzNPMw8GLDcrKSKL6zemoDaCRlwTi /cG1rwV4CDSGEz5Mm+gfp3D8SgvN/ekSsTRpCewJD11ZOQ92pAzUL9ABltCJSEs+drHweG ODzS7/GkdkQsOxCFiF5sJP/jeFcvQD1VGucgvosHZAdoaL0H3EQHQJQXsPa2hWErzVO8qr wRWs0Szyi2cZ/p6GyL8ktqUAseCqY8kRzdUmht3kio7DrOyuP4zZbO8Yorf2QCKBEI4Zkw Gyn0yh6P443FdxJ41cxjZxgPun/iYStKH+r+1TCyG084jZ0gZ2U8HkqNtKcYjA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708495267; a=rsa-sha256; cv=none; b=QyRoGijOQ62tKKB7rO1/4u5H1HJAo6ws3frFYphOmnMvHaELTxc0VpqLg6sLTKsGo2m2eA YoeWnqBRfKe7Ch2swbL/ZLAeGpguIGSrb/oOy1TU2PeyHuZmegoHgam79PJOuZJ6D7TfNy goGyUaOBntqbGpNI6Klxt81zv2PiRClXqy5pBPqD2PXnVFDMxJ8oFrlT1olLa7U7sLCyMh zgzd4MIl2L84+7eZ68Cv/41bS6ipkKwdcssinmbI/lD11VsU4apveV6qiC07EvtpElUasK Iutk3tHB7h7Nb3Kzh7BLNl0kIe8drIf9VHw6GsvbtwDk2oczESwwQvPEBsmGCw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TflyC2PDXzrND; Wed, 21 Feb 2024 06:01:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41L617ST068318; Wed, 21 Feb 2024 06:01:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41L617UF068315; Wed, 21 Feb 2024 06:01:07 GMT (envelope-from git) Date: Wed, 21 Feb 2024 06:01:07 GMT Message-Id: <202402210601.41L617UF068315@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: a4510dafa804 - stable/13 - irdma(4): Upgrade to 1.2.36-k List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: a4510dafa8045bfa521303db7f23123a47d8749f Auto-Submitted: auto-generated The branch stable/13 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=a4510dafa8045bfa521303db7f23123a47d8749f commit a4510dafa8045bfa521303db7f23123a47d8749f Author: Bartosz Sobczak AuthorDate: 2024-02-16 21:55:08 +0000 Commit: Eric Joyner CommitDate: 2024-02-21 06:00:00 +0000 irdma(4): Upgrade to 1.2.36-k Update Intel irdma driver to version 1.2.36-k. Notable changes: - Start using ib_sge directly instead of irdma_sge - Turn off flush completion generator for libirdma - Minor formatting changes Signed-off-by: Bartosz Sobczak Signed-off-by: Eric Joyner Reviewed by: erj@ Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D43567 (cherry picked from commit 5b5f7d0e77a9eee73eb5d596f43aef4e1a3674d8) --- contrib/ofed/libirdma/abi.h | 8 +- contrib/ofed/libirdma/irdma-abi.h | 11 ++ contrib/ofed/libirdma/irdma.h | 1 - contrib/ofed/libirdma/irdma_defs.h | 13 --- contrib/ofed/libirdma/irdma_uk.c | 106 ++++++++---------- contrib/ofed/libirdma/irdma_umain.c | 2 +- contrib/ofed/libirdma/irdma_umain.h | 2 - contrib/ofed/libirdma/irdma_user.h | 198 ++-------------------------------- contrib/ofed/libirdma/irdma_uverbs.c | 89 +++++---------- contrib/ofed/libirdma/osdep.h | 1 - sys/dev/irdma/fbsd_kcompat.c | 5 +- sys/dev/irdma/fbsd_kcompat.h | 25 ++--- sys/dev/irdma/icrdma.c | 2 +- sys/dev/irdma/icrdma_hw.c | 7 +- sys/dev/irdma/icrdma_hw.h | 3 +- sys/dev/irdma/irdma-abi.h | 11 ++ sys/dev/irdma/irdma.h | 2 +- sys/dev/irdma/irdma_cm.c | 47 ++++---- sys/dev/irdma/irdma_cm.h | 2 +- sys/dev/irdma/irdma_ctrl.c | 99 ++++++++++------- sys/dev/irdma/irdma_defs.h | 3 - sys/dev/irdma/irdma_hw.c | 43 +++++--- sys/dev/irdma/irdma_kcompat.c | 96 +++++++---------- sys/dev/irdma/irdma_main.h | 13 ++- sys/dev/irdma/irdma_pble.h | 2 +- sys/dev/irdma/irdma_protos.h | 2 +- sys/dev/irdma/irdma_puda.c | 8 +- sys/dev/irdma/irdma_type.h | 29 +++-- sys/dev/irdma/irdma_uda.c | 2 +- sys/dev/irdma/irdma_uda.h | 3 +- sys/dev/irdma/irdma_uk.c | 80 +++++++------- sys/dev/irdma/irdma_user.h | 35 +++--- sys/dev/irdma/irdma_utils.c | 53 +++------ sys/dev/irdma/irdma_verbs.c | 202 ++++++++--------------------------- sys/dev/irdma/irdma_verbs.h | 4 +- sys/dev/irdma/irdma_ws.c | 4 +- sys/dev/irdma/irdma_ws.h | 2 +- 37 files changed, 424 insertions(+), 791 deletions(-) diff --git a/contrib/ofed/libirdma/abi.h b/contrib/ofed/libirdma/abi.h index 1d84fbc747f6..a3e159828bec 100644 --- a/contrib/ofed/libirdma/abi.h +++ b/contrib/ofed/libirdma/abi.h @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB * - * Copyright (C) 2019 - 2022 Intel Corporation + * Copyright (C) 2019 - 2023 Intel Corporation * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU @@ -85,6 +85,7 @@ struct irdma_ucreate_qp { struct ibv_create_qp ibv_cmd; __aligned_u64 user_wqe_bufs; __aligned_u64 user_compl_ctx; + __aligned_u64 comp_mask; }; struct irdma_ucreate_qp_resp { @@ -97,6 +98,9 @@ struct irdma_ucreate_qp_resp { __u8 lsmm; __u8 rsvd; __u32 qp_caps; + __aligned_u64 comp_mask; + __u8 start_wqe_idx; + __u8 rsvd2[7]; }; struct irdma_umodify_qp_resp { @@ -137,6 +141,8 @@ struct irdma_get_context_resp { __u8 hw_rev; __u8 rsvd2; __aligned_u64 comp_mask; + __u16 min_hw_wq_size; + __u8 rsvd3[6]; }; struct irdma_ureg_mr { diff --git a/contrib/ofed/libirdma/irdma-abi.h b/contrib/ofed/libirdma/irdma-abi.h index 8c04dcce2e8b..ae805919ea55 100644 --- a/contrib/ofed/libirdma/irdma-abi.h +++ b/contrib/ofed/libirdma/irdma-abi.h @@ -54,6 +54,11 @@ enum irdma_memreg_type { enum { IRDMA_ALLOC_UCTX_USE_RAW_ATTR = 1 << 0, + IRDMA_ALLOC_UCTX_MIN_HW_WQ_SIZE = 1 << 1, +}; + +enum { + IRDMA_CREATE_QP_USE_START_WQE_IDX = 1 << 0, }; struct irdma_alloc_ucontext_req { @@ -82,6 +87,8 @@ struct irdma_alloc_ucontext_resp { __u8 hw_rev; __u8 rsvd2; __aligned_u64 comp_mask; + __u16 min_hw_wq_size; + __u8 rsvd3[6]; }; struct irdma_alloc_pd_resp { @@ -101,6 +108,7 @@ struct irdma_create_cq_req { struct irdma_create_qp_req { __aligned_u64 user_wqe_bufs; __aligned_u64 user_compl_ctx; + __aligned_u64 comp_mask; }; struct irdma_mem_reg_req { @@ -130,6 +138,9 @@ struct irdma_create_qp_resp { __u8 lsmm; __u8 rsvd; __u32 qp_caps; + __aligned_u64 comp_mask; + __u8 start_wqe_idx; + __u8 rsvd2[7]; }; struct irdma_modify_qp_resp { diff --git a/contrib/ofed/libirdma/irdma.h b/contrib/ofed/libirdma/irdma.h index 0e2a5189acd1..f4a5a4796f82 100644 --- a/contrib/ofed/libirdma/irdma.h +++ b/contrib/ofed/libirdma/irdma.h @@ -46,7 +46,6 @@ enum irdma_vers { IRDMA_GEN_RSVD = 0, IRDMA_GEN_1 = 1, IRDMA_GEN_2 = 2, - IRDMA_GEN_MAX = 2, }; struct irdma_uk_attrs { diff --git a/contrib/ofed/libirdma/irdma_defs.h b/contrib/ofed/libirdma/irdma_defs.h index da9eea472568..39d4e7772c31 100644 --- a/contrib/ofed/libirdma/irdma_defs.h +++ b/contrib/ofed/libirdma/irdma_defs.h @@ -456,19 +456,6 @@ enum irdma_qp_wqe_size { IRDMA_WQE_SIZE_256 = 256, }; -enum irdma_ws_op_type { - IRDMA_WS_OP_TYPE_NODE = 0, - IRDMA_WS_OP_TYPE_LEAF_NODE_GROUP, -}; - -enum irdma_ws_rate_limit_flags { - IRDMA_WS_RATE_LIMIT_FLAGS_VALID = 0x1, - IRDMA_WS_NO_RDMA_RATE_LIMIT = 0x2, - IRDMA_WS_LEAF_NODE_IS_PART_GROUP = 0x4, - IRDMA_WS_TREE_RATE_LIMITING = 0x8, - IRDMA_WS_PACING_CONTROL = 0x10, -}; - /** * set_64bit_val - set 64 bit value to hw wqe * @wqe_words: wqe addr to write diff --git a/contrib/ofed/libirdma/irdma_uk.c b/contrib/ofed/libirdma/irdma_uk.c index 5fa9d792745f..115c5f0a27f0 100644 --- a/contrib/ofed/libirdma/irdma_uk.c +++ b/contrib/ofed/libirdma/irdma_uk.c @@ -45,16 +45,16 @@ * @valid: The wqe valid */ static void -irdma_set_fragment(__le64 * wqe, u32 offset, struct irdma_sge *sge, +irdma_set_fragment(__le64 * wqe, u32 offset, struct ibv_sge *sge, u8 valid) { if (sge) { set_64bit_val(wqe, offset, - FIELD_PREP(IRDMAQPSQ_FRAG_TO, sge->tag_off)); + FIELD_PREP(IRDMAQPSQ_FRAG_TO, sge->addr)); set_64bit_val(wqe, offset + IRDMA_BYTE_8, FIELD_PREP(IRDMAQPSQ_VALID, valid) | - FIELD_PREP(IRDMAQPSQ_FRAG_LEN, sge->len) | - FIELD_PREP(IRDMAQPSQ_FRAG_STAG, sge->stag)); + FIELD_PREP(IRDMAQPSQ_FRAG_LEN, sge->length) | + FIELD_PREP(IRDMAQPSQ_FRAG_STAG, sge->lkey)); } else { set_64bit_val(wqe, offset, 0); set_64bit_val(wqe, offset + IRDMA_BYTE_8, @@ -71,14 +71,14 @@ irdma_set_fragment(__le64 * wqe, u32 offset, struct irdma_sge *sge, */ static void irdma_set_fragment_gen_1(__le64 * wqe, u32 offset, - struct irdma_sge *sge, u8 valid) + struct ibv_sge *sge, u8 valid) { if (sge) { set_64bit_val(wqe, offset, - FIELD_PREP(IRDMAQPSQ_FRAG_TO, sge->tag_off)); + FIELD_PREP(IRDMAQPSQ_FRAG_TO, sge->addr)); set_64bit_val(wqe, offset + IRDMA_BYTE_8, - FIELD_PREP(IRDMAQPSQ_GEN1_FRAG_LEN, sge->len) | - FIELD_PREP(IRDMAQPSQ_GEN1_FRAG_STAG, sge->stag)); + FIELD_PREP(IRDMAQPSQ_GEN1_FRAG_LEN, sge->length) | + FIELD_PREP(IRDMAQPSQ_GEN1_FRAG_STAG, sge->lkey)); } else { set_64bit_val(wqe, offset, 0); set_64bit_val(wqe, offset + IRDMA_BYTE_8, 0); @@ -209,8 +209,7 @@ irdma_qp_push_wqe(struct irdma_qp_uk *qp, __le64 * wqe, u16 quanta, if (IRDMA_RING_CURRENT_HEAD(qp->initial_ring) != IRDMA_RING_CURRENT_TAIL(qp->sq_ring) && !qp->push_mode) { - if (post_sq) - irdma_uk_qp_post_wr(qp); + irdma_uk_qp_post_wr(qp); } else { push = (__le64 *) ((uintptr_t)qp->push_wqe + (wqe_idx & 0x7) * 0x20); @@ -338,7 +337,7 @@ irdma_uk_rdma_write(struct irdma_qp_uk *qp, struct irdma_post_sq_info *info, return EINVAL; for (i = 0; i < op_info->num_lo_sges; i++) - total_size += op_info->lo_sg_list[i].len; + total_size += op_info->lo_sg_list[i].length; read_fence |= info->read_fence; @@ -357,7 +356,7 @@ irdma_uk_rdma_write(struct irdma_qp_uk *qp, struct irdma_post_sq_info *info, qp->sq_wrtrk_array[wqe_idx].signaled = info->signaled; set_64bit_val(wqe, IRDMA_BYTE_16, - FIELD_PREP(IRDMAQPSQ_FRAG_TO, op_info->rem_addr.tag_off)); + FIELD_PREP(IRDMAQPSQ_FRAG_TO, op_info->rem_addr.addr)); if (info->imm_data_valid) { set_64bit_val(wqe, IRDMA_BYTE_0, @@ -386,7 +385,7 @@ irdma_uk_rdma_write(struct irdma_qp_uk *qp, struct irdma_post_sq_info *info, ++addl_frag_cnt; } - hdr = FIELD_PREP(IRDMAQPSQ_REMSTAG, op_info->rem_addr.stag) | + hdr = FIELD_PREP(IRDMAQPSQ_REMSTAG, op_info->rem_addr.lkey) | FIELD_PREP(IRDMAQPSQ_OPCODE, info->op_type) | FIELD_PREP(IRDMAQPSQ_IMMDATAFLAG, info->imm_data_valid) | FIELD_PREP(IRDMAQPSQ_REPORTRTT, info->report_rtt) | @@ -437,7 +436,7 @@ irdma_uk_rdma_read(struct irdma_qp_uk *qp, struct irdma_post_sq_info *info, return EINVAL; for (i = 0; i < op_info->num_lo_sges; i++) - total_size += op_info->lo_sg_list[i].len; + total_size += op_info->lo_sg_list[i].length; ret_code = irdma_fragcnt_to_quanta_sq(op_info->num_lo_sges, &quanta); if (ret_code) @@ -475,8 +474,8 @@ irdma_uk_rdma_read(struct irdma_qp_uk *qp, struct irdma_post_sq_info *info, ++addl_frag_cnt; } set_64bit_val(wqe, IRDMA_BYTE_16, - FIELD_PREP(IRDMAQPSQ_FRAG_TO, op_info->rem_addr.tag_off)); - hdr = FIELD_PREP(IRDMAQPSQ_REMSTAG, op_info->rem_addr.stag) | + FIELD_PREP(IRDMAQPSQ_FRAG_TO, op_info->rem_addr.addr)); + hdr = FIELD_PREP(IRDMAQPSQ_REMSTAG, op_info->rem_addr.lkey) | FIELD_PREP(IRDMAQPSQ_REPORTRTT, (info->report_rtt ? 1 : 0)) | FIELD_PREP(IRDMAQPSQ_ADDFRAGCNT, addl_frag_cnt) | FIELD_PREP(IRDMAQPSQ_OPCODE, @@ -525,7 +524,7 @@ irdma_uk_send(struct irdma_qp_uk *qp, struct irdma_post_sq_info *info, return EINVAL; for (i = 0; i < op_info->num_sges; i++) - total_size += op_info->sg_list[i].len; + total_size += op_info->sg_list[i].length; if (info->imm_data_valid) frag_cnt = op_info->num_sges + 1; @@ -620,15 +619,15 @@ irdma_set_mw_bind_wqe_gen_1(__le64 * wqe, * @polarity: compatibility parameter */ static void -irdma_copy_inline_data_gen_1(u8 *wqe, struct irdma_sge *sge_list, +irdma_copy_inline_data_gen_1(u8 *wqe, struct ibv_sge *sge_list, u32 num_sges, u8 polarity) { u32 quanta_bytes_remaining = 16; u32 i; for (i = 0; i < num_sges; i++) { - u8 *cur_sge = (u8 *)(uintptr_t)sge_list[i].tag_off; - u32 sge_len = sge_list[i].len; + u8 *cur_sge = (u8 *)(uintptr_t)sge_list[i].addr; + u32 sge_len = sge_list[i].length; while (sge_len) { u32 bytes_copied; @@ -683,7 +682,7 @@ irdma_set_mw_bind_wqe(__le64 * wqe, * @polarity: polarity of wqe valid bit */ static void -irdma_copy_inline_data(u8 *wqe, struct irdma_sge *sge_list, +irdma_copy_inline_data(u8 *wqe, struct ibv_sge *sge_list, u32 num_sges, u8 polarity) { u8 inline_valid = polarity << IRDMA_INLINE_VALID_S; @@ -694,8 +693,8 @@ irdma_copy_inline_data(u8 *wqe, struct irdma_sge *sge_list, wqe += 8; for (i = 0; i < num_sges; i++) { - u8 *cur_sge = (u8 *)(uintptr_t)sge_list[i].tag_off; - u32 sge_len = sge_list[i].len; + u8 *cur_sge = (u8 *)(uintptr_t)sge_list[i].addr; + u32 sge_len = sge_list[i].length; while (sge_len) { u32 bytes_copied; @@ -775,7 +774,7 @@ irdma_uk_inline_rdma_write(struct irdma_qp_uk *qp, return EINVAL; for (i = 0; i < op_info->num_lo_sges; i++) - total_size += op_info->lo_sg_list[i].len; + total_size += op_info->lo_sg_list[i].length; if (unlikely(total_size > qp->max_inline_data)) return EINVAL; @@ -788,9 +787,9 @@ irdma_uk_inline_rdma_write(struct irdma_qp_uk *qp, qp->sq_wrtrk_array[wqe_idx].signaled = info->signaled; read_fence |= info->read_fence; set_64bit_val(wqe, IRDMA_BYTE_16, - FIELD_PREP(IRDMAQPSQ_FRAG_TO, op_info->rem_addr.tag_off)); + FIELD_PREP(IRDMAQPSQ_FRAG_TO, op_info->rem_addr.addr)); - hdr = FIELD_PREP(IRDMAQPSQ_REMSTAG, op_info->rem_addr.stag) | + hdr = FIELD_PREP(IRDMAQPSQ_REMSTAG, op_info->rem_addr.lkey) | FIELD_PREP(IRDMAQPSQ_OPCODE, info->op_type) | FIELD_PREP(IRDMAQPSQ_INLINEDATALEN, total_size) | FIELD_PREP(IRDMAQPSQ_REPORTRTT, info->report_rtt ? 1 : 0) | @@ -846,7 +845,7 @@ irdma_uk_inline_send(struct irdma_qp_uk *qp, return EINVAL; for (i = 0; i < op_info->num_sges; i++) - total_size += op_info->sg_list[i].len; + total_size += op_info->sg_list[i].length; if (unlikely(total_size > qp->max_inline_data)) return EINVAL; @@ -911,7 +910,7 @@ irdma_uk_stag_local_invalidate(struct irdma_qp_uk *qp, u64 hdr; u32 wqe_idx; bool local_fence = false; - struct irdma_sge sge = {0}; + struct ibv_sge sge = {0}; u16 quanta = IRDMA_QP_WQE_MIN_QUANTA; info->push_wqe = qp->push_db ? true : false; @@ -922,7 +921,7 @@ irdma_uk_stag_local_invalidate(struct irdma_qp_uk *qp, if (!wqe) return ENOSPC; - sge.stag = op_info->target_stag; + sge.lkey = op_info->target_stag; qp->wqe_ops.iw_set_fragment(wqe, IRDMA_BYTE_0, &sge, 0); set_64bit_val(wqe, IRDMA_BYTE_16, 0); @@ -1436,8 +1435,7 @@ irdma_uk_cq_poll_cmpl(struct irdma_cq_uk *cq, IRDMA_RING_MOVE_TAIL(cq->cq_ring); set_64bit_val(cq->shadow_area, IRDMA_BYTE_0, IRDMA_RING_CURRENT_HEAD(cq->cq_ring)); - memset(info, 0, - sizeof(struct irdma_cq_poll_info)); + memset(info, 0, sizeof(*info)); return irdma_uk_cq_poll_cmpl(cq, info); } } @@ -1510,7 +1508,6 @@ exit: if (pring && IRDMA_RING_MORE_WORK(*pring)) move_cq_head = false; } - if (move_cq_head) { IRDMA_RING_MOVE_HEAD_NOCHECK(cq->cq_ring); if (!IRDMA_RING_CURRENT_HEAD(cq->cq_ring)) @@ -1591,10 +1588,12 @@ irdma_get_wqe_shift(struct irdma_uk_attrs *uk_attrs, u32 sge, int irdma_get_sqdepth(struct irdma_uk_attrs *uk_attrs, u32 sq_size, u8 shift, u32 *sqdepth) { + u32 min_size = (u32)uk_attrs->min_hw_wq_size << shift; + *sqdepth = irdma_round_up_wq((sq_size << shift) + IRDMA_SQ_RSVD); - if (*sqdepth < ((u32)uk_attrs->min_hw_wq_size << shift)) - *sqdepth = uk_attrs->min_hw_wq_size << shift; + if (*sqdepth < min_size) + *sqdepth = min_size; else if (*sqdepth > uk_attrs->max_hw_wq_quanta) return EINVAL; @@ -1608,10 +1607,12 @@ irdma_get_sqdepth(struct irdma_uk_attrs *uk_attrs, u32 sq_size, u8 shift, u32 *s int irdma_get_rqdepth(struct irdma_uk_attrs *uk_attrs, u32 rq_size, u8 shift, u32 *rqdepth) { + u32 min_size = (u32)uk_attrs->min_hw_wq_size << shift; + *rqdepth = irdma_round_up_wq((rq_size << shift) + IRDMA_RQ_RSVD); - if (*rqdepth < ((u32)uk_attrs->min_hw_wq_size << shift)) - *rqdepth = uk_attrs->min_hw_wq_size << shift; + if (*rqdepth < min_size) + *rqdepth = min_size; else if (*rqdepth > uk_attrs->max_hw_rq_quanta) return EINVAL; @@ -1644,41 +1645,16 @@ irdma_setup_connection_wqes(struct irdma_qp_uk *qp, { u16 move_cnt = 1; - if (qp->uk_attrs->feature_flags & IRDMA_FEATURE_RTS_AE) + if (info->start_wqe_idx) + move_cnt = info->start_wqe_idx; + else if (qp->uk_attrs->feature_flags & IRDMA_FEATURE_RTS_AE) move_cnt = 3; - qp->conn_wqes = move_cnt; IRDMA_RING_MOVE_HEAD_BY_COUNT_NOCHECK(qp->sq_ring, move_cnt); IRDMA_RING_MOVE_TAIL_BY_COUNT(qp->sq_ring, move_cnt); IRDMA_RING_MOVE_HEAD_BY_COUNT_NOCHECK(qp->initial_ring, move_cnt); } -/** - * irdma_uk_calc_shift_wq - calculate WQE shift for both SQ and RQ - * @ukinfo: qp initialization info - * @sq_shift: Returns shift of SQ - * @rq_shift: Returns shift of RQ - */ -void -irdma_uk_calc_shift_wq(struct irdma_qp_uk_init_info *ukinfo, u8 *sq_shift, - u8 *rq_shift) -{ - bool imm_support = ukinfo->uk_attrs->hw_rev >= IRDMA_GEN_2 ? true : false; - - irdma_get_wqe_shift(ukinfo->uk_attrs, - imm_support ? ukinfo->max_sq_frag_cnt + 1 : - ukinfo->max_sq_frag_cnt, - ukinfo->max_inline_data, sq_shift); - - irdma_get_wqe_shift(ukinfo->uk_attrs, ukinfo->max_rq_frag_cnt, 0, - rq_shift); - - if (ukinfo->uk_attrs->hw_rev == IRDMA_GEN_1) { - if (ukinfo->abi_ver > 4) - *rq_shift = IRDMA_MAX_RQ_WQE_SHIFT_GEN1; - } -} - /** * irdma_uk_calc_depth_shift_sq - calculate depth and shift for SQ size. * @ukinfo: qp initialization info @@ -1786,6 +1762,8 @@ irdma_uk_qp_init(struct irdma_qp_uk *qp, struct irdma_qp_uk_init_info *info) qp->wqe_ops = iw_wqe_uk_ops_gen_1; else qp->wqe_ops = iw_wqe_uk_ops; + qp->start_wqe_idx = info->start_wqe_idx; + return ret_code; } diff --git a/contrib/ofed/libirdma/irdma_umain.c b/contrib/ofed/libirdma/irdma_umain.c index 2902dd963e18..e8d27c31a0dc 100644 --- a/contrib/ofed/libirdma/irdma_umain.c +++ b/contrib/ofed/libirdma/irdma_umain.c @@ -48,7 +48,7 @@ /** * Driver version */ -char libirdma_version[] = "1.2.17-k"; +char libirdma_version[] = "1.2.36-k"; unsigned int irdma_dbg; diff --git a/contrib/ofed/libirdma/irdma_umain.h b/contrib/ofed/libirdma/irdma_umain.h index 1fa18dd7a847..269609f8c77f 100644 --- a/contrib/ofed/libirdma/irdma_umain.h +++ b/contrib/ofed/libirdma/irdma_umain.h @@ -96,7 +96,6 @@ struct irdma_cq_buf { LIST_ENTRY(irdma_cq_buf) list; struct irdma_cq_uk cq; struct verbs_mr vmr; - size_t buf_size; }; extern pthread_mutex_t sigusr1_wait_mutex; @@ -142,7 +141,6 @@ struct irdma_uqp { struct ibv_recv_wr *pend_rx_wr; struct irdma_qp_uk qp; enum ibv_qp_type qp_type; - struct irdma_sge *recv_sges; }; /* irdma_uverbs.c */ diff --git a/contrib/ofed/libirdma/irdma_user.h b/contrib/ofed/libirdma/irdma_user.h index 0f0aa30bec91..aeb6aa9feebd 100644 --- a/contrib/ofed/libirdma/irdma_user.h +++ b/contrib/ofed/libirdma/irdma_user.h @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB * - * Copyright (c) 2015 - 2022 Intel Corporation + * Copyright (c) 2015 - 2023 Intel Corporation * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU @@ -50,7 +50,7 @@ #define irdma_access_privileges u32 #define irdma_physical_fragment u64 #define irdma_address_list u64 * -#define irdma_sgl struct irdma_sge * +#define irdma_sgl struct ibv_sge * #define IRDMA_MAX_MR_SIZE 0x200000000000ULL @@ -80,96 +80,6 @@ #define IRDMA_OP_TYPE_REC_IMM 0x3f #define IRDMA_FLUSH_MAJOR_ERR 1 -#define IRDMA_SRQFLUSH_RSVD_MAJOR_ERR 0xfffe - -/* Async Events codes */ -#define IRDMA_AE_AMP_UNALLOCATED_STAG 0x0102 -#define IRDMA_AE_AMP_INVALID_STAG 0x0103 -#define IRDMA_AE_AMP_BAD_QP 0x0104 -#define IRDMA_AE_AMP_BAD_PD 0x0105 -#define IRDMA_AE_AMP_BAD_STAG_KEY 0x0106 -#define IRDMA_AE_AMP_BAD_STAG_INDEX 0x0107 -#define IRDMA_AE_AMP_BOUNDS_VIOLATION 0x0108 -#define IRDMA_AE_AMP_RIGHTS_VIOLATION 0x0109 -#define IRDMA_AE_AMP_TO_WRAP 0x010a -#define IRDMA_AE_AMP_FASTREG_VALID_STAG 0x010c -#define IRDMA_AE_AMP_FASTREG_MW_STAG 0x010d -#define IRDMA_AE_AMP_FASTREG_INVALID_RIGHTS 0x010e -#define IRDMA_AE_AMP_FASTREG_INVALID_LENGTH 0x0110 -#define IRDMA_AE_AMP_INVALIDATE_SHARED 0x0111 -#define IRDMA_AE_AMP_INVALIDATE_NO_REMOTE_ACCESS_RIGHTS 0x0112 -#define IRDMA_AE_AMP_INVALIDATE_MR_WITH_BOUND_WINDOWS 0x0113 -#define IRDMA_AE_AMP_MWBIND_VALID_STAG 0x0114 -#define IRDMA_AE_AMP_MWBIND_OF_MR_STAG 0x0115 -#define IRDMA_AE_AMP_MWBIND_TO_ZERO_BASED_STAG 0x0116 -#define IRDMA_AE_AMP_MWBIND_TO_MW_STAG 0x0117 -#define IRDMA_AE_AMP_MWBIND_INVALID_RIGHTS 0x0118 -#define IRDMA_AE_AMP_MWBIND_INVALID_BOUNDS 0x0119 -#define IRDMA_AE_AMP_MWBIND_TO_INVALID_PARENT 0x011a -#define IRDMA_AE_AMP_MWBIND_BIND_DISABLED 0x011b -#define IRDMA_AE_PRIV_OPERATION_DENIED 0x011c -#define IRDMA_AE_AMP_INVALIDATE_TYPE1_MW 0x011d -#define IRDMA_AE_AMP_MWBIND_ZERO_BASED_TYPE1_MW 0x011e -#define IRDMA_AE_AMP_FASTREG_INVALID_PBL_HPS_CFG 0x011f -#define IRDMA_AE_AMP_MWBIND_WRONG_TYPE 0x0120 -#define IRDMA_AE_AMP_FASTREG_PBLE_MISMATCH 0x0121 -#define IRDMA_AE_UDA_XMIT_DGRAM_TOO_LONG 0x0132 -#define IRDMA_AE_UDA_XMIT_BAD_PD 0x0133 -#define IRDMA_AE_UDA_XMIT_DGRAM_TOO_SHORT 0x0134 -#define IRDMA_AE_UDA_L4LEN_INVALID 0x0135 -#define IRDMA_AE_BAD_CLOSE 0x0201 -#define IRDMA_AE_RDMAP_ROE_BAD_LLP_CLOSE 0x0202 -#define IRDMA_AE_CQ_OPERATION_ERROR 0x0203 -#define IRDMA_AE_RDMA_READ_WHILE_ORD_ZERO 0x0205 -#define IRDMA_AE_STAG_ZERO_INVALID 0x0206 -#define IRDMA_AE_IB_RREQ_AND_Q1_FULL 0x0207 -#define IRDMA_AE_IB_INVALID_REQUEST 0x0208 -#define IRDMA_AE_WQE_UNEXPECTED_OPCODE 0x020a -#define IRDMA_AE_WQE_INVALID_PARAMETER 0x020b -#define IRDMA_AE_WQE_INVALID_FRAG_DATA 0x020c -#define IRDMA_AE_IB_REMOTE_ACCESS_ERROR 0x020d -#define IRDMA_AE_IB_REMOTE_OP_ERROR 0x020e -#define IRDMA_AE_WQE_LSMM_TOO_LONG 0x0220 -#define IRDMA_AE_DDP_INVALID_MSN_GAP_IN_MSN 0x0301 -#define IRDMA_AE_DDP_UBE_DDP_MESSAGE_TOO_LONG_FOR_AVAILABLE_BUFFER 0x0303 -#define IRDMA_AE_DDP_UBE_INVALID_DDP_VERSION 0x0304 -#define IRDMA_AE_DDP_UBE_INVALID_MO 0x0305 -#define IRDMA_AE_DDP_UBE_INVALID_MSN_NO_BUFFER_AVAILABLE 0x0306 -#define IRDMA_AE_DDP_UBE_INVALID_QN 0x0307 -#define IRDMA_AE_DDP_NO_L_BIT 0x0308 -#define IRDMA_AE_RDMAP_ROE_INVALID_RDMAP_VERSION 0x0311 -#define IRDMA_AE_RDMAP_ROE_UNEXPECTED_OPCODE 0x0312 -#define IRDMA_AE_ROE_INVALID_RDMA_READ_REQUEST 0x0313 -#define IRDMA_AE_ROE_INVALID_RDMA_WRITE_OR_READ_RESP 0x0314 -#define IRDMA_AE_ROCE_RSP_LENGTH_ERROR 0x0316 -#define IRDMA_AE_ROCE_EMPTY_MCG 0x0380 -#define IRDMA_AE_ROCE_BAD_MC_IP_ADDR 0x0381 -#define IRDMA_AE_ROCE_BAD_MC_QPID 0x0382 -#define IRDMA_AE_MCG_QP_PROTOCOL_MISMATCH 0x0383 -#define IRDMA_AE_INVALID_ARP_ENTRY 0x0401 -#define IRDMA_AE_INVALID_TCP_OPTION_RCVD 0x0402 -#define IRDMA_AE_STALE_ARP_ENTRY 0x0403 -#define IRDMA_AE_INVALID_AH_ENTRY 0x0406 -#define IRDMA_AE_LLP_CLOSE_COMPLETE 0x0501 -#define IRDMA_AE_LLP_CONNECTION_RESET 0x0502 -#define IRDMA_AE_LLP_FIN_RECEIVED 0x0503 -#define IRDMA_AE_LLP_RECEIVED_MARKER_AND_LENGTH_FIELDS_DONT_MATCH 0x0504 -#define IRDMA_AE_LLP_RECEIVED_MPA_CRC_ERROR 0x0505 -#define IRDMA_AE_LLP_SEGMENT_TOO_SMALL 0x0507 -#define IRDMA_AE_LLP_SYN_RECEIVED 0x0508 -#define IRDMA_AE_LLP_TERMINATE_RECEIVED 0x0509 -#define IRDMA_AE_LLP_TOO_MANY_RETRIES 0x050a -#define IRDMA_AE_LLP_TOO_MANY_KEEPALIVE_RETRIES 0x050b -#define IRDMA_AE_LLP_DOUBT_REACHABILITY 0x050c -#define IRDMA_AE_LLP_CONNECTION_ESTABLISHED 0x050e -#define IRDMA_AE_RESOURCE_EXHAUSTION 0x0520 -#define IRDMA_AE_RESET_SENT 0x0601 -#define IRDMA_AE_TERMINATE_SENT 0x0602 -#define IRDMA_AE_RESET_NOT_SENT 0x0603 -#define IRDMA_AE_LCE_QP_CATASTROPHIC 0x0700 -#define IRDMA_AE_LCE_FUNCTION_CATASTROPHIC 0x0701 -#define IRDMA_AE_LCE_CQ_CATASTROPHIC 0x0702 -#define IRDMA_AE_QP_SUSPEND_COMPLETE 0x0900 enum irdma_device_caps_const { IRDMA_WQE_SIZE = 4, @@ -201,8 +111,7 @@ enum irdma_device_caps_const { IRDMA_MAX_OUTBOUND_MSG_SIZE = 65537, /* 64K +1 */ IRDMA_MAX_INBOUND_MSG_SIZE = 65537, - IRDMA_MAX_PUSH_PAGE_COUNT = 1024, - IRDMA_MAX_PE_ENA_VF_COUNT = 32, + IRDMA_MAX_PE_ENA_VF_COUNT = 32, IRDMA_MAX_VF_FPM_ID = 47, IRDMA_MAX_SQ_PAYLOAD_SIZE = 2145386496, IRDMA_MAX_INLINE_DATA_SIZE = 101, @@ -229,12 +138,7 @@ enum irdma_flush_opcode { FLUSH_RETRY_EXC_ERR, FLUSH_MW_BIND_ERR, FLUSH_REM_INV_REQ_ERR, -}; - -enum irdma_qp_event_type { - IRDMA_QP_EVENT_CATASTROPHIC, - IRDMA_QP_EVENT_ACCESS_ERR, - IRDMA_QP_EVENT_REQ_ERR, + FLUSH_RNR_RETRY_EXC_ERR, }; enum irdma_cmpl_status { @@ -282,12 +186,6 @@ struct irdma_cq_uk; struct irdma_qp_uk_init_info; struct irdma_cq_uk_init_info; -struct irdma_sge { - irdma_tagged_offset tag_off; - u32 len; - irdma_stag stag; -}; - struct irdma_ring { volatile u32 head; volatile u32 tail; /* effective tail */ @@ -319,13 +217,13 @@ struct irdma_post_rq_info { struct irdma_rdma_write { irdma_sgl lo_sg_list; u32 num_lo_sges; - struct irdma_sge rem_addr; + struct ibv_sge rem_addr; }; struct irdma_rdma_read { irdma_sgl lo_sg_list; u32 num_lo_sges; - struct irdma_sge rem_addr; + struct ibv_sge rem_addr; }; struct irdma_bind_window { @@ -399,11 +297,6 @@ struct irdma_cq_poll_info { } stat; }; -struct qp_err_code { - enum irdma_flush_opcode flush_code; - enum irdma_qp_event_type event_type; -}; - int irdma_uk_inline_rdma_write(struct irdma_qp_uk *qp, struct irdma_post_sq_info *info, bool post_sq); int irdma_uk_inline_send(struct irdma_qp_uk *qp, @@ -426,9 +319,9 @@ int irdma_uk_stag_local_invalidate(struct irdma_qp_uk *qp, bool post_sq); struct irdma_wqe_uk_ops { - void (*iw_copy_inline_data)(u8 *dest, struct irdma_sge *sge_list, u32 num_sges, u8 polarity); + void (*iw_copy_inline_data)(u8 *dest, struct ibv_sge *sge_list, u32 num_sges, u8 polarity); u16 (*iw_inline_data_size_to_quanta)(u32 data_size); - void (*iw_set_fragment)(__le64 *wqe, u32 offset, struct irdma_sge *sge, + void (*iw_set_fragment)(__le64 *wqe, u32 offset, struct ibv_sge *sge, u8 valid); void (*iw_set_mw_bind_wqe)(__le64 *wqe, struct irdma_bind_window *op_info); @@ -444,8 +337,6 @@ int irdma_uk_cq_init(struct irdma_cq_uk *cq, struct irdma_cq_uk_init_info *info); int irdma_uk_qp_init(struct irdma_qp_uk *qp, struct irdma_qp_uk_init_info *info); -void irdma_uk_calc_shift_wq(struct irdma_qp_uk_init_info *ukinfo, u8 *sq_shift, - u8 *rq_shift); int irdma_uk_calc_depth_shift_sq(struct irdma_qp_uk_init_info *ukinfo, u32 *sq_depth, u8 *sq_shift); int irdma_uk_calc_depth_shift_rq(struct irdma_qp_uk_init_info *ukinfo, @@ -494,6 +385,7 @@ struct irdma_qp_uk { u8 rwqe_polarity; u8 rq_wqe_size; u8 rq_wqe_size_multiplier; + u8 start_wqe_idx; bool deferred_flag:1; bool push_mode:1; /* whether the last post wqe was pushed */ bool push_dropped:1; @@ -541,6 +433,7 @@ struct irdma_qp_uk_init_info { u32 sq_depth; u32 rq_depth; u8 first_sq_wq; + u8 start_wqe_idx; u8 type; u8 sq_shift; u8 rq_shift; @@ -574,75 +467,4 @@ int irdma_get_rqdepth(struct irdma_uk_attrs *uk_attrs, u32 rq_size, u8 shift, u3 void irdma_qp_push_wqe(struct irdma_qp_uk *qp, __le64 *wqe, u16 quanta, u32 wqe_idx, bool post_sq); void irdma_clr_wqes(struct irdma_qp_uk *qp, u32 qp_wqe_idx); - -static inline struct qp_err_code irdma_ae_to_qp_err_code(u16 ae_id) -{ - struct qp_err_code qp_err = { 0 }; - - switch (ae_id) { - case IRDMA_AE_AMP_BOUNDS_VIOLATION: - case IRDMA_AE_AMP_INVALID_STAG: - case IRDMA_AE_AMP_RIGHTS_VIOLATION: - case IRDMA_AE_AMP_UNALLOCATED_STAG: - case IRDMA_AE_AMP_BAD_PD: - case IRDMA_AE_AMP_BAD_QP: - case IRDMA_AE_AMP_BAD_STAG_KEY: - case IRDMA_AE_AMP_BAD_STAG_INDEX: - case IRDMA_AE_AMP_TO_WRAP: - case IRDMA_AE_PRIV_OPERATION_DENIED: - qp_err.flush_code = FLUSH_PROT_ERR; - qp_err.event_type = IRDMA_QP_EVENT_ACCESS_ERR; - break; - case IRDMA_AE_UDA_XMIT_BAD_PD: - case IRDMA_AE_WQE_UNEXPECTED_OPCODE: - qp_err.flush_code = FLUSH_LOC_QP_OP_ERR; - qp_err.event_type = IRDMA_QP_EVENT_CATASTROPHIC; - break; - case IRDMA_AE_UDA_XMIT_DGRAM_TOO_SHORT: - case IRDMA_AE_UDA_XMIT_DGRAM_TOO_LONG: - case IRDMA_AE_UDA_L4LEN_INVALID: - case IRDMA_AE_DDP_UBE_INVALID_MO: - case IRDMA_AE_DDP_UBE_DDP_MESSAGE_TOO_LONG_FOR_AVAILABLE_BUFFER: - qp_err.flush_code = FLUSH_LOC_LEN_ERR; - qp_err.event_type = IRDMA_QP_EVENT_CATASTROPHIC; - break; - case IRDMA_AE_AMP_INVALIDATE_NO_REMOTE_ACCESS_RIGHTS: - case IRDMA_AE_IB_REMOTE_ACCESS_ERROR: - qp_err.flush_code = FLUSH_REM_ACCESS_ERR; - qp_err.event_type = IRDMA_QP_EVENT_ACCESS_ERR; - break; - case IRDMA_AE_AMP_MWBIND_INVALID_RIGHTS: - case IRDMA_AE_AMP_MWBIND_BIND_DISABLED: - case IRDMA_AE_AMP_MWBIND_INVALID_BOUNDS: - case IRDMA_AE_AMP_MWBIND_VALID_STAG: - qp_err.flush_code = FLUSH_MW_BIND_ERR; - qp_err.event_type = IRDMA_QP_EVENT_ACCESS_ERR; - break; - case IRDMA_AE_LLP_TOO_MANY_RETRIES: - qp_err.flush_code = FLUSH_RETRY_EXC_ERR; - qp_err.event_type = IRDMA_QP_EVENT_CATASTROPHIC; - break; - case IRDMA_AE_IB_INVALID_REQUEST: - qp_err.flush_code = FLUSH_REM_INV_REQ_ERR; - qp_err.event_type = IRDMA_QP_EVENT_REQ_ERR; - break; - case IRDMA_AE_LLP_SEGMENT_TOO_SMALL: - case IRDMA_AE_LLP_RECEIVED_MPA_CRC_ERROR: - case IRDMA_AE_ROCE_RSP_LENGTH_ERROR: - case IRDMA_AE_IB_REMOTE_OP_ERROR: - qp_err.flush_code = FLUSH_REM_OP_ERR; - qp_err.event_type = IRDMA_QP_EVENT_CATASTROPHIC; - break; - case IRDMA_AE_LCE_QP_CATASTROPHIC: - qp_err.flush_code = FLUSH_FATAL_ERR; - qp_err.event_type = IRDMA_QP_EVENT_CATASTROPHIC; - break; - default: - qp_err.flush_code = FLUSH_GENERAL_ERR; - qp_err.event_type = IRDMA_QP_EVENT_CATASTROPHIC; - break; - } - - return qp_err; -} #endif /* IRDMA_USER_H */ diff --git a/contrib/ofed/libirdma/irdma_uverbs.c b/contrib/ofed/libirdma/irdma_uverbs.c index 962af399ed31..e52ce1cfa229 100644 --- a/contrib/ofed/libirdma/irdma_uverbs.c +++ b/contrib/ofed/libirdma/irdma_uverbs.c @@ -152,6 +152,7 @@ irdma_ualloc_pd(struct ibv_context *context) err_free: free(iwupd); + errno = err; return NULL; } @@ -163,7 +164,6 @@ err_free: int irdma_ufree_pd(struct ibv_pd *pd) { - struct irdma_uvcontext *iwvctx = container_of(pd->context, struct irdma_uvcontext, ibv_ctx); struct irdma_upd *iwupd; int ret; @@ -374,12 +374,12 @@ irdma_free_hw_buf(void *buf, size_t size) * @cqe_64byte_ena: enable 64byte cqe */ static inline int -get_cq_size(int ncqe, u8 hw_rev, bool cqe_64byte_ena) +get_cq_size(int ncqe, u8 hw_rev) { ncqe++; /* Completions with immediate require 1 extra entry */ - if (!cqe_64byte_ena && hw_rev > IRDMA_GEN_1) + if (hw_rev > IRDMA_GEN_1) ncqe *= 2; if (ncqe < IRDMA_U_MINCQ_SIZE) @@ -388,11 +388,8 @@ get_cq_size(int ncqe, u8 hw_rev, bool cqe_64byte_ena) return ncqe; } -static inline size_t get_cq_total_bytes(u32 cq_size, bool cqe_64byte_ena){ - if (cqe_64byte_ena) - return roundup(cq_size * sizeof(struct irdma_extended_cqe), IRDMA_HW_PAGE_SIZE); - else - return roundup(cq_size * sizeof(struct irdma_cqe), IRDMA_HW_PAGE_SIZE); +static inline size_t get_cq_total_bytes(u32 cq_size) { + return roundup(cq_size * sizeof(struct irdma_cqe), IRDMA_HW_PAGE_SIZE); } /** @@ -420,7 +417,6 @@ ucreate_cq(struct ibv_context *context, u32 cq_pages; int ret, ncqe; u8 hw_rev; - bool cqe_64byte_ena; iwvctx = container_of(context, struct irdma_uvcontext, ibv_ctx); uk_attrs = &iwvctx->uk_attrs; @@ -454,11 +450,10 @@ ucreate_cq(struct ibv_context *context, return NULL; } - cqe_64byte_ena = uk_attrs->feature_flags & IRDMA_FEATURE_64_BYTE_CQE ? true : false; - info.cq_size = get_cq_size(attr_ex->cqe, hw_rev, cqe_64byte_ena); + info.cq_size = get_cq_size(attr_ex->cqe, hw_rev); + total_size = get_cq_total_bytes(info.cq_size); iwucq->comp_vector = attr_ex->comp_vector; LIST_INIT(&iwucq->resize_list); - total_size = get_cq_total_bytes(info.cq_size, cqe_64byte_ena); cq_pages = total_size >> IRDMA_HW_PAGE_SHIFT; if (!(uk_attrs->feature_flags & IRDMA_FEATURE_CQ_RESIZE)) @@ -528,8 +523,6 @@ ucreate_cq(struct ibv_context *context, info.cq_id = resp.cq_id; /* Do not report the CQE's reserved for immediate and burned by HW */ iwucq->verbs_cq.cq.cqe = ncqe; - if (cqe_64byte_ena) - info.avoid_mem_cflct = true; info.cqe_alloc_db = (u32 *)((u8 *)iwvctx->db + IRDMA_DB_CQ_OFFSET); irdma_uk_cq_init(&iwucq->cq, &info); return &iwucq->verbs_cq.cq_ex; @@ -585,7 +578,7 @@ static void irdma_free_cq_buf(struct irdma_cq_buf *cq_buf) { ibv_cmd_dereg_mr(&cq_buf->vmr.ibv_mr); - irdma_free_hw_buf(cq_buf->cq.cq_base, cq_buf->buf_size); + irdma_free_hw_buf(cq_buf->cq.cq_base, get_cq_total_bytes(cq_buf->cq.cq_size)); free(cq_buf); } @@ -1322,6 +1315,8 @@ irdma_vmapped_qp(struct irdma_uqp *iwuqp, struct ibv_pd *pd, cmd.user_wqe_bufs = (__u64) ((uintptr_t)info->sq); cmd.user_compl_ctx = (__u64) (uintptr_t)&iwuqp->qp; + cmd.comp_mask |= IRDMA_CREATE_QP_USE_START_WQE_IDX; + ret = ibv_cmd_create_qp(pd, &iwuqp->ibv_qp, attr, &cmd.ibv_cmd, sizeof(cmd), &resp.ibv_resp, sizeof(struct irdma_ucreate_qp_resp)); @@ -1331,6 +1326,8 @@ irdma_vmapped_qp(struct irdma_uqp *iwuqp, struct ibv_pd *pd, info->sq_size = resp.actual_sq_size; info->rq_size = resp.actual_rq_size; info->first_sq_wq = legacy_mode ? 1 : resp.lsmm; + if (resp.comp_mask & IRDMA_CREATE_QP_USE_START_WQE_IDX) + info->start_wqe_idx = resp.start_wqe_idx; info->qp_caps = resp.qp_caps; info->qp_id = resp.qp_id; iwuqp->irdma_drv_opt = resp.irdma_drv_opt; @@ -1379,6 +1376,8 @@ irdma_ucreate_qp(struct ibv_pd *pd, if (attr->cap.max_send_sge > uk_attrs->max_hw_wq_frags || attr->cap.max_recv_sge > uk_attrs->max_hw_wq_frags || + attr->cap.max_send_wr > uk_attrs->max_hw_wq_quanta || + attr->cap.max_recv_wr > uk_attrs->max_hw_rq_quanta || attr->cap.max_inline_data > uk_attrs->max_hw_inline) { errno = EINVAL; return NULL; @@ -1430,18 +1429,12 @@ irdma_ucreate_qp(struct ibv_pd *pd, attr->cap.max_recv_wr = info.rq_size; } - iwuqp->recv_sges = calloc(attr->cap.max_recv_sge, sizeof(*iwuqp->recv_sges)); - if (!iwuqp->recv_sges) { - status = errno; /* preserve errno */ - goto err_destroy_lock; - } - info.wqe_alloc_db = (u32 *)iwvctx->db; info.legacy_mode = iwvctx->legacy_mode; info.sq_wrtrk_array = calloc(info.sq_depth, sizeof(*info.sq_wrtrk_array)); if (!info.sq_wrtrk_array) { status = errno; /* preserve errno */ - goto err_free_rsges; + goto err_destroy_lock; } info.rq_wrid_array = calloc(info.rq_depth, sizeof(*info.rq_wrid_array)); @@ -1475,8 +1468,6 @@ err_free_rq_wrid: free(info.rq_wrid_array); err_free_sq_wrtrk: free(info.sq_wrtrk_array); -err_free_rsges: - free(iwuqp->recv_sges); err_destroy_lock: pthread_spin_destroy(&iwuqp->lock); err_free_qp: @@ -1635,7 +1626,6 @@ irdma_udestroy_qp(struct ibv_qp *qp) free(iwuqp->qp.rq_wrid_array); irdma_free_hw_buf(iwuqp->qp.sq_base, iwuqp->buf_size); - free(iwuqp->recv_sges); free(iwuqp); return 0; @@ -1645,26 +1635,6 @@ err: return ret; } -/** - * irdma_copy_sg_list - copy sg list for qp - * @sg_list: copied into sg_list - * @sgl: copy from sgl - * @num_sges: count of sg entries - * @max_sges: count of max supported sg entries - */ -static void -irdma_copy_sg_list(struct irdma_sge *sg_list, struct ibv_sge *sgl, - int num_sges) -{ - int i; - *** 2464 LINES SKIPPED *** From nobody Wed Feb 21 06:58:03 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TfnCw0MZZz5BcNc; Wed, 21 Feb 2024 06:58:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TfnCv5CHmz4sbZ; Wed, 21 Feb 2024 06:58:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708498683; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=86ytu2tiQMjdPfzgplD0E3pt+3ig3B5v88RFm4YO03c=; b=X+4fyfj1G33GEzkDZUhAndQiwqq26awHCzpBqD3rHt2Jucv8eSvDbalIk7lhh/A9WjF0/H VB/F511ou7qxhWkjcaz3PkZFXLy0soMo1fD5TlTK9J0F+QVku5SR5QLvAXPg+M4fLxluI9 LRi1Fv6q9g/e/F5+FVb2tH09SE52hsXK1zkI88jQkvCGicNDrHZZpWGqx+EqYVjrfWLQqc CGlRBgN3G4Xy4xfJvAZ5eEAoqrPd4ayV/u+w4wbS4/8QDf/goSzpFDWGDZL/e/CQdDOYgc 3hT4dks0wkO+R/wWkm8BJlds8zWrPgq1pCYoU9u+65w+6B5m3OIo7TRR5iYF6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708498683; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=86ytu2tiQMjdPfzgplD0E3pt+3ig3B5v88RFm4YO03c=; b=lY+Zsb9DD2flVWElr8M4DEyFUy1StgKfS2eOud2cQ3BpCMJimR/3uJgzoJJCeTU0boyUKe DgHA+nMRPEJp8RrBPm8o9B6gttQGkImQ8O7WkvvU6wRXF6NdT2zSQKrDwcjxL4n3aQml1T OZTSJ/07A8HtzugzxHuwYSfWB7UiqJNF3dt91ivsQBlMPpl/k1XobVfF069QmrkmHJ/TMX 8bBvoFwy1KNLOMV3Woh8aVlYW3cS5Na0A8/NN6NIQ4i22LVQysM/CPKMkpEuODYLTNVy72 phqsmXpxS0SbX2woJPtRmtcF8f56Dxxijz8Mhr06v7C01YyYNxLwoR3Tdw4xmw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708498683; a=rsa-sha256; cv=none; b=c1q4FLxJl/jfLY/dx90lXd2afN5ryL0UsUZm5gmLJ9zBAvNnvTQo6VmJgojqloLIXOcsQZ NSDmxXXuSbJ3c/TFtHmr4zbIpubkXfjpCsVhXP3SWo7N0W3KZkhtovnq2rru8zM8qtx9D/ oguLolOTmAnhRNuayPdY1YA/i/RCdLOvNGCOKjn/HMz6LwjTQbYZPUqZi7wLHeL+Lv0hcZ UD8YZGcIsUuzXoF/BM9dSPRBfcX7/CeQcCsdfDMLOHPIckyOES4OOK14n+Y88+C6VU0W/M wZ0vqtTx0DVKgPfIZtrXp8n1nHUGtHF8VWbfxu6zgpm1WlL9pZKF33V8dv6wIw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TfnCv4G8yzs3g; Wed, 21 Feb 2024 06:58:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41L6w3RT057499; Wed, 21 Feb 2024 06:58:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41L6w3mB057496; Wed, 21 Feb 2024 06:58:03 GMT (envelope-from git) Date: Wed, 21 Feb 2024 06:58:03 GMT Message-Id: <202402210658.41L6w3mB057496@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: 60cfaec917da - stable/13 - MFC: MFV: expat 2.6.0. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 60cfaec917dad12ceab7450a518616668d9f1ed0 Auto-Submitted: auto-generated The branch stable/13 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=60cfaec917dad12ceab7450a518616668d9f1ed0 commit 60cfaec917dad12ceab7450a518616668d9f1ed0 Author: Xin LI AuthorDate: 2024-02-17 21:56:56 +0000 Commit: Xin LI CommitDate: 2024-02-21 06:57:35 +0000 MFC: MFV: expat 2.6.0. (cherry picked from commit 4543ef516683042d46f3bd3bb8a4f3f746e00499) --- contrib/expat/Changes | 118 +- contrib/expat/Makefile.am | 10 +- contrib/expat/Makefile.in | 22 +- contrib/expat/README.md | 7 +- contrib/expat/configure.ac | 43 +- contrib/expat/doc/Makefile.in | 10 +- contrib/expat/doc/ok.min.css | 4 +- contrib/expat/doc/reference.html | 222 +- contrib/expat/doc/xmlwf.1 | 24 +- contrib/expat/doc/xmlwf.xml | 50 +- contrib/expat/examples/Makefile.am | 9 +- contrib/expat/examples/Makefile.in | 48 +- contrib/expat/examples/element_declarations.c | 234 + contrib/expat/expat_config.h.in | 8 +- contrib/expat/fuzz/xml_parse_fuzzer.c | 53 +- contrib/expat/fuzz/xml_parsebuffer_fuzzer.c | 68 +- contrib/expat/lib/Makefile.in | 10 +- contrib/expat/lib/expat.h | 28 +- contrib/expat/lib/internal.h | 8 +- contrib/expat/lib/siphash.h | 10 +- contrib/expat/lib/xmlparse.c | 558 +- contrib/expat/lib/xmlrole.c | 6 +- contrib/expat/lib/xmlrole.h | 6 +- contrib/expat/lib/xmltok.c | 29 +- contrib/expat/lib/xmltok.h | 8 +- contrib/expat/lib/xmltok_impl.c | 2 +- contrib/expat/tests/Makefile.am | 61 +- contrib/expat/tests/Makefile.in | 261 +- contrib/expat/tests/acc_tests.c | 396 + contrib/expat/tests/acc_tests.h | 56 + contrib/expat/tests/acc_tests_cxx.cpp | 32 + contrib/expat/tests/alloc_tests.c | 2127 ++++ contrib/expat/tests/alloc_tests.h | 56 + contrib/expat/tests/alloc_tests_cxx.cpp | 32 + contrib/expat/tests/basic_tests.c | 6076 +++++++++ contrib/expat/tests/basic_tests.h | 56 + contrib/expat/tests/basic_tests_cxx.cpp | 32 + contrib/expat/tests/benchmark/Makefile.in | 10 +- contrib/expat/tests/benchmark/benchmark.c | 14 +- contrib/expat/tests/chardata.c | 16 +- contrib/expat/tests/chardata_cxx.cpp | 32 + contrib/expat/tests/common.c | 325 + contrib/expat/tests/common.h | 162 + contrib/expat/tests/common_cxx.cpp | 32 + contrib/expat/tests/dummy.c | 261 + contrib/expat/tests/dummy.h | 150 + contrib/expat/tests/dummy_cxx.cpp | 32 + contrib/expat/tests/handlers.c | 1932 +++ contrib/expat/tests/handlers.h | 595 + contrib/expat/tests/handlers_cxx.cpp | 32 + contrib/expat/tests/memcheck.c | 21 +- contrib/expat/tests/memcheck_cxx.cpp | 32 + contrib/expat/tests/minicheck.c | 58 +- contrib/expat/tests/minicheck.h | 79 +- contrib/expat/tests/minicheck_cxx.cpp | 32 + contrib/expat/tests/misc_tests.c | 523 + contrib/expat/tests/misc_tests.h | 56 + contrib/expat/tests/misc_tests_cxx.cpp | 32 + contrib/expat/tests/ns_tests.c | 754 ++ contrib/expat/tests/ns_tests.h | 56 + contrib/expat/tests/ns_tests_cxx.cpp | 32 + contrib/expat/tests/nsalloc_tests.c | 1537 +++ contrib/expat/tests/nsalloc_tests.h | 56 + contrib/expat/tests/nsalloc_tests_cxx.cpp | 32 + contrib/expat/tests/runtests.c | 12479 +------------------ .../tests/{runtestspp.cpp => runtests_cxx.cpp} | 4 +- contrib/expat/tests/structdata.c | 37 +- contrib/expat/tests/structdata_cxx.cpp | 32 + contrib/expat/xmlwf/Makefile.in | 10 +- contrib/expat/xmlwf/readfilemap.c | 21 +- contrib/expat/xmlwf/xmlfile.c | 16 +- contrib/expat/xmlwf/xmlfile.h | 4 +- contrib/expat/xmlwf/xmlwf.c | 156 +- contrib/expat/xmlwf/xmlwf_helpgen.py | 31 +- lib/libexpat/expat_config.h | 16 +- lib/libexpat/libbsdxml.3 | 4 +- 76 files changed, 17368 insertions(+), 13115 deletions(-) diff --git a/contrib/expat/Changes b/contrib/expat/Changes index e67171056950..a7d4caf9ac81 100644 --- a/contrib/expat/Changes +++ b/contrib/expat/Changes @@ -2,6 +2,120 @@ NOTE: We are looking for help with a few things: https://github.com/libexpat/libexpat/labels/help%20wanted If you can help, please get in touch. Thanks! +Release 2.6.0 Tue February 6 2024 + Security fixes: + #789 #814 CVE-2023-52425 -- Fix quadratic runtime issues with big tokens + that can cause denial of service, in partial where + dealing with compressed XML input. Applications + that parsed a document in one go -- a single call to + functions XML_Parse or XML_ParseBuffer -- were not affected. + The smaller the chunks/buffers you use for parsing + previously, the bigger the problem prior to the fix. + Backporters should be careful to no omit parts of + pull request #789 and to include earlier pull request #771, + in order to not break the fix. + #777 CVE-2023-52426 -- Fix billion laughs attacks for users + compiling *without* XML_DTD defined (which is not common). + Users with XML_DTD defined have been protected since + Expat >=2.4.0 (and that was CVE-2013-0340 back then). + + Bug fixes: + #753 Fix parse-size-dependent "invalid token" error for + external entities that start with a byte order mark + #780 Fix NULL pointer dereference in setContext via + XML_ExternalEntityParserCreate for compilation with + XML_DTD undefined + #812 #813 Protect against closing entities out of order + + Other changes: + #723 Improve support for arc4random/arc4random_buf + #771 #788 Improve buffer growth in XML_GetBuffer and XML_Parse + #761 #770 xmlwf: Support --help and --version + #759 #770 xmlwf: Support custom buffer size for XML_GetBuffer and read + #744 xmlwf: Improve language and URL clickability in help output + #673 examples: Add new example "element_declarations.c" + #764 Be stricter about macro XML_CONTEXT_BYTES at build time + #765 Make inclusion to expat_config.h consistent + #726 #727 Autotools: configure.ac: Support --disable-maintainer-mode + #678 #705 .. + #706 #733 #792 Autotools: Sync CMake templates with CMake 3.26 + #795 Autotools: Make installation of shipped man page doc/xmlwf.1 + independent of docbook2man availability + #815 Autotools|CMake: Add missing -DXML_STATIC to pkg-config file + section "Cflags.private" in order to fix compilation + against static libexpat using pkg-config on Windows + #724 #751 Autotools|CMake: Require a C99 compiler + (a de-facto requirement already since Expat 2.2.2 of 2017) + #793 Autotools|CMake: Fix PACKAGE_BUGREPORT variable + #750 #786 Autotools|CMake: Make test suite require a C++11 compiler + #749 CMake: Require CMake >=3.5.0 + #672 CMake: Lowercase off_t and size_t to help a bug in Meson + #746 CMake: Sort xmlwf sources alphabetically + #785 CMake|Windows: Fix generation of DLL file version info + #790 CMake: Build tests/benchmark/benchmark.c as well for + a build with -DEXPAT_BUILD_TESTS=ON + #745 #757 docs: Document the importance of isFinal + adjust tests + accordingly + #736 docs: Improve use of "NULL" and "null" + #713 docs: Be specific about version of XML (XML 1.0r4) + and version of C (C99); (XML 1.0r5 will need a sponsor.) + #762 docs: reference.html: Promote function XML_ParseBuffer more + #779 docs: reference.html: Add HTML anchors to XML_* macros + #760 docs: reference.html: Upgrade to OK.css 1.2.0 + #763 #739 docs: Fix typos + #696 docs|CI: Use HTTPS URLs instead of HTTP at various places + #669 #670 .. + #692 #703 .. + #733 #772 Address compiler warnings + #798 #800 Address clang-tidy warnings + #775 #776 Version info bumped from 9:10:8 (libexpat*.so.1.8.10) + to 10:0:9 (libexpat*.so.1.9.0); see https://verbump.de/ + for what these numbers do + + Infrastructure: + #700 #701 docs: Document security policy in file SECURITY.md + #766 docs: Improve parse buffer variables in-code documentation + #674 #738 .. + #740 #747 .. + #748 #781 #782 Refactor coverage and conformance tests + #714 #716 Refactor debug level variables to unsigned long + #671 Improve handling of empty environment variable value + in function getDebugLevel (without visible user effect) + #755 #774 .. + #758 #783 .. + #784 #787 tests: Improve test coverage with regard to parse chunk size + #660 #797 #801 Fuzzing: Improve fuzzing coverage + #367 #799 Fuzzing|CI: Start running OSS-Fuzz fuzzing regression tests + #698 #721 CI: Resolve some Travis CI leftovers + #669 CI: Be robust towards absence of Git tags + #693 #694 CI: Set permissions to "contents: read" for security + #709 CI: Pin all GitHub Actions to specific commits for security + #739 CI: Reject spelling errors using codespell + #798 CI: Enforce clang-tidy clean code + #773 #808 .. + #809 #810 CI: Upgrade Clang from 15 to 18 + #796 CI: Start using Clang's Control Flow Integrity sanitizer + #675 #720 #722 CI: Adapt to breaking changes in GitHub Actions Ubuntu images + #689 CI: Adapt to breaking changes in Clang/LLVM Debian packaging + #763 CI: Adapt to breaking changes in codespell + #803 CI: Adapt to breaking changes in Cppcheck + + Special thanks to: + Ivan Galkin + Joyce Brum + Philippe Antoine + Rhodri James + Snild Dolkow + spookyahell + Steven Garske + and + Clang AddressSanitizer + Clang UndefinedBehaviorSanitizer + codespell + GCC Farm Project + OSS-Fuzz + Sony Mobile + Release 2.5.0 Tue October 25 2022 Security fixes: #616 #649 #650 CVE-2022-43680 -- Fix heap use-after-free after overeager @@ -11,7 +125,7 @@ Release 2.5.0 Tue October 25 2022 arbitrary code execution. Bug fixes: - #612 #645 Fix curruption from undefined entities + #612 #645 Fix corruption from undefined entities #613 #654 Fix case when parsing was suspended while processing nested entities #616 #652 #653 Stop leaking opening tag bindings after a closing tag @@ -318,7 +432,7 @@ Release 2.4.2 Sun December 19 2021 see https://verbump.de/ for what these numbers do Special thanks to: - Dong-hee Na + Donghee Na Joergen Ibsen Kai Pastor diff --git a/contrib/expat/Makefile.am b/contrib/expat/Makefile.am index 37ae3738edd3..9c2259d23e63 100644 --- a/contrib/expat/Makefile.am +++ b/contrib/expat/Makefile.am @@ -6,9 +6,10 @@ # \___/_/\_\ .__/ \__,_|\__| # |_| XML parser # -# Copyright (c) 2017-2021 Sebastian Pipping +# Copyright (c) 2017-2023 Sebastian Pipping # Copyright (c) 2018 KangLin # Copyright (c) 2022 Johnny Jazeix +# Copyright (c) 2023 Sony Corporation / Snild Dolkow # Licensed under the MIT license: # # Permission is hereby granted, free of charge, to any person obtaining @@ -84,7 +85,7 @@ _EXTRA_DIST_WINDOWS = \ win32/expat.iss \ win32/MANIFEST.txt \ win32/README.txt \ - win32/version.rc + win32/version.rc.cmake EXTRA_DIST = \ $(_EXTRA_DIST_CMAKE) \ @@ -131,6 +132,11 @@ buildlib: run-benchmark: $(MAKE) -C tests/benchmark ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/recset.xml 65535 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_attr.xml 4096 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_cdata.xml 4096 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_comment.xml 4096 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_tag.xml 4096 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_text.xml 4096 3 .PHONY: download-xmlts-zip download-xmlts-zip: diff --git a/contrib/expat/Makefile.in b/contrib/expat/Makefile.in index 008c4109b793..f505224f6fa8 100644 --- a/contrib/expat/Makefile.in +++ b/contrib/expat/Makefile.in @@ -22,9 +22,10 @@ # \___/_/\_\ .__/ \__,_|\__| # |_| XML parser # -# Copyright (c) 2017-2021 Sebastian Pipping +# Copyright (c) 2017-2023 Sebastian Pipping # Copyright (c) 2018 KangLin # Copyright (c) 2022 Johnny Jazeix +# Copyright (c) 2023 Sony Corporation / Snild Dolkow # Licensed under the MIT license: # # Permission is hereby granted, free of charge, to any person obtaining @@ -136,6 +137,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/conftools/ax-append-compile-flags.m4 \ $(top_srcdir)/conftools/ax-append-link-flags.m4 \ $(top_srcdir)/conftools/expatcfg-compiler-supports-visibility.m4 \ + $(top_srcdir)/conftools/ax-cxx-compile-stdcxx.m4 \ + $(top_srcdir)/conftools/ax-cxx-compile-stdcxx-11.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -339,6 +342,7 @@ FGREP = @FGREP@ FILECMD = @FILECMD@ FILEMAP = @FILEMAP@ GREP = @GREP@ +HAVE_CXX11 = @HAVE_CXX11@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -358,6 +362,7 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -478,7 +483,7 @@ _EXTRA_DIST_WINDOWS = \ win32/expat.iss \ win32/MANIFEST.txt \ win32/README.txt \ - win32/version.rc + win32/version.rc.cmake EXTRA_DIST = \ $(_EXTRA_DIST_CMAKE) \ @@ -506,7 +511,7 @@ all: expat_config.h .SUFFIXES: am--refresh: Makefile @: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -532,9 +537,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck -$(top_srcdir)/configure: $(am__configure_deps) +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) -$(ACLOCAL_M4): $(am__aclocal_m4_deps) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): @@ -545,7 +550,7 @@ expat_config.h: stamp-h1 stamp-h1: $(srcdir)/expat_config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status expat_config.h -$(srcdir)/expat_config.h.in: $(am__configure_deps) +$(srcdir)/expat_config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ @@ -1092,6 +1097,11 @@ buildlib: run-benchmark: $(MAKE) -C tests/benchmark ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/recset.xml 65535 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_attr.xml 4096 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_cdata.xml 4096 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_comment.xml 4096 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_tag.xml 4096 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_text.xml 4096 3 .PHONY: download-xmlts-zip download-xmlts-zip: diff --git a/contrib/expat/README.md b/contrib/expat/README.md index e5e237fc9496..43c4f4f3dbb3 100644 --- a/contrib/expat/README.md +++ b/contrib/expat/README.md @@ -1,13 +1,14 @@ -[![Run Linux Travis CI tasks](https://github.com/libexpat/libexpat/actions/workflows/linux.yml/badge.svg)](https://github.com/libexpat/libexpat/actions/workflows/linux.yml) +[![Run Linux CI tasks](https://github.com/libexpat/libexpat/actions/workflows/linux.yml/badge.svg)](https://github.com/libexpat/libexpat/actions/workflows/linux.yml) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/libexpat/libexpat?svg=true)](https://ci.appveyor.com/project/libexpat/libexpat) [![Packaging status](https://repology.org/badge/tiny-repos/expat.svg)](https://repology.org/metapackage/expat/versions) [![Downloads SourceForge](https://img.shields.io/sourceforge/dt/expat?label=Downloads%20SourceForge)](https://sourceforge.net/projects/expat/files/) [![Downloads GitHub](https://img.shields.io/github/downloads/libexpat/libexpat/total?label=Downloads%20GitHub)](https://github.com/libexpat/libexpat/releases) -# Expat, Release 2.5.0 +# Expat, Release 2.6.0 -This is Expat, a C library for parsing XML, started by +This is Expat, a C99 library for parsing +[XML 1.0 Fourth Edition](https://www.w3.org/TR/2006/REC-xml-20060816/), started by [James Clark](https://en.wikipedia.org/wiki/James_Clark_%28programmer%29) in 1997. Expat is a stream-oriented XML parser. This means that you register handlers with the parser before starting the parse. These handlers diff --git a/contrib/expat/configure.ac b/contrib/expat/configure.ac index d3642dea5864..a5d1ff9317c8 100644 --- a/contrib/expat/configure.ac +++ b/contrib/expat/configure.ac @@ -11,7 +11,7 @@ dnl Copyright (c) 2000 Clark Cooper dnl Copyright (c) 2000-2005 Fred L. Drake, Jr. dnl Copyright (c) 2001-2003 Greg Stein dnl Copyright (c) 2006-2012 Karl Waclawek -dnl Copyright (c) 2016-2022 Sebastian Pipping +dnl Copyright (c) 2016-2024 Sebastian Pipping dnl Copyright (c) 2017 S. P. Zeidler dnl Copyright (c) 2017 Stephen Groat dnl Copyright (c) 2017-2020 Joe Orton @@ -60,7 +60,7 @@ m4_define([expat_version], m4_ifdef([__gnu__], [esyscmd(conftools/get-version.sh lib/expat.h)], [2.2.x])) -AC_INIT([expat], expat_version, [expat-bugs@libexpat.org]) +AC_INIT([expat], expat_version, [https://github.com/libexpat/libexpat/issues]) m4_undefine([expat_version]) AC_CONFIG_SRCDIR([Makefile.in]) @@ -68,6 +68,7 @@ AC_CONFIG_AUX_DIR([conftools]) AC_CONFIG_MACRO_DIR([m4]) AC_CANONICAL_HOST AM_INIT_AUTOMAKE +AM_MAINTAINER_MODE([enable]) # to allow argument --disable-maintainer-mode dnl @@ -81,9 +82,9 @@ dnl dnl If the API changes incompatibly set LIBAGE back to 0 dnl -LIBCURRENT=9 # sync -LIBREVISION=10 # with -LIBAGE=8 # CMakeLists.txt! +LIBCURRENT=10 # sync +LIBREVISION=0 # with +LIBAGE=9 # CMakeLists.txt! AC_CONFIG_HEADERS([expat_config.h]) AH_TOP([#ifndef EXPAT_CONFIG_H @@ -105,6 +106,9 @@ AC_SUBST(LIBAGE) AC_LANG([C]) AC_PROG_CC_C99 +AS_IF([test "${ac_cv_prog_cc_c99}" = no], + [AC_MSG_ERROR([Expat requires a C99 compiler.])]) + AS_IF([test "$GCC" = yes], [AX_APPEND_COMPILE_FLAGS([-Wall -Wextra], [AM_CFLAGS]) dnl Be careful about adding the -fexceptions option; some versions of @@ -176,6 +180,8 @@ AC_ARG_WITH([tests], [with_tests=yes]) AM_CONDITIONAL([WITH_TESTS], [test x${with_tests} = xyes]) +AS_IF([test x${with_tests} = xyes], + [AX_CXX_COMPILE_STDCXX_11([noext], [mandatory])]) AS_VAR_SET([EXPATCFG_ON_MINGW],[no]) AS_CASE("${host_os}", @@ -202,14 +208,16 @@ AS_IF([test "x${with_libbsd}" != xno], [], [AS_IF([test "x${with_libbsd}" = xyes], [AC_MSG_ERROR([Enforced use of libbsd cannot be satisfied.])])])]) -AC_MSG_CHECKING([for arc4random_buf (BSD or libbsd)]) +AC_MSG_CHECKING([for arc4random_buf (BSD, libbsd or glibc 2.36+)]) AC_LINK_IFELSE([AC_LANG_SOURCE([ - #include /* for arc4random_buf on BSD, for NULL */ #if defined(HAVE_LIBBSD) # include + #else + # include /* for arc4random_buf on BSD */ #endif int main() { - arc4random_buf(NULL, 0U); + char dummy[[123]]; // double brackets for m4 + arc4random_buf(dummy, 0U); return 0; } ])], @@ -217,7 +225,7 @@ AC_LINK_IFELSE([AC_LANG_SOURCE([ AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]) - AC_MSG_CHECKING([for arc4random (BSD, macOS or libbsd)]) + AC_MSG_CHECKING([for arc4random (BSD, macOS, libbsd or glibc 2.36+)]) AC_LINK_IFELSE([AC_LANG_SOURCE([ #if defined(HAVE_LIBBSD) # include @@ -295,6 +303,8 @@ AC_SUBST(FILEMAP) dnl Some basic configuration: AC_DEFINE([XML_NS], 1, [Define to make XML Namespaces functionality available.]) +AC_DEFINE([XML_GE], 1, + [Define as 1/0 to enable/disable support for general entities.]) AC_DEFINE([XML_DTD], 1, [Define to make parameter entity parsing functionality available.]) AC_DEFINE([XML_DEV_URANDOM], 1, @@ -319,9 +329,10 @@ AS_HELP_STRING([--disable-xml-context], AS_IF([test "x${enable_xml_context}" != "xno"], [AS_IF([test "x${enable_xml_context}" = "xyes" \ -o "x${enable_xml_context}" = "x"], - [AS_VAR_SET(enable_xml_context,1024)]) - AC_DEFINE_UNQUOTED([XML_CONTEXT_BYTES], [${enable_xml_context}], - [Define to specify how much context to retain around the current parse point.])]) + [AS_VAR_SET(enable_xml_context,1024)])], + [AS_VAR_SET(enable_xml_context,0)]) +AC_DEFINE_UNQUOTED([XML_CONTEXT_BYTES], [${enable_xml_context}], + [Define to specify how much context to retain around the current parse point, 0 to disable.]) AC_ARG_WITH([docbook], [AS_HELP_STRING([--with-docbook], @@ -345,8 +356,12 @@ AS_IF([test "x${DOCBOOK_TO_MAN}" != x -a "x$with_docbook" != xno], You can also configure using --without-docbook if you can do without a man page for xmlwf.])])]) -AM_CONDITIONAL(WITH_DOCBOOK, [test "x${DOCBOOK_TO_MAN}" != x]) - +dnl This will make sure that a release tarball shipping a pre-rendered xmlwf man page will +dnl get it installed, independent of whether some flavor of docbook2man is available. +dnl This relies on file xmlwf.1 being at least as recent as its source file xmlwf.xml. +AS_IF([test -f "${srcdir}"/doc/xmlwf.1], + [AM_CONDITIONAL(WITH_DOCBOOK, [true])], + [AM_CONDITIONAL(WITH_DOCBOOK, [test "x${DOCBOOK_TO_MAN}" != x])]) dnl Configure CMake file templates dnl NOTE: The *_TRUE variables read here are Automake conditionals diff --git a/contrib/expat/doc/Makefile.in b/contrib/expat/doc/Makefile.in index 7fef3eda1897..18f86be3947b 100644 --- a/contrib/expat/doc/Makefile.in +++ b/contrib/expat/doc/Makefile.in @@ -132,6 +132,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/conftools/ax-append-compile-flags.m4 \ $(top_srcdir)/conftools/ax-append-link-flags.m4 \ $(top_srcdir)/conftools/expatcfg-compiler-supports-visibility.m4 \ + $(top_srcdir)/conftools/ax-cxx-compile-stdcxx.m4 \ + $(top_srcdir)/conftools/ax-cxx-compile-stdcxx-11.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -241,6 +243,7 @@ FGREP = @FGREP@ FILECMD = @FILECMD@ FILEMAP = @FILEMAP@ GREP = @GREP@ +HAVE_CXX11 = @HAVE_CXX11@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -260,6 +263,7 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -351,7 +355,7 @@ EXTRA_DIST = \ all: all-am .SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -375,9 +379,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: $(am__configure_deps) +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/contrib/expat/doc/ok.min.css b/contrib/expat/doc/ok.min.css index 8b5f86e7042c..d324fabb2873 100644 --- a/contrib/expat/doc/ok.min.css +++ b/contrib/expat/doc/ok.min.css @@ -1,2 +1,2 @@ -/*! OK.css v1.0.3 | MIT License | github.com/andrewh0/okcss */@import url("https://rsms.me/inter/inter.css"); -/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus -inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}:root{--ok-sans:"Inter",system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Open Sans","Helvetica Neue","Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Se goe UI Symbol","Noto Color Emoji";--ok-mono:! SFMono-Regular,Menlo,Monaco,Consolas,"Ubuntu Mono","Liberation Mono","Courier New",Courier,monospace;--ok-fw-0:400;--ok-fw-1:600;--ok-fw-2:700;--ok-fw-3:700;--ok-fs-0:2.5rem;--ok-fs-1:2rem;--ok-fs-2:1.5rem;--ok-fs-3:1.25rem;--ok-fs-4:1rem;--ok-fs-5:0.75rem;--ok-br:0.25rem;--ok-s-0:0;--ok-s-1:0.25rem;--ok-s-2:0.5rem;--ok-s-3:1rem;--ok-s-4:1.5rem;--ok-s-5:2rem;--ok-s-6:2.5rem;--ok-lh-body:1.5;--ok-lh-heading:1.25;--ok-t-hl:#ffcf30;--ok-accent-0:#3e67fa;--ok-accent-1:#4788ff;--ok-tc-accent:#3173de;--ok-tc-code:#c23a30;--ok-tc-0:#000;--ok-tc-1:#747474;--ok-tc-2:#848484;--ok-bg-0:#fff;--ok-bg-1:#f0f0f0;--ok-bg-2:#ccc;--ok-b-0:1px solid #cbcbcb;--ok-b-1:1px solid #848484;--ok-down-0:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='8' viewBox='0 0 12 8' width='24' fill='none'%3E%3Cpath d='M6 6l4-4h1v1-1L6 7 1 2h1l4 4z' fill='%23747474'/%3E%3C/svg%3E");--ok-down-1:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='8 ' viewBox='0 0 12 8' width='24' fill='none'%3E%3Cpath d='M6 6l4-4h1v1-1L6 7 1 2h1l4 4z' fill='%23848484'/%3E%3C/svg%3E")}@media (prefers-color-scheme:dark){:root{--ok-tc-accent:#5c9aff;--ok-tc-code:#ed5853;--ok-tc-0:#fff;--ok-tc-1:#ababab;--ok-tc-2:#929292;--ok-bg-0:#000;--ok-bg-1:#212121;--ok-bg-2:#3e3e3e;--ok-b-0:1px solid #747474;--ok-b-1:1px solid #929292;--ok-down-0:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='8' viewBox='0 0 12 8' width='24' fill='none'%3E%3Cpath d='M6 6l4-4h1v1-1L6 7 1 2h1l4 4z' fill='%23ababab'/%3E%3C/svg%3E");--ok-down-1:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='8' viewBox='0 0 12 8' width='24' fill='none'%3E%3Cpath d='M6 6l4-4h1v1-1L6 7 1 2h1l4 4z' fill='%23929292'/%3E%3C/svg%3E")}}*,:after,:before{box-sizing:border-box}*{margin:0;padding:0}html{font-family:var(--ok-sans);line-sizing:normal;line-height:var(--ok-lh-body);font-weight:var(--ok-fw-0);color:var(--ok-tc-0);b ackground-color:var(--ok-bg-0);-webkit-font-! smoothing! :antialiased;-moz-osx-font-smoothing:grayscale;-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;-ms-text-size-adjust:100%;text-size-adjust:100%;text-rendering:optimizeLegibility}@supports (font-variation-settings:normal){html{font-family:Inter var,var(--ok-sans)}}button,input,optgroup,select,textarea{font-family:inherit;line-height:var(--ok-lh-body)}[role=button],button{cursor:pointer}audio,canvas,embed,iframe,img,input,object,select,svg,textarea,video{display:block}img,video{max-width:100%;height:auto}body{padding:var(--ok-s-3);max-width:80ch;margin:auto}h1{font-size:var(--ok-fs-0);margin:0}h2{font-size:var(--ok-fs-1)}h3{font-size:var(--ok-fs-2)}h4{font-size:var(--ok-fs-3)}h5{font-size:var(--ok-fs-4)}h6{font-size:var(--ok-fs-5);text-transform:uppercase;font-weight:var(--ok-fw-1)}h1,h2,h3,h4,h5,h6{line-height:var(--ok-lh-heading);font-weight:var(--ok-fw-3)}p{font-size:var(--ok-fs-4)}small{font-size:var(--ok-fs-5)}b,dt,strong{font-weight:var(--ok-fw-2)}address,article,aside,a udio,blockquote,button,canvas,dd,details,dialog,div,dl,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,img,input,main,nav,object,ol,p,pre,section,select,summary,svg,table,textarea,ul,video{margin-bottom:var(--ok-s-4)}address:last-child,article:last-child,aside:last-child,blockquote:last-child,dd:last-child,details:last-child,dialog:last-child,div:last-child,dl:last-child,dt:last-child,fieldset:last-child,figcaption:last-child,figure:last-child,footer:last-child,form:last-child,h1:last-child,h2:last-child,h3:last-child,h4:last-child,h5:last-child,h6:last-child,header:last-child,hgroup:last-child,hr:last-child,input[type=checkbox],input[type=radio],main:last-child,nav:last-child,ol:last-child,p:last-child,pre:last-child,section:last-child,table:last-child,ul:last-child{margin-bottom:0}fieldset{padding:var(--ok-s-3);border:var(--ok-b-0);border-radius:var(--ok-br)}legend{font-weight:var(--ok-fw-1);text-transform:uppercase;font-size:var(--ok-fs-5)}i nput,select{padding:var(--ok-s-2);background! :var(--ok! -bg-0);border:var(--ok-b-0);border-radius:var(--ok-br);color:var(--ok-tc-0);min-width:25ch}input:disabled,select:disabled,textarea:disabled{color:var(--ok-tc-2)}input::placeholder,textarea::placeholder{color:var(--ok-tc-2)}input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{color:var(--ok-tc-2)}input::-moz-placeholder,textarea::-moz-placeholder{color:var(--ok-tc-2)}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:var(--ok-tc-2)}input::-ms-input-placeholder,textarea::-ms-input-placeholder{color:var(--ok-tc-2)}input::-webkit-clear-button,input::-webkit-inner-spin-button,input::-webkit-search-cancel-button,input::-webkit-search-results-button{display:none}input::-ms-clear,input::-ms-reveal{display:none}input:disabled,textarea:disabled{background-color:var(--ok-bg-1)}input[type=search]{-webkit-appearance:none;-moz-appearance:none;appearance:none}input[type=file]{max-width:300px}input[type=number]{-moz-appearance:textfield}input[type=checkbox],input[type= radio]{display:inline;min-width:auto}input[type=color]{height:2.5rem}input[type=date],input[type=datetime-local],input[type=month],input[type=time],input[type=week]{height:2.5rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;position:relative}input[type=date]:before,input[type=datetime-local]:before,input[type=month]:before,input[type=time]:before,input[type=week]:before{position:absolute;right:0;top:0;background-image:var(--ok-down-0);background-repeat:no-repeat;background-position:right .2em top 50%;background-size:2em auto;width:2.5rem;height:calc(2.5rem - 2px);content:""}input[type=date]:disabled:before,input[type=datetime-local]:disabled:before,input[type=month]:disabled:before,input[type=time]:disabled:before,input[type=week]:disabled:before{background-image:var(--ok-down-1)}input::-webkit-calendar-picker-indicator{position:absolute;top:0;right:0;background-color:transparent;cursor:pointer;padding:0;width:2.5rem;height:calc(2.5rem - 2px);content:"";opacity:0}inp ut[type=range]{overflow:visible;line-height:! inherit;f! ont-family:inherit;-webkit-appearance:none;-moz-appearance:none;appearance:none;margin:0;outline:none;cursor:pointer;padding:0;vertical-align:middle;border:none;min-height:2rem;background-color:transparent}input[type=range]::-webkit-slider-runnable-track{cursor:pointer;-webkit-appearance:none;border-radius:var(--ok-br);border:var(--ok-b-0);background-color:var(--ok-bg-1);background-image:linear-gradient(var(--ok-bg-1),var(--ok-bg-1));width:100%;height:.5rem;color:transparent;box-sizing:border-box;position:relative}input[type=range]::-moz-range-track{cursor:pointer;-moz-appearance:none;border-radius:var(--ok-br);border:var(--ok-b-0);background-color:var(--ok-bg-1);background-image:linear-gradient(var(--ok-bg-1),var(--ok-bg-1));width:100%;height:.5rem;color:transparent;box-sizing:border-box}input[type=range]::-ms-track{cursor:pointer;-ms-appearance:none;border-radius:var(--ok-br);border:var(--ok-b-0);background-color:var(--ok-bg-1);background-image:linear-gradient(var(--ok-bg-1),var(- -ok-bg-1));width:100%;height:.5rem;color:transparent;box-sizing:border-box}input[type=range]::-ms-fill-lower{background:transparent}input[type=range]::-webkit-slider-thumb{cursor:pointer;-webkit-appearance:none;border-radius:50%;background-color:var(--ok-accent-0);width:1.5rem;height:1.5rem;margin-top:calc(-.5rem - 1px)}input[type=range]::-moz-range-thumb{cursor:pointer;-moz-appearance:none;border:none;border-radius:50%;background-color:var(--ok-accent-0);width:1.5rem;height:1.5rem}input[type=range]::-ms-thumb{cursor:pointer;-ms-appearance:none;border-radius:50%;background-color:var(--ok-accent-0);width:1.5rem;height:1.5rem;transform:translateY(.25rem)}input[type=range]:focus:not(:disabled)::-webkit-slider-thumb{background-color:var(--ok-accent-1)}input[type=range]:focus:not(:disabled)::-moz-range-thumb{background-color:var(--ok-accent-1)}input[type=range]:focus:not(:disabled)::-ms-thumb{background-color:var(--ok-accent-1)}input[type=range]:disabled{cursor:default}input[type=range]: disabled::-webkit-slider-runnable-track{curs! or:defaul! t}input[type=range]:disabled::-moz-range-track{cursor:default}input[type=range]:disabled::-ms-track{cursor:default}input[type=range]:disabled::-webkit-slider-thumb{background-color:var(--ok-bg-2);cursor:default}input[type=range]:disabled::-moz-range-thumb{background-color:var(--ok-bg-2);cursor:default}input[type=range]:disabled::-ms-thumb{background-color:var(--ok-bg-2);cursor:default}select{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:var(--ok-b-0);border-radius:var(--ok-br);background-color:var(--ok-bg-0);min-height:2.5rem;color:var(--ok-tc-0)}select:not([multiple]){background-image:var(--ok-down-0);background-repeat:no-repeat,repeat;background-position:right .2em top 50%;background-size:2em auto;padding-right:2.5em;height:2.5rem}select::-ms-expand{display:none}select:not([multiple]):disabled{background-image:var(--ok-down-1);background-color:var(--ok-bg-1);cursor:default}select[multiple]{border-radius:var(--ok-br)}select[multiple]:disabled{background-color: var(--ok-bg-1)}select[multiple] option{color:var(--ok-t-)}select[multiple]:disabled option{color:var(--ok-tc-2)}textarea{padding:var(--ok-s-2);resize:vertical;background:var(--ok-bg-0);border:var(--ok-b-0);border-radius:var(--ok-br);color:var(--ok-tc-0);min-height:calc(2.5rem - 2px);min-width:25ch}button,input[type=button],input[type=reset],input[type=submit]{display:inline-block;background-color:var(--ok-accent-0);border-radius:var(--ok-br);color:#fff;font-weight:var(--ok-fw-1);height:2.5rem;border:none;padding:var(--ok-s-2) var(--ok-s-3);white-space:nowrap;min-width:auto}input::-webkit-file-upload-button{display:inline-block;background-color:var(--ok-accent-0);border-radius:var(--ok-br);color:#fff;font-weight:var(--ok-fw-1);height:2.5rem;border:none;padding:var(--ok-s-2) var(--ok-s-3);white-space:nowrap}input:disabled::-webkit-file-upload-button{cursor:default;opacity:.5}button,input[type=button],input[type=reset],input[type=submit]{cursor:pointer}input:not(:disabled)::-webkit-fil e-upload-button{cursor:pointer}button:disabl! ed,input[! type=button]:disabled,input[type=reset]:disabled,input[type=submit]:disabled{cursor:default;opacity:.5;background-color:var(--ok-accent-0)}button:focus:not(:disabled),input[type=button]:focus:not(:disabled),input[type=reset]:focus:not(:disabled),input[type=submit]:focus:not(:disabled){background-color:var(--ok-accent-1)}input:not(:disabled):focus::-webkit-file-upload-button{background-color:var(--ok-accent-1)}table{border-collapse:collapse;border-radius:var(--ok-br);display:block;max-width:-webkit-fit-content;max-width:-moz-fit-content;max-width:fit-content;margin-left:auto;margin-right:auto;overflow-x:auto;white-space:nowrap}tfoot,thead{border:var(--ok-b-0)}tfoot tr,thead tr{background-color:var(--ok-bg-1);font-size:var(--ok-fs-5);text-transform:uppercase;color:var(--ok-tc-0)}td,th{border:var(--ok-b-0) 0;text-align:left;padding:.5rem}td{white-space:normal;max-width:20ch}tr{border:var(--ok-b-0)}table caption{font-size:var(--ok-fs-4);font-weight:var(--ok-fw-3);padding:.5rem}code,samp {padding:.2em .4em;color:var(--ok-tc-code)}code,pre,samp{font-family:var(--ok-mono);line-height:var(--ok-lh-body);background-color:var(--ok-bg-1);border-radius:var(--ok-br);text-transform:none}pre{padding:var(--ok-s-3);white-space:pre;overflow-x:auto}pre,var{color:var(--ok-tc-0)}var{font-family:var(--ok-mono);font-style:normal}code pre,pre code{background:inherit;font-size:inherit;color:inherit;border:0;padding:0;margin:0}code pre{display:inline}kbd{background-color:var(--ok-bg-1);border:var(--ok-b-0);border-radius:var(--ok-br);border-bottom:2px solid var(--ok-bg-2);padding:var(--ok-s-1);font-family:var(--ok-sans);color:var(--ok-tc-0)}a{text-decoration:none;font-weight:var(--ok-fw-1)}a,a:visited{color:var(--ok-tc-accent)}ol,ul{padding-left:var(--ok-s-5)}nav ul{text-decoration:none;padding-left:0}nav ul li{display:inline;margin-right:1em}audio,img,video{margin-left:auto;margin-right:auto}img{border-radius:var(--ok-br)}figure>img:not(:last-child){margin-bottom:var(--ok-s-1)}figure>fig caption{text-align:center}figcaption,time{fo! nt-size:v! ar(--ok-fs-5);color:var(--ok-tc-1)}mark{padding:.2em .4em;background:var(--ok-t-hl);color:#000;border-radius:var(--ok-br)}iframe{border:var(--ok-b-0);border-radius:var(--ok-br);width:100%}hr{border:none;border-bottom:var(--ok-b-0)}footer{font-size:var(--ok-fs-5)}blockquote,footer{color:var(--ok-tc-1)}blockquote{position:relative;margin-left:0;margin-right:0;padding-left:var(--ok-s-5)}blockquote:before{position:absolute;height:100%;content:"";width:4px;left:0;border-radius:var(--ok-br);background-color:var(--ok-bg-1)}dd{padding-left:var(--ok-s-5)}abbr{cursor:help}@media (hover:hover){a:hover{text-decoration:underline}input:hover:not(:disabled):not(:focus):not([type=submit]):not([type=button]):not([type=reset]):not([type=range]),select:hover:not(:disabled):not(:focus),textarea:hover:not(:disabled):not(:focus){border:var(--ok-b-1)}input[type=range]:hover:not(:disabled)::-webkit-slider-runnable-track{border:var(--ok-b-1)}input[type=range]:hover:not(:disabled)::-moz-range-track{border:va r(--ok-b-1)}input[type=range]:hover:not(:disabled)::-ms-track{border:var(--ok-b-1)}select:not([multiple]):not(:disabled):hover{cursor:pointer}button:hover:not(:disabled),input[type=button]:hover:not(:disabled),input[type=reset]:hover:not(:disabled),input[type=submit]:hover:not(:disabled){background-color:var(--ok-accent-1)}input:not(:disabled):hover::-webkit-file-upload-button{background-color:var(--ok-accent-1)}} \ No newline at end of file +/*! OK.css v1.2.0 | MIT License | github.com/andrewh0/okcss */@import url("https://rsms.me/inter/inter.css"); +/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus -inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}:root{--ok-sans:"Inter",system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Open Sans","Helvetica Neue","Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Se goe UI Symbol","Noto Color Emoji";--ok-mono:! SFMono-Regular,Menlo,Monaco,Consolas,"Ubuntu Mono","Liberation Mono","Courier New",Courier,monospace;--ok-fw-0:400;--ok-fw-1:600;--ok-fw-2:700;--ok-fw-3:700;--ok-fs-0:2.5rem;--ok-fs-1:2rem;--ok-fs-2:1.5rem;--ok-fs-3:1.25rem;--ok-fs-4:1rem;--ok-fs-5:0.75rem;--ok-br:0.25rem;--ok-s-0:0;--ok-s-1:0.25rem;--ok-s-2:0.5rem;--ok-s-3:1rem;--ok-s-4:1.5rem;--ok-s-5:2rem;--ok-s-6:2.5rem;--ok-lh-body:1.5;--ok-lh-heading:1.25;--ok-t-hl:#ffcf30;--ok-accent-0:#3e67fa;--ok-accent-1:#4788ff;--ok-tc-accent:#3173de;--ok-tc-code:#c23a30;--ok-tc-0:#000;--ok-tc-1:#747474;--ok-tc-2:#848484;--ok-bg-0:#fff;--ok-bg-1:#f0f0f0;--ok-bg-2:#ccc;--ok-b-0:1px solid #cbcbcb;--ok-b-1:1px solid #848484;--ok-down-0:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='8' viewBox='0 0 12 8' width='24' fill='none'%3E%3Cpath d='M6 6l4-4h1v1-1L6 7 1 2h1l4 4z' fill='%23747474'/%3E%3C/svg%3E");--ok-down-1:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='8 ' viewBox='0 0 12 8' width='24' fill='none'%3E%3Cpath d='M6 6l4-4h1v1-1L6 7 1 2h1l4 4z' fill='%23848484'/%3E%3C/svg%3E")}@media (prefers-color-scheme:dark){:root{--ok-tc-accent:#5c9aff;--ok-tc-code:#ed5853;--ok-tc-0:#fff;--ok-tc-1:#ababab;--ok-tc-2:#929292;--ok-bg-0:#000;--ok-bg-1:#212121;--ok-bg-2:#3e3e3e;--ok-b-0:1px solid #747474;--ok-b-1:1px solid #929292;--ok-down-0:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='8' viewBox='0 0 12 8' width='24' fill='none'%3E%3Cpath d='M6 6l4-4h1v1-1L6 7 1 2h1l4 4z' fill='%23ababab'/%3E%3C/svg%3E");--ok-down-1:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='8' viewBox='0 0 12 8' width='24' fill='none'%3E%3Cpath d='M6 6l4-4h1v1-1L6 7 1 2h1l4 4z' fill='%23929292'/%3E%3C/svg%3E")}}*,:after,:before{box-sizing:border-box}*{margin:0;padding:0}html{font-family:var(--ok-sans);line-sizing:normal;line-height:var(--ok-lh-body);font-weight:var(--ok-fw-0);color:var(--ok-tc-0);b ackground-color:var(--ok-bg-0);-webkit-font-! smoothing! :antialiased;-moz-osx-font-smoothing:grayscale;-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;-ms-text-size-adjust:100%;text-size-adjust:100%;text-rendering:optimizeLegibility;scroll-behavior:smooth}@supports (font-variation-settings:normal){html{font-family:Inter var,var(--ok-sans)}}button,input,optgroup,select,textarea{font-family:inherit;line-height:var(--ok-lh-body)}[role=button],button{cursor:pointer}audio,canvas,embed,iframe,img,input,object,select,svg,textarea,video{display:block}img,video{max-width:100%;height:auto}body{padding:var(--ok-s-3);max-width:80ch;margin:auto}article{padding-bottom:var(--ok-s-6)}h1{font-size:var(--ok-fs-0);margin:0}h2{font-size:var(--ok-fs-1)}h3{font-size:var(--ok-fs-2)}h4{font-size:var(--ok-fs-3)}h5{font-size:var(--ok-fs-4)}h6{font-size:var(--ok-fs-5);text-transform:uppercase;font-weight:var(--ok-fw-1)}h1,h2,h3,h4,h5,h6{line-height:var(--ok-lh-heading);font-weight:var(--ok-fw-3);margin-top:var(--ok-s-6);margin-bottom:var(--ok-s-3)}h1+*,h2 +*,h3+*,h4+*,h5+*,h6+*,hr+*{margin-top:0}p{font-size:var(--ok-fs-4)}small{font-size:var(--ok-fs-5)}b,dt,strong{font-weight:var(--ok-fw-2)}address,article,aside,audio,blockquote,button,canvas,dd,details,dialog,div,dl,embed,fieldset,figcaption,figure,footer,form,header,hgroup,hr,iframe,img,input,main,nav,object,ol,p,pre,section,select,summary,svg,table,textarea,ul,video{margin-bottom:var(--ok-s-4)}address:last-child,article:last-child,aside:last-child,blockquote:last-child,dd:last-child,details:last-child,dialog:last-child,div:last-child,dl:last-child,dt:last-child,fieldset:last-child,figcaption:last-child,figure:last-child,footer:last-child,form:last-child,h1:last-child,h2:last-child,h3:last-child,h4:last-child,h5:last-child,h6:last-child,header:last-child,hgroup:last-child,hr:last-child,input[type=checkbox],input[type=radio],main:last-child,nav:last-child,ol:last-child,p:last-child,pre:last-child,section:last-child,table:last-child,ul:last-child{margin-bottom:0}fieldset{padding:var( --ok-s-3);border:var(--ok-b-0);border-radius! :var(--ok! -br)}legend{font-weight:var(--ok-fw-1);text-transform:uppercase;font-size:var(--ok-fs-5)}input,select{padding:var(--ok-s-2);background:var(--ok-bg-0);border:var(--ok-b-0);border-radius:var(--ok-br);color:var(--ok-tc-0);min-width:25ch}input:disabled,select:disabled,textarea:disabled{color:var(--ok-tc-2)}input::placeholder,textarea::placeholder{color:var(--ok-tc-2)}input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{color:var(--ok-tc-2)}input::-moz-placeholder,textarea::-moz-placeholder{color:var(--ok-tc-2)}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:var(--ok-tc-2)}input::-ms-input-placeholder,textarea::-ms-input-placeholder{color:var(--ok-tc-2)}input::-webkit-clear-button,input::-webkit-inner-spin-button,input::-webkit-search-cancel-button,input::-webkit-search-results-button{display:none}input::-ms-clear,input::-ms-reveal{display:none}input:disabled,textarea:disabled{background-color:var(--ok-bg-1)}input[type=search]{-webkit-appearance:none;-moz -appearance:none;appearance:none}input[type=file]{max-width:300px}input[type=number]{-moz-appearance:textfield}input[type=checkbox],input[type=radio]{display:inline;min-width:auto}input[type=color]{height:2.5rem}input[type=date],input[type=datetime-local],input[type=month],input[type=time],input[type=week]{height:2.5rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;position:relative}input[type=date]:before,input[type=datetime-local]:before,input[type=month]:before,input[type=time]:before,input[type=week]:before{position:absolute;right:0;top:0;background-image:var(--ok-down-0);background-repeat:no-repeat;background-position:right .2em top 50%;background-size:2em auto;width:2.5rem;height:calc(2.5rem - 2px);content:""}input[type=date]:disabled:before,input[type=datetime-local]:disabled:before,input[type=month]:disabled:before,input[type=time]:disabled:before,input[type=week]:disabled:before{background-image:var(--ok-down-1)}input::-webkit-calendar-picker-indicator{positi on:absolute;top:0;right:0;background-color:t! ransparen! t;cursor:pointer;padding:0;width:2.5rem;height:calc(2.5rem - 2px);content:"";opacity:0}input[type=range]{overflow:visible;line-height:inherit;font-family:inherit;-webkit-appearance:none;-moz-appearance:none;appearance:none;margin:0;outline:none;cursor:pointer;padding:0;vertical-align:middle;border:none;min-height:2rem;background-color:transparent}input[type=range]::-webkit-slider-runnable-track{cursor:pointer;-webkit-appearance:none;border-radius:var(--ok-br);border:var(--ok-b-0);background-color:var(--ok-bg-1);background-image:linear-gradient(var(--ok-bg-1),var(--ok-bg-1));width:100%;height:.5rem;color:transparent;box-sizing:border-box;position:relative}input[type=range]::-moz-range-track{cursor:pointer;-moz-appearance:none;border-radius:var(--ok-br);border:var(--ok-b-0);background-color:var(--ok-bg-1);background-image:linear-gradient(var(--ok-bg-1),var(--ok-bg-1));width:100%;height:.5rem;color:transparent;box-sizing:border-box}input[type=range]::-ms-track{cursor:pointer;-ms-appear ance:none;border-radius:var(--ok-br);border:var(--ok-b-0);background-color:var(--ok-bg-1);background-image:linear-gradient(var(--ok-bg-1),var(--ok-bg-1));width:100%;height:.5rem;color:transparent;box-sizing:border-box}input[type=range]::-ms-fill-lower{background:transparent}input[type=range]::-webkit-slider-thumb{cursor:pointer;-webkit-appearance:none;border-radius:50%;background-color:var(--ok-accent-0);width:1.5rem;height:1.5rem;margin-top:calc(-.5rem - 1px)}input[type=range]::-moz-range-thumb{cursor:pointer;-moz-appearance:none;border:none;border-radius:50%;background-color:var(--ok-accent-0);width:1.5rem;height:1.5rem}input[type=range]::-ms-thumb{cursor:pointer;-ms-appearance:none;border-radius:50%;background-color:var(--ok-accent-0);width:1.5rem;height:1.5rem;transform:translateY(.25rem)}input[type=range]:focus:not(:disabled)::-webkit-slider-thumb{background-color:var(--ok-accent-1)}input[type=range]:focus:not(:disabled)::-moz-range-thumb{background-color:var(--ok-accent-1)}inp ut[type=range]:focus:not(:disabled)::-ms-thu! mb{backgr! ound-color:var(--ok-accent-1)}input[type=range]:disabled{cursor:default}input[type=range]:disabled::-webkit-slider-runnable-track{cursor:default}input[type=range]:disabled::-moz-range-track{cursor:default}input[type=range]:disabled::-ms-track{cursor:default}input[type=range]:disabled::-webkit-slider-thumb{background-color:var(--ok-bg-2);cursor:default}input[type=range]:disabled::-moz-range-thumb{background-color:var(--ok-bg-2);cursor:default}input[type=range]:disabled::-ms-thumb{background-color:var(--ok-bg-2);cursor:default}select{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:var(--ok-b-0);border-radius:var(--ok-br);background-color:var(--ok-bg-0);min-height:2.5rem;color:var(--ok-tc-0)}select:not([multiple]){background-image:var(--ok-down-0);background-repeat:no-repeat,repeat;background-position:right .2em top 50%;background-size:2em auto;padding-right:2.5em;height:2.5rem}select::-ms-expand{display:none}select:not([multiple]):disabled{background-image:var(--ok -down-1);background-color:var(--ok-bg-1);cursor:default}select[multiple]{border-radius:var(--ok-br)}select[multiple]:disabled{background-color:var(--ok-bg-1)}select[multiple] option{color:var(--ok-t-)}select[multiple]:disabled option{color:var(--ok-tc-2)}textarea{padding:var(--ok-s-2);resize:vertical;background:var(--ok-bg-0);border:var(--ok-b-0);border-radius:var(--ok-br);color:var(--ok-tc-0);min-height:calc(2.5rem - 2px);min-width:25ch}button,input[type=button],input[type=reset],input[type=submit]{display:inline-block;background-color:var(--ok-accent-0);border-radius:var(--ok-br);color:#fff;font-weight:var(--ok-fw-1);height:2.5rem;border:none;padding:var(--ok-s-2) var(--ok-s-3);white-space:nowrap;min-width:auto}input::-webkit-file-upload-button{display:inline-block;background-color:var(--ok-accent-0);border-radius:var(--ok-br);color:#fff;font-weight:var(--ok-fw-1);height:2.5rem;border:none;padding:var(--ok-s-2) var(--ok-s-3);white-space:nowrap}input:disabled::-webkit-file-upload-b utton{cursor:default;opacity:.5}button,input! [type=but! ton],input[type=reset],input[type=submit]{cursor:pointer}input:not(:disabled)::-webkit-file-upload-button{cursor:pointer}button:disabled,input[type=button]:disabled,input[type=reset]:disabled,input[type=submit]:disabled{cursor:default;opacity:.5;background-color:var(--ok-accent-0)}button:focus:not(:disabled),input[type=button]:focus:not(:disabled),input[type=reset]:focus:not(:disabled),input[type=submit]:focus:not(:disabled){background-color:var(--ok-accent-1)}input:not(:disabled):focus::-webkit-file-upload-button{background-color:var(--ok-accent-1)}table{border-collapse:collapse;display:table;margin-left:auto;margin-right:auto;white-space:nowrap}tfoot,thead{border:var(--ok-b-0)}thead{position:-webkit-sticky;position:sticky;top:0}tfoot tr,thead tr{background-color:var(--ok-bg-1);font-size:var(--ok-fs-5);text-transform:uppercase;color:var(--ok-tc-0)}td,th{border:var(--ok-b-0) 0;text-align:left;padding:.5rem}td{white-space:normal;max-width:20ch}tr{border:var(--ok-b-0)}table caption{fo nt-size:var(--ok-fs-4);font-weight:var(--ok-fw-3);padding:.5rem}code,samp{padding:.2em .4em;color:var(--ok-tc-code)}code,pre,samp{font-family:var(--ok-mono);font-size:87.5%;line-height:var(--ok-lh-body);background-color:var(--ok-bg-1);border-radius:var(--ok-br);text-transform:none}pre{padding:var(--ok-s-3);white-space:pre;overflow-x:auto}pre,var{color:var(--ok-tc-0)}var{font-family:var(--ok-mono);font-style:normal}code pre,pre code{background:inherit;font-size:inherit;color:inherit;border:0;padding:0;margin:0}code pre{display:inline}kbd{background-color:var(--ok-bg-1);border:var(--ok-b-0);border-radius:var(--ok-br);border-bottom:2px solid var(--ok-bg-2);padding:var(--ok-s-1);font-family:var(--ok-sans);color:var(--ok-tc-0)}a{text-decoration:none;font-weight:var(--ok-fw-1)}a,a:visited,a code,a mark,a samp{color:var(--ok-tc-accent)}ol,ul{padding-left:var(--ok-s-5)}nav ul{text-decoration:none;padding-left:0}nav ul li{display:inline;margin-right:1em}li p{margin-bottom:0}li,li p+p{margin- top:.5em}audio,img,video{margin-left:auto;ma! rgin-righ! t:auto}img{border-radius:var(--ok-br)}figure>img:not(:last-child){margin-bottom:var(--ok-s-1)}figure>figcaption{text-align:center}figcaption,time{font-size:var(--ok-fs-5);color:var(--ok-tc-1)}mark{padding:.2em .4em;background:var(--ok-t-hl);color:#000;border-radius:var(--ok-br)}iframe{border:var(--ok-b-0);border-radius:var(--ok-br);width:100%}hr{border:none;border-bottom:var(--ok-b-0)}footer{font-size:var(--ok-fs-5)}blockquote,footer{color:var(--ok-tc-1)}blockquote{position:relative;margin-left:0;margin-right:0;padding-left:var(--ok-s-5)}blockquote:before{position:absolute;height:100%;content:"";width:4px;left:0;border-radius:var(--ok-br);background-color:var(--ok-bg-1)}dd{padding-left:var(--ok-s-5)}abbr{cursor:help}@media (hover:hover){a:hover{text-decoration:underline}input:hover:not(:disabled):not(:focus):not([type=submit]):not([type=button]):not([type=reset]):not([type=range]),select:hover:not(:disabled):not(:focus),textarea:hover:not(:disabled):not(:focus){border:var(--ok-b-1)} input[type=range]:hover:not(:disabled)::-webkit-slider-runnable-track{border:var(--ok-b-1)}input[type=range]:hover:not(:disabled)::-moz-range-track{border:var(--ok-b-1)}input[type=range]:hover:not(:disabled)::-ms-track{border:var(--ok-b-1)}select:not([multiple]):not(:disabled):hover{cursor:pointer}button:hover:not(:disabled),input[type=button]:hover:not(:disabled),input[type=reset]:hover:not(:disabled),input[type=submit]:hover:not(:disabled){background-color:var(--ok-accent-1)}input:not(:disabled):hover::-webkit-file-upload-button{background-color:var(--ok-accent-1)}} \ No newline at end of file diff --git a/contrib/expat/doc/reference.html b/contrib/expat/doc/reference.html index 8b0d47d6dd7b..898f03a3364d 100644 --- a/contrib/expat/doc/reference.html +++ b/contrib/expat/doc/reference.html @@ -14,11 +14,13 @@ Copyright (c) 2000 Clark Cooper Copyright (c) 2000-2004 Fred L. Drake, Jr. Copyright (c) 2002-2012 Karl Waclawek - Copyright (c) 2017-2022 Sebastian Pipping + Copyright (c) 2017-2024 Sebastian Pipping Copyright (c) 2017 Jakub Wilk Copyright (c) 2021 Tomas Korbar Copyright (c) 2021 Nicolas Cavallari Copyright (c) 2022 Thijs Schreijer + Copyright (c) 2023 Hanno Böck + Copyright (c) 2023 Sony Corporation / Snild Dolkow Licensed under the MIT license: Permission is hereby granted, free of charge, to any person obtaining @@ -50,7 +52,7 @@

The Expat XML Parser - Release 2.5.0 + Release 2.6.0

@@ -68,11 +70,11 @@ Working Group at W3C that produced the XML specification.

This is free software, licensed under the MIT/X Consortium license. You may download it -from the Expat home page. +from the Expat home page.

The bulk of this document was originally commissioned as an article -by XML.com. They graciously allowed +by XML.com. They graciously allowed Clark Cooper to retain copyright and to distribute it with Expat. This version has been substantially extended to include documentation on features which have been added since the original article was @@ -151,10 +153,11 @@ interface.

  • - Billion Laughs Attack Protection + Attack Protection
  • Miscellaneous Functions @@ -305,7 +308,7 @@ shoveling the document to the parser so that it can do its work.

    The Expat distribution comes as a compressed (with GNU gzip) tar file. You may download the latest version from Source Forge. After +"https://sourceforge.net/projects/expat/" >Source Forge. After unpacking this, cd into the directory. Then follow either the Win32 directions or Unix directions below.

    @@ -359,37 +362,64 @@ and the definition of character types in the case of XML_UNICODE_WCHAR_T. The symbols are:

    -
    XML_DTD
    +
    XML_GE
    +
    +Added in Expat 2.6.0. +Include support for +general entities +(syntax &e1; to reference and +syntax <!ENTITY e1 'value1'> (an internal general entity) or +<!ENTITY e2 SYSTEM 'file2'> (an external general entity) to declare). +With XML_GE enabled, general entities will be replaced by their declared replacement text; +for this to work for external general entities, in addition an +XML_ExternalEntityRefHandler must be set using +XML_SetExternalEntityRefHandler. +Also, enabling XML_GE makes +the functions +XML_SetBillionLaughsAttackProtectionMaximumAmplification and + +XML_SetBillionLaughsAttackProtectionActivationThreshold available. +
    +With XML_GE disabled, Expat has a smaller memory footprint and can be faster, but will +not load external general entities and will replace all general entities +(except the predefined five: +amp, apos, gt, lt, quot) +with a self-reference: +for example, referencing an entity e1 via &e1; will be replaced +by text &e1;. +
    + +
    XML_DTD
    Include support for using and reporting DTD-based content. If this is defined, default attribute values from an external DTD subset are reported and attribute value normalization occurs based on the type of attributes defined in the external subset. Without this, Expat has a smaller memory footprint and can be faster, but will -not load external entities or process conditional sections. If defined, makes +not load external parameter entities or process conditional sections. If defined, makes the functions XML_SetBillionLaughsAttackProtectionMaximumAmplification and XML_SetBillionLaughsAttackProtectionActivationThreshold available.
    -
    XML_NS
    +
    XML_NS
    When defined, support for the Namespaces in XML +"https://www.w3.org/TR/REC-xml-names/" >Namespaces in XML specification is included.
    -
    XML_UNICODE
    +
    XML_UNICODE
    When defined, character data reported to the application is encoded in UTF-16 using wide characters of the type XML_Char. This is implied if XML_UNICODE_WCHAR_T is defined.
    -
    XML_UNICODE_WCHAR_T
    +
    XML_UNICODE_WCHAR_T
    If defined, causes the XML_Char character type to be defined using the wchar_t type; otherwise, unsigned short is used. Defining this implies XML_UNICODE.
    -
    XML_LARGE_SIZE
    +
    XML_LARGE_SIZE
    If defined, causes the XML_Size and XML_Index integer types to be at least 64 bits in size. This is intended to support processing of very large input streams, where the return values of @@ -399,23 +429,23 @@ processing of very large input streams, where the return values of could overflow. It may not be supported by all compilers, and is turned off by default.
    -
    XML_CONTEXT_BYTES
    +
    XML_CONTEXT_BYTES
    The number of input bytes of markup context which the parser will ensure are available for reporting via XML_GetInputContext. This is -normally set to 1024, and must be set to a positive integer. If this -is not defined, the input context will not be available and XML_GetInputContext will -always report NULL. Without this, Expat has a smaller memory +always report NULL. Without this, Expat has a smaller memory footprint and can be faster.
    -
    XML_STATIC
    +
    XML_STATIC
    On Windows, this should be set if Expat is going to be linked statically with the code that calls it; this is required to get all the right MSVC magic annotations correct. This is ignored on other platforms.
    -
    XML_ATTR_INFO
    +
    XML_ATTR_INFO
    If defined, makes the additional function XML_GetAttributeInfo available for reporting attribute byte offsets.
    @@ -669,8 +699,9 @@ function. The StartNamespaceDeclHandler is called prior to the start tag handler and the EndNamespaceDeclHandler is called after the corresponding end tag that ends the namespace's scope. The namespace start handler gets passed the prefix and URI for the namespace. For a -default namespace declaration (xmlns='...'), the prefix will be null. -The URI will be null for the case where the default namespace is being +default namespace declaration (xmlns='...'), the prefix will be +NULL. +The URI will be NULL for the case where the default namespace is being unset. The namespace end handler just gets the prefix for the closing scope.

    @@ -799,7 +830,7 @@ has already been passed into the parser. Applications for this include

      -
    • Supporting the Supporting the XInclude specification.
    • Delaying further processing until additional information is @@ -947,16 +978,20 @@ XML_Parser XMLCALL XML_ParserCreate(const XML_Char *encoding);
      -Construct a new parser. If encoding is non-null, it specifies a +

      +Construct a new parser. If encoding is non-NULL, it specifies a character encoding to use for the document. This overrides the document encoding declaration. There are four built-in encodings: +

      • US-ASCII
      • UTF-8
      • UTF-16
      • ISO-8859-1
      +

      Any other value will invoke a call to the UnknownEncodingHandler. +

      XML_ParserCreateNS

      @@ -1003,9 +1038,9 @@ typedef struct {

      Construct a new parser using the suite of memory handling functions -specified in ms. If ms is NULL, then use the +specified in ms. If ms is NULL, then use the standard set of memory management functions. If sep is -non NULL, then namespace processing is enabled in the created parser +non-NULL, then namespace processing is enabled in the created parser and the character pointed at by sep is used as the separator between the namespace URI and the local part of the name.

      @@ -1077,6 +1112,11 @@ exceed the maximum integer value. Input data at the end of a buffer will remain unprocessed if it is part of an XML token for which the end is not part of that buffer.

      +

      The application must make a concluding +XML_Parse or +XML_ParseBuffer call +with isFinal set to XML_TRUE.

      +

      XML_Parse

       enum XML_Status XMLCALL
      @@ -1092,17 +1132,50 @@ enum XML_Status {
       };
       
      +

      Parse some more of the document. The string s is a buffer containing part (or perhaps all) of the document. The number of bytes of s that are part of the document is indicated by len. This means -that s doesn't have to be null terminated. It also means that +that s doesn't have to be null-terminated. It also means that if len is larger than the number of bytes in the block of memory that s points at, then a memory fault is likely. The isFinal parameter informs the parser that this is the last piece of the document. Frequently, the last piece is empty (i.e. len is zero.) +

      + +

      If a parse error occurred, it returns XML_STATUS_ERROR. Otherwise it returns XML_STATUS_OK value. +Note that regardless of the return value, there is no guarantee that all +provided input has been parsed; only after the +concluding call will all handler callbacks and parsing errors have +happened. +

      + +

      +Simplified, XML_Parse can be considered a convenience wrapper +that is pairing calls +to XML_GetBuffer +and XML_ParseBuffer +(when Expat is built with macro XML_CONTEXT_BYTES +defined to a positive value, which is both common and default). +XML_Parse is then functionally equivalent to calling +XML_GetBuffer, +memcpy, and +XML_ParseBuffer. +

      + +

      +To avoid double copying of the input, direct use of functions +XML_GetBuffer and +XML_ParseBuffer is advised +for most production use, e.g. +if you're using read or similar functionality to fill your +buffers, fill directly into the buffer from +XML_GetBuffer, +then parse with XML_ParseBuffer. +

      XML_ParseBuffer

      @@ -1128,8 +1201,8 @@ XML_GetBuffer(XML_Parser p,
      Obtain a buffer of size len to read a piece of the document -into. A NULL value is returned if Expat can't allocate enough memory for -this buffer. A NULL value may also be returned if len is zero. +into. A NULL value is returned if Expat can't allocate enough memory for +this buffer. A NULL value may also be returned if len is zero. This has to be called prior to every call to XML_ParseBuffer. A typical use would look like this: @@ -1275,7 +1348,7 @@ typedef struct {

      Returns status of parser with respect to being initialized, parsing, finished, or suspended, and whether the final buffer is being processed. The status parameter must not be -NULL.

      +NULL.

      New in Expat 1.95.8.

      @@ -1290,7 +1363,7 @@ to ignore all text not descended from a para element. One way it could do this is to set the character handler when a para start tag is seen, and unset it for the corresponding end tag.

      -

      A handler may be unset by providing a NULL pointer to the +

      A handler may be unset by providing a NULL pointer to the appropriate handler setter. None of the handler setting functions have a return value.

      @@ -1318,7 +1391,7 @@ typedef void handler as a pointer to a vector of char pointers. Each attribute seen in a start (or empty) tag occupies 2 consecutive places in this vector: the attribute name followed by the attribute value. These pairs are terminated -by a null pointer.

      +by a NULL pointer.

      Note that an empty tag generates a call to both start and end handlers (in that order).

  • @@ -1368,7 +1441,7 @@ is NOT null-terminated. You have to use the length argument to deal with the end of the string. A single block of contiguous text free of markup may still result in a sequence of calls to this handler. In other words, if you're searching for a pattern in the text, it may -be split across calls to this handler. Note: Setting this handler to NULL +be split across calls to this handler. Note: Setting this handler to NULL may NOT immediately terminate call-backs if the parser is currently processing such a single block of contiguous markup-free text, as the parser will continue calling back until the end of the block is reached.

    @@ -1526,16 +1599,16 @@ the format expected by the context argument to XML_ExternalEntityParserCreate. code is valid only until the handler returns, so if the referenced entity is -to be parsed later, it must be copied. context is NULL +to be parsed later, it must be copied. context is NULL only when the entity is a parameter entity, which is how one can differentiate between general and parameter entities.

    The base parameter is the base to use for relative system identifiers. It is set by XML_SetBase and may be NULL. The +href="#XML_SetBase">XML_SetBase and may be NULL. The publicId parameter is the public id given in the entity -declaration and may be NULL. systemId is the system -identifier specified in the entity declaration and is never NULL.

    +declaration and may be NULL. systemId is the system +identifier specified in the entity declaration and is never NULL.

    There are a couple of ways in which this handler differs from others. First, this handler returns a status indicator (an @@ -1564,10 +1637,10 @@ XML_SetExternalEntityRefHandlerArg(XML_Parser p,

    Set the argument passed to the ExternalEntityRefHandler. If -arg is not NULL, it is the new value passed to the +arg is not NULL, it is the new value passed to the handler set using XML_SetExternalEntityRefHandler; if arg is -NULL, the argument passed to the handler function will be the parser +NULL, the argument passed to the handler function will be the parser object itself.

    Note: @@ -1650,14 +1723,14 @@ value is -1, then that byte is invalid as the initial byte in a sequence. If the value is -n, where n is an integer > 1, then n is the number of bytes in the sequence and the actual conversion is accomplished by a call to the function pointed at by convert. This function may return -1 -if the sequence itself is invalid. The convert pointer may be null if +if the sequence itself is invalid. The convert pointer may be NULL if there are only single byte codes. The data parameter passed to the convert function is the data pointer from XML_Encoding. The string s is NOT null-terminated and points at the sequence of bytes to be converted.

    The function pointed at by release is called by the -parser when it is finished with the encoding. It may be NULL.

    +parser when it is finished with the encoding. It may be NULL.

    @@ -1724,8 +1797,8 @@ typedef void

    Sets a handler that is called for XML declarations and also for text declarations discovered in external entities. The way to -distinguish is that the version parameter will be NULL -for text declarations. The encoding parameter may be NULL +distinguish is that the version parameter will be NULL +for text declarations. The encoding parameter may be NULL for an XML declaration. The standalone argument will contain -1, 0, or 1 indicating respectively that there was no standalone parameter in the declaration, that it was given as no, or @@ -1749,7 +1822,7 @@ typedef void

    Set a handler that is called at the start of a DOCTYPE declaration, before any external or internal subset is parsed. Both sysid -and pubid may be NULL. The has_internal_subset +and pubid may be NULL. The has_internal_subset will be non-zero if the DOCTYPE declaration has an internal subset.

    @@ -1831,7 +1904,7 @@ around and freed at a later stage.

    XML_Content nodes. If type equals XML_CTYPE_EMPTY or XML_CTYPE_ANY, then quant will be XML_CQUANT_NONE, and the other -fields will be zero or NULL. If type is +fields will be zero or NULL. If type is XML_CTYPE_MIXED, then quant will be XML_CQUANT_NONE or XML_CQUANT_REP and *** 32725 LINES SKIPPED *** From nobody Wed Feb 21 06:58:04 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TfnCx2dVpz5BcNd; Wed, 21 Feb 2024 06:58:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TfnCx1W56z4sqL; Wed, 21 Feb 2024 06:58:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708498685; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6ShtgyECIWZV8Hq00nerN4Bua3lrntGAk/LFJSiSA5k=; b=jrXQ2NXlccaNlcnGdhdJVrnPeSyjaPFIQ+bemHDdtvRADKh1PTVe1ts8aDJRmXraB5JYxC GlANQgVbS5GqihPWR4JCuUX/weVUuvkYYbxH5MvhpSbCRLOfn1k5njyK6Zr+9VSFV2f7jp jMEfBTsRQAI2TvNwuAVPn4rpxCYp3g4J1Z30N/5ADDcvojR44t9N3Ll46FkVB0oScT+Pl+ 4UfJvsxcibJVZsxGJkKHRAX82LxAl4VdaqaaU7FVnbMwJua0DeJgOvBj2NAKb1R2KWXZ2p I6XVjpcXH/JLKT9rguZJ0JbHnmRadTgK+gt8VwB3bhTGTy+FHeW8oVZszN2hJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708498685; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6ShtgyECIWZV8Hq00nerN4Bua3lrntGAk/LFJSiSA5k=; b=ku5I+ymY1lLNjX1HsfsrqWp8d6Vf0AK7WGkbhd4YVr8hKTWcXNVQj9uQ+Bi4y7Adw1m46x 3F3EFUgfF2OmLI1MunfnGIsMHA5VJXkLZZt1SYyWq+g6+totwsmGK5tfHAaK2xoOofwWX2 nsxlvYtW6sttoyL88K+kMUz5BG9pEry5PnHc5lmqFoDtkTd/DYzio9mgx+a20fvBrMLfD1 2OJv712kmB7g6EwdgIKzZ5DsepDLnLnkKc/e+ytJVz/+T8TZsSXQQJE8WT4gmVFDYFCOoI wL0FMmT/Y4Fitt1tA+5anKJpY7XPYgsgA6ATyMMjzi8e4xfqIWTOncRjwuugVA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708498685; a=rsa-sha256; cv=none; b=AamY9bTjIu51yh8JxzxTqQUArmcH5iywa0S7JZ3rjL4hRazEyjXc05kXHxISkhQVXBTadq hjmrbyNQAjZa45xp1pAP0YqEjSscDysQ+HvxWHDZtpnkT/Th0eaHXTA5uKVduWnFRiMYSq Tr2fl+No9+sjwHqpEXYUbObyJ3Vr7S6bDkK9NCJ+3jOJq9Y2EJkb+ocbVQ2+CanTXIKEGg 6Rv9STk00a5xSOwoz8wMaqVgky1vY+gWHlG7xBGXnVbFpW+psTX4fJgc9MBFSawI4OcZL6 zKuPtz8VKw3FVcejb9//rvvEYRk6u6rj3y6N+YMoeQyeb/mOfnwo8x8wM/LLhA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TfnCx0ZC9zsJD; Wed, 21 Feb 2024 06:58:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41L6w5oW057550; Wed, 21 Feb 2024 06:58:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41L6w459057547; Wed, 21 Feb 2024 06:58:04 GMT (envelope-from git) Date: Wed, 21 Feb 2024 06:58:04 GMT Message-Id: <202402210658.41L6w459057547@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: 4b79ff18c3b5 - stable/14 - MFC: MFV: expat 2.6.0. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 4b79ff18c3b5ea2e3fc2f50569d5cda9f74b8a94 Auto-Submitted: auto-generated The branch stable/14 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=4b79ff18c3b5ea2e3fc2f50569d5cda9f74b8a94 commit 4b79ff18c3b5ea2e3fc2f50569d5cda9f74b8a94 Author: Xin LI AuthorDate: 2024-02-17 21:56:56 +0000 Commit: Xin LI CommitDate: 2024-02-21 06:52:29 +0000 MFC: MFV: expat 2.6.0. (cherry picked from commit 4543ef516683042d46f3bd3bb8a4f3f746e00499) --- contrib/expat/Changes | 118 +- contrib/expat/Makefile.am | 10 +- contrib/expat/Makefile.in | 22 +- contrib/expat/README.md | 7 +- contrib/expat/configure.ac | 43 +- contrib/expat/doc/Makefile.in | 10 +- contrib/expat/doc/ok.min.css | 4 +- contrib/expat/doc/reference.html | 222 +- contrib/expat/doc/xmlwf.1 | 24 +- contrib/expat/doc/xmlwf.xml | 50 +- contrib/expat/examples/Makefile.am | 9 +- contrib/expat/examples/Makefile.in | 48 +- contrib/expat/examples/element_declarations.c | 234 + contrib/expat/expat_config.h.in | 8 +- contrib/expat/fuzz/xml_parse_fuzzer.c | 53 +- contrib/expat/fuzz/xml_parsebuffer_fuzzer.c | 68 +- contrib/expat/lib/Makefile.in | 10 +- contrib/expat/lib/expat.h | 28 +- contrib/expat/lib/internal.h | 8 +- contrib/expat/lib/siphash.h | 10 +- contrib/expat/lib/xmlparse.c | 558 +- contrib/expat/lib/xmlrole.c | 6 +- contrib/expat/lib/xmlrole.h | 6 +- contrib/expat/lib/xmltok.c | 29 +- contrib/expat/lib/xmltok.h | 8 +- contrib/expat/lib/xmltok_impl.c | 2 +- contrib/expat/tests/Makefile.am | 61 +- contrib/expat/tests/Makefile.in | 261 +- contrib/expat/tests/acc_tests.c | 396 + contrib/expat/tests/acc_tests.h | 56 + contrib/expat/tests/acc_tests_cxx.cpp | 32 + contrib/expat/tests/alloc_tests.c | 2127 ++++ contrib/expat/tests/alloc_tests.h | 56 + contrib/expat/tests/alloc_tests_cxx.cpp | 32 + contrib/expat/tests/basic_tests.c | 6076 +++++++++ contrib/expat/tests/basic_tests.h | 56 + contrib/expat/tests/basic_tests_cxx.cpp | 32 + contrib/expat/tests/benchmark/Makefile.in | 10 +- contrib/expat/tests/benchmark/benchmark.c | 14 +- contrib/expat/tests/chardata.c | 16 +- contrib/expat/tests/chardata_cxx.cpp | 32 + contrib/expat/tests/common.c | 325 + contrib/expat/tests/common.h | 162 + contrib/expat/tests/common_cxx.cpp | 32 + contrib/expat/tests/dummy.c | 261 + contrib/expat/tests/dummy.h | 150 + contrib/expat/tests/dummy_cxx.cpp | 32 + contrib/expat/tests/handlers.c | 1932 +++ contrib/expat/tests/handlers.h | 595 + contrib/expat/tests/handlers_cxx.cpp | 32 + contrib/expat/tests/memcheck.c | 21 +- contrib/expat/tests/memcheck_cxx.cpp | 32 + contrib/expat/tests/minicheck.c | 58 +- contrib/expat/tests/minicheck.h | 79 +- contrib/expat/tests/minicheck_cxx.cpp | 32 + contrib/expat/tests/misc_tests.c | 523 + contrib/expat/tests/misc_tests.h | 56 + contrib/expat/tests/misc_tests_cxx.cpp | 32 + contrib/expat/tests/ns_tests.c | 754 ++ contrib/expat/tests/ns_tests.h | 56 + contrib/expat/tests/ns_tests_cxx.cpp | 32 + contrib/expat/tests/nsalloc_tests.c | 1537 +++ contrib/expat/tests/nsalloc_tests.h | 56 + contrib/expat/tests/nsalloc_tests_cxx.cpp | 32 + contrib/expat/tests/runtests.c | 12479 +------------------ .../tests/{runtestspp.cpp => runtests_cxx.cpp} | 4 +- contrib/expat/tests/structdata.c | 37 +- contrib/expat/tests/structdata_cxx.cpp | 32 + contrib/expat/xmlwf/Makefile.in | 10 +- contrib/expat/xmlwf/readfilemap.c | 21 +- contrib/expat/xmlwf/xmlfile.c | 16 +- contrib/expat/xmlwf/xmlfile.h | 4 +- contrib/expat/xmlwf/xmlwf.c | 156 +- contrib/expat/xmlwf/xmlwf_helpgen.py | 31 +- lib/libexpat/expat_config.h | 16 +- lib/libexpat/libbsdxml.3 | 4 +- 76 files changed, 17368 insertions(+), 13115 deletions(-) diff --git a/contrib/expat/Changes b/contrib/expat/Changes index e67171056950..a7d4caf9ac81 100644 --- a/contrib/expat/Changes +++ b/contrib/expat/Changes @@ -2,6 +2,120 @@ NOTE: We are looking for help with a few things: https://github.com/libexpat/libexpat/labels/help%20wanted If you can help, please get in touch. Thanks! +Release 2.6.0 Tue February 6 2024 + Security fixes: + #789 #814 CVE-2023-52425 -- Fix quadratic runtime issues with big tokens + that can cause denial of service, in partial where + dealing with compressed XML input. Applications + that parsed a document in one go -- a single call to + functions XML_Parse or XML_ParseBuffer -- were not affected. + The smaller the chunks/buffers you use for parsing + previously, the bigger the problem prior to the fix. + Backporters should be careful to no omit parts of + pull request #789 and to include earlier pull request #771, + in order to not break the fix. + #777 CVE-2023-52426 -- Fix billion laughs attacks for users + compiling *without* XML_DTD defined (which is not common). + Users with XML_DTD defined have been protected since + Expat >=2.4.0 (and that was CVE-2013-0340 back then). + + Bug fixes: + #753 Fix parse-size-dependent "invalid token" error for + external entities that start with a byte order mark + #780 Fix NULL pointer dereference in setContext via + XML_ExternalEntityParserCreate for compilation with + XML_DTD undefined + #812 #813 Protect against closing entities out of order + + Other changes: + #723 Improve support for arc4random/arc4random_buf + #771 #788 Improve buffer growth in XML_GetBuffer and XML_Parse + #761 #770 xmlwf: Support --help and --version + #759 #770 xmlwf: Support custom buffer size for XML_GetBuffer and read + #744 xmlwf: Improve language and URL clickability in help output + #673 examples: Add new example "element_declarations.c" + #764 Be stricter about macro XML_CONTEXT_BYTES at build time + #765 Make inclusion to expat_config.h consistent + #726 #727 Autotools: configure.ac: Support --disable-maintainer-mode + #678 #705 .. + #706 #733 #792 Autotools: Sync CMake templates with CMake 3.26 + #795 Autotools: Make installation of shipped man page doc/xmlwf.1 + independent of docbook2man availability + #815 Autotools|CMake: Add missing -DXML_STATIC to pkg-config file + section "Cflags.private" in order to fix compilation + against static libexpat using pkg-config on Windows + #724 #751 Autotools|CMake: Require a C99 compiler + (a de-facto requirement already since Expat 2.2.2 of 2017) + #793 Autotools|CMake: Fix PACKAGE_BUGREPORT variable + #750 #786 Autotools|CMake: Make test suite require a C++11 compiler + #749 CMake: Require CMake >=3.5.0 + #672 CMake: Lowercase off_t and size_t to help a bug in Meson + #746 CMake: Sort xmlwf sources alphabetically + #785 CMake|Windows: Fix generation of DLL file version info + #790 CMake: Build tests/benchmark/benchmark.c as well for + a build with -DEXPAT_BUILD_TESTS=ON + #745 #757 docs: Document the importance of isFinal + adjust tests + accordingly + #736 docs: Improve use of "NULL" and "null" + #713 docs: Be specific about version of XML (XML 1.0r4) + and version of C (C99); (XML 1.0r5 will need a sponsor.) + #762 docs: reference.html: Promote function XML_ParseBuffer more + #779 docs: reference.html: Add HTML anchors to XML_* macros + #760 docs: reference.html: Upgrade to OK.css 1.2.0 + #763 #739 docs: Fix typos + #696 docs|CI: Use HTTPS URLs instead of HTTP at various places + #669 #670 .. + #692 #703 .. + #733 #772 Address compiler warnings + #798 #800 Address clang-tidy warnings + #775 #776 Version info bumped from 9:10:8 (libexpat*.so.1.8.10) + to 10:0:9 (libexpat*.so.1.9.0); see https://verbump.de/ + for what these numbers do + + Infrastructure: + #700 #701 docs: Document security policy in file SECURITY.md + #766 docs: Improve parse buffer variables in-code documentation + #674 #738 .. + #740 #747 .. + #748 #781 #782 Refactor coverage and conformance tests + #714 #716 Refactor debug level variables to unsigned long + #671 Improve handling of empty environment variable value + in function getDebugLevel (without visible user effect) + #755 #774 .. + #758 #783 .. + #784 #787 tests: Improve test coverage with regard to parse chunk size + #660 #797 #801 Fuzzing: Improve fuzzing coverage + #367 #799 Fuzzing|CI: Start running OSS-Fuzz fuzzing regression tests + #698 #721 CI: Resolve some Travis CI leftovers + #669 CI: Be robust towards absence of Git tags + #693 #694 CI: Set permissions to "contents: read" for security + #709 CI: Pin all GitHub Actions to specific commits for security + #739 CI: Reject spelling errors using codespell + #798 CI: Enforce clang-tidy clean code + #773 #808 .. + #809 #810 CI: Upgrade Clang from 15 to 18 + #796 CI: Start using Clang's Control Flow Integrity sanitizer + #675 #720 #722 CI: Adapt to breaking changes in GitHub Actions Ubuntu images + #689 CI: Adapt to breaking changes in Clang/LLVM Debian packaging + #763 CI: Adapt to breaking changes in codespell + #803 CI: Adapt to breaking changes in Cppcheck + + Special thanks to: + Ivan Galkin + Joyce Brum + Philippe Antoine + Rhodri James + Snild Dolkow + spookyahell + Steven Garske + and + Clang AddressSanitizer + Clang UndefinedBehaviorSanitizer + codespell + GCC Farm Project + OSS-Fuzz + Sony Mobile + Release 2.5.0 Tue October 25 2022 Security fixes: #616 #649 #650 CVE-2022-43680 -- Fix heap use-after-free after overeager @@ -11,7 +125,7 @@ Release 2.5.0 Tue October 25 2022 arbitrary code execution. Bug fixes: - #612 #645 Fix curruption from undefined entities + #612 #645 Fix corruption from undefined entities #613 #654 Fix case when parsing was suspended while processing nested entities #616 #652 #653 Stop leaking opening tag bindings after a closing tag @@ -318,7 +432,7 @@ Release 2.4.2 Sun December 19 2021 see https://verbump.de/ for what these numbers do Special thanks to: - Dong-hee Na + Donghee Na Joergen Ibsen Kai Pastor diff --git a/contrib/expat/Makefile.am b/contrib/expat/Makefile.am index 37ae3738edd3..9c2259d23e63 100644 --- a/contrib/expat/Makefile.am +++ b/contrib/expat/Makefile.am @@ -6,9 +6,10 @@ # \___/_/\_\ .__/ \__,_|\__| # |_| XML parser # -# Copyright (c) 2017-2021 Sebastian Pipping +# Copyright (c) 2017-2023 Sebastian Pipping # Copyright (c) 2018 KangLin # Copyright (c) 2022 Johnny Jazeix +# Copyright (c) 2023 Sony Corporation / Snild Dolkow # Licensed under the MIT license: # # Permission is hereby granted, free of charge, to any person obtaining @@ -84,7 +85,7 @@ _EXTRA_DIST_WINDOWS = \ win32/expat.iss \ win32/MANIFEST.txt \ win32/README.txt \ - win32/version.rc + win32/version.rc.cmake EXTRA_DIST = \ $(_EXTRA_DIST_CMAKE) \ @@ -131,6 +132,11 @@ buildlib: run-benchmark: $(MAKE) -C tests/benchmark ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/recset.xml 65535 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_attr.xml 4096 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_cdata.xml 4096 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_comment.xml 4096 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_tag.xml 4096 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_text.xml 4096 3 .PHONY: download-xmlts-zip download-xmlts-zip: diff --git a/contrib/expat/Makefile.in b/contrib/expat/Makefile.in index 008c4109b793..f505224f6fa8 100644 --- a/contrib/expat/Makefile.in +++ b/contrib/expat/Makefile.in @@ -22,9 +22,10 @@ # \___/_/\_\ .__/ \__,_|\__| # |_| XML parser # -# Copyright (c) 2017-2021 Sebastian Pipping +# Copyright (c) 2017-2023 Sebastian Pipping # Copyright (c) 2018 KangLin # Copyright (c) 2022 Johnny Jazeix +# Copyright (c) 2023 Sony Corporation / Snild Dolkow # Licensed under the MIT license: # # Permission is hereby granted, free of charge, to any person obtaining @@ -136,6 +137,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/conftools/ax-append-compile-flags.m4 \ $(top_srcdir)/conftools/ax-append-link-flags.m4 \ $(top_srcdir)/conftools/expatcfg-compiler-supports-visibility.m4 \ + $(top_srcdir)/conftools/ax-cxx-compile-stdcxx.m4 \ + $(top_srcdir)/conftools/ax-cxx-compile-stdcxx-11.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -339,6 +342,7 @@ FGREP = @FGREP@ FILECMD = @FILECMD@ FILEMAP = @FILEMAP@ GREP = @GREP@ +HAVE_CXX11 = @HAVE_CXX11@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -358,6 +362,7 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -478,7 +483,7 @@ _EXTRA_DIST_WINDOWS = \ win32/expat.iss \ win32/MANIFEST.txt \ win32/README.txt \ - win32/version.rc + win32/version.rc.cmake EXTRA_DIST = \ $(_EXTRA_DIST_CMAKE) \ @@ -506,7 +511,7 @@ all: expat_config.h .SUFFIXES: am--refresh: Makefile @: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -532,9 +537,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck -$(top_srcdir)/configure: $(am__configure_deps) +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) -$(ACLOCAL_M4): $(am__aclocal_m4_deps) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): @@ -545,7 +550,7 @@ expat_config.h: stamp-h1 stamp-h1: $(srcdir)/expat_config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status expat_config.h -$(srcdir)/expat_config.h.in: $(am__configure_deps) +$(srcdir)/expat_config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ @@ -1092,6 +1097,11 @@ buildlib: run-benchmark: $(MAKE) -C tests/benchmark ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/recset.xml 65535 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_attr.xml 4096 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_cdata.xml 4096 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_comment.xml 4096 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_tag.xml 4096 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_text.xml 4096 3 .PHONY: download-xmlts-zip download-xmlts-zip: diff --git a/contrib/expat/README.md b/contrib/expat/README.md index e5e237fc9496..43c4f4f3dbb3 100644 --- a/contrib/expat/README.md +++ b/contrib/expat/README.md @@ -1,13 +1,14 @@ -[![Run Linux Travis CI tasks](https://github.com/libexpat/libexpat/actions/workflows/linux.yml/badge.svg)](https://github.com/libexpat/libexpat/actions/workflows/linux.yml) +[![Run Linux CI tasks](https://github.com/libexpat/libexpat/actions/workflows/linux.yml/badge.svg)](https://github.com/libexpat/libexpat/actions/workflows/linux.yml) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/libexpat/libexpat?svg=true)](https://ci.appveyor.com/project/libexpat/libexpat) [![Packaging status](https://repology.org/badge/tiny-repos/expat.svg)](https://repology.org/metapackage/expat/versions) [![Downloads SourceForge](https://img.shields.io/sourceforge/dt/expat?label=Downloads%20SourceForge)](https://sourceforge.net/projects/expat/files/) [![Downloads GitHub](https://img.shields.io/github/downloads/libexpat/libexpat/total?label=Downloads%20GitHub)](https://github.com/libexpat/libexpat/releases) -# Expat, Release 2.5.0 +# Expat, Release 2.6.0 -This is Expat, a C library for parsing XML, started by +This is Expat, a C99 library for parsing +[XML 1.0 Fourth Edition](https://www.w3.org/TR/2006/REC-xml-20060816/), started by [James Clark](https://en.wikipedia.org/wiki/James_Clark_%28programmer%29) in 1997. Expat is a stream-oriented XML parser. This means that you register handlers with the parser before starting the parse. These handlers diff --git a/contrib/expat/configure.ac b/contrib/expat/configure.ac index d3642dea5864..a5d1ff9317c8 100644 --- a/contrib/expat/configure.ac +++ b/contrib/expat/configure.ac @@ -11,7 +11,7 @@ dnl Copyright (c) 2000 Clark Cooper dnl Copyright (c) 2000-2005 Fred L. Drake, Jr. dnl Copyright (c) 2001-2003 Greg Stein dnl Copyright (c) 2006-2012 Karl Waclawek -dnl Copyright (c) 2016-2022 Sebastian Pipping +dnl Copyright (c) 2016-2024 Sebastian Pipping dnl Copyright (c) 2017 S. P. Zeidler dnl Copyright (c) 2017 Stephen Groat dnl Copyright (c) 2017-2020 Joe Orton @@ -60,7 +60,7 @@ m4_define([expat_version], m4_ifdef([__gnu__], [esyscmd(conftools/get-version.sh lib/expat.h)], [2.2.x])) -AC_INIT([expat], expat_version, [expat-bugs@libexpat.org]) +AC_INIT([expat], expat_version, [https://github.com/libexpat/libexpat/issues]) m4_undefine([expat_version]) AC_CONFIG_SRCDIR([Makefile.in]) @@ -68,6 +68,7 @@ AC_CONFIG_AUX_DIR([conftools]) AC_CONFIG_MACRO_DIR([m4]) AC_CANONICAL_HOST AM_INIT_AUTOMAKE +AM_MAINTAINER_MODE([enable]) # to allow argument --disable-maintainer-mode dnl @@ -81,9 +82,9 @@ dnl dnl If the API changes incompatibly set LIBAGE back to 0 dnl -LIBCURRENT=9 # sync -LIBREVISION=10 # with -LIBAGE=8 # CMakeLists.txt! +LIBCURRENT=10 # sync +LIBREVISION=0 # with +LIBAGE=9 # CMakeLists.txt! AC_CONFIG_HEADERS([expat_config.h]) AH_TOP([#ifndef EXPAT_CONFIG_H @@ -105,6 +106,9 @@ AC_SUBST(LIBAGE) AC_LANG([C]) AC_PROG_CC_C99 +AS_IF([test "${ac_cv_prog_cc_c99}" = no], + [AC_MSG_ERROR([Expat requires a C99 compiler.])]) + AS_IF([test "$GCC" = yes], [AX_APPEND_COMPILE_FLAGS([-Wall -Wextra], [AM_CFLAGS]) dnl Be careful about adding the -fexceptions option; some versions of @@ -176,6 +180,8 @@ AC_ARG_WITH([tests], [with_tests=yes]) AM_CONDITIONAL([WITH_TESTS], [test x${with_tests} = xyes]) +AS_IF([test x${with_tests} = xyes], + [AX_CXX_COMPILE_STDCXX_11([noext], [mandatory])]) AS_VAR_SET([EXPATCFG_ON_MINGW],[no]) AS_CASE("${host_os}", @@ -202,14 +208,16 @@ AS_IF([test "x${with_libbsd}" != xno], [], [AS_IF([test "x${with_libbsd}" = xyes], [AC_MSG_ERROR([Enforced use of libbsd cannot be satisfied.])])])]) -AC_MSG_CHECKING([for arc4random_buf (BSD or libbsd)]) +AC_MSG_CHECKING([for arc4random_buf (BSD, libbsd or glibc 2.36+)]) AC_LINK_IFELSE([AC_LANG_SOURCE([ - #include /* for arc4random_buf on BSD, for NULL */ #if defined(HAVE_LIBBSD) # include + #else + # include /* for arc4random_buf on BSD */ #endif int main() { - arc4random_buf(NULL, 0U); + char dummy[[123]]; // double brackets for m4 + arc4random_buf(dummy, 0U); return 0; } ])], @@ -217,7 +225,7 @@ AC_LINK_IFELSE([AC_LANG_SOURCE([ AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]) - AC_MSG_CHECKING([for arc4random (BSD, macOS or libbsd)]) + AC_MSG_CHECKING([for arc4random (BSD, macOS, libbsd or glibc 2.36+)]) AC_LINK_IFELSE([AC_LANG_SOURCE([ #if defined(HAVE_LIBBSD) # include @@ -295,6 +303,8 @@ AC_SUBST(FILEMAP) dnl Some basic configuration: AC_DEFINE([XML_NS], 1, [Define to make XML Namespaces functionality available.]) +AC_DEFINE([XML_GE], 1, + [Define as 1/0 to enable/disable support for general entities.]) AC_DEFINE([XML_DTD], 1, [Define to make parameter entity parsing functionality available.]) AC_DEFINE([XML_DEV_URANDOM], 1, @@ -319,9 +329,10 @@ AS_HELP_STRING([--disable-xml-context], AS_IF([test "x${enable_xml_context}" != "xno"], [AS_IF([test "x${enable_xml_context}" = "xyes" \ -o "x${enable_xml_context}" = "x"], - [AS_VAR_SET(enable_xml_context,1024)]) - AC_DEFINE_UNQUOTED([XML_CONTEXT_BYTES], [${enable_xml_context}], - [Define to specify how much context to retain around the current parse point.])]) + [AS_VAR_SET(enable_xml_context,1024)])], + [AS_VAR_SET(enable_xml_context,0)]) +AC_DEFINE_UNQUOTED([XML_CONTEXT_BYTES], [${enable_xml_context}], + [Define to specify how much context to retain around the current parse point, 0 to disable.]) AC_ARG_WITH([docbook], [AS_HELP_STRING([--with-docbook], @@ -345,8 +356,12 @@ AS_IF([test "x${DOCBOOK_TO_MAN}" != x -a "x$with_docbook" != xno], You can also configure using --without-docbook if you can do without a man page for xmlwf.])])]) -AM_CONDITIONAL(WITH_DOCBOOK, [test "x${DOCBOOK_TO_MAN}" != x]) - +dnl This will make sure that a release tarball shipping a pre-rendered xmlwf man page will +dnl get it installed, independent of whether some flavor of docbook2man is available. +dnl This relies on file xmlwf.1 being at least as recent as its source file xmlwf.xml. +AS_IF([test -f "${srcdir}"/doc/xmlwf.1], + [AM_CONDITIONAL(WITH_DOCBOOK, [true])], + [AM_CONDITIONAL(WITH_DOCBOOK, [test "x${DOCBOOK_TO_MAN}" != x])]) dnl Configure CMake file templates dnl NOTE: The *_TRUE variables read here are Automake conditionals diff --git a/contrib/expat/doc/Makefile.in b/contrib/expat/doc/Makefile.in index 7fef3eda1897..18f86be3947b 100644 --- a/contrib/expat/doc/Makefile.in +++ b/contrib/expat/doc/Makefile.in @@ -132,6 +132,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/conftools/ax-append-compile-flags.m4 \ $(top_srcdir)/conftools/ax-append-link-flags.m4 \ $(top_srcdir)/conftools/expatcfg-compiler-supports-visibility.m4 \ + $(top_srcdir)/conftools/ax-cxx-compile-stdcxx.m4 \ + $(top_srcdir)/conftools/ax-cxx-compile-stdcxx-11.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -241,6 +243,7 @@ FGREP = @FGREP@ FILECMD = @FILECMD@ FILEMAP = @FILEMAP@ GREP = @GREP@ +HAVE_CXX11 = @HAVE_CXX11@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -260,6 +263,7 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -351,7 +355,7 @@ EXTRA_DIST = \ all: all-am .SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -375,9 +379,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: $(am__configure_deps) +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/contrib/expat/doc/ok.min.css b/contrib/expat/doc/ok.min.css index 8b5f86e7042c..d324fabb2873 100644 --- a/contrib/expat/doc/ok.min.css +++ b/contrib/expat/doc/ok.min.css @@ -1,2 +1,2 @@ -/*! OK.css v1.0.3 | MIT License | github.com/andrewh0/okcss */@import url("https://rsms.me/inter/inter.css"); -/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus -inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}:root{--ok-sans:"Inter",system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Open Sans","Helvetica Neue","Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Se goe UI Symbol","Noto Color Emoji";--ok-mono:! SFMono-Regular,Menlo,Monaco,Consolas,"Ubuntu Mono","Liberation Mono","Courier New",Courier,monospace;--ok-fw-0:400;--ok-fw-1:600;--ok-fw-2:700;--ok-fw-3:700;--ok-fs-0:2.5rem;--ok-fs-1:2rem;--ok-fs-2:1.5rem;--ok-fs-3:1.25rem;--ok-fs-4:1rem;--ok-fs-5:0.75rem;--ok-br:0.25rem;--ok-s-0:0;--ok-s-1:0.25rem;--ok-s-2:0.5rem;--ok-s-3:1rem;--ok-s-4:1.5rem;--ok-s-5:2rem;--ok-s-6:2.5rem;--ok-lh-body:1.5;--ok-lh-heading:1.25;--ok-t-hl:#ffcf30;--ok-accent-0:#3e67fa;--ok-accent-1:#4788ff;--ok-tc-accent:#3173de;--ok-tc-code:#c23a30;--ok-tc-0:#000;--ok-tc-1:#747474;--ok-tc-2:#848484;--ok-bg-0:#fff;--ok-bg-1:#f0f0f0;--ok-bg-2:#ccc;--ok-b-0:1px solid #cbcbcb;--ok-b-1:1px solid #848484;--ok-down-0:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='8' viewBox='0 0 12 8' width='24' fill='none'%3E%3Cpath d='M6 6l4-4h1v1-1L6 7 1 2h1l4 4z' fill='%23747474'/%3E%3C/svg%3E");--ok-down-1:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='8 ' viewBox='0 0 12 8' width='24' fill='none'%3E%3Cpath d='M6 6l4-4h1v1-1L6 7 1 2h1l4 4z' fill='%23848484'/%3E%3C/svg%3E")}@media (prefers-color-scheme:dark){:root{--ok-tc-accent:#5c9aff;--ok-tc-code:#ed5853;--ok-tc-0:#fff;--ok-tc-1:#ababab;--ok-tc-2:#929292;--ok-bg-0:#000;--ok-bg-1:#212121;--ok-bg-2:#3e3e3e;--ok-b-0:1px solid #747474;--ok-b-1:1px solid #929292;--ok-down-0:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='8' viewBox='0 0 12 8' width='24' fill='none'%3E%3Cpath d='M6 6l4-4h1v1-1L6 7 1 2h1l4 4z' fill='%23ababab'/%3E%3C/svg%3E");--ok-down-1:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='8' viewBox='0 0 12 8' width='24' fill='none'%3E%3Cpath d='M6 6l4-4h1v1-1L6 7 1 2h1l4 4z' fill='%23929292'/%3E%3C/svg%3E")}}*,:after,:before{box-sizing:border-box}*{margin:0;padding:0}html{font-family:var(--ok-sans);line-sizing:normal;line-height:var(--ok-lh-body);font-weight:var(--ok-fw-0);color:var(--ok-tc-0);b ackground-color:var(--ok-bg-0);-webkit-font-! smoothing! :antialiased;-moz-osx-font-smoothing:grayscale;-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;-ms-text-size-adjust:100%;text-size-adjust:100%;text-rendering:optimizeLegibility}@supports (font-variation-settings:normal){html{font-family:Inter var,var(--ok-sans)}}button,input,optgroup,select,textarea{font-family:inherit;line-height:var(--ok-lh-body)}[role=button],button{cursor:pointer}audio,canvas,embed,iframe,img,input,object,select,svg,textarea,video{display:block}img,video{max-width:100%;height:auto}body{padding:var(--ok-s-3);max-width:80ch;margin:auto}h1{font-size:var(--ok-fs-0);margin:0}h2{font-size:var(--ok-fs-1)}h3{font-size:var(--ok-fs-2)}h4{font-size:var(--ok-fs-3)}h5{font-size:var(--ok-fs-4)}h6{font-size:var(--ok-fs-5);text-transform:uppercase;font-weight:var(--ok-fw-1)}h1,h2,h3,h4,h5,h6{line-height:var(--ok-lh-heading);font-weight:var(--ok-fw-3)}p{font-size:var(--ok-fs-4)}small{font-size:var(--ok-fs-5)}b,dt,strong{font-weight:var(--ok-fw-2)}address,article,aside,a udio,blockquote,button,canvas,dd,details,dialog,div,dl,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,img,input,main,nav,object,ol,p,pre,section,select,summary,svg,table,textarea,ul,video{margin-bottom:var(--ok-s-4)}address:last-child,article:last-child,aside:last-child,blockquote:last-child,dd:last-child,details:last-child,dialog:last-child,div:last-child,dl:last-child,dt:last-child,fieldset:last-child,figcaption:last-child,figure:last-child,footer:last-child,form:last-child,h1:last-child,h2:last-child,h3:last-child,h4:last-child,h5:last-child,h6:last-child,header:last-child,hgroup:last-child,hr:last-child,input[type=checkbox],input[type=radio],main:last-child,nav:last-child,ol:last-child,p:last-child,pre:last-child,section:last-child,table:last-child,ul:last-child{margin-bottom:0}fieldset{padding:var(--ok-s-3);border:var(--ok-b-0);border-radius:var(--ok-br)}legend{font-weight:var(--ok-fw-1);text-transform:uppercase;font-size:var(--ok-fs-5)}i nput,select{padding:var(--ok-s-2);background! :var(--ok! -bg-0);border:var(--ok-b-0);border-radius:var(--ok-br);color:var(--ok-tc-0);min-width:25ch}input:disabled,select:disabled,textarea:disabled{color:var(--ok-tc-2)}input::placeholder,textarea::placeholder{color:var(--ok-tc-2)}input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{color:var(--ok-tc-2)}input::-moz-placeholder,textarea::-moz-placeholder{color:var(--ok-tc-2)}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:var(--ok-tc-2)}input::-ms-input-placeholder,textarea::-ms-input-placeholder{color:var(--ok-tc-2)}input::-webkit-clear-button,input::-webkit-inner-spin-button,input::-webkit-search-cancel-button,input::-webkit-search-results-button{display:none}input::-ms-clear,input::-ms-reveal{display:none}input:disabled,textarea:disabled{background-color:var(--ok-bg-1)}input[type=search]{-webkit-appearance:none;-moz-appearance:none;appearance:none}input[type=file]{max-width:300px}input[type=number]{-moz-appearance:textfield}input[type=checkbox],input[type= radio]{display:inline;min-width:auto}input[type=color]{height:2.5rem}input[type=date],input[type=datetime-local],input[type=month],input[type=time],input[type=week]{height:2.5rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;position:relative}input[type=date]:before,input[type=datetime-local]:before,input[type=month]:before,input[type=time]:before,input[type=week]:before{position:absolute;right:0;top:0;background-image:var(--ok-down-0);background-repeat:no-repeat;background-position:right .2em top 50%;background-size:2em auto;width:2.5rem;height:calc(2.5rem - 2px);content:""}input[type=date]:disabled:before,input[type=datetime-local]:disabled:before,input[type=month]:disabled:before,input[type=time]:disabled:before,input[type=week]:disabled:before{background-image:var(--ok-down-1)}input::-webkit-calendar-picker-indicator{position:absolute;top:0;right:0;background-color:transparent;cursor:pointer;padding:0;width:2.5rem;height:calc(2.5rem - 2px);content:"";opacity:0}inp ut[type=range]{overflow:visible;line-height:! inherit;f! ont-family:inherit;-webkit-appearance:none;-moz-appearance:none;appearance:none;margin:0;outline:none;cursor:pointer;padding:0;vertical-align:middle;border:none;min-height:2rem;background-color:transparent}input[type=range]::-webkit-slider-runnable-track{cursor:pointer;-webkit-appearance:none;border-radius:var(--ok-br);border:var(--ok-b-0);background-color:var(--ok-bg-1);background-image:linear-gradient(var(--ok-bg-1),var(--ok-bg-1));width:100%;height:.5rem;color:transparent;box-sizing:border-box;position:relative}input[type=range]::-moz-range-track{cursor:pointer;-moz-appearance:none;border-radius:var(--ok-br);border:var(--ok-b-0);background-color:var(--ok-bg-1);background-image:linear-gradient(var(--ok-bg-1),var(--ok-bg-1));width:100%;height:.5rem;color:transparent;box-sizing:border-box}input[type=range]::-ms-track{cursor:pointer;-ms-appearance:none;border-radius:var(--ok-br);border:var(--ok-b-0);background-color:var(--ok-bg-1);background-image:linear-gradient(var(--ok-bg-1),var(- -ok-bg-1));width:100%;height:.5rem;color:transparent;box-sizing:border-box}input[type=range]::-ms-fill-lower{background:transparent}input[type=range]::-webkit-slider-thumb{cursor:pointer;-webkit-appearance:none;border-radius:50%;background-color:var(--ok-accent-0);width:1.5rem;height:1.5rem;margin-top:calc(-.5rem - 1px)}input[type=range]::-moz-range-thumb{cursor:pointer;-moz-appearance:none;border:none;border-radius:50%;background-color:var(--ok-accent-0);width:1.5rem;height:1.5rem}input[type=range]::-ms-thumb{cursor:pointer;-ms-appearance:none;border-radius:50%;background-color:var(--ok-accent-0);width:1.5rem;height:1.5rem;transform:translateY(.25rem)}input[type=range]:focus:not(:disabled)::-webkit-slider-thumb{background-color:var(--ok-accent-1)}input[type=range]:focus:not(:disabled)::-moz-range-thumb{background-color:var(--ok-accent-1)}input[type=range]:focus:not(:disabled)::-ms-thumb{background-color:var(--ok-accent-1)}input[type=range]:disabled{cursor:default}input[type=range]: disabled::-webkit-slider-runnable-track{curs! or:defaul! t}input[type=range]:disabled::-moz-range-track{cursor:default}input[type=range]:disabled::-ms-track{cursor:default}input[type=range]:disabled::-webkit-slider-thumb{background-color:var(--ok-bg-2);cursor:default}input[type=range]:disabled::-moz-range-thumb{background-color:var(--ok-bg-2);cursor:default}input[type=range]:disabled::-ms-thumb{background-color:var(--ok-bg-2);cursor:default}select{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:var(--ok-b-0);border-radius:var(--ok-br);background-color:var(--ok-bg-0);min-height:2.5rem;color:var(--ok-tc-0)}select:not([multiple]){background-image:var(--ok-down-0);background-repeat:no-repeat,repeat;background-position:right .2em top 50%;background-size:2em auto;padding-right:2.5em;height:2.5rem}select::-ms-expand{display:none}select:not([multiple]):disabled{background-image:var(--ok-down-1);background-color:var(--ok-bg-1);cursor:default}select[multiple]{border-radius:var(--ok-br)}select[multiple]:disabled{background-color: var(--ok-bg-1)}select[multiple] option{color:var(--ok-t-)}select[multiple]:disabled option{color:var(--ok-tc-2)}textarea{padding:var(--ok-s-2);resize:vertical;background:var(--ok-bg-0);border:var(--ok-b-0);border-radius:var(--ok-br);color:var(--ok-tc-0);min-height:calc(2.5rem - 2px);min-width:25ch}button,input[type=button],input[type=reset],input[type=submit]{display:inline-block;background-color:var(--ok-accent-0);border-radius:var(--ok-br);color:#fff;font-weight:var(--ok-fw-1);height:2.5rem;border:none;padding:var(--ok-s-2) var(--ok-s-3);white-space:nowrap;min-width:auto}input::-webkit-file-upload-button{display:inline-block;background-color:var(--ok-accent-0);border-radius:var(--ok-br);color:#fff;font-weight:var(--ok-fw-1);height:2.5rem;border:none;padding:var(--ok-s-2) var(--ok-s-3);white-space:nowrap}input:disabled::-webkit-file-upload-button{cursor:default;opacity:.5}button,input[type=button],input[type=reset],input[type=submit]{cursor:pointer}input:not(:disabled)::-webkit-fil e-upload-button{cursor:pointer}button:disabl! ed,input[! type=button]:disabled,input[type=reset]:disabled,input[type=submit]:disabled{cursor:default;opacity:.5;background-color:var(--ok-accent-0)}button:focus:not(:disabled),input[type=button]:focus:not(:disabled),input[type=reset]:focus:not(:disabled),input[type=submit]:focus:not(:disabled){background-color:var(--ok-accent-1)}input:not(:disabled):focus::-webkit-file-upload-button{background-color:var(--ok-accent-1)}table{border-collapse:collapse;border-radius:var(--ok-br);display:block;max-width:-webkit-fit-content;max-width:-moz-fit-content;max-width:fit-content;margin-left:auto;margin-right:auto;overflow-x:auto;white-space:nowrap}tfoot,thead{border:var(--ok-b-0)}tfoot tr,thead tr{background-color:var(--ok-bg-1);font-size:var(--ok-fs-5);text-transform:uppercase;color:var(--ok-tc-0)}td,th{border:var(--ok-b-0) 0;text-align:left;padding:.5rem}td{white-space:normal;max-width:20ch}tr{border:var(--ok-b-0)}table caption{font-size:var(--ok-fs-4);font-weight:var(--ok-fw-3);padding:.5rem}code,samp {padding:.2em .4em;color:var(--ok-tc-code)}code,pre,samp{font-family:var(--ok-mono);line-height:var(--ok-lh-body);background-color:var(--ok-bg-1);border-radius:var(--ok-br);text-transform:none}pre{padding:var(--ok-s-3);white-space:pre;overflow-x:auto}pre,var{color:var(--ok-tc-0)}var{font-family:var(--ok-mono);font-style:normal}code pre,pre code{background:inherit;font-size:inherit;color:inherit;border:0;padding:0;margin:0}code pre{display:inline}kbd{background-color:var(--ok-bg-1);border:var(--ok-b-0);border-radius:var(--ok-br);border-bottom:2px solid var(--ok-bg-2);padding:var(--ok-s-1);font-family:var(--ok-sans);color:var(--ok-tc-0)}a{text-decoration:none;font-weight:var(--ok-fw-1)}a,a:visited{color:var(--ok-tc-accent)}ol,ul{padding-left:var(--ok-s-5)}nav ul{text-decoration:none;padding-left:0}nav ul li{display:inline;margin-right:1em}audio,img,video{margin-left:auto;margin-right:auto}img{border-radius:var(--ok-br)}figure>img:not(:last-child){margin-bottom:var(--ok-s-1)}figure>fig caption{text-align:center}figcaption,time{fo! nt-size:v! ar(--ok-fs-5);color:var(--ok-tc-1)}mark{padding:.2em .4em;background:var(--ok-t-hl);color:#000;border-radius:var(--ok-br)}iframe{border:var(--ok-b-0);border-radius:var(--ok-br);width:100%}hr{border:none;border-bottom:var(--ok-b-0)}footer{font-size:var(--ok-fs-5)}blockquote,footer{color:var(--ok-tc-1)}blockquote{position:relative;margin-left:0;margin-right:0;padding-left:var(--ok-s-5)}blockquote:before{position:absolute;height:100%;content:"";width:4px;left:0;border-radius:var(--ok-br);background-color:var(--ok-bg-1)}dd{padding-left:var(--ok-s-5)}abbr{cursor:help}@media (hover:hover){a:hover{text-decoration:underline}input:hover:not(:disabled):not(:focus):not([type=submit]):not([type=button]):not([type=reset]):not([type=range]),select:hover:not(:disabled):not(:focus),textarea:hover:not(:disabled):not(:focus){border:var(--ok-b-1)}input[type=range]:hover:not(:disabled)::-webkit-slider-runnable-track{border:var(--ok-b-1)}input[type=range]:hover:not(:disabled)::-moz-range-track{border:va r(--ok-b-1)}input[type=range]:hover:not(:disabled)::-ms-track{border:var(--ok-b-1)}select:not([multiple]):not(:disabled):hover{cursor:pointer}button:hover:not(:disabled),input[type=button]:hover:not(:disabled),input[type=reset]:hover:not(:disabled),input[type=submit]:hover:not(:disabled){background-color:var(--ok-accent-1)}input:not(:disabled):hover::-webkit-file-upload-button{background-color:var(--ok-accent-1)}} \ No newline at end of file +/*! OK.css v1.2.0 | MIT License | github.com/andrewh0/okcss */@import url("https://rsms.me/inter/inter.css"); +/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus -inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}:root{--ok-sans:"Inter",system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Open Sans","Helvetica Neue","Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Se goe UI Symbol","Noto Color Emoji";--ok-mono:! SFMono-Regular,Menlo,Monaco,Consolas,"Ubuntu Mono","Liberation Mono","Courier New",Courier,monospace;--ok-fw-0:400;--ok-fw-1:600;--ok-fw-2:700;--ok-fw-3:700;--ok-fs-0:2.5rem;--ok-fs-1:2rem;--ok-fs-2:1.5rem;--ok-fs-3:1.25rem;--ok-fs-4:1rem;--ok-fs-5:0.75rem;--ok-br:0.25rem;--ok-s-0:0;--ok-s-1:0.25rem;--ok-s-2:0.5rem;--ok-s-3:1rem;--ok-s-4:1.5rem;--ok-s-5:2rem;--ok-s-6:2.5rem;--ok-lh-body:1.5;--ok-lh-heading:1.25;--ok-t-hl:#ffcf30;--ok-accent-0:#3e67fa;--ok-accent-1:#4788ff;--ok-tc-accent:#3173de;--ok-tc-code:#c23a30;--ok-tc-0:#000;--ok-tc-1:#747474;--ok-tc-2:#848484;--ok-bg-0:#fff;--ok-bg-1:#f0f0f0;--ok-bg-2:#ccc;--ok-b-0:1px solid #cbcbcb;--ok-b-1:1px solid #848484;--ok-down-0:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='8' viewBox='0 0 12 8' width='24' fill='none'%3E%3Cpath d='M6 6l4-4h1v1-1L6 7 1 2h1l4 4z' fill='%23747474'/%3E%3C/svg%3E");--ok-down-1:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='8 ' viewBox='0 0 12 8' width='24' fill='none'%3E%3Cpath d='M6 6l4-4h1v1-1L6 7 1 2h1l4 4z' fill='%23848484'/%3E%3C/svg%3E")}@media (prefers-color-scheme:dark){:root{--ok-tc-accent:#5c9aff;--ok-tc-code:#ed5853;--ok-tc-0:#fff;--ok-tc-1:#ababab;--ok-tc-2:#929292;--ok-bg-0:#000;--ok-bg-1:#212121;--ok-bg-2:#3e3e3e;--ok-b-0:1px solid #747474;--ok-b-1:1px solid #929292;--ok-down-0:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='8' viewBox='0 0 12 8' width='24' fill='none'%3E%3Cpath d='M6 6l4-4h1v1-1L6 7 1 2h1l4 4z' fill='%23ababab'/%3E%3C/svg%3E");--ok-down-1:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='8' viewBox='0 0 12 8' width='24' fill='none'%3E%3Cpath d='M6 6l4-4h1v1-1L6 7 1 2h1l4 4z' fill='%23929292'/%3E%3C/svg%3E")}}*,:after,:before{box-sizing:border-box}*{margin:0;padding:0}html{font-family:var(--ok-sans);line-sizing:normal;line-height:var(--ok-lh-body);font-weight:var(--ok-fw-0);color:var(--ok-tc-0);b ackground-color:var(--ok-bg-0);-webkit-font-! smoothing! :antialiased;-moz-osx-font-smoothing:grayscale;-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;-ms-text-size-adjust:100%;text-size-adjust:100%;text-rendering:optimizeLegibility;scroll-behavior:smooth}@supports (font-variation-settings:normal){html{font-family:Inter var,var(--ok-sans)}}button,input,optgroup,select,textarea{font-family:inherit;line-height:var(--ok-lh-body)}[role=button],button{cursor:pointer}audio,canvas,embed,iframe,img,input,object,select,svg,textarea,video{display:block}img,video{max-width:100%;height:auto}body{padding:var(--ok-s-3);max-width:80ch;margin:auto}article{padding-bottom:var(--ok-s-6)}h1{font-size:var(--ok-fs-0);margin:0}h2{font-size:var(--ok-fs-1)}h3{font-size:var(--ok-fs-2)}h4{font-size:var(--ok-fs-3)}h5{font-size:var(--ok-fs-4)}h6{font-size:var(--ok-fs-5);text-transform:uppercase;font-weight:var(--ok-fw-1)}h1,h2,h3,h4,h5,h6{line-height:var(--ok-lh-heading);font-weight:var(--ok-fw-3);margin-top:var(--ok-s-6);margin-bottom:var(--ok-s-3)}h1+*,h2 +*,h3+*,h4+*,h5+*,h6+*,hr+*{margin-top:0}p{font-size:var(--ok-fs-4)}small{font-size:var(--ok-fs-5)}b,dt,strong{font-weight:var(--ok-fw-2)}address,article,aside,audio,blockquote,button,canvas,dd,details,dialog,div,dl,embed,fieldset,figcaption,figure,footer,form,header,hgroup,hr,iframe,img,input,main,nav,object,ol,p,pre,section,select,summary,svg,table,textarea,ul,video{margin-bottom:var(--ok-s-4)}address:last-child,article:last-child,aside:last-child,blockquote:last-child,dd:last-child,details:last-child,dialog:last-child,div:last-child,dl:last-child,dt:last-child,fieldset:last-child,figcaption:last-child,figure:last-child,footer:last-child,form:last-child,h1:last-child,h2:last-child,h3:last-child,h4:last-child,h5:last-child,h6:last-child,header:last-child,hgroup:last-child,hr:last-child,input[type=checkbox],input[type=radio],main:last-child,nav:last-child,ol:last-child,p:last-child,pre:last-child,section:last-child,table:last-child,ul:last-child{margin-bottom:0}fieldset{padding:var( --ok-s-3);border:var(--ok-b-0);border-radius! :var(--ok! -br)}legend{font-weight:var(--ok-fw-1);text-transform:uppercase;font-size:var(--ok-fs-5)}input,select{padding:var(--ok-s-2);background:var(--ok-bg-0);border:var(--ok-b-0);border-radius:var(--ok-br);color:var(--ok-tc-0);min-width:25ch}input:disabled,select:disabled,textarea:disabled{color:var(--ok-tc-2)}input::placeholder,textarea::placeholder{color:var(--ok-tc-2)}input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{color:var(--ok-tc-2)}input::-moz-placeholder,textarea::-moz-placeholder{color:var(--ok-tc-2)}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:var(--ok-tc-2)}input::-ms-input-placeholder,textarea::-ms-input-placeholder{color:var(--ok-tc-2)}input::-webkit-clear-button,input::-webkit-inner-spin-button,input::-webkit-search-cancel-button,input::-webkit-search-results-button{display:none}input::-ms-clear,input::-ms-reveal{display:none}input:disabled,textarea:disabled{background-color:var(--ok-bg-1)}input[type=search]{-webkit-appearance:none;-moz -appearance:none;appearance:none}input[type=file]{max-width:300px}input[type=number]{-moz-appearance:textfield}input[type=checkbox],input[type=radio]{display:inline;min-width:auto}input[type=color]{height:2.5rem}input[type=date],input[type=datetime-local],input[type=month],input[type=time],input[type=week]{height:2.5rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;position:relative}input[type=date]:before,input[type=datetime-local]:before,input[type=month]:before,input[type=time]:before,input[type=week]:before{position:absolute;right:0;top:0;background-image:var(--ok-down-0);background-repeat:no-repeat;background-position:right .2em top 50%;background-size:2em auto;width:2.5rem;height:calc(2.5rem - 2px);content:""}input[type=date]:disabled:before,input[type=datetime-local]:disabled:before,input[type=month]:disabled:before,input[type=time]:disabled:before,input[type=week]:disabled:before{background-image:var(--ok-down-1)}input::-webkit-calendar-picker-indicator{positi on:absolute;top:0;right:0;background-color:t! ransparen! t;cursor:pointer;padding:0;width:2.5rem;height:calc(2.5rem - 2px);content:"";opacity:0}input[type=range]{overflow:visible;line-height:inherit;font-family:inherit;-webkit-appearance:none;-moz-appearance:none;appearance:none;margin:0;outline:none;cursor:pointer;padding:0;vertical-align:middle;border:none;min-height:2rem;background-color:transparent}input[type=range]::-webkit-slider-runnable-track{cursor:pointer;-webkit-appearance:none;border-radius:var(--ok-br);border:var(--ok-b-0);background-color:var(--ok-bg-1);background-image:linear-gradient(var(--ok-bg-1),var(--ok-bg-1));width:100%;height:.5rem;color:transparent;box-sizing:border-box;position:relative}input[type=range]::-moz-range-track{cursor:pointer;-moz-appearance:none;border-radius:var(--ok-br);border:var(--ok-b-0);background-color:var(--ok-bg-1);background-image:linear-gradient(var(--ok-bg-1),var(--ok-bg-1));width:100%;height:.5rem;color:transparent;box-sizing:border-box}input[type=range]::-ms-track{cursor:pointer;-ms-appear ance:none;border-radius:var(--ok-br);border:var(--ok-b-0);background-color:var(--ok-bg-1);background-image:linear-gradient(var(--ok-bg-1),var(--ok-bg-1));width:100%;height:.5rem;color:transparent;box-sizing:border-box}input[type=range]::-ms-fill-lower{background:transparent}input[type=range]::-webkit-slider-thumb{cursor:pointer;-webkit-appearance:none;border-radius:50%;background-color:var(--ok-accent-0);width:1.5rem;height:1.5rem;margin-top:calc(-.5rem - 1px)}input[type=range]::-moz-range-thumb{cursor:pointer;-moz-appearance:none;border:none;border-radius:50%;background-color:var(--ok-accent-0);width:1.5rem;height:1.5rem}input[type=range]::-ms-thumb{cursor:pointer;-ms-appearance:none;border-radius:50%;background-color:var(--ok-accent-0);width:1.5rem;height:1.5rem;transform:translateY(.25rem)}input[type=range]:focus:not(:disabled)::-webkit-slider-thumb{background-color:var(--ok-accent-1)}input[type=range]:focus:not(:disabled)::-moz-range-thumb{background-color:var(--ok-accent-1)}inp ut[type=range]:focus:not(:disabled)::-ms-thu! mb{backgr! ound-color:var(--ok-accent-1)}input[type=range]:disabled{cursor:default}input[type=range]:disabled::-webkit-slider-runnable-track{cursor:default}input[type=range]:disabled::-moz-range-track{cursor:default}input[type=range]:disabled::-ms-track{cursor:default}input[type=range]:disabled::-webkit-slider-thumb{background-color:var(--ok-bg-2);cursor:default}input[type=range]:disabled::-moz-range-thumb{background-color:var(--ok-bg-2);cursor:default}input[type=range]:disabled::-ms-thumb{background-color:var(--ok-bg-2);cursor:default}select{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:var(--ok-b-0);border-radius:var(--ok-br);background-color:var(--ok-bg-0);min-height:2.5rem;color:var(--ok-tc-0)}select:not([multiple]){background-image:var(--ok-down-0);background-repeat:no-repeat,repeat;background-position:right .2em top 50%;background-size:2em auto;padding-right:2.5em;height:2.5rem}select::-ms-expand{display:none}select:not([multiple]):disabled{background-image:var(--ok -down-1);background-color:var(--ok-bg-1);cursor:default}select[multiple]{border-radius:var(--ok-br)}select[multiple]:disabled{background-color:var(--ok-bg-1)}select[multiple] option{color:var(--ok-t-)}select[multiple]:disabled option{color:var(--ok-tc-2)}textarea{padding:var(--ok-s-2);resize:vertical;background:var(--ok-bg-0);border:var(--ok-b-0);border-radius:var(--ok-br);color:var(--ok-tc-0);min-height:calc(2.5rem - 2px);min-width:25ch}button,input[type=button],input[type=reset],input[type=submit]{display:inline-block;background-color:var(--ok-accent-0);border-radius:var(--ok-br);color:#fff;font-weight:var(--ok-fw-1);height:2.5rem;border:none;padding:var(--ok-s-2) var(--ok-s-3);white-space:nowrap;min-width:auto}input::-webkit-file-upload-button{display:inline-block;background-color:var(--ok-accent-0);border-radius:var(--ok-br);color:#fff;font-weight:var(--ok-fw-1);height:2.5rem;border:none;padding:var(--ok-s-2) var(--ok-s-3);white-space:nowrap}input:disabled::-webkit-file-upload-b utton{cursor:default;opacity:.5}button,input! [type=but! ton],input[type=reset],input[type=submit]{cursor:pointer}input:not(:disabled)::-webkit-file-upload-button{cursor:pointer}button:disabled,input[type=button]:disabled,input[type=reset]:disabled,input[type=submit]:disabled{cursor:default;opacity:.5;background-color:var(--ok-accent-0)}button:focus:not(:disabled),input[type=button]:focus:not(:disabled),input[type=reset]:focus:not(:disabled),input[type=submit]:focus:not(:disabled){background-color:var(--ok-accent-1)}input:not(:disabled):focus::-webkit-file-upload-button{background-color:var(--ok-accent-1)}table{border-collapse:collapse;display:table;margin-left:auto;margin-right:auto;white-space:nowrap}tfoot,thead{border:var(--ok-b-0)}thead{position:-webkit-sticky;position:sticky;top:0}tfoot tr,thead tr{background-color:var(--ok-bg-1);font-size:var(--ok-fs-5);text-transform:uppercase;color:var(--ok-tc-0)}td,th{border:var(--ok-b-0) 0;text-align:left;padding:.5rem}td{white-space:normal;max-width:20ch}tr{border:var(--ok-b-0)}table caption{fo nt-size:var(--ok-fs-4);font-weight:var(--ok-fw-3);padding:.5rem}code,samp{padding:.2em .4em;color:var(--ok-tc-code)}code,pre,samp{font-family:var(--ok-mono);font-size:87.5%;line-height:var(--ok-lh-body);background-color:var(--ok-bg-1);border-radius:var(--ok-br);text-transform:none}pre{padding:var(--ok-s-3);white-space:pre;overflow-x:auto}pre,var{color:var(--ok-tc-0)}var{font-family:var(--ok-mono);font-style:normal}code pre,pre code{background:inherit;font-size:inherit;color:inherit;border:0;padding:0;margin:0}code pre{display:inline}kbd{background-color:var(--ok-bg-1);border:var(--ok-b-0);border-radius:var(--ok-br);border-bottom:2px solid var(--ok-bg-2);padding:var(--ok-s-1);font-family:var(--ok-sans);color:var(--ok-tc-0)}a{text-decoration:none;font-weight:var(--ok-fw-1)}a,a:visited,a code,a mark,a samp{color:var(--ok-tc-accent)}ol,ul{padding-left:var(--ok-s-5)}nav ul{text-decoration:none;padding-left:0}nav ul li{display:inline;margin-right:1em}li p{margin-bottom:0}li,li p+p{margin- top:.5em}audio,img,video{margin-left:auto;ma! rgin-righ! t:auto}img{border-radius:var(--ok-br)}figure>img:not(:last-child){margin-bottom:var(--ok-s-1)}figure>figcaption{text-align:center}figcaption,time{font-size:var(--ok-fs-5);color:var(--ok-tc-1)}mark{padding:.2em .4em;background:var(--ok-t-hl);color:#000;border-radius:var(--ok-br)}iframe{border:var(--ok-b-0);border-radius:var(--ok-br);width:100%}hr{border:none;border-bottom:var(--ok-b-0)}footer{font-size:var(--ok-fs-5)}blockquote,footer{color:var(--ok-tc-1)}blockquote{position:relative;margin-left:0;margin-right:0;padding-left:var(--ok-s-5)}blockquote:before{position:absolute;height:100%;content:"";width:4px;left:0;border-radius:var(--ok-br);background-color:var(--ok-bg-1)}dd{padding-left:var(--ok-s-5)}abbr{cursor:help}@media (hover:hover){a:hover{text-decoration:underline}input:hover:not(:disabled):not(:focus):not([type=submit]):not([type=button]):not([type=reset]):not([type=range]),select:hover:not(:disabled):not(:focus),textarea:hover:not(:disabled):not(:focus){border:var(--ok-b-1)} input[type=range]:hover:not(:disabled)::-webkit-slider-runnable-track{border:var(--ok-b-1)}input[type=range]:hover:not(:disabled)::-moz-range-track{border:var(--ok-b-1)}input[type=range]:hover:not(:disabled)::-ms-track{border:var(--ok-b-1)}select:not([multiple]):not(:disabled):hover{cursor:pointer}button:hover:not(:disabled),input[type=button]:hover:not(:disabled),input[type=reset]:hover:not(:disabled),input[type=submit]:hover:not(:disabled){background-color:var(--ok-accent-1)}input:not(:disabled):hover::-webkit-file-upload-button{background-color:var(--ok-accent-1)}} \ No newline at end of file diff --git a/contrib/expat/doc/reference.html b/contrib/expat/doc/reference.html index 8b0d47d6dd7b..898f03a3364d 100644 --- a/contrib/expat/doc/reference.html +++ b/contrib/expat/doc/reference.html @@ -14,11 +14,13 @@ Copyright (c) 2000 Clark Cooper Copyright (c) 2000-2004 Fred L. Drake, Jr. Copyright (c) 2002-2012 Karl Waclawek - Copyright (c) 2017-2022 Sebastian Pipping + Copyright (c) 2017-2024 Sebastian Pipping Copyright (c) 2017 Jakub Wilk Copyright (c) 2021 Tomas Korbar Copyright (c) 2021 Nicolas Cavallari Copyright (c) 2022 Thijs Schreijer + Copyright (c) 2023 Hanno Böck + Copyright (c) 2023 Sony Corporation / Snild Dolkow Licensed under the MIT license: Permission is hereby granted, free of charge, to any person obtaining @@ -50,7 +52,7 @@

    The Expat XML Parser - Release 2.5.0 + Release 2.6.0

    @@ -68,11 +70,11 @@ Working Group at W3C that produced the XML specification.

    This is free software, licensed under the MIT/X Consortium license. You may download it -from the Expat home page. +from the Expat home page.

    The bulk of this document was originally commissioned as an article -by XML.com. They graciously allowed +by XML.com. They graciously allowed Clark Cooper to retain copyright and to distribute it with Expat. This version has been substantially extended to include documentation on features which have been added since the original article was @@ -151,10 +153,11 @@ interface.

  • - Billion Laughs Attack Protection + Attack Protection
  • Miscellaneous Functions @@ -305,7 +308,7 @@ shoveling the document to the parser so that it can do its work.

    The Expat distribution comes as a compressed (with GNU gzip) tar file. You may download the latest version from Source Forge. After +"https://sourceforge.net/projects/expat/" >Source Forge. After unpacking this, cd into the directory. Then follow either the Win32 directions or Unix directions below.

    @@ -359,37 +362,64 @@ and the definition of character types in the case of XML_UNICODE_WCHAR_T. The symbols are:

    -
    XML_DTD
    +
    XML_GE
    +
    +Added in Expat 2.6.0. +Include support for +general entities +(syntax &e1; to reference and +syntax <!ENTITY e1 'value1'> (an internal general entity) or +<!ENTITY e2 SYSTEM 'file2'> (an external general entity) to declare). +With XML_GE enabled, general entities will be replaced by their declared replacement text; +for this to work for external general entities, in addition an +XML_ExternalEntityRefHandler must be set using +XML_SetExternalEntityRefHandler. +Also, enabling XML_GE makes +the functions +XML_SetBillionLaughsAttackProtectionMaximumAmplification and + +XML_SetBillionLaughsAttackProtectionActivationThreshold available. +
    +With XML_GE disabled, Expat has a smaller memory footprint and can be faster, but will +not load external general entities and will replace all general entities +(except the predefined five: +amp, apos, gt, lt, quot) +with a self-reference: +for example, referencing an entity e1 via &e1; will be replaced +by text &e1;. +
    + +
    XML_DTD
    Include support for using and reporting DTD-based content. If this is defined, default attribute values from an external DTD subset are reported and attribute value normalization occurs based on the type of attributes defined in the external subset. Without this, Expat has a smaller memory footprint and can be faster, but will -not load external entities or process conditional sections. If defined, makes +not load external parameter entities or process conditional sections. If defined, makes the functions XML_SetBillionLaughsAttackProtectionMaximumAmplification and XML_SetBillionLaughsAttackProtectionActivationThreshold available.
    -
    XML_NS
    +
    XML_NS
    When defined, support for the Namespaces in XML +"https://www.w3.org/TR/REC-xml-names/" >Namespaces in XML specification is included.
    -
    XML_UNICODE
    +
    XML_UNICODE
    When defined, character data reported to the application is encoded in UTF-16 using wide characters of the type XML_Char. This is implied if XML_UNICODE_WCHAR_T is defined.
    -
    XML_UNICODE_WCHAR_T
    +
    XML_UNICODE_WCHAR_T
    If defined, causes the XML_Char character type to be defined using the wchar_t type; otherwise, unsigned short is used. Defining this implies XML_UNICODE.
    -
    XML_LARGE_SIZE
    +
    XML_LARGE_SIZE
    If defined, causes the XML_Size and XML_Index integer types to be at least 64 bits in size. This is intended to support processing of very large input streams, where the return values of @@ -399,23 +429,23 @@ processing of very large input streams, where the return values of could overflow. It may not be supported by all compilers, and is turned off by default.
    -
    XML_CONTEXT_BYTES
    +
    XML_CONTEXT_BYTES
    The number of input bytes of markup context which the parser will ensure are available for reporting via XML_GetInputContext. This is -normally set to 1024, and must be set to a positive integer. If this -is not defined, the input context will not be available and XML_GetInputContext will -always report NULL. Without this, Expat has a smaller memory +always report NULL. Without this, Expat has a smaller memory footprint and can be faster.
    -
    XML_STATIC
    +
    XML_STATIC
    On Windows, this should be set if Expat is going to be linked statically with the code that calls it; this is required to get all the right MSVC magic annotations correct. This is ignored on other platforms.
    -
    XML_ATTR_INFO
    +
    XML_ATTR_INFO
    If defined, makes the additional function XML_GetAttributeInfo available for reporting attribute byte offsets.
    @@ -669,8 +699,9 @@ function. The StartNamespaceDeclHandler is called prior to the start tag handler and the EndNamespaceDeclHandler is called after the corresponding end tag that ends the namespace's scope. The namespace start handler gets passed the prefix and URI for the namespace. For a -default namespace declaration (xmlns='...'), the prefix will be null. -The URI will be null for the case where the default namespace is being +default namespace declaration (xmlns='...'), the prefix will be +NULL. +The URI will be NULL for the case where the default namespace is being unset. The namespace end handler just gets the prefix for the closing scope.

    @@ -799,7 +830,7 @@ has already been passed into the parser. Applications for this include

      -
    • Supporting the Supporting the XInclude specification.
    • Delaying further processing until additional information is @@ -947,16 +978,20 @@ XML_Parser XMLCALL XML_ParserCreate(const XML_Char *encoding);
      -Construct a new parser. If encoding is non-null, it specifies a +

      +Construct a new parser. If encoding is non-NULL, it specifies a character encoding to use for the document. This overrides the document encoding declaration. There are four built-in encodings: +

      • US-ASCII
      • UTF-8
      • UTF-16
      • ISO-8859-1
      +

      Any other value will invoke a call to the UnknownEncodingHandler. +

      XML_ParserCreateNS

      @@ -1003,9 +1038,9 @@ typedef struct {

      Construct a new parser using the suite of memory handling functions -specified in ms. If ms is NULL, then use the +specified in ms. If ms is NULL, then use the standard set of memory management functions. If sep is -non NULL, then namespace processing is enabled in the created parser +non-NULL, then namespace processing is enabled in the created parser and the character pointed at by sep is used as the separator between the namespace URI and the local part of the name.

      @@ -1077,6 +1112,11 @@ exceed the maximum integer value. Input data at the end of a buffer will remain unprocessed if it is part of an XML token for which the end is not part of that buffer.

      +

      The application must make a concluding +XML_Parse or +XML_ParseBuffer call +with isFinal set to XML_TRUE.

      +

      XML_Parse

       enum XML_Status XMLCALL
      @@ -1092,17 +1132,50 @@ enum XML_Status {
       };
       
      +

      Parse some more of the document. The string s is a buffer containing part (or perhaps all) of the document. The number of bytes of s that are part of the document is indicated by len. This means -that s doesn't have to be null terminated. It also means that +that s doesn't have to be null-terminated. It also means that if len is larger than the number of bytes in the block of memory that s points at, then a memory fault is likely. The isFinal parameter informs the parser that this is the last piece of the document. Frequently, the last piece is empty (i.e. len is zero.) +

      + +

      If a parse error occurred, it returns XML_STATUS_ERROR. Otherwise it returns XML_STATUS_OK value. +Note that regardless of the return value, there is no guarantee that all +provided input has been parsed; only after the +concluding call will all handler callbacks and parsing errors have +happened. +

      + +

      +Simplified, XML_Parse can be considered a convenience wrapper +that is pairing calls +to XML_GetBuffer +and XML_ParseBuffer +(when Expat is built with macro XML_CONTEXT_BYTES +defined to a positive value, which is both common and default). +XML_Parse is then functionally equivalent to calling +XML_GetBuffer, +memcpy, and +XML_ParseBuffer. +

      + +

      +To avoid double copying of the input, direct use of functions +XML_GetBuffer and +XML_ParseBuffer is advised +for most production use, e.g. +if you're using read or similar functionality to fill your +buffers, fill directly into the buffer from +XML_GetBuffer, +then parse with XML_ParseBuffer. +

      XML_ParseBuffer

      @@ -1128,8 +1201,8 @@ XML_GetBuffer(XML_Parser p,
      Obtain a buffer of size len to read a piece of the document -into. A NULL value is returned if Expat can't allocate enough memory for -this buffer. A NULL value may also be returned if len is zero. +into. A NULL value is returned if Expat can't allocate enough memory for +this buffer. A NULL value may also be returned if len is zero. This has to be called prior to every call to XML_ParseBuffer. A typical use would look like this: @@ -1275,7 +1348,7 @@ typedef struct {

      Returns status of parser with respect to being initialized, parsing, finished, or suspended, and whether the final buffer is being processed. The status parameter must not be -NULL.

      +NULL.

      New in Expat 1.95.8.

      @@ -1290,7 +1363,7 @@ to ignore all text not descended from a para element. One way it could do this is to set the character handler when a para start tag is seen, and unset it for the corresponding end tag.

      -

      A handler may be unset by providing a NULL pointer to the +

      A handler may be unset by providing a NULL pointer to the appropriate handler setter. None of the handler setting functions have a return value.

      @@ -1318,7 +1391,7 @@ typedef void handler as a pointer to a vector of char pointers. Each attribute seen in a start (or empty) tag occupies 2 consecutive places in this vector: the attribute name followed by the attribute value. These pairs are terminated -by a null pointer.

      +by a NULL pointer.

      Note that an empty tag generates a call to both start and end handlers (in that order).

  • @@ -1368,7 +1441,7 @@ is NOT null-terminated. You have to use the length argument to deal with the end of the string. A single block of contiguous text free of markup may still result in a sequence of calls to this handler. In other words, if you're searching for a pattern in the text, it may -be split across calls to this handler. Note: Setting this handler to NULL +be split across calls to this handler. Note: Setting this handler to NULL may NOT immediately terminate call-backs if the parser is currently processing such a single block of contiguous markup-free text, as the parser will continue calling back until the end of the block is reached.

    @@ -1526,16 +1599,16 @@ the format expected by the context argument to XML_ExternalEntityParserCreate. code is valid only until the handler returns, so if the referenced entity is -to be parsed later, it must be copied. context is NULL +to be parsed later, it must be copied. context is NULL only when the entity is a parameter entity, which is how one can differentiate between general and parameter entities.

    The base parameter is the base to use for relative system identifiers. It is set by XML_SetBase and may be NULL. The +href="#XML_SetBase">XML_SetBase and may be NULL. The publicId parameter is the public id given in the entity -declaration and may be NULL. systemId is the system -identifier specified in the entity declaration and is never NULL.

    +declaration and may be NULL. systemId is the system +identifier specified in the entity declaration and is never NULL.

    There are a couple of ways in which this handler differs from others. First, this handler returns a status indicator (an @@ -1564,10 +1637,10 @@ XML_SetExternalEntityRefHandlerArg(XML_Parser p,

    Set the argument passed to the ExternalEntityRefHandler. If -arg is not NULL, it is the new value passed to the +arg is not NULL, it is the new value passed to the handler set using XML_SetExternalEntityRefHandler; if arg is -NULL, the argument passed to the handler function will be the parser +NULL, the argument passed to the handler function will be the parser object itself.

    Note: @@ -1650,14 +1723,14 @@ value is -1, then that byte is invalid as the initial byte in a sequence. If the value is -n, where n is an integer > 1, then n is the number of bytes in the sequence and the actual conversion is accomplished by a call to the function pointed at by convert. This function may return -1 -if the sequence itself is invalid. The convert pointer may be null if +if the sequence itself is invalid. The convert pointer may be NULL if there are only single byte codes. The data parameter passed to the convert function is the data pointer from XML_Encoding. The string s is NOT null-terminated and points at the sequence of bytes to be converted.

    The function pointed at by release is called by the -parser when it is finished with the encoding. It may be NULL.

    +parser when it is finished with the encoding. It may be NULL.

    @@ -1724,8 +1797,8 @@ typedef void

    Sets a handler that is called for XML declarations and also for text declarations discovered in external entities. The way to -distinguish is that the version parameter will be NULL -for text declarations. The encoding parameter may be NULL +distinguish is that the version parameter will be NULL +for text declarations. The encoding parameter may be NULL for an XML declaration. The standalone argument will contain -1, 0, or 1 indicating respectively that there was no standalone parameter in the declaration, that it was given as no, or @@ -1749,7 +1822,7 @@ typedef void

    Set a handler that is called at the start of a DOCTYPE declaration, before any external or internal subset is parsed. Both sysid -and pubid may be NULL. The has_internal_subset +and pubid may be NULL. The has_internal_subset will be non-zero if the DOCTYPE declaration has an internal subset.

    @@ -1831,7 +1904,7 @@ around and freed at a later stage.

    XML_Content nodes. If type equals XML_CTYPE_EMPTY or XML_CTYPE_ANY, then quant will be XML_CQUANT_NONE, and the other -fields will be zero or NULL. If type is +fields will be zero or NULL. If type is XML_CTYPE_MIXED, then quant will be XML_CQUANT_NONE or XML_CQUANT_REP and *** 32725 LINES SKIPPED *** From nobody Wed Feb 21 07:18:09 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Tfng610ZVz5Bdm2; Wed, 21 Feb 2024 07:18:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Tfng60DrCz4tvG; Wed, 21 Feb 2024 07:18:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708499890; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qwbp0gcGEZ6WjPSP7RQ+k6L4dSrWHkzoZzxkUI+iNos=; b=g5UWiaakJpxt8EbrstsvCcxIw8uoBafSHkX67h5w2qDlvdm48c0z9wNFd5u9FfDeGNTUlf 67v+uJ6aSEEol8xUTYNfR6gIzH9vUxh4veS2nzSx6AEi1jl4Zpvg7uqqGFhQFvePfDxFkH TNdMlvJDtf2jiPL9JxPHEYRazBB/CNOgR/P75vU7w75qvgV3sEHl3BeW/5R7URyUHxMbgT 97gd2jyPsEjyvtWpNwgg7w/SnSCHeC0/cfYkhuaEkdrntwuUSNZVXdmpmXZvkNldWaP8a9 g7XgLH1cDHCXTwXTLPI33aAnSH2zEPCecV6veOGwN9LnUffB9lodmZVwf8ed/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708499890; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qwbp0gcGEZ6WjPSP7RQ+k6L4dSrWHkzoZzxkUI+iNos=; b=u8dmitz7BTBeb3OYw5vGfbCHvzMUJg8coK45RH4MBy5z7Mfe64CsBN0TCUjPrQSY/GfEcy HC0XNYZNOmdD3Lx/EVLlUxzYqOpR8rGC/6le54d0BiScT0A+mcsbRIW4YZZM/Mg/6zmx3q KVP2SSE5dhGSXaN8zZ1dJe/TsyGiMTKwyfeJk8VjxTjSoAy7Y+/bdCBDNefUuKIoP1B1Jq 8vOZWJwsGoV8wxy/D1ramkFJL//rh3Bn3LiAw5DXpQ/9xHf4V2P0aEtNoYeIwqjviYIP1t XdgHZKPXu/tJCV7f8Ale9RzEEClDNHsKP8PeOhAqtw0LERiEgAhp5cXThS3Tnw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708499890; a=rsa-sha256; cv=none; b=Q/iFY9O71WEkTNx2YYklWXEPVN6X4FjGG6OqxhSPdtRu4Expr1S7CtrzPaEXpwfLGeN1g1 S/gu7Ppk2sWyToGOI6JWbsanqFY5uZat6gw/ydrKmpdbRbYirLYJnEFCud1hcHxMK+N3Ya KLj03frSSS3GAv4hBr38XJh0lNltgMxAwOtS007opHIrg2fWat/ur+BX5hjiwaFAMmw4dA SM558mMmjsIDQ9Y/qT2yguaMa0xV6m7TLO4+kbssy5kqyEcA/ZCRDQWrf5i1mNbasXN7TQ SZRPLX6KyIDRtFohhOtdFQYJjooQ/ycs8lBuZGLUIi9dVPcDuQTHtcD38gZONQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Tfng56PXbzsw5; Wed, 21 Feb 2024 07:18:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41L7I9j4091903; Wed, 21 Feb 2024 07:18:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41L7I9fH091900; Wed, 21 Feb 2024 07:18:09 GMT (envelope-from git) Date: Wed, 21 Feb 2024 07:18:09 GMT Message-Id: <202402210718.41L7I9fH091900@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: c71ed5dc63de - stable/14 - sctp(4): Fix a typo in a source code comment List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c71ed5dc63de35de352e9d223577a5e4a34593f9 Auto-Submitted: auto-generated The branch stable/14 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=c71ed5dc63de35de352e9d223577a5e4a34593f9 commit c71ed5dc63de35de352e9d223577a5e4a34593f9 Author: Gordon Bergling AuthorDate: 2024-02-18 12:01:04 +0000 Commit: Gordon Bergling CommitDate: 2024-02-21 07:17:54 +0000 sctp(4): Fix a typo in a source code comment - s/anthing/anything/ (cherry picked from commit 2fb174d18a42d1b2965164186843540ee65881ea) --- sys/netinet/sctp_indata.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/sctp_indata.c b/sys/netinet/sctp_indata.c index c195cce96f39..a30fd95fef30 100644 --- a/sys/netinet/sctp_indata.c +++ b/sys/netinet/sctp_indata.c @@ -1359,7 +1359,7 @@ out: /* * Dump onto the re-assembly queue, in its proper place. After dumping on the - * queue, see if anthing can be delivered. If so pull it off (or as much as + * queue, see if anything can be delivered. If so pull it off (or as much as * we can. If we run out of space then we must dump what we can and set the * appropriate flag to say we queued what we could. */ From nobody Wed Feb 21 07:18:45 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Tfngn2vf1z5Bf36; Wed, 21 Feb 2024 07:18:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Tfngn2Pk4z4vbv; Wed, 21 Feb 2024 07:18:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708499925; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IEf5sbmSZ148dhkePGe8BkF28r3M1FhGibQ3Q7tzr1A=; b=LG4Nn9MGyfSsVFEBFBFEgDk8sOTug5kv4n5I3jPaR7relkIpTJ66d57srChGTM+LQ7CCIU JRRWuJ7tDvDocZ+QIaqP+pO0fLhGNNiRWG/iaJMXtPzFYzzdnhyX6lpRCaYwsg5TkoAhLL ZmTZaw0lwSaIMQPr8QhwXyIihUwPcAJqN9JRplu7UoaRTnHkX5FllMkQtEbxnEZtVK9rMC sZlpDIousa2wW4Wi4vMVPHETunh8rgzRL0S0+/RtSeh+Rs+cNZ6D+JZ6+rlynx2rU3bCdu RACnsWjO0vKo+lpWWCto2A+52j08jCK6x47HhrBozKcMXZKHQo8haZh0krXgaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708499925; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IEf5sbmSZ148dhkePGe8BkF28r3M1FhGibQ3Q7tzr1A=; b=kD3zkHOt4pk5JQBtMYPuyGr4shaGXOqjWuhbUZx/doR4+cJcDiqzpkvtLLVVTZfUdcHiVv +wVe5y6TGBR9vWU3MamYt+6BBE1Np33Y0THrbP+WmHPsTV/V0lQCgKezGyGpFMez6oBEpe 8exqfG5VPU5EcYoV0EFvVLvoLJ3/BcJjQs4Mrhg7ZX8imNFA11dr3JCpV+/jNgNucWhpPJ ZBDnBZcnz1oG3eVp4Q1YQa7rteJDoogjhlEPzcNMY7XDj3IYzMDdYrxtZvkS6QuTKmKOIA yyCHgqxGARJpfW3mkJxYkT2pOqasS8BS6DtUFEfSSbUzcgCcc6WjD0zdShYxFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708499925; a=rsa-sha256; cv=none; b=AdJValFxcKM2yLsJEULYNbm3JuvI05eeqfT0dTQK36fIrQGFRx+vvIQ+N4CFTU6L6wFNSJ MnL46CkgJdgje6830PpqaLSFhaceI7GzzPK2MWE7Gak/Aiqe6337T9xjAAcC28A2kRobbr KIY/ja+GBq2N2z2TbvQL6Bsk8Y1TKFOWIpk1+emT7S0grZr690O/pz6GZLbIYzkVXR5J80 /GEqq1F4f1+R76g1OId07BysfCxDBl+ujIoCutLbubWLPsyrwJrUHjxz5Tz5RNLZPGGFad i1Es5RVqUhlVZAoVbvs1Wix2CDLHegXnIMbdeq1pG94jvn3TttEV6rS3zNpJuw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Tfngn1Sb7ztCK; Wed, 21 Feb 2024 07:18:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41L7Ij8W092093; Wed, 21 Feb 2024 07:18:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41L7Ij8S092090; Wed, 21 Feb 2024 07:18:45 GMT (envelope-from git) Date: Wed, 21 Feb 2024 07:18:45 GMT Message-Id: <202402210718.41L7Ij8S092090@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 0c3ca6ce1fca - stable/13 - sctp(4): Fix a typo in a source code comment List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0c3ca6ce1fca963662d09bee0c43b3a026233222 Auto-Submitted: auto-generated The branch stable/13 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=0c3ca6ce1fca963662d09bee0c43b3a026233222 commit 0c3ca6ce1fca963662d09bee0c43b3a026233222 Author: Gordon Bergling AuthorDate: 2024-02-18 12:01:04 +0000 Commit: Gordon Bergling CommitDate: 2024-02-21 07:18:29 +0000 sctp(4): Fix a typo in a source code comment - s/anthing/anything/ (cherry picked from commit 2fb174d18a42d1b2965164186843540ee65881ea) --- sys/netinet/sctp_indata.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/sctp_indata.c b/sys/netinet/sctp_indata.c index c195cce96f39..a30fd95fef30 100644 --- a/sys/netinet/sctp_indata.c +++ b/sys/netinet/sctp_indata.c @@ -1359,7 +1359,7 @@ out: /* * Dump onto the re-assembly queue, in its proper place. After dumping on the - * queue, see if anthing can be delivered. If so pull it off (or as much as + * queue, see if anything can be delivered. If so pull it off (or as much as * we can. If we run out of space then we must dump what we can and set the * appropriate flag to say we queued what we could. */ From nobody Wed Feb 21 07:39:36 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Tfp7r6gM4z5BgSq; Wed, 21 Feb 2024 07:39:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Tfp7r6K1Lz3xSS; Wed, 21 Feb 2024 07:39:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708501176; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1sC48S9cCJDVWYv48pXA9wHpNFi6M2P9mEPBz42yzAI=; b=jPJvFY0kYcvKqjza8EYnyFKTIW1utGw2y801BoqjB0OiIMYv13fX4B1aPhEGtNaoYDCepR jtt7Dswifw5dqWmI6ppo8vzxQ6P0/B+iSHToVX+fPb4BS78tm0U6Q7xhCdEET9urIA93Wk +2G44/Dfb15C7qStbaWnaXmF/GL+tK7BxE6UByHzozmGNLLFgv09MRQ+Va60aDe6VGKniY 9GRbAGoqR9K1O0nW7WOuugp92MRfL1aYAHwcsh55aFzChXd8V2my11rYzcvJeh0JKZngLi GeoNxZr6Uue4PZKioTATKj8ymIAkNftt1xHc2MsgpIdrUnitb1ZoPQ3kmyZS3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708501176; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1sC48S9cCJDVWYv48pXA9wHpNFi6M2P9mEPBz42yzAI=; b=ulrkcOWuzeRuJnPk7+A9N+ZftxApzwiRqsi6Ew4yRD0QaX4yI9TRlw9b2xywgFpO5138AH OjwhqWdwfiSFnkIQX5BegqL8v/x2o/pfXJ12RwBqAEda7uEgVRUKpuZxmO+xA2iU5ZRbID WK9A0y8k8bbyO0i97oLyXFbYMIrNv82/C0c/eRApLEUmzEAdOEncgAZ9HxTYXbCkCE1rT0 n9dUZDiBYkp6+r8tLH9FFSoZwLSJUkQiBDFBqhOBDKgfQv/t08HwqbStrdGLmhAyJmc4bV QdHLXrTOcm90dFkrPL3GBSKCJDCcrLurjO6rktNE4ZIdF2h0FqYnO86wkSpIKg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708501176; a=rsa-sha256; cv=none; b=CeeIE33fZY0TmrRLwQsJ/p7CCllOb3bOP9nj62SkvMWN8MzZ936ZaTnPxPgK9bWfV4FTnV lLP49YJQMJFF569UQRSRZIks1pP97EuxR3qSh6x6iguU4w/QhlFin54RZAj6UxCQsOcIOb jv+3zb08j2R63en3B5R0Oxb2UdahPj9l+JwkT+UvRwUwvfKlZSw3evsz4EDCdRJJAALsgj wz/b2c1ST5ujnN3lw0j6gilhQr1atZNAvy2EcsKu/6V3rDmdLKujAigU2sYTGBLV/BKWyh eEPHEStDXcloDmEjua3P/18/zzqfNhVoaa73pCm4fssKY3UzkvAEWI2FYqUrHw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Tfp7r5N4SztDZ; Wed, 21 Feb 2024 07:39:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41L7daxe025708; Wed, 21 Feb 2024 07:39:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41L7danu025705; Wed, 21 Feb 2024 07:39:36 GMT (envelope-from git) Date: Wed, 21 Feb 2024 07:39:36 GMT Message-Id: <202402210739.41L7danu025705@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: 07ece5936ab1 - releng/13.3 - MFC: MFV: expat 2.6.0. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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.3 X-Git-Reftype: branch X-Git-Commit: 07ece5936ab1129003231af9c593a9cb77f763b3 Auto-Submitted: auto-generated The branch releng/13.3 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=07ece5936ab1129003231af9c593a9cb77f763b3 commit 07ece5936ab1129003231af9c593a9cb77f763b3 Author: Xin LI AuthorDate: 2024-02-17 21:56:56 +0000 Commit: Xin LI CommitDate: 2024-02-21 07:39:10 +0000 MFC: MFV: expat 2.6.0. Approved by: re (cperciva) (cherry picked from commit 4543ef516683042d46f3bd3bb8a4f3f746e00499) (cherry picked from commit 60cfaec917dad12ceab7450a518616668d9f1ed0) --- contrib/expat/Changes | 118 +- contrib/expat/Makefile.am | 10 +- contrib/expat/Makefile.in | 22 +- contrib/expat/README.md | 7 +- contrib/expat/configure.ac | 43 +- contrib/expat/doc/Makefile.in | 10 +- contrib/expat/doc/ok.min.css | 4 +- contrib/expat/doc/reference.html | 222 +- contrib/expat/doc/xmlwf.1 | 24 +- contrib/expat/doc/xmlwf.xml | 50 +- contrib/expat/examples/Makefile.am | 9 +- contrib/expat/examples/Makefile.in | 48 +- contrib/expat/examples/element_declarations.c | 234 + contrib/expat/expat_config.h.in | 8 +- contrib/expat/fuzz/xml_parse_fuzzer.c | 53 +- contrib/expat/fuzz/xml_parsebuffer_fuzzer.c | 68 +- contrib/expat/lib/Makefile.in | 10 +- contrib/expat/lib/expat.h | 28 +- contrib/expat/lib/internal.h | 8 +- contrib/expat/lib/siphash.h | 10 +- contrib/expat/lib/xmlparse.c | 558 +- contrib/expat/lib/xmlrole.c | 6 +- contrib/expat/lib/xmlrole.h | 6 +- contrib/expat/lib/xmltok.c | 29 +- contrib/expat/lib/xmltok.h | 8 +- contrib/expat/lib/xmltok_impl.c | 2 +- contrib/expat/tests/Makefile.am | 61 +- contrib/expat/tests/Makefile.in | 261 +- contrib/expat/tests/acc_tests.c | 396 + contrib/expat/tests/acc_tests.h | 56 + contrib/expat/tests/acc_tests_cxx.cpp | 32 + contrib/expat/tests/alloc_tests.c | 2127 ++++ contrib/expat/tests/alloc_tests.h | 56 + contrib/expat/tests/alloc_tests_cxx.cpp | 32 + contrib/expat/tests/basic_tests.c | 6076 +++++++++ contrib/expat/tests/basic_tests.h | 56 + contrib/expat/tests/basic_tests_cxx.cpp | 32 + contrib/expat/tests/benchmark/Makefile.in | 10 +- contrib/expat/tests/benchmark/benchmark.c | 14 +- contrib/expat/tests/chardata.c | 16 +- contrib/expat/tests/chardata_cxx.cpp | 32 + contrib/expat/tests/common.c | 325 + contrib/expat/tests/common.h | 162 + contrib/expat/tests/common_cxx.cpp | 32 + contrib/expat/tests/dummy.c | 261 + contrib/expat/tests/dummy.h | 150 + contrib/expat/tests/dummy_cxx.cpp | 32 + contrib/expat/tests/handlers.c | 1932 +++ contrib/expat/tests/handlers.h | 595 + contrib/expat/tests/handlers_cxx.cpp | 32 + contrib/expat/tests/memcheck.c | 21 +- contrib/expat/tests/memcheck_cxx.cpp | 32 + contrib/expat/tests/minicheck.c | 58 +- contrib/expat/tests/minicheck.h | 79 +- contrib/expat/tests/minicheck_cxx.cpp | 32 + contrib/expat/tests/misc_tests.c | 523 + contrib/expat/tests/misc_tests.h | 56 + contrib/expat/tests/misc_tests_cxx.cpp | 32 + contrib/expat/tests/ns_tests.c | 754 ++ contrib/expat/tests/ns_tests.h | 56 + contrib/expat/tests/ns_tests_cxx.cpp | 32 + contrib/expat/tests/nsalloc_tests.c | 1537 +++ contrib/expat/tests/nsalloc_tests.h | 56 + contrib/expat/tests/nsalloc_tests_cxx.cpp | 32 + contrib/expat/tests/runtests.c | 12479 +------------------ .../tests/{runtestspp.cpp => runtests_cxx.cpp} | 4 +- contrib/expat/tests/structdata.c | 37 +- contrib/expat/tests/structdata_cxx.cpp | 32 + contrib/expat/xmlwf/Makefile.in | 10 +- contrib/expat/xmlwf/readfilemap.c | 21 +- contrib/expat/xmlwf/xmlfile.c | 16 +- contrib/expat/xmlwf/xmlfile.h | 4 +- contrib/expat/xmlwf/xmlwf.c | 156 +- contrib/expat/xmlwf/xmlwf_helpgen.py | 31 +- lib/libexpat/expat_config.h | 16 +- lib/libexpat/libbsdxml.3 | 4 +- 76 files changed, 17368 insertions(+), 13115 deletions(-) diff --git a/contrib/expat/Changes b/contrib/expat/Changes index e67171056950..a7d4caf9ac81 100644 --- a/contrib/expat/Changes +++ b/contrib/expat/Changes @@ -2,6 +2,120 @@ NOTE: We are looking for help with a few things: https://github.com/libexpat/libexpat/labels/help%20wanted If you can help, please get in touch. Thanks! +Release 2.6.0 Tue February 6 2024 + Security fixes: + #789 #814 CVE-2023-52425 -- Fix quadratic runtime issues with big tokens + that can cause denial of service, in partial where + dealing with compressed XML input. Applications + that parsed a document in one go -- a single call to + functions XML_Parse or XML_ParseBuffer -- were not affected. + The smaller the chunks/buffers you use for parsing + previously, the bigger the problem prior to the fix. + Backporters should be careful to no omit parts of + pull request #789 and to include earlier pull request #771, + in order to not break the fix. + #777 CVE-2023-52426 -- Fix billion laughs attacks for users + compiling *without* XML_DTD defined (which is not common). + Users with XML_DTD defined have been protected since + Expat >=2.4.0 (and that was CVE-2013-0340 back then). + + Bug fixes: + #753 Fix parse-size-dependent "invalid token" error for + external entities that start with a byte order mark + #780 Fix NULL pointer dereference in setContext via + XML_ExternalEntityParserCreate for compilation with + XML_DTD undefined + #812 #813 Protect against closing entities out of order + + Other changes: + #723 Improve support for arc4random/arc4random_buf + #771 #788 Improve buffer growth in XML_GetBuffer and XML_Parse + #761 #770 xmlwf: Support --help and --version + #759 #770 xmlwf: Support custom buffer size for XML_GetBuffer and read + #744 xmlwf: Improve language and URL clickability in help output + #673 examples: Add new example "element_declarations.c" + #764 Be stricter about macro XML_CONTEXT_BYTES at build time + #765 Make inclusion to expat_config.h consistent + #726 #727 Autotools: configure.ac: Support --disable-maintainer-mode + #678 #705 .. + #706 #733 #792 Autotools: Sync CMake templates with CMake 3.26 + #795 Autotools: Make installation of shipped man page doc/xmlwf.1 + independent of docbook2man availability + #815 Autotools|CMake: Add missing -DXML_STATIC to pkg-config file + section "Cflags.private" in order to fix compilation + against static libexpat using pkg-config on Windows + #724 #751 Autotools|CMake: Require a C99 compiler + (a de-facto requirement already since Expat 2.2.2 of 2017) + #793 Autotools|CMake: Fix PACKAGE_BUGREPORT variable + #750 #786 Autotools|CMake: Make test suite require a C++11 compiler + #749 CMake: Require CMake >=3.5.0 + #672 CMake: Lowercase off_t and size_t to help a bug in Meson + #746 CMake: Sort xmlwf sources alphabetically + #785 CMake|Windows: Fix generation of DLL file version info + #790 CMake: Build tests/benchmark/benchmark.c as well for + a build with -DEXPAT_BUILD_TESTS=ON + #745 #757 docs: Document the importance of isFinal + adjust tests + accordingly + #736 docs: Improve use of "NULL" and "null" + #713 docs: Be specific about version of XML (XML 1.0r4) + and version of C (C99); (XML 1.0r5 will need a sponsor.) + #762 docs: reference.html: Promote function XML_ParseBuffer more + #779 docs: reference.html: Add HTML anchors to XML_* macros + #760 docs: reference.html: Upgrade to OK.css 1.2.0 + #763 #739 docs: Fix typos + #696 docs|CI: Use HTTPS URLs instead of HTTP at various places + #669 #670 .. + #692 #703 .. + #733 #772 Address compiler warnings + #798 #800 Address clang-tidy warnings + #775 #776 Version info bumped from 9:10:8 (libexpat*.so.1.8.10) + to 10:0:9 (libexpat*.so.1.9.0); see https://verbump.de/ + for what these numbers do + + Infrastructure: + #700 #701 docs: Document security policy in file SECURITY.md + #766 docs: Improve parse buffer variables in-code documentation + #674 #738 .. + #740 #747 .. + #748 #781 #782 Refactor coverage and conformance tests + #714 #716 Refactor debug level variables to unsigned long + #671 Improve handling of empty environment variable value + in function getDebugLevel (without visible user effect) + #755 #774 .. + #758 #783 .. + #784 #787 tests: Improve test coverage with regard to parse chunk size + #660 #797 #801 Fuzzing: Improve fuzzing coverage + #367 #799 Fuzzing|CI: Start running OSS-Fuzz fuzzing regression tests + #698 #721 CI: Resolve some Travis CI leftovers + #669 CI: Be robust towards absence of Git tags + #693 #694 CI: Set permissions to "contents: read" for security + #709 CI: Pin all GitHub Actions to specific commits for security + #739 CI: Reject spelling errors using codespell + #798 CI: Enforce clang-tidy clean code + #773 #808 .. + #809 #810 CI: Upgrade Clang from 15 to 18 + #796 CI: Start using Clang's Control Flow Integrity sanitizer + #675 #720 #722 CI: Adapt to breaking changes in GitHub Actions Ubuntu images + #689 CI: Adapt to breaking changes in Clang/LLVM Debian packaging + #763 CI: Adapt to breaking changes in codespell + #803 CI: Adapt to breaking changes in Cppcheck + + Special thanks to: + Ivan Galkin + Joyce Brum + Philippe Antoine + Rhodri James + Snild Dolkow + spookyahell + Steven Garske + and + Clang AddressSanitizer + Clang UndefinedBehaviorSanitizer + codespell + GCC Farm Project + OSS-Fuzz + Sony Mobile + Release 2.5.0 Tue October 25 2022 Security fixes: #616 #649 #650 CVE-2022-43680 -- Fix heap use-after-free after overeager @@ -11,7 +125,7 @@ Release 2.5.0 Tue October 25 2022 arbitrary code execution. Bug fixes: - #612 #645 Fix curruption from undefined entities + #612 #645 Fix corruption from undefined entities #613 #654 Fix case when parsing was suspended while processing nested entities #616 #652 #653 Stop leaking opening tag bindings after a closing tag @@ -318,7 +432,7 @@ Release 2.4.2 Sun December 19 2021 see https://verbump.de/ for what these numbers do Special thanks to: - Dong-hee Na + Donghee Na Joergen Ibsen Kai Pastor diff --git a/contrib/expat/Makefile.am b/contrib/expat/Makefile.am index 37ae3738edd3..9c2259d23e63 100644 --- a/contrib/expat/Makefile.am +++ b/contrib/expat/Makefile.am @@ -6,9 +6,10 @@ # \___/_/\_\ .__/ \__,_|\__| # |_| XML parser # -# Copyright (c) 2017-2021 Sebastian Pipping +# Copyright (c) 2017-2023 Sebastian Pipping # Copyright (c) 2018 KangLin # Copyright (c) 2022 Johnny Jazeix +# Copyright (c) 2023 Sony Corporation / Snild Dolkow # Licensed under the MIT license: # # Permission is hereby granted, free of charge, to any person obtaining @@ -84,7 +85,7 @@ _EXTRA_DIST_WINDOWS = \ win32/expat.iss \ win32/MANIFEST.txt \ win32/README.txt \ - win32/version.rc + win32/version.rc.cmake EXTRA_DIST = \ $(_EXTRA_DIST_CMAKE) \ @@ -131,6 +132,11 @@ buildlib: run-benchmark: $(MAKE) -C tests/benchmark ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/recset.xml 65535 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_attr.xml 4096 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_cdata.xml 4096 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_comment.xml 4096 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_tag.xml 4096 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_text.xml 4096 3 .PHONY: download-xmlts-zip download-xmlts-zip: diff --git a/contrib/expat/Makefile.in b/contrib/expat/Makefile.in index 008c4109b793..f505224f6fa8 100644 --- a/contrib/expat/Makefile.in +++ b/contrib/expat/Makefile.in @@ -22,9 +22,10 @@ # \___/_/\_\ .__/ \__,_|\__| # |_| XML parser # -# Copyright (c) 2017-2021 Sebastian Pipping +# Copyright (c) 2017-2023 Sebastian Pipping # Copyright (c) 2018 KangLin # Copyright (c) 2022 Johnny Jazeix +# Copyright (c) 2023 Sony Corporation / Snild Dolkow # Licensed under the MIT license: # # Permission is hereby granted, free of charge, to any person obtaining @@ -136,6 +137,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/conftools/ax-append-compile-flags.m4 \ $(top_srcdir)/conftools/ax-append-link-flags.m4 \ $(top_srcdir)/conftools/expatcfg-compiler-supports-visibility.m4 \ + $(top_srcdir)/conftools/ax-cxx-compile-stdcxx.m4 \ + $(top_srcdir)/conftools/ax-cxx-compile-stdcxx-11.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -339,6 +342,7 @@ FGREP = @FGREP@ FILECMD = @FILECMD@ FILEMAP = @FILEMAP@ GREP = @GREP@ +HAVE_CXX11 = @HAVE_CXX11@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -358,6 +362,7 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -478,7 +483,7 @@ _EXTRA_DIST_WINDOWS = \ win32/expat.iss \ win32/MANIFEST.txt \ win32/README.txt \ - win32/version.rc + win32/version.rc.cmake EXTRA_DIST = \ $(_EXTRA_DIST_CMAKE) \ @@ -506,7 +511,7 @@ all: expat_config.h .SUFFIXES: am--refresh: Makefile @: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -532,9 +537,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck -$(top_srcdir)/configure: $(am__configure_deps) +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) -$(ACLOCAL_M4): $(am__aclocal_m4_deps) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): @@ -545,7 +550,7 @@ expat_config.h: stamp-h1 stamp-h1: $(srcdir)/expat_config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status expat_config.h -$(srcdir)/expat_config.h.in: $(am__configure_deps) +$(srcdir)/expat_config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ @@ -1092,6 +1097,11 @@ buildlib: run-benchmark: $(MAKE) -C tests/benchmark ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/recset.xml 65535 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_attr.xml 4096 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_cdata.xml 4096 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_comment.xml 4096 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_tag.xml 4096 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_text.xml 4096 3 .PHONY: download-xmlts-zip download-xmlts-zip: diff --git a/contrib/expat/README.md b/contrib/expat/README.md index e5e237fc9496..43c4f4f3dbb3 100644 --- a/contrib/expat/README.md +++ b/contrib/expat/README.md @@ -1,13 +1,14 @@ -[![Run Linux Travis CI tasks](https://github.com/libexpat/libexpat/actions/workflows/linux.yml/badge.svg)](https://github.com/libexpat/libexpat/actions/workflows/linux.yml) +[![Run Linux CI tasks](https://github.com/libexpat/libexpat/actions/workflows/linux.yml/badge.svg)](https://github.com/libexpat/libexpat/actions/workflows/linux.yml) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/libexpat/libexpat?svg=true)](https://ci.appveyor.com/project/libexpat/libexpat) [![Packaging status](https://repology.org/badge/tiny-repos/expat.svg)](https://repology.org/metapackage/expat/versions) [![Downloads SourceForge](https://img.shields.io/sourceforge/dt/expat?label=Downloads%20SourceForge)](https://sourceforge.net/projects/expat/files/) [![Downloads GitHub](https://img.shields.io/github/downloads/libexpat/libexpat/total?label=Downloads%20GitHub)](https://github.com/libexpat/libexpat/releases) -# Expat, Release 2.5.0 +# Expat, Release 2.6.0 -This is Expat, a C library for parsing XML, started by +This is Expat, a C99 library for parsing +[XML 1.0 Fourth Edition](https://www.w3.org/TR/2006/REC-xml-20060816/), started by [James Clark](https://en.wikipedia.org/wiki/James_Clark_%28programmer%29) in 1997. Expat is a stream-oriented XML parser. This means that you register handlers with the parser before starting the parse. These handlers diff --git a/contrib/expat/configure.ac b/contrib/expat/configure.ac index d3642dea5864..a5d1ff9317c8 100644 --- a/contrib/expat/configure.ac +++ b/contrib/expat/configure.ac @@ -11,7 +11,7 @@ dnl Copyright (c) 2000 Clark Cooper dnl Copyright (c) 2000-2005 Fred L. Drake, Jr. dnl Copyright (c) 2001-2003 Greg Stein dnl Copyright (c) 2006-2012 Karl Waclawek -dnl Copyright (c) 2016-2022 Sebastian Pipping +dnl Copyright (c) 2016-2024 Sebastian Pipping dnl Copyright (c) 2017 S. P. Zeidler dnl Copyright (c) 2017 Stephen Groat dnl Copyright (c) 2017-2020 Joe Orton @@ -60,7 +60,7 @@ m4_define([expat_version], m4_ifdef([__gnu__], [esyscmd(conftools/get-version.sh lib/expat.h)], [2.2.x])) -AC_INIT([expat], expat_version, [expat-bugs@libexpat.org]) +AC_INIT([expat], expat_version, [https://github.com/libexpat/libexpat/issues]) m4_undefine([expat_version]) AC_CONFIG_SRCDIR([Makefile.in]) @@ -68,6 +68,7 @@ AC_CONFIG_AUX_DIR([conftools]) AC_CONFIG_MACRO_DIR([m4]) AC_CANONICAL_HOST AM_INIT_AUTOMAKE +AM_MAINTAINER_MODE([enable]) # to allow argument --disable-maintainer-mode dnl @@ -81,9 +82,9 @@ dnl dnl If the API changes incompatibly set LIBAGE back to 0 dnl -LIBCURRENT=9 # sync -LIBREVISION=10 # with -LIBAGE=8 # CMakeLists.txt! +LIBCURRENT=10 # sync +LIBREVISION=0 # with +LIBAGE=9 # CMakeLists.txt! AC_CONFIG_HEADERS([expat_config.h]) AH_TOP([#ifndef EXPAT_CONFIG_H @@ -105,6 +106,9 @@ AC_SUBST(LIBAGE) AC_LANG([C]) AC_PROG_CC_C99 +AS_IF([test "${ac_cv_prog_cc_c99}" = no], + [AC_MSG_ERROR([Expat requires a C99 compiler.])]) + AS_IF([test "$GCC" = yes], [AX_APPEND_COMPILE_FLAGS([-Wall -Wextra], [AM_CFLAGS]) dnl Be careful about adding the -fexceptions option; some versions of @@ -176,6 +180,8 @@ AC_ARG_WITH([tests], [with_tests=yes]) AM_CONDITIONAL([WITH_TESTS], [test x${with_tests} = xyes]) +AS_IF([test x${with_tests} = xyes], + [AX_CXX_COMPILE_STDCXX_11([noext], [mandatory])]) AS_VAR_SET([EXPATCFG_ON_MINGW],[no]) AS_CASE("${host_os}", @@ -202,14 +208,16 @@ AS_IF([test "x${with_libbsd}" != xno], [], [AS_IF([test "x${with_libbsd}" = xyes], [AC_MSG_ERROR([Enforced use of libbsd cannot be satisfied.])])])]) -AC_MSG_CHECKING([for arc4random_buf (BSD or libbsd)]) +AC_MSG_CHECKING([for arc4random_buf (BSD, libbsd or glibc 2.36+)]) AC_LINK_IFELSE([AC_LANG_SOURCE([ - #include /* for arc4random_buf on BSD, for NULL */ #if defined(HAVE_LIBBSD) # include + #else + # include /* for arc4random_buf on BSD */ #endif int main() { - arc4random_buf(NULL, 0U); + char dummy[[123]]; // double brackets for m4 + arc4random_buf(dummy, 0U); return 0; } ])], @@ -217,7 +225,7 @@ AC_LINK_IFELSE([AC_LANG_SOURCE([ AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]) - AC_MSG_CHECKING([for arc4random (BSD, macOS or libbsd)]) + AC_MSG_CHECKING([for arc4random (BSD, macOS, libbsd or glibc 2.36+)]) AC_LINK_IFELSE([AC_LANG_SOURCE([ #if defined(HAVE_LIBBSD) # include @@ -295,6 +303,8 @@ AC_SUBST(FILEMAP) dnl Some basic configuration: AC_DEFINE([XML_NS], 1, [Define to make XML Namespaces functionality available.]) +AC_DEFINE([XML_GE], 1, + [Define as 1/0 to enable/disable support for general entities.]) AC_DEFINE([XML_DTD], 1, [Define to make parameter entity parsing functionality available.]) AC_DEFINE([XML_DEV_URANDOM], 1, @@ -319,9 +329,10 @@ AS_HELP_STRING([--disable-xml-context], AS_IF([test "x${enable_xml_context}" != "xno"], [AS_IF([test "x${enable_xml_context}" = "xyes" \ -o "x${enable_xml_context}" = "x"], - [AS_VAR_SET(enable_xml_context,1024)]) - AC_DEFINE_UNQUOTED([XML_CONTEXT_BYTES], [${enable_xml_context}], - [Define to specify how much context to retain around the current parse point.])]) + [AS_VAR_SET(enable_xml_context,1024)])], + [AS_VAR_SET(enable_xml_context,0)]) +AC_DEFINE_UNQUOTED([XML_CONTEXT_BYTES], [${enable_xml_context}], + [Define to specify how much context to retain around the current parse point, 0 to disable.]) AC_ARG_WITH([docbook], [AS_HELP_STRING([--with-docbook], @@ -345,8 +356,12 @@ AS_IF([test "x${DOCBOOK_TO_MAN}" != x -a "x$with_docbook" != xno], You can also configure using --without-docbook if you can do without a man page for xmlwf.])])]) -AM_CONDITIONAL(WITH_DOCBOOK, [test "x${DOCBOOK_TO_MAN}" != x]) - +dnl This will make sure that a release tarball shipping a pre-rendered xmlwf man page will +dnl get it installed, independent of whether some flavor of docbook2man is available. +dnl This relies on file xmlwf.1 being at least as recent as its source file xmlwf.xml. +AS_IF([test -f "${srcdir}"/doc/xmlwf.1], + [AM_CONDITIONAL(WITH_DOCBOOK, [true])], + [AM_CONDITIONAL(WITH_DOCBOOK, [test "x${DOCBOOK_TO_MAN}" != x])]) dnl Configure CMake file templates dnl NOTE: The *_TRUE variables read here are Automake conditionals diff --git a/contrib/expat/doc/Makefile.in b/contrib/expat/doc/Makefile.in index 7fef3eda1897..18f86be3947b 100644 --- a/contrib/expat/doc/Makefile.in +++ b/contrib/expat/doc/Makefile.in @@ -132,6 +132,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/conftools/ax-append-compile-flags.m4 \ $(top_srcdir)/conftools/ax-append-link-flags.m4 \ $(top_srcdir)/conftools/expatcfg-compiler-supports-visibility.m4 \ + $(top_srcdir)/conftools/ax-cxx-compile-stdcxx.m4 \ + $(top_srcdir)/conftools/ax-cxx-compile-stdcxx-11.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -241,6 +243,7 @@ FGREP = @FGREP@ FILECMD = @FILECMD@ FILEMAP = @FILEMAP@ GREP = @GREP@ +HAVE_CXX11 = @HAVE_CXX11@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -260,6 +263,7 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -351,7 +355,7 @@ EXTRA_DIST = \ all: all-am .SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -375,9 +379,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: $(am__configure_deps) +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/contrib/expat/doc/ok.min.css b/contrib/expat/doc/ok.min.css index 8b5f86e7042c..d324fabb2873 100644 --- a/contrib/expat/doc/ok.min.css +++ b/contrib/expat/doc/ok.min.css @@ -1,2 +1,2 @@ -/*! OK.css v1.0.3 | MIT License | github.com/andrewh0/okcss */@import url("https://rsms.me/inter/inter.css"); -/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus -inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}:root{--ok-sans:"Inter",system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Open Sans","Helvetica Neue","Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Se goe UI Symbol","Noto Color Emoji";--ok-mono:! SFMono-Regular,Menlo,Monaco,Consolas,"Ubuntu Mono","Liberation Mono","Courier New",Courier,monospace;--ok-fw-0:400;--ok-fw-1:600;--ok-fw-2:700;--ok-fw-3:700;--ok-fs-0:2.5rem;--ok-fs-1:2rem;--ok-fs-2:1.5rem;--ok-fs-3:1.25rem;--ok-fs-4:1rem;--ok-fs-5:0.75rem;--ok-br:0.25rem;--ok-s-0:0;--ok-s-1:0.25rem;--ok-s-2:0.5rem;--ok-s-3:1rem;--ok-s-4:1.5rem;--ok-s-5:2rem;--ok-s-6:2.5rem;--ok-lh-body:1.5;--ok-lh-heading:1.25;--ok-t-hl:#ffcf30;--ok-accent-0:#3e67fa;--ok-accent-1:#4788ff;--ok-tc-accent:#3173de;--ok-tc-code:#c23a30;--ok-tc-0:#000;--ok-tc-1:#747474;--ok-tc-2:#848484;--ok-bg-0:#fff;--ok-bg-1:#f0f0f0;--ok-bg-2:#ccc;--ok-b-0:1px solid #cbcbcb;--ok-b-1:1px solid #848484;--ok-down-0:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='8' viewBox='0 0 12 8' width='24' fill='none'%3E%3Cpath d='M6 6l4-4h1v1-1L6 7 1 2h1l4 4z' fill='%23747474'/%3E%3C/svg%3E");--ok-down-1:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='8 ' viewBox='0 0 12 8' width='24' fill='none'%3E%3Cpath d='M6 6l4-4h1v1-1L6 7 1 2h1l4 4z' fill='%23848484'/%3E%3C/svg%3E")}@media (prefers-color-scheme:dark){:root{--ok-tc-accent:#5c9aff;--ok-tc-code:#ed5853;--ok-tc-0:#fff;--ok-tc-1:#ababab;--ok-tc-2:#929292;--ok-bg-0:#000;--ok-bg-1:#212121;--ok-bg-2:#3e3e3e;--ok-b-0:1px solid #747474;--ok-b-1:1px solid #929292;--ok-down-0:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='8' viewBox='0 0 12 8' width='24' fill='none'%3E%3Cpath d='M6 6l4-4h1v1-1L6 7 1 2h1l4 4z' fill='%23ababab'/%3E%3C/svg%3E");--ok-down-1:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='8' viewBox='0 0 12 8' width='24' fill='none'%3E%3Cpath d='M6 6l4-4h1v1-1L6 7 1 2h1l4 4z' fill='%23929292'/%3E%3C/svg%3E")}}*,:after,:before{box-sizing:border-box}*{margin:0;padding:0}html{font-family:var(--ok-sans);line-sizing:normal;line-height:var(--ok-lh-body);font-weight:var(--ok-fw-0);color:var(--ok-tc-0);b ackground-color:var(--ok-bg-0);-webkit-font-! smoothing! :antialiased;-moz-osx-font-smoothing:grayscale;-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;-ms-text-size-adjust:100%;text-size-adjust:100%;text-rendering:optimizeLegibility}@supports (font-variation-settings:normal){html{font-family:Inter var,var(--ok-sans)}}button,input,optgroup,select,textarea{font-family:inherit;line-height:var(--ok-lh-body)}[role=button],button{cursor:pointer}audio,canvas,embed,iframe,img,input,object,select,svg,textarea,video{display:block}img,video{max-width:100%;height:auto}body{padding:var(--ok-s-3);max-width:80ch;margin:auto}h1{font-size:var(--ok-fs-0);margin:0}h2{font-size:var(--ok-fs-1)}h3{font-size:var(--ok-fs-2)}h4{font-size:var(--ok-fs-3)}h5{font-size:var(--ok-fs-4)}h6{font-size:var(--ok-fs-5);text-transform:uppercase;font-weight:var(--ok-fw-1)}h1,h2,h3,h4,h5,h6{line-height:var(--ok-lh-heading);font-weight:var(--ok-fw-3)}p{font-size:var(--ok-fs-4)}small{font-size:var(--ok-fs-5)}b,dt,strong{font-weight:var(--ok-fw-2)}address,article,aside,a udio,blockquote,button,canvas,dd,details,dialog,div,dl,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,img,input,main,nav,object,ol,p,pre,section,select,summary,svg,table,textarea,ul,video{margin-bottom:var(--ok-s-4)}address:last-child,article:last-child,aside:last-child,blockquote:last-child,dd:last-child,details:last-child,dialog:last-child,div:last-child,dl:last-child,dt:last-child,fieldset:last-child,figcaption:last-child,figure:last-child,footer:last-child,form:last-child,h1:last-child,h2:last-child,h3:last-child,h4:last-child,h5:last-child,h6:last-child,header:last-child,hgroup:last-child,hr:last-child,input[type=checkbox],input[type=radio],main:last-child,nav:last-child,ol:last-child,p:last-child,pre:last-child,section:last-child,table:last-child,ul:last-child{margin-bottom:0}fieldset{padding:var(--ok-s-3);border:var(--ok-b-0);border-radius:var(--ok-br)}legend{font-weight:var(--ok-fw-1);text-transform:uppercase;font-size:var(--ok-fs-5)}i nput,select{padding:var(--ok-s-2);background! :var(--ok! -bg-0);border:var(--ok-b-0);border-radius:var(--ok-br);color:var(--ok-tc-0);min-width:25ch}input:disabled,select:disabled,textarea:disabled{color:var(--ok-tc-2)}input::placeholder,textarea::placeholder{color:var(--ok-tc-2)}input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{color:var(--ok-tc-2)}input::-moz-placeholder,textarea::-moz-placeholder{color:var(--ok-tc-2)}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:var(--ok-tc-2)}input::-ms-input-placeholder,textarea::-ms-input-placeholder{color:var(--ok-tc-2)}input::-webkit-clear-button,input::-webkit-inner-spin-button,input::-webkit-search-cancel-button,input::-webkit-search-results-button{display:none}input::-ms-clear,input::-ms-reveal{display:none}input:disabled,textarea:disabled{background-color:var(--ok-bg-1)}input[type=search]{-webkit-appearance:none;-moz-appearance:none;appearance:none}input[type=file]{max-width:300px}input[type=number]{-moz-appearance:textfield}input[type=checkbox],input[type= radio]{display:inline;min-width:auto}input[type=color]{height:2.5rem}input[type=date],input[type=datetime-local],input[type=month],input[type=time],input[type=week]{height:2.5rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;position:relative}input[type=date]:before,input[type=datetime-local]:before,input[type=month]:before,input[type=time]:before,input[type=week]:before{position:absolute;right:0;top:0;background-image:var(--ok-down-0);background-repeat:no-repeat;background-position:right .2em top 50%;background-size:2em auto;width:2.5rem;height:calc(2.5rem - 2px);content:""}input[type=date]:disabled:before,input[type=datetime-local]:disabled:before,input[type=month]:disabled:before,input[type=time]:disabled:before,input[type=week]:disabled:before{background-image:var(--ok-down-1)}input::-webkit-calendar-picker-indicator{position:absolute;top:0;right:0;background-color:transparent;cursor:pointer;padding:0;width:2.5rem;height:calc(2.5rem - 2px);content:"";opacity:0}inp ut[type=range]{overflow:visible;line-height:! inherit;f! ont-family:inherit;-webkit-appearance:none;-moz-appearance:none;appearance:none;margin:0;outline:none;cursor:pointer;padding:0;vertical-align:middle;border:none;min-height:2rem;background-color:transparent}input[type=range]::-webkit-slider-runnable-track{cursor:pointer;-webkit-appearance:none;border-radius:var(--ok-br);border:var(--ok-b-0);background-color:var(--ok-bg-1);background-image:linear-gradient(var(--ok-bg-1),var(--ok-bg-1));width:100%;height:.5rem;color:transparent;box-sizing:border-box;position:relative}input[type=range]::-moz-range-track{cursor:pointer;-moz-appearance:none;border-radius:var(--ok-br);border:var(--ok-b-0);background-color:var(--ok-bg-1);background-image:linear-gradient(var(--ok-bg-1),var(--ok-bg-1));width:100%;height:.5rem;color:transparent;box-sizing:border-box}input[type=range]::-ms-track{cursor:pointer;-ms-appearance:none;border-radius:var(--ok-br);border:var(--ok-b-0);background-color:var(--ok-bg-1);background-image:linear-gradient(var(--ok-bg-1),var(- -ok-bg-1));width:100%;height:.5rem;color:transparent;box-sizing:border-box}input[type=range]::-ms-fill-lower{background:transparent}input[type=range]::-webkit-slider-thumb{cursor:pointer;-webkit-appearance:none;border-radius:50%;background-color:var(--ok-accent-0);width:1.5rem;height:1.5rem;margin-top:calc(-.5rem - 1px)}input[type=range]::-moz-range-thumb{cursor:pointer;-moz-appearance:none;border:none;border-radius:50%;background-color:var(--ok-accent-0);width:1.5rem;height:1.5rem}input[type=range]::-ms-thumb{cursor:pointer;-ms-appearance:none;border-radius:50%;background-color:var(--ok-accent-0);width:1.5rem;height:1.5rem;transform:translateY(.25rem)}input[type=range]:focus:not(:disabled)::-webkit-slider-thumb{background-color:var(--ok-accent-1)}input[type=range]:focus:not(:disabled)::-moz-range-thumb{background-color:var(--ok-accent-1)}input[type=range]:focus:not(:disabled)::-ms-thumb{background-color:var(--ok-accent-1)}input[type=range]:disabled{cursor:default}input[type=range]: disabled::-webkit-slider-runnable-track{curs! or:defaul! t}input[type=range]:disabled::-moz-range-track{cursor:default}input[type=range]:disabled::-ms-track{cursor:default}input[type=range]:disabled::-webkit-slider-thumb{background-color:var(--ok-bg-2);cursor:default}input[type=range]:disabled::-moz-range-thumb{background-color:var(--ok-bg-2);cursor:default}input[type=range]:disabled::-ms-thumb{background-color:var(--ok-bg-2);cursor:default}select{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:var(--ok-b-0);border-radius:var(--ok-br);background-color:var(--ok-bg-0);min-height:2.5rem;color:var(--ok-tc-0)}select:not([multiple]){background-image:var(--ok-down-0);background-repeat:no-repeat,repeat;background-position:right .2em top 50%;background-size:2em auto;padding-right:2.5em;height:2.5rem}select::-ms-expand{display:none}select:not([multiple]):disabled{background-image:var(--ok-down-1);background-color:var(--ok-bg-1);cursor:default}select[multiple]{border-radius:var(--ok-br)}select[multiple]:disabled{background-color: var(--ok-bg-1)}select[multiple] option{color:var(--ok-t-)}select[multiple]:disabled option{color:var(--ok-tc-2)}textarea{padding:var(--ok-s-2);resize:vertical;background:var(--ok-bg-0);border:var(--ok-b-0);border-radius:var(--ok-br);color:var(--ok-tc-0);min-height:calc(2.5rem - 2px);min-width:25ch}button,input[type=button],input[type=reset],input[type=submit]{display:inline-block;background-color:var(--ok-accent-0);border-radius:var(--ok-br);color:#fff;font-weight:var(--ok-fw-1);height:2.5rem;border:none;padding:var(--ok-s-2) var(--ok-s-3);white-space:nowrap;min-width:auto}input::-webkit-file-upload-button{display:inline-block;background-color:var(--ok-accent-0);border-radius:var(--ok-br);color:#fff;font-weight:var(--ok-fw-1);height:2.5rem;border:none;padding:var(--ok-s-2) var(--ok-s-3);white-space:nowrap}input:disabled::-webkit-file-upload-button{cursor:default;opacity:.5}button,input[type=button],input[type=reset],input[type=submit]{cursor:pointer}input:not(:disabled)::-webkit-fil e-upload-button{cursor:pointer}button:disabl! ed,input[! type=button]:disabled,input[type=reset]:disabled,input[type=submit]:disabled{cursor:default;opacity:.5;background-color:var(--ok-accent-0)}button:focus:not(:disabled),input[type=button]:focus:not(:disabled),input[type=reset]:focus:not(:disabled),input[type=submit]:focus:not(:disabled){background-color:var(--ok-accent-1)}input:not(:disabled):focus::-webkit-file-upload-button{background-color:var(--ok-accent-1)}table{border-collapse:collapse;border-radius:var(--ok-br);display:block;max-width:-webkit-fit-content;max-width:-moz-fit-content;max-width:fit-content;margin-left:auto;margin-right:auto;overflow-x:auto;white-space:nowrap}tfoot,thead{border:var(--ok-b-0)}tfoot tr,thead tr{background-color:var(--ok-bg-1);font-size:var(--ok-fs-5);text-transform:uppercase;color:var(--ok-tc-0)}td,th{border:var(--ok-b-0) 0;text-align:left;padding:.5rem}td{white-space:normal;max-width:20ch}tr{border:var(--ok-b-0)}table caption{font-size:var(--ok-fs-4);font-weight:var(--ok-fw-3);padding:.5rem}code,samp {padding:.2em .4em;color:var(--ok-tc-code)}code,pre,samp{font-family:var(--ok-mono);line-height:var(--ok-lh-body);background-color:var(--ok-bg-1);border-radius:var(--ok-br);text-transform:none}pre{padding:var(--ok-s-3);white-space:pre;overflow-x:auto}pre,var{color:var(--ok-tc-0)}var{font-family:var(--ok-mono);font-style:normal}code pre,pre code{background:inherit;font-size:inherit;color:inherit;border:0;padding:0;margin:0}code pre{display:inline}kbd{background-color:var(--ok-bg-1);border:var(--ok-b-0);border-radius:var(--ok-br);border-bottom:2px solid var(--ok-bg-2);padding:var(--ok-s-1);font-family:var(--ok-sans);color:var(--ok-tc-0)}a{text-decoration:none;font-weight:var(--ok-fw-1)}a,a:visited{color:var(--ok-tc-accent)}ol,ul{padding-left:var(--ok-s-5)}nav ul{text-decoration:none;padding-left:0}nav ul li{display:inline;margin-right:1em}audio,img,video{margin-left:auto;margin-right:auto}img{border-radius:var(--ok-br)}figure>img:not(:last-child){margin-bottom:var(--ok-s-1)}figure>fig caption{text-align:center}figcaption,time{fo! nt-size:v! ar(--ok-fs-5);color:var(--ok-tc-1)}mark{padding:.2em .4em;background:var(--ok-t-hl);color:#000;border-radius:var(--ok-br)}iframe{border:var(--ok-b-0);border-radius:var(--ok-br);width:100%}hr{border:none;border-bottom:var(--ok-b-0)}footer{font-size:var(--ok-fs-5)}blockquote,footer{color:var(--ok-tc-1)}blockquote{position:relative;margin-left:0;margin-right:0;padding-left:var(--ok-s-5)}blockquote:before{position:absolute;height:100%;content:"";width:4px;left:0;border-radius:var(--ok-br);background-color:var(--ok-bg-1)}dd{padding-left:var(--ok-s-5)}abbr{cursor:help}@media (hover:hover){a:hover{text-decoration:underline}input:hover:not(:disabled):not(:focus):not([type=submit]):not([type=button]):not([type=reset]):not([type=range]),select:hover:not(:disabled):not(:focus),textarea:hover:not(:disabled):not(:focus){border:var(--ok-b-1)}input[type=range]:hover:not(:disabled)::-webkit-slider-runnable-track{border:var(--ok-b-1)}input[type=range]:hover:not(:disabled)::-moz-range-track{border:va r(--ok-b-1)}input[type=range]:hover:not(:disabled)::-ms-track{border:var(--ok-b-1)}select:not([multiple]):not(:disabled):hover{cursor:pointer}button:hover:not(:disabled),input[type=button]:hover:not(:disabled),input[type=reset]:hover:not(:disabled),input[type=submit]:hover:not(:disabled){background-color:var(--ok-accent-1)}input:not(:disabled):hover::-webkit-file-upload-button{background-color:var(--ok-accent-1)}} \ No newline at end of file +/*! OK.css v1.2.0 | MIT License | github.com/andrewh0/okcss */@import url("https://rsms.me/inter/inter.css"); +/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus -inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}:root{--ok-sans:"Inter",system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Open Sans","Helvetica Neue","Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Se goe UI Symbol","Noto Color Emoji";--ok-mono:! SFMono-Regular,Menlo,Monaco,Consolas,"Ubuntu Mono","Liberation Mono","Courier New",Courier,monospace;--ok-fw-0:400;--ok-fw-1:600;--ok-fw-2:700;--ok-fw-3:700;--ok-fs-0:2.5rem;--ok-fs-1:2rem;--ok-fs-2:1.5rem;--ok-fs-3:1.25rem;--ok-fs-4:1rem;--ok-fs-5:0.75rem;--ok-br:0.25rem;--ok-s-0:0;--ok-s-1:0.25rem;--ok-s-2:0.5rem;--ok-s-3:1rem;--ok-s-4:1.5rem;--ok-s-5:2rem;--ok-s-6:2.5rem;--ok-lh-body:1.5;--ok-lh-heading:1.25;--ok-t-hl:#ffcf30;--ok-accent-0:#3e67fa;--ok-accent-1:#4788ff;--ok-tc-accent:#3173de;--ok-tc-code:#c23a30;--ok-tc-0:#000;--ok-tc-1:#747474;--ok-tc-2:#848484;--ok-bg-0:#fff;--ok-bg-1:#f0f0f0;--ok-bg-2:#ccc;--ok-b-0:1px solid #cbcbcb;--ok-b-1:1px solid #848484;--ok-down-0:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='8' viewBox='0 0 12 8' width='24' fill='none'%3E%3Cpath d='M6 6l4-4h1v1-1L6 7 1 2h1l4 4z' fill='%23747474'/%3E%3C/svg%3E");--ok-down-1:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='8 ' viewBox='0 0 12 8' width='24' fill='none'%3E%3Cpath d='M6 6l4-4h1v1-1L6 7 1 2h1l4 4z' fill='%23848484'/%3E%3C/svg%3E")}@media (prefers-color-scheme:dark){:root{--ok-tc-accent:#5c9aff;--ok-tc-code:#ed5853;--ok-tc-0:#fff;--ok-tc-1:#ababab;--ok-tc-2:#929292;--ok-bg-0:#000;--ok-bg-1:#212121;--ok-bg-2:#3e3e3e;--ok-b-0:1px solid #747474;--ok-b-1:1px solid #929292;--ok-down-0:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='8' viewBox='0 0 12 8' width='24' fill='none'%3E%3Cpath d='M6 6l4-4h1v1-1L6 7 1 2h1l4 4z' fill='%23ababab'/%3E%3C/svg%3E");--ok-down-1:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='8' viewBox='0 0 12 8' width='24' fill='none'%3E%3Cpath d='M6 6l4-4h1v1-1L6 7 1 2h1l4 4z' fill='%23929292'/%3E%3C/svg%3E")}}*,:after,:before{box-sizing:border-box}*{margin:0;padding:0}html{font-family:var(--ok-sans);line-sizing:normal;line-height:var(--ok-lh-body);font-weight:var(--ok-fw-0);color:var(--ok-tc-0);b ackground-color:var(--ok-bg-0);-webkit-font-! smoothing! :antialiased;-moz-osx-font-smoothing:grayscale;-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;-ms-text-size-adjust:100%;text-size-adjust:100%;text-rendering:optimizeLegibility;scroll-behavior:smooth}@supports (font-variation-settings:normal){html{font-family:Inter var,var(--ok-sans)}}button,input,optgroup,select,textarea{font-family:inherit;line-height:var(--ok-lh-body)}[role=button],button{cursor:pointer}audio,canvas,embed,iframe,img,input,object,select,svg,textarea,video{display:block}img,video{max-width:100%;height:auto}body{padding:var(--ok-s-3);max-width:80ch;margin:auto}article{padding-bottom:var(--ok-s-6)}h1{font-size:var(--ok-fs-0);margin:0}h2{font-size:var(--ok-fs-1)}h3{font-size:var(--ok-fs-2)}h4{font-size:var(--ok-fs-3)}h5{font-size:var(--ok-fs-4)}h6{font-size:var(--ok-fs-5);text-transform:uppercase;font-weight:var(--ok-fw-1)}h1,h2,h3,h4,h5,h6{line-height:var(--ok-lh-heading);font-weight:var(--ok-fw-3);margin-top:var(--ok-s-6);margin-bottom:var(--ok-s-3)}h1+*,h2 +*,h3+*,h4+*,h5+*,h6+*,hr+*{margin-top:0}p{font-size:var(--ok-fs-4)}small{font-size:var(--ok-fs-5)}b,dt,strong{font-weight:var(--ok-fw-2)}address,article,aside,audio,blockquote,button,canvas,dd,details,dialog,div,dl,embed,fieldset,figcaption,figure,footer,form,header,hgroup,hr,iframe,img,input,main,nav,object,ol,p,pre,section,select,summary,svg,table,textarea,ul,video{margin-bottom:var(--ok-s-4)}address:last-child,article:last-child,aside:last-child,blockquote:last-child,dd:last-child,details:last-child,dialog:last-child,div:last-child,dl:last-child,dt:last-child,fieldset:last-child,figcaption:last-child,figure:last-child,footer:last-child,form:last-child,h1:last-child,h2:last-child,h3:last-child,h4:last-child,h5:last-child,h6:last-child,header:last-child,hgroup:last-child,hr:last-child,input[type=checkbox],input[type=radio],main:last-child,nav:last-child,ol:last-child,p:last-child,pre:last-child,section:last-child,table:last-child,ul:last-child{margin-bottom:0}fieldset{padding:var( --ok-s-3);border:var(--ok-b-0);border-radius! :var(--ok! -br)}legend{font-weight:var(--ok-fw-1);text-transform:uppercase;font-size:var(--ok-fs-5)}input,select{padding:var(--ok-s-2);background:var(--ok-bg-0);border:var(--ok-b-0);border-radius:var(--ok-br);color:var(--ok-tc-0);min-width:25ch}input:disabled,select:disabled,textarea:disabled{color:var(--ok-tc-2)}input::placeholder,textarea::placeholder{color:var(--ok-tc-2)}input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{color:var(--ok-tc-2)}input::-moz-placeholder,textarea::-moz-placeholder{color:var(--ok-tc-2)}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:var(--ok-tc-2)}input::-ms-input-placeholder,textarea::-ms-input-placeholder{color:var(--ok-tc-2)}input::-webkit-clear-button,input::-webkit-inner-spin-button,input::-webkit-search-cancel-button,input::-webkit-search-results-button{display:none}input::-ms-clear,input::-ms-reveal{display:none}input:disabled,textarea:disabled{background-color:var(--ok-bg-1)}input[type=search]{-webkit-appearance:none;-moz -appearance:none;appearance:none}input[type=file]{max-width:300px}input[type=number]{-moz-appearance:textfield}input[type=checkbox],input[type=radio]{display:inline;min-width:auto}input[type=color]{height:2.5rem}input[type=date],input[type=datetime-local],input[type=month],input[type=time],input[type=week]{height:2.5rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;position:relative}input[type=date]:before,input[type=datetime-local]:before,input[type=month]:before,input[type=time]:before,input[type=week]:before{position:absolute;right:0;top:0;background-image:var(--ok-down-0);background-repeat:no-repeat;background-position:right .2em top 50%;background-size:2em auto;width:2.5rem;height:calc(2.5rem - 2px);content:""}input[type=date]:disabled:before,input[type=datetime-local]:disabled:before,input[type=month]:disabled:before,input[type=time]:disabled:before,input[type=week]:disabled:before{background-image:var(--ok-down-1)}input::-webkit-calendar-picker-indicator{positi on:absolute;top:0;right:0;background-color:t! ransparen! t;cursor:pointer;padding:0;width:2.5rem;height:calc(2.5rem - 2px);content:"";opacity:0}input[type=range]{overflow:visible;line-height:inherit;font-family:inherit;-webkit-appearance:none;-moz-appearance:none;appearance:none;margin:0;outline:none;cursor:pointer;padding:0;vertical-align:middle;border:none;min-height:2rem;background-color:transparent}input[type=range]::-webkit-slider-runnable-track{cursor:pointer;-webkit-appearance:none;border-radius:var(--ok-br);border:var(--ok-b-0);background-color:var(--ok-bg-1);background-image:linear-gradient(var(--ok-bg-1),var(--ok-bg-1));width:100%;height:.5rem;color:transparent;box-sizing:border-box;position:relative}input[type=range]::-moz-range-track{cursor:pointer;-moz-appearance:none;border-radius:var(--ok-br);border:var(--ok-b-0);background-color:var(--ok-bg-1);background-image:linear-gradient(var(--ok-bg-1),var(--ok-bg-1));width:100%;height:.5rem;color:transparent;box-sizing:border-box}input[type=range]::-ms-track{cursor:pointer;-ms-appear ance:none;border-radius:var(--ok-br);border:var(--ok-b-0);background-color:var(--ok-bg-1);background-image:linear-gradient(var(--ok-bg-1),var(--ok-bg-1));width:100%;height:.5rem;color:transparent;box-sizing:border-box}input[type=range]::-ms-fill-lower{background:transparent}input[type=range]::-webkit-slider-thumb{cursor:pointer;-webkit-appearance:none;border-radius:50%;background-color:var(--ok-accent-0);width:1.5rem;height:1.5rem;margin-top:calc(-.5rem - 1px)}input[type=range]::-moz-range-thumb{cursor:pointer;-moz-appearance:none;border:none;border-radius:50%;background-color:var(--ok-accent-0);width:1.5rem;height:1.5rem}input[type=range]::-ms-thumb{cursor:pointer;-ms-appearance:none;border-radius:50%;background-color:var(--ok-accent-0);width:1.5rem;height:1.5rem;transform:translateY(.25rem)}input[type=range]:focus:not(:disabled)::-webkit-slider-thumb{background-color:var(--ok-accent-1)}input[type=range]:focus:not(:disabled)::-moz-range-thumb{background-color:var(--ok-accent-1)}inp ut[type=range]:focus:not(:disabled)::-ms-thu! mb{backgr! ound-color:var(--ok-accent-1)}input[type=range]:disabled{cursor:default}input[type=range]:disabled::-webkit-slider-runnable-track{cursor:default}input[type=range]:disabled::-moz-range-track{cursor:default}input[type=range]:disabled::-ms-track{cursor:default}input[type=range]:disabled::-webkit-slider-thumb{background-color:var(--ok-bg-2);cursor:default}input[type=range]:disabled::-moz-range-thumb{background-color:var(--ok-bg-2);cursor:default}input[type=range]:disabled::-ms-thumb{background-color:var(--ok-bg-2);cursor:default}select{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:var(--ok-b-0);border-radius:var(--ok-br);background-color:var(--ok-bg-0);min-height:2.5rem;color:var(--ok-tc-0)}select:not([multiple]){background-image:var(--ok-down-0);background-repeat:no-repeat,repeat;background-position:right .2em top 50%;background-size:2em auto;padding-right:2.5em;height:2.5rem}select::-ms-expand{display:none}select:not([multiple]):disabled{background-image:var(--ok -down-1);background-color:var(--ok-bg-1);cursor:default}select[multiple]{border-radius:var(--ok-br)}select[multiple]:disabled{background-color:var(--ok-bg-1)}select[multiple] option{color:var(--ok-t-)}select[multiple]:disabled option{color:var(--ok-tc-2)}textarea{padding:var(--ok-s-2);resize:vertical;background:var(--ok-bg-0);border:var(--ok-b-0);border-radius:var(--ok-br);color:var(--ok-tc-0);min-height:calc(2.5rem - 2px);min-width:25ch}button,input[type=button],input[type=reset],input[type=submit]{display:inline-block;background-color:var(--ok-accent-0);border-radius:var(--ok-br);color:#fff;font-weight:var(--ok-fw-1);height:2.5rem;border:none;padding:var(--ok-s-2) var(--ok-s-3);white-space:nowrap;min-width:auto}input::-webkit-file-upload-button{display:inline-block;background-color:var(--ok-accent-0);border-radius:var(--ok-br);color:#fff;font-weight:var(--ok-fw-1);height:2.5rem;border:none;padding:var(--ok-s-2) var(--ok-s-3);white-space:nowrap}input:disabled::-webkit-file-upload-b utton{cursor:default;opacity:.5}button,input! [type=but! ton],input[type=reset],input[type=submit]{cursor:pointer}input:not(:disabled)::-webkit-file-upload-button{cursor:pointer}button:disabled,input[type=button]:disabled,input[type=reset]:disabled,input[type=submit]:disabled{cursor:default;opacity:.5;background-color:var(--ok-accent-0)}button:focus:not(:disabled),input[type=button]:focus:not(:disabled),input[type=reset]:focus:not(:disabled),input[type=submit]:focus:not(:disabled){background-color:var(--ok-accent-1)}input:not(:disabled):focus::-webkit-file-upload-button{background-color:var(--ok-accent-1)}table{border-collapse:collapse;display:table;margin-left:auto;margin-right:auto;white-space:nowrap}tfoot,thead{border:var(--ok-b-0)}thead{position:-webkit-sticky;position:sticky;top:0}tfoot tr,thead tr{background-color:var(--ok-bg-1);font-size:var(--ok-fs-5);text-transform:uppercase;color:var(--ok-tc-0)}td,th{border:var(--ok-b-0) 0;text-align:left;padding:.5rem}td{white-space:normal;max-width:20ch}tr{border:var(--ok-b-0)}table caption{fo nt-size:var(--ok-fs-4);font-weight:var(--ok-fw-3);padding:.5rem}code,samp{padding:.2em .4em;color:var(--ok-tc-code)}code,pre,samp{font-family:var(--ok-mono);font-size:87.5%;line-height:var(--ok-lh-body);background-color:var(--ok-bg-1);border-radius:var(--ok-br);text-transform:none}pre{padding:var(--ok-s-3);white-space:pre;overflow-x:auto}pre,var{color:var(--ok-tc-0)}var{font-family:var(--ok-mono);font-style:normal}code pre,pre code{background:inherit;font-size:inherit;color:inherit;border:0;padding:0;margin:0}code pre{display:inline}kbd{background-color:var(--ok-bg-1);border:var(--ok-b-0);border-radius:var(--ok-br);border-bottom:2px solid var(--ok-bg-2);padding:var(--ok-s-1);font-family:var(--ok-sans);color:var(--ok-tc-0)}a{text-decoration:none;font-weight:var(--ok-fw-1)}a,a:visited,a code,a mark,a samp{color:var(--ok-tc-accent)}ol,ul{padding-left:var(--ok-s-5)}nav ul{text-decoration:none;padding-left:0}nav ul li{display:inline;margin-right:1em}li p{margin-bottom:0}li,li p+p{margin- top:.5em}audio,img,video{margin-left:auto;ma! rgin-righ! t:auto}img{border-radius:var(--ok-br)}figure>img:not(:last-child){margin-bottom:var(--ok-s-1)}figure>figcaption{text-align:center}figcaption,time{font-size:var(--ok-fs-5);color:var(--ok-tc-1)}mark{padding:.2em .4em;background:var(--ok-t-hl);color:#000;border-radius:var(--ok-br)}iframe{border:var(--ok-b-0);border-radius:var(--ok-br);width:100%}hr{border:none;border-bottom:var(--ok-b-0)}footer{font-size:var(--ok-fs-5)}blockquote,footer{color:var(--ok-tc-1)}blockquote{position:relative;margin-left:0;margin-right:0;padding-left:var(--ok-s-5)}blockquote:before{position:absolute;height:100%;content:"";width:4px;left:0;border-radius:var(--ok-br);background-color:var(--ok-bg-1)}dd{padding-left:var(--ok-s-5)}abbr{cursor:help}@media (hover:hover){a:hover{text-decoration:underline}input:hover:not(:disabled):not(:focus):not([type=submit]):not([type=button]):not([type=reset]):not([type=range]),select:hover:not(:disabled):not(:focus),textarea:hover:not(:disabled):not(:focus){border:var(--ok-b-1)} input[type=range]:hover:not(:disabled)::-webkit-slider-runnable-track{border:var(--ok-b-1)}input[type=range]:hover:not(:disabled)::-moz-range-track{border:var(--ok-b-1)}input[type=range]:hover:not(:disabled)::-ms-track{border:var(--ok-b-1)}select:not([multiple]):not(:disabled):hover{cursor:pointer}button:hover:not(:disabled),input[type=button]:hover:not(:disabled),input[type=reset]:hover:not(:disabled),input[type=submit]:hover:not(:disabled){background-color:var(--ok-accent-1)}input:not(:disabled):hover::-webkit-file-upload-button{background-color:var(--ok-accent-1)}} \ No newline at end of file diff --git a/contrib/expat/doc/reference.html b/contrib/expat/doc/reference.html index 8b0d47d6dd7b..898f03a3364d 100644 --- a/contrib/expat/doc/reference.html +++ b/contrib/expat/doc/reference.html @@ -14,11 +14,13 @@ Copyright (c) 2000 Clark Cooper Copyright (c) 2000-2004 Fred L. Drake, Jr. Copyright (c) 2002-2012 Karl Waclawek - Copyright (c) 2017-2022 Sebastian Pipping + Copyright (c) 2017-2024 Sebastian Pipping Copyright (c) 2017 Jakub Wilk Copyright (c) 2021 Tomas Korbar Copyright (c) 2021 Nicolas Cavallari Copyright (c) 2022 Thijs Schreijer + Copyright (c) 2023 Hanno Böck + Copyright (c) 2023 Sony Corporation / Snild Dolkow Licensed under the MIT license: Permission is hereby granted, free of charge, to any person obtaining @@ -50,7 +52,7 @@

    The Expat XML Parser - Release 2.5.0 + Release 2.6.0

    @@ -68,11 +70,11 @@ Working Group at W3C that produced the XML specification.

    This is free software, licensed under the MIT/X Consortium license. You may download it -from the Expat home page. +from the Expat home page.

    The bulk of this document was originally commissioned as an article -by XML.com. They graciously allowed +by XML.com. They graciously allowed Clark Cooper to retain copyright and to distribute it with Expat. This version has been substantially extended to include documentation on features which have been added since the original article was @@ -151,10 +153,11 @@ interface.

  • - Billion Laughs Attack Protection + Attack Protection
  • Miscellaneous Functions @@ -305,7 +308,7 @@ shoveling the document to the parser so that it can do its work.

    The Expat distribution comes as a compressed (with GNU gzip) tar file. You may download the latest version from Source Forge. After +"https://sourceforge.net/projects/expat/" >Source Forge. After unpacking this, cd into the directory. Then follow either the Win32 directions or Unix directions below.

    @@ -359,37 +362,64 @@ and the definition of character types in the case of XML_UNICODE_WCHAR_T. The symbols are:

    -
    XML_DTD
    +
    XML_GE
    +
    +Added in Expat 2.6.0. +Include support for +general entities +(syntax &e1; to reference and +syntax <!ENTITY e1 'value1'> (an internal general entity) or +<!ENTITY e2 SYSTEM 'file2'> (an external general entity) to declare). +With XML_GE enabled, general entities will be replaced by their declared replacement text; +for this to work for external general entities, in addition an +XML_ExternalEntityRefHandler must be set using +XML_SetExternalEntityRefHandler. +Also, enabling XML_GE makes +the functions +XML_SetBillionLaughsAttackProtectionMaximumAmplification and + +XML_SetBillionLaughsAttackProtectionActivationThreshold available. +
    +With XML_GE disabled, Expat has a smaller memory footprint and can be faster, but will +not load external general entities and will replace all general entities +(except the predefined five: +amp, apos, gt, lt, quot) +with a self-reference: +for example, referencing an entity e1 via &e1; will be replaced +by text &e1;. +
    + +
    XML_DTD
    Include support for using and reporting DTD-based content. If this is defined, default attribute values from an external DTD subset are reported and attribute value normalization occurs based on the type of attributes defined in the external subset. Without this, Expat has a smaller memory footprint and can be faster, but will -not load external entities or process conditional sections. If defined, makes +not load external parameter entities or process conditional sections. If defined, makes the functions XML_SetBillionLaughsAttackProtectionMaximumAmplification and XML_SetBillionLaughsAttackProtectionActivationThreshold available.
    -
    XML_NS
    +
    XML_NS
    When defined, support for the Namespaces in XML +"https://www.w3.org/TR/REC-xml-names/" >Namespaces in XML specification is included.
    -
    XML_UNICODE
    +
    XML_UNICODE
    When defined, character data reported to the application is encoded in UTF-16 using wide characters of the type XML_Char. This is implied if XML_UNICODE_WCHAR_T is defined.
    -
    XML_UNICODE_WCHAR_T
    +
    XML_UNICODE_WCHAR_T
    If defined, causes the XML_Char character type to be defined using the wchar_t type; otherwise, unsigned short is used. Defining this implies XML_UNICODE.
    -
    XML_LARGE_SIZE
    +
    XML_LARGE_SIZE
    If defined, causes the XML_Size and XML_Index integer types to be at least 64 bits in size. This is intended to support processing of very large input streams, where the return values of @@ -399,23 +429,23 @@ processing of very large input streams, where the return values of could overflow. It may not be supported by all compilers, and is turned off by default.
    -
    XML_CONTEXT_BYTES
    +
    XML_CONTEXT_BYTES
    The number of input bytes of markup context which the parser will ensure are available for reporting via XML_GetInputContext. This is -normally set to 1024, and must be set to a positive integer. If this -is not defined, the input context will not be available and XML_GetInputContext will -always report NULL. Without this, Expat has a smaller memory +always report NULL. Without this, Expat has a smaller memory footprint and can be faster.
    -
    XML_STATIC
    +
    XML_STATIC
    On Windows, this should be set if Expat is going to be linked statically with the code that calls it; this is required to get all the right MSVC magic annotations correct. This is ignored on other platforms.
    -
    XML_ATTR_INFO
    +
    XML_ATTR_INFO
    If defined, makes the additional function XML_GetAttributeInfo available for reporting attribute byte offsets.
    @@ -669,8 +699,9 @@ function. The StartNamespaceDeclHandler is called prior to the start tag handler and the EndNamespaceDeclHandler is called after the corresponding end tag that ends the namespace's scope. The namespace start handler gets passed the prefix and URI for the namespace. For a -default namespace declaration (xmlns='...'), the prefix will be null. -The URI will be null for the case where the default namespace is being +default namespace declaration (xmlns='...'), the prefix will be +NULL. +The URI will be NULL for the case where the default namespace is being unset. The namespace end handler just gets the prefix for the closing scope.

    @@ -799,7 +830,7 @@ has already been passed into the parser. Applications for this include

      -
    • Supporting the Supporting the XInclude specification.
    • Delaying further processing until additional information is @@ -947,16 +978,20 @@ XML_Parser XMLCALL XML_ParserCreate(const XML_Char *encoding);
      -Construct a new parser. If encoding is non-null, it specifies a +

      +Construct a new parser. If encoding is non-NULL, it specifies a character encoding to use for the document. This overrides the document encoding declaration. There are four built-in encodings: +

      • US-ASCII
      • UTF-8
      • UTF-16
      • ISO-8859-1
      +

      Any other value will invoke a call to the UnknownEncodingHandler. +

      XML_ParserCreateNS

      @@ -1003,9 +1038,9 @@ typedef struct {

      Construct a new parser using the suite of memory handling functions -specified in ms. If ms is NULL, then use the +specified in ms. If ms is NULL, then use the standard set of memory management functions. If sep is -non NULL, then namespace processing is enabled in the created parser +non-NULL, then namespace processing is enabled in the created parser and the character pointed at by sep is used as the separator between the namespace URI and the local part of the name.

      @@ -1077,6 +1112,11 @@ exceed the maximum integer value. Input data at the end of a buffer will remain unprocessed if it is part of an XML token for which the end is not part of that buffer.

      +

      The application must make a concluding +XML_Parse or +XML_ParseBuffer call +with isFinal set to XML_TRUE.

      +

      XML_Parse

       enum XML_Status XMLCALL
      @@ -1092,17 +1132,50 @@ enum XML_Status {
       };
       
      +

      Parse some more of the document. The string s is a buffer containing part (or perhaps all) of the document. The number of bytes of s that are part of the document is indicated by len. This means -that s doesn't have to be null terminated. It also means that +that s doesn't have to be null-terminated. It also means that if len is larger than the number of bytes in the block of memory that s points at, then a memory fault is likely. The isFinal parameter informs the parser that this is the last piece of the document. Frequently, the last piece is empty (i.e. len is zero.) +

      + +

      If a parse error occurred, it returns XML_STATUS_ERROR. Otherwise it returns XML_STATUS_OK value. +Note that regardless of the return value, there is no guarantee that all +provided input has been parsed; only after the +concluding call will all handler callbacks and parsing errors have +happened. +

      + +

      +Simplified, XML_Parse can be considered a convenience wrapper +that is pairing calls +to XML_GetBuffer +and XML_ParseBuffer +(when Expat is built with macro XML_CONTEXT_BYTES +defined to a positive value, which is both common and default). +XML_Parse is then functionally equivalent to calling +XML_GetBuffer, +memcpy, and +XML_ParseBuffer. +

      + +

      +To avoid double copying of the input, direct use of functions +XML_GetBuffer and +XML_ParseBuffer is advised +for most production use, e.g. +if you're using read or similar functionality to fill your +buffers, fill directly into the buffer from +XML_GetBuffer, +then parse with XML_ParseBuffer. +

      XML_ParseBuffer

      @@ -1128,8 +1201,8 @@ XML_GetBuffer(XML_Parser p,
      Obtain a buffer of size len to read a piece of the document -into. A NULL value is returned if Expat can't allocate enough memory for -this buffer. A NULL value may also be returned if len is zero. +into. A NULL value is returned if Expat can't allocate enough memory for +this buffer. A NULL value may also be returned if len is zero. This has to be called prior to every call to XML_ParseBuffer. A typical use would look like this: @@ -1275,7 +1348,7 @@ typedef struct {

      Returns status of parser with respect to being initialized, parsing, finished, or suspended, and whether the final buffer is being processed. The status parameter must not be -NULL.

      +NULL.

      New in Expat 1.95.8.

      @@ -1290,7 +1363,7 @@ to ignore all text not descended from a para element. One way it could do this is to set the character handler when a para start tag is seen, and unset it for the corresponding end tag.

      -

      A handler may be unset by providing a NULL pointer to the +

      A handler may be unset by providing a NULL pointer to the appropriate handler setter. None of the handler setting functions have a return value.

      @@ -1318,7 +1391,7 @@ typedef void handler as a pointer to a vector of char pointers. Each attribute seen in a start (or empty) tag occupies 2 consecutive places in this vector: the attribute name followed by the attribute value. These pairs are terminated -by a null pointer.

      +by a NULL pointer.

      Note that an empty tag generates a call to both start and end handlers (in that order).

  • @@ -1368,7 +1441,7 @@ is NOT null-terminated. You have to use the length argument to deal with the end of the string. A single block of contiguous text free of markup may still result in a sequence of calls to this handler. In other words, if you're searching for a pattern in the text, it may -be split across calls to this handler. Note: Setting this handler to NULL +be split across calls to this handler. Note: Setting this handler to NULL may NOT immediately terminate call-backs if the parser is currently processing such a single block of contiguous markup-free text, as the parser will continue calling back until the end of the block is reached.

    @@ -1526,16 +1599,16 @@ the format expected by the context argument to XML_ExternalEntityParserCreate. code is valid only until the handler returns, so if the referenced entity is -to be parsed later, it must be copied. context is NULL +to be parsed later, it must be copied. context is NULL only when the entity is a parameter entity, which is how one can differentiate between general and parameter entities.

    The base parameter is the base to use for relative system identifiers. It is set by XML_SetBase and may be NULL. The +href="#XML_SetBase">XML_SetBase and may be NULL. The publicId parameter is the public id given in the entity -declaration and may be NULL. systemId is the system -identifier specified in the entity declaration and is never NULL.

    +declaration and may be NULL. systemId is the system +identifier specified in the entity declaration and is never NULL.

    There are a couple of ways in which this handler differs from others. First, this handler returns a status indicator (an @@ -1564,10 +1637,10 @@ XML_SetExternalEntityRefHandlerArg(XML_Parser p,

    Set the argument passed to the ExternalEntityRefHandler. If -arg is not NULL, it is the new value passed to the +arg is not NULL, it is the new value passed to the handler set using XML_SetExternalEntityRefHandler; if arg is -NULL, the argument passed to the handler function will be the parser +NULL, the argument passed to the handler function will be the parser object itself.

    Note: @@ -1650,14 +1723,14 @@ value is -1, then that byte is invalid as the initial byte in a sequence. If the value is -n, where n is an integer > 1, then n is the number of bytes in the sequence and the actual conversion is accomplished by a call to the function pointed at by convert. This function may return -1 -if the sequence itself is invalid. The convert pointer may be null if +if the sequence itself is invalid. The convert pointer may be NULL if there are only single byte codes. The data parameter passed to the convert function is the data pointer from XML_Encoding. The string s is NOT null-terminated and points at the sequence of bytes to be converted.

    The function pointed at by release is called by the -parser when it is finished with the encoding. It may be NULL.

    +parser when it is finished with the encoding. It may be NULL.

    @@ -1724,8 +1797,8 @@ typedef void

    Sets a handler that is called for XML declarations and also for text declarations discovered in external entities. The way to -distinguish is that the version parameter will be NULL -for text declarations. The encoding parameter may be NULL +distinguish is that the version parameter will be NULL +for text declarations. The encoding parameter may be NULL for an XML declaration. The standalone argument will contain -1, 0, or 1 indicating respectively that there was no standalone parameter in the declaration, that it was given as no, or @@ -1749,7 +1822,7 @@ typedef void

    Set a handler that is called at the start of a DOCTYPE declaration, before any external or internal subset is parsed. Both sysid -and pubid may be NULL. The has_internal_subset +and pubid may be NULL. The has_internal_subset will be non-zero if the DOCTYPE declaration has an internal subset.

    @@ -1831,7 +1904,7 @@ around and freed at a later stage.

    XML_Content nodes. If type equals XML_CTYPE_EMPTY or XML_CTYPE_ANY, then quant will be XML_CQUANT_NONE, and the other -fields will be zero or NULL. If type is *** 32728 LINES SKIPPED *** From nobody Wed Feb 21 08:09:08 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Tfpnw3kLlz5Bjcj; Wed, 21 Feb 2024 08:09:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Tfpnw2cKtz415M; Wed, 21 Feb 2024 08:09:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708502948; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZnBhJoYIlZdmSjVUn5gJGbCgvkxKcddfmBgscYuG5Xg=; b=NBfegqJkilXwOAiSPgViFqyn1bxV1TnpymDNct3l5g8THkiERRVj2JhDWGcXYZ8+UMw0mA XYoBj/RcDhZRFVyTcIuKj49XvDtapla1oBEGXPfzz72iYqn2qbfRHzxQyyJxI/ElQI14aO dwUUsO8gnzFG9ahyZ5UjJxCJO9MZPV3feoSSYFVKuf131pee5mh8vRSAD7dGNiCHYv2FvV /8OCc2fi9Aqf6nLCbnA/oV50IzNl75JVt7scq6e6PWe77PPVaC8WZmSJsYiAezhU286HSw 0dI6FfZa3hlNjU24RR6iHNHk2+cWm2mbfc102WlolhlNa6F6P4bh///i3iODtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708502948; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZnBhJoYIlZdmSjVUn5gJGbCgvkxKcddfmBgscYuG5Xg=; b=EoUy9aUv1wpeVdWnrTYFyIGmzKwtrtNamMCVT/fK+NdyVMcTmjKRqh/QfTOLqlGr/jaMpJ d7EjvTO+hoF6AdiYOJRzb+cMhXQfe+dAcvaGCsE3Ui/N+Sifmr9NGC4zxbVMd1WdApVnvu PmkoSSscc6JZktq1UQCgJFDR1aqVTupgTIedq9B4iK5kQkl1uPKEE7cQkDY+RmvYylKawD d+6qyz093/lHqyOUkxpSAOshHeSyek8QuN8Te6xvpdO8WnkAPIx6739/U+Bdty4e0bNlNf BaCliujszOCdHk8JsRV/2QzmGflwuZasetz29RG2KTkAdK5KWUOhNq6v9pm3Cg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708502948; a=rsa-sha256; cv=none; b=bZqPwJO2stgJBgJp2CXMYGqVmw/KjtB31GUNr6zUAdZ8BWodB0kSN5QuX2GO0QVdL9QOJp xtFesduwiGrkJba+dtikuhMoAfwMeJs+/U1iX4atTnWdZwMPrB8roBqxqsk/MHAf9FVuwO uGywRXHxQptt7qc00uW/CTgbZjDlozp8HIOzizr16RG7RSCrgOd6zUkktQq31G6RifffF5 /hXjsVyx3AMocH4Gbg9rrHKE/jJSAebm+3fuW7e7nO5y13xcfepuMIt9JXe7ZhbsKST3y7 V86G0nrV6b7WIq+IdgYy97tuuHwh+eKwExnsm91uWU7rr314252P6VmOkF59XA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Tfpnw1fVyzvXm; Wed, 21 Feb 2024 08:09:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41L898Cc076803; Wed, 21 Feb 2024 08:09:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41L898Oo076800; Wed, 21 Feb 2024 08:09:08 GMT (envelope-from git) Date: Wed, 21 Feb 2024 08:09:08 GMT Message-Id: <202402210809.41L898Oo076800@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: d111b1e4a0a7 - stable/13 - MFC: MFV: zlib 1.3.1. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: d111b1e4a0a78aa4de8c0b68f031fdcec3a15ea0 Auto-Submitted: auto-generated The branch stable/13 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=d111b1e4a0a78aa4de8c0b68f031fdcec3a15ea0 commit d111b1e4a0a78aa4de8c0b68f031fdcec3a15ea0 Author: Xin LI AuthorDate: 2024-02-18 06:12:51 +0000 Commit: Xin LI CommitDate: 2024-02-21 08:08:02 +0000 MFC: MFV: zlib 1.3.1. Approved by: re (cperciva, expedited MFC) (cherry picked from commit 6255c67c3d1a268535c50de74d3300fd86d8f15d) --- sys/contrib/zlib/ChangeLog | 10 ++++++++ sys/contrib/zlib/FAQ | 3 +-- sys/contrib/zlib/README | 6 ++--- sys/contrib/zlib/deflate.c | 47 +++++++++++++++++++++++++++++--------- sys/contrib/zlib/deflate.h | 35 ++++++++++++++++++++++++++-- sys/contrib/zlib/doc/algorithm.txt | 2 +- sys/contrib/zlib/gzguts.h | 8 ++----- sys/contrib/zlib/gzlib.c | 12 +++++----- sys/contrib/zlib/inflate.c | 2 +- sys/contrib/zlib/inftrees.c | 6 ++--- sys/contrib/zlib/inftrees.h | 4 ++-- sys/contrib/zlib/test/example.c | 3 ++- sys/contrib/zlib/test/minigzip.c | 2 +- sys/contrib/zlib/trees.c | 20 +++++++++++++--- sys/contrib/zlib/zconf.h | 10 +------- sys/contrib/zlib/zconf.h.in | 10 +------- sys/contrib/zlib/zlib.3 | 6 ++--- sys/contrib/zlib/zlib.h | 22 +++++++++--------- sys/contrib/zlib/zutil.h | 27 +++------------------- 19 files changed, 137 insertions(+), 98 deletions(-) diff --git a/sys/contrib/zlib/ChangeLog b/sys/contrib/zlib/ChangeLog index 8707988ac18c..b801a1031ec0 100644 --- a/sys/contrib/zlib/ChangeLog +++ b/sys/contrib/zlib/ChangeLog @@ -1,6 +1,16 @@ ChangeLog file for zlib +Changes in 1.3.1 (22 Jan 2024) +- Reject overflows of zip header fields in minizip +- Fix bug in inflateSync() for data held in bit buffer +- Add LIT_MEM define to use more memory for a small deflate speedup +- Fix decision on the emission of Zip64 end records in minizip +- Add bounds checking to ERR_MSG() macro, used by zError() +- Neutralize zip file traversal attacks in miniunz +- Fix a bug in ZLIB_DEBUG compiles in check_match() +- Various portability and appearance improvements + Changes in 1.3 (18 Aug 2023) - Remove K&R function definitions and zlib2ansi - Fix bug in deflateBound() for level 0 and memLevel 9 diff --git a/sys/contrib/zlib/FAQ b/sys/contrib/zlib/FAQ index 55f1cdc22f6b..92f5d3e29fab 100644 --- a/sys/contrib/zlib/FAQ +++ b/sys/contrib/zlib/FAQ @@ -14,8 +14,7 @@ The latest zlib FAQ is at http://zlib.net/zlib_faq.html 2. Where can I get a Windows DLL version? The zlib sources can be compiled without change to produce a DLL. See the - file win32/DLL_FAQ.txt in the zlib distribution. Pointers to the - precompiled DLL are found in the zlib web site at http://zlib.net/ . + file win32/DLL_FAQ.txt in the zlib distribution. 3. Where can I get a Visual Basic interface to zlib? diff --git a/sys/contrib/zlib/README b/sys/contrib/zlib/README index e02fc5aa206b..c5f917540b6f 100644 --- a/sys/contrib/zlib/README +++ b/sys/contrib/zlib/README @@ -1,6 +1,6 @@ ZLIB DATA COMPRESSION LIBRARY -zlib 1.3 is a general purpose data compression library. All the code is +zlib 1.3.1 is a general purpose data compression library. All the code is thread safe. The data format used by the zlib library is described by RFCs (Request for Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and @@ -31,7 +31,7 @@ Mark Nelson wrote an article about zlib for the Jan. 1997 issue of Dr. Dobb's Journal; a copy of the article is available at https://marknelson.us/posts/1997/01/01/zlib-engine.html . -The changes made in version 1.3 are documented in the file ChangeLog. +The changes made in version 1.3.1 are documented in the file ChangeLog. Unsupported third party contributions are provided in directory contrib/ . @@ -83,7 +83,7 @@ Acknowledgments: Copyright notice: - (C) 1995-2023 Jean-loup Gailly and Mark Adler + (C) 1995-2024 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/sys/contrib/zlib/deflate.c b/sys/contrib/zlib/deflate.c index 06eb2c0f6de5..97b184a82868 100644 --- a/sys/contrib/zlib/deflate.c +++ b/sys/contrib/zlib/deflate.c @@ -1,5 +1,5 @@ /* deflate.c -- compress data using the deflation algorithm - * Copyright (C) 1995-2023 Jean-loup Gailly and Mark Adler + * Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -52,7 +52,7 @@ #include "deflate.h" const char deflate_copyright[] = - " deflate 1.3 Copyright 1995-2023 Jean-loup Gailly and Mark Adler "; + " deflate 1.3.1 Copyright 1995-2024 Jean-loup Gailly and Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -493,7 +493,7 @@ int ZEXPORT deflateInit2_(z_streamp strm, int level, int method, * symbols from which it is being constructed. */ - s->pending_buf = (uchf *) ZALLOC(strm, s->lit_bufsize, 4); + s->pending_buf = (uchf *) ZALLOC(strm, s->lit_bufsize, LIT_BUFS); s->pending_buf_size = (ulg)s->lit_bufsize * 4; if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL || @@ -503,8 +503,14 @@ int ZEXPORT deflateInit2_(z_streamp strm, int level, int method, deflateEnd (strm); return Z_MEM_ERROR; } +#ifdef LIT_MEM + s->d_buf = (ushf *)(s->pending_buf + (s->lit_bufsize << 1)); + s->l_buf = s->pending_buf + (s->lit_bufsize << 2); + s->sym_end = s->lit_bufsize - 1; +#else s->sym_buf = s->pending_buf + s->lit_bufsize; s->sym_end = (s->lit_bufsize - 1) * 3; +#endif /* We avoid equality with lit_bufsize*3 because of wraparound at 64K * on 16 bit machines and because stored blocks are restricted to * 64K-1 bytes. @@ -720,9 +726,15 @@ int ZEXPORT deflatePrime(z_streamp strm, int bits, int value) { if (deflateStateCheck(strm)) return Z_STREAM_ERROR; s = strm->state; +#ifdef LIT_MEM + if (bits < 0 || bits > 16 || + (uchf *)s->d_buf < s->pending_out + ((Buf_size + 7) >> 3)) + return Z_BUF_ERROR; +#else if (bits < 0 || bits > 16 || s->sym_buf < s->pending_out + ((Buf_size + 7) >> 3)) return Z_BUF_ERROR; +#endif do { put = Buf_size - s->bi_valid; if (put > bits) @@ -1294,7 +1306,7 @@ int ZEXPORT deflateCopy(z_streamp dest, z_streamp source) { ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte)); ds->prev = (Posf *) ZALLOC(dest, ds->w_size, sizeof(Pos)); ds->head = (Posf *) ZALLOC(dest, ds->hash_size, sizeof(Pos)); - ds->pending_buf = (uchf *) ZALLOC(dest, ds->lit_bufsize, 4); + ds->pending_buf = (uchf *) ZALLOC(dest, ds->lit_bufsize, LIT_BUFS); if (ds->window == Z_NULL || ds->prev == Z_NULL || ds->head == Z_NULL || ds->pending_buf == Z_NULL) { @@ -1305,10 +1317,15 @@ int ZEXPORT deflateCopy(z_streamp dest, z_streamp source) { zmemcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte)); zmemcpy((voidpf)ds->prev, (voidpf)ss->prev, ds->w_size * sizeof(Pos)); zmemcpy((voidpf)ds->head, (voidpf)ss->head, ds->hash_size * sizeof(Pos)); - zmemcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size); + zmemcpy(ds->pending_buf, ss->pending_buf, ds->lit_bufsize * LIT_BUFS); ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf); +#ifdef LIT_MEM + ds->d_buf = (ushf *)(ds->pending_buf + (ds->lit_bufsize << 1)); + ds->l_buf = ds->pending_buf + (ds->lit_bufsize << 2); +#else ds->sym_buf = ds->pending_buf + ds->lit_bufsize; +#endif ds->l_desc.dyn_tree = ds->dyn_ltree; ds->d_desc.dyn_tree = ds->dyn_dtree; @@ -1539,13 +1556,21 @@ local uInt longest_match(deflate_state *s, IPos cur_match) { */ local void check_match(deflate_state *s, IPos start, IPos match, int length) { /* check that the match is indeed a match */ - if (zmemcmp(s->window + match, - s->window + start, length) != EQUAL) { - fprintf(stderr, " start %u, match %u, length %d\n", - start, match, length); + Bytef *back = s->window + (int)match, *here = s->window + start; + IPos len = length; + if (match == (IPos)-1) { + /* match starts one byte before the current window -- just compare the + subsequent length-1 bytes */ + back++; + here++; + len--; + } + if (zmemcmp(back, here, len) != EQUAL) { + fprintf(stderr, " start %u, match %d, length %d\n", + start, (int)match, length); do { - fprintf(stderr, "%c%c", s->window[match++], s->window[start++]); - } while (--length != 0); + fprintf(stderr, "(%02x %02x)", *back++, *here++); + } while (--len != 0); z_error("invalid match"); } if (z_verbose > 1) { diff --git a/sys/contrib/zlib/deflate.h b/sys/contrib/zlib/deflate.h index 8696791429f2..300c6ada62b8 100644 --- a/sys/contrib/zlib/deflate.h +++ b/sys/contrib/zlib/deflate.h @@ -1,5 +1,5 @@ /* deflate.h -- internal compression state - * Copyright (C) 1995-2018 Jean-loup Gailly + * Copyright (C) 1995-2024 Jean-loup Gailly * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -23,6 +23,10 @@ # define GZIP #endif +/* define LIT_MEM to slightly increase the speed of deflate (order 1% to 2%) at + the cost of a larger memory footprint */ +/* #define LIT_MEM */ + /* =========================================================================== * Internal compression state. */ @@ -217,7 +221,14 @@ typedef struct internal_state { /* Depth of each subtree used as tie breaker for trees of equal frequency */ +#ifdef LIT_MEM +# define LIT_BUFS 5 + ushf *d_buf; /* buffer for distances */ + uchf *l_buf; /* buffer for literals/lengths */ +#else +# define LIT_BUFS 4 uchf *sym_buf; /* buffer for distances and literals/lengths */ +#endif uInt lit_bufsize; /* Size of match buffer for literals/lengths. There are 4 reasons for @@ -239,7 +250,7 @@ typedef struct internal_state { * - I can't count above 4 */ - uInt sym_next; /* running index in sym_buf */ + uInt sym_next; /* running index in symbol buffer */ uInt sym_end; /* symbol table full when sym_next reaches this */ ulg opt_len; /* bit length of current block with optimal trees */ @@ -318,6 +329,25 @@ void ZLIB_INTERNAL _tr_stored_block(deflate_state *s, charf *buf, extern const uch ZLIB_INTERNAL _dist_code[]; #endif +#ifdef LIT_MEM +# define _tr_tally_lit(s, c, flush) \ + { uch cc = (c); \ + s->d_buf[s->sym_next] = 0; \ + s->l_buf[s->sym_next++] = cc; \ + s->dyn_ltree[cc].Freq++; \ + flush = (s->sym_next == s->sym_end); \ + } +# define _tr_tally_dist(s, distance, length, flush) \ + { uch len = (uch)(length); \ + ush dist = (ush)(distance); \ + s->d_buf[s->sym_next] = dist; \ + s->l_buf[s->sym_next++] = len; \ + dist--; \ + s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \ + s->dyn_dtree[d_code(dist)].Freq++; \ + flush = (s->sym_next == s->sym_end); \ + } +#else # define _tr_tally_lit(s, c, flush) \ { uch cc = (c); \ s->sym_buf[s->sym_next++] = 0; \ @@ -337,6 +367,7 @@ void ZLIB_INTERNAL _tr_stored_block(deflate_state *s, charf *buf, s->dyn_dtree[d_code(dist)].Freq++; \ flush = (s->sym_next == s->sym_end); \ } +#endif #else # define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c) # define _tr_tally_dist(s, distance, length, flush) \ diff --git a/sys/contrib/zlib/doc/algorithm.txt b/sys/contrib/zlib/doc/algorithm.txt index c97f495020b4..029e5a313498 100644 --- a/sys/contrib/zlib/doc/algorithm.txt +++ b/sys/contrib/zlib/doc/algorithm.txt @@ -77,7 +77,7 @@ table took no time (and if you had infinite memory), then there would only be a first level table to cover all the way to the longest code. However, building the table ends up taking a lot longer for more bits since short codes are replicated many times in such a table. What inflate() does is -simply to make the number of bits in the first table a variable, and then +simply to make the number of bits in the first table a variable, and then to set that variable for the maximum speed. For inflate, which has 286 possible codes for the literal/length tree, the size diff --git a/sys/contrib/zlib/gzguts.h b/sys/contrib/zlib/gzguts.h index f9375047e8c5..eba72085bb75 100644 --- a/sys/contrib/zlib/gzguts.h +++ b/sys/contrib/zlib/gzguts.h @@ -1,5 +1,5 @@ /* gzguts.h -- zlib internal header definitions for gz* operations - * Copyright (C) 2004-2019 Mark Adler + * Copyright (C) 2004-2024 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -210,9 +210,5 @@ char ZLIB_INTERNAL *gz_strwinerror(DWORD error); /* GT_OFF(x), where x is an unsigned value, is true if x > maximum z_off64_t value -- needed when comparing unsigned to z_off64_t, which is signed (possible z_off64_t types off_t, off64_t, and long are all signed) */ -#ifdef INT_MAX -# define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > INT_MAX) -#else unsigned ZLIB_INTERNAL gz_intmax(void); -# define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax()) -#endif +#define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax()) diff --git a/sys/contrib/zlib/gzlib.c b/sys/contrib/zlib/gzlib.c index da6b2c56c380..75b3e675f5f7 100644 --- a/sys/contrib/zlib/gzlib.c +++ b/sys/contrib/zlib/gzlib.c @@ -1,5 +1,5 @@ /* gzlib.c -- zlib functions common to reading and writing gzip files - * Copyright (C) 2004-2019 Mark Adler + * Copyright (C) 2004-2024 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -565,20 +565,20 @@ void ZLIB_INTERNAL gz_error(gz_statep state, int err, const char *msg) { #endif } -#ifndef INT_MAX /* portably return maximum value for an int (when limits.h presumed not available) -- we need to do this to cover cases where 2's complement not used, since C standard permits 1's complement and sign-bit representations, otherwise we could just use ((unsigned)-1) >> 1 */ unsigned ZLIB_INTERNAL gz_intmax(void) { - unsigned p, q; - - p = 1; +#ifdef INT_MAX + return INT_MAX; +#else + unsigned p = 1, q; do { q = p; p <<= 1; p++; } while (p > q); return q >> 1; -} #endif +} diff --git a/sys/contrib/zlib/inflate.c b/sys/contrib/zlib/inflate.c index c58ee237956a..395ae51bbf56 100644 --- a/sys/contrib/zlib/inflate.c +++ b/sys/contrib/zlib/inflate.c @@ -1387,7 +1387,7 @@ int ZEXPORT inflateSync(z_streamp strm) { /* if first time, start search in bit buffer */ if (state->mode != SYNC) { state->mode = SYNC; - state->hold <<= state->bits & 7; + state->hold >>= state->bits & 7; state->bits -= state->bits & 7; len = 0; while (state->bits >= 8) { diff --git a/sys/contrib/zlib/inftrees.c b/sys/contrib/zlib/inftrees.c index 8a208c2daa8c..98cfe164458c 100644 --- a/sys/contrib/zlib/inftrees.c +++ b/sys/contrib/zlib/inftrees.c @@ -1,5 +1,5 @@ /* inftrees.c -- generate Huffman trees for efficient decoding - * Copyright (C) 1995-2023 Mark Adler + * Copyright (C) 1995-2024 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -9,7 +9,7 @@ #define MAXBITS 15 const char inflate_copyright[] = - " inflate 1.3 Copyright 1995-2023 Mark Adler "; + " inflate 1.3.1 Copyright 1995-2024 Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -57,7 +57,7 @@ int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; static const unsigned short lext[31] = { /* Length codes 257..285 extra */ 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, - 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 198, 203}; + 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 203, 77}; static const unsigned short dbase[32] = { /* Distance codes 0..29 base */ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, diff --git a/sys/contrib/zlib/inftrees.h b/sys/contrib/zlib/inftrees.h index a10712d8cb5a..396f74b5da79 100644 --- a/sys/contrib/zlib/inftrees.h +++ b/sys/contrib/zlib/inftrees.h @@ -41,8 +41,8 @@ typedef struct { examples/enough.c found in the zlib distribution. The arguments to that program are the number of symbols, the initial root table size, and the maximum bit length of a code. "enough 286 9 15" for literal/length codes - returns returns 852, and "enough 30 6 15" for distance codes returns 592. - The initial root table size (9 or 6) is found in the fifth argument of the + returns 852, and "enough 30 6 15" for distance codes returns 592. The + initial root table size (9 or 6) is found in the fifth argument of the inflate_table() calls in inflate.c and infback.c. If the root table size is changed, then these maximum sizes would be need to be recalculated and updated. */ diff --git a/sys/contrib/zlib/test/example.c b/sys/contrib/zlib/test/example.c index f27ba8e2fdcb..c3521dd5934f 100644 --- a/sys/contrib/zlib/test/example.c +++ b/sys/contrib/zlib/test/example.c @@ -364,7 +364,8 @@ static void test_flush(Byte *compr, uLong *comprLen) { /* =========================================================================== * Test inflateSync() */ -static void test_sync(Byte *compr, uLong comprLen, Byte *uncompr, uLong uncomprLen) { +static void test_sync(Byte *compr, uLong comprLen, Byte *uncompr, + uLong uncomprLen) { int err; z_stream d_stream; /* decompression stream */ diff --git a/sys/contrib/zlib/test/minigzip.c b/sys/contrib/zlib/test/minigzip.c index c72356dbccf2..134e10e6c3e9 100644 --- a/sys/contrib/zlib/test/minigzip.c +++ b/sys/contrib/zlib/test/minigzip.c @@ -303,7 +303,7 @@ static void error(const char *msg) { #ifdef USE_MMAP /* MMAP version, Miguel Albrecht */ /* Try compressing the input file at once using mmap. Return Z_OK if - * if success, Z_ERRNO otherwise. + * success, Z_ERRNO otherwise. */ static int gz_compress_mmap(FILE *in, gzFile out) { int len; diff --git a/sys/contrib/zlib/trees.c b/sys/contrib/zlib/trees.c index 8dbdc40bacce..6a523ef34e3c 100644 --- a/sys/contrib/zlib/trees.c +++ b/sys/contrib/zlib/trees.c @@ -1,5 +1,5 @@ /* trees.c -- output deflated data using Huffman coding - * Copyright (C) 1995-2021 Jean-loup Gailly + * Copyright (C) 1995-2024 Jean-loup Gailly * detect_data_type() function provided freely by Cosmin Truta, 2006 * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -899,14 +899,19 @@ local void compress_block(deflate_state *s, const ct_data *ltree, const ct_data *dtree) { unsigned dist; /* distance of matched string */ int lc; /* match length or unmatched char (if dist == 0) */ - unsigned sx = 0; /* running index in sym_buf */ + unsigned sx = 0; /* running index in symbol buffers */ unsigned code; /* the code to send */ int extra; /* number of extra bits to send */ if (s->sym_next != 0) do { +#ifdef LIT_MEM + dist = s->d_buf[sx]; + lc = s->l_buf[sx++]; +#else dist = s->sym_buf[sx++] & 0xff; dist += (unsigned)(s->sym_buf[sx++] & 0xff) << 8; lc = s->sym_buf[sx++]; +#endif if (dist == 0) { send_code(s, lc, ltree); /* send a literal byte */ Tracecv(isgraph(lc), (stderr," '%c' ", lc)); @@ -931,8 +936,12 @@ local void compress_block(deflate_state *s, const ct_data *ltree, } } /* literal or match pair ? */ - /* Check that the overlay between pending_buf and sym_buf is ok: */ + /* Check for no overlay of pending_buf on needed symbols */ +#ifdef LIT_MEM + Assert(s->pending < 2 * (s->lit_bufsize + sx), "pendingBuf overflow"); +#else Assert(s->pending < s->lit_bufsize + sx, "pendingBuf overflow"); +#endif } while (sx < s->sym_next); @@ -1082,9 +1091,14 @@ void ZLIB_INTERNAL _tr_flush_block(deflate_state *s, charf *buf, * the current block must be flushed. */ int ZLIB_INTERNAL _tr_tally(deflate_state *s, unsigned dist, unsigned lc) { +#ifdef LIT_MEM + s->d_buf[s->sym_next] = (ush)dist; + s->l_buf[s->sym_next++] = (uch)lc; +#else s->sym_buf[s->sym_next++] = (uch)dist; s->sym_buf[s->sym_next++] = (uch)(dist >> 8); s->sym_buf[s->sym_next++] = (uch)lc; +#endif if (dist == 0) { /* lc is the unmatched char */ s->dyn_ltree[lc].Freq++; diff --git a/sys/contrib/zlib/zconf.h b/sys/contrib/zlib/zconf.h index 4021363ba6c2..349914dbecca 100644 --- a/sys/contrib/zlib/zconf.h +++ b/sys/contrib/zlib/zconf.h @@ -1,5 +1,5 @@ /* zconf.h -- configuration of the zlib compression library - * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler + * Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -311,14 +311,6 @@ # endif #endif -#ifndef Z_ARG /* function prototypes for stdarg */ -# if defined(STDC) || defined(Z_HAVE_STDARG_H) -# define Z_ARG(args) args -# else -# define Z_ARG(args) () -# endif -#endif - /* The following definitions for FAR are needed only for MSDOS mixed * model programming (small or medium model with some far allocations). * This was tested only with MSC; for other MSDOS compilers you may have diff --git a/sys/contrib/zlib/zconf.h.in b/sys/contrib/zlib/zconf.h.in index fb76ffe312ae..62adc8d8431f 100644 --- a/sys/contrib/zlib/zconf.h.in +++ b/sys/contrib/zlib/zconf.h.in @@ -1,5 +1,5 @@ /* zconf.h -- configuration of the zlib compression library - * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler + * Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -300,14 +300,6 @@ # endif #endif -#ifndef Z_ARG /* function prototypes for stdarg */ -# if defined(STDC) || defined(Z_HAVE_STDARG_H) -# define Z_ARG(args) args -# else -# define Z_ARG(args) () -# endif -#endif - /* The following definitions for FAR are needed only for MSDOS mixed * model programming (small or medium model with some far allocations). * This was tested only with MSC; for other MSDOS compilers you may have diff --git a/sys/contrib/zlib/zlib.3 b/sys/contrib/zlib/zlib.3 index 4dd289675349..c716020ea9c4 100644 --- a/sys/contrib/zlib/zlib.3 +++ b/sys/contrib/zlib/zlib.3 @@ -1,4 +1,4 @@ -.TH ZLIB 3 "18 Aug 2023" +.TH ZLIB 3 "22 Jan 2024" .SH NAME zlib \- compression/decompression library .SH SYNOPSIS @@ -105,9 +105,9 @@ before asking for help. Send questions and/or comments to zlib@gzip.org, or (for the Windows DLL version) to Gilles Vollant (info@winimage.com). .SH AUTHORS AND LICENSE -Version 1.3 +Version 1.3.1 .LP -Copyright (C) 1995-2023 Jean-loup Gailly and Mark Adler +Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler .LP This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/sys/contrib/zlib/zlib.h b/sys/contrib/zlib/zlib.h index 48b95a64a830..04eaa04ce8d3 100644 --- a/sys/contrib/zlib/zlib.h +++ b/sys/contrib/zlib/zlib.h @@ -1,7 +1,7 @@ /* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.3, August 18th, 2023 + version 1.3.1, January 22nd, 2024 - Copyright (C) 1995-2023 Jean-loup Gailly and Mark Adler + Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -37,11 +37,11 @@ extern "C" { #endif -#define ZLIB_VERSION "1.3" -#define ZLIB_VERNUM 0x1300 +#define ZLIB_VERSION "1.3.1" +#define ZLIB_VERNUM 0x1310 #define ZLIB_VER_MAJOR 1 #define ZLIB_VER_MINOR 3 -#define ZLIB_VER_REVISION 0 +#define ZLIB_VER_REVISION 1 #define ZLIB_VER_SUBREVISION 0 /* @@ -936,10 +936,10 @@ ZEXTERN int ZEXPORT inflateSync(z_streamp strm); inflateSync returns Z_OK if a possible full flush point has been found, Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point has been found, or Z_STREAM_ERROR if the stream structure was inconsistent. - In the success case, the application may save the current current value of - total_in which indicates where valid compressed data was found. In the - error case, the application may repeatedly call inflateSync, providing more - input each time, until success or end of the input data. + In the success case, the application may save the current value of total_in + which indicates where valid compressed data was found. In the error case, + the application may repeatedly call inflateSync, providing more input each + time, until success or end of the input data. */ ZEXTERN int ZEXPORT inflateCopy(z_streamp dest, @@ -1761,14 +1761,14 @@ ZEXTERN uLong ZEXPORT crc32_combine(uLong crc1, uLong crc2, z_off_t len2); seq1 and seq2 with lengths len1 and len2, CRC-32 check values were calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and - len2. + len2. len2 must be non-negative. */ /* ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t len2); Return the operator corresponding to length len2, to be used with - crc32_combine_op(). + crc32_combine_op(). len2 must be non-negative. */ ZEXTERN uLong ZEXPORT crc32_combine_op(uLong crc1, uLong crc2, uLong op); diff --git a/sys/contrib/zlib/zutil.h b/sys/contrib/zlib/zutil.h index 9e0f3f9d0a2a..347597f50d3c 100644 --- a/sys/contrib/zlib/zutil.h +++ b/sys/contrib/zlib/zutil.h @@ -1,5 +1,5 @@ /* zutil.h -- internal interface and configuration of the compression library - * Copyright (C) 1995-2022 Jean-loup Gailly, Mark Adler + * Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -56,7 +56,7 @@ typedef unsigned long ulg; extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ /* (size given to avoid silly warnings with Visual C++) */ -#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)] +#define ERR_MSG(err) z_errmsg[(err) < -6 || (err) > 2 ? 9 : 2 - (err)] #define ERR_RETURN(strm,err) \ return (strm->msg = ERR_MSG(err), (err)) @@ -137,17 +137,8 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ # endif #endif -#if defined(MACOS) || defined(TARGET_OS_MAC) +#if defined(MACOS) # define OS_CODE 7 -# ifndef Z_SOLO -# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os -# include /* for fdopen */ -# else -# ifndef fdopen -# define fdopen(fd,mode) NULL /* No fdopen() */ -# endif -# endif -# endif #endif #ifdef __acorn @@ -170,18 +161,6 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ # define OS_CODE 19 #endif -#if defined(_BEOS_) || defined(RISCOS) -# define fdopen(fd,mode) NULL /* No fdopen() */ -#endif - -#if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX -# if defined(_WIN32_WCE) -# define fdopen(fd,mode) NULL /* No fdopen() */ -# else -# define fdopen(fd,type) _fdopen(fd,type) -# endif -#endif - #if defined(__BORLANDC__) && !defined(MSDOS) #pragma warn -8004 #pragma warn -8008 From nobody Wed Feb 21 08:09:09 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Tfpnx56Zwz5Bjck; Wed, 21 Feb 2024 08:09:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Tfpnx3XWbz417K; Wed, 21 Feb 2024 08:09:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708502949; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AYl/fh8Ewb7xRm9zodPGRABphkYXhNbBb5GKMhIk5Rs=; b=nLkoOy+2r9M4CMHqxtSIzLP5l+puY9z4hWmnj1oD6l/g3sz1CnD8yyjO7l30BCWoaOnwsg X0l4TzHuGoMRFoBSquKJF2y2Wu5VC8mB9tiNPNo7q3yBb2RTYHEL/tn59kFtEgKRfpyLdK YgxBSCCLSlm0rFXCLnNEtCek0GLmF8npQ2NP83+/79TeNV4YQF5/gS9cQMlXTnJvtNCeCb i08mls664K+Ey6giJ4pLKBrnIErLhfWpVRqFihEjyZbir84EAg3suSpflhrIjIxncyOu7L /TbyFDorbjCWPPs+aeyM6Ff9PQaASFE7+hrWP9nScWE9rE0aM1MQWcGyWHt2DA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708502949; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AYl/fh8Ewb7xRm9zodPGRABphkYXhNbBb5GKMhIk5Rs=; b=spt3O0sl5QSIJkv998MPtRPdH6e3crAhbCFnK+sjHOXjdI35FtWDrUWbc9nWD9atUvGrnV l933fU4Aweo/P8P3tHv5Y8rDIZp3RXkxYnpUyDU7yKudDwm08tMXmezGgtwPRof+OWitsM lMGTcvN0h6GFUznHDZ+s/EeBKFqkmX7pqgaVLXlb6NilCFUZ3wjfe6zDuXQraxAUZ9kWCE V9HmR+4YfNNbQ6YinHazqXdE1qN+4XXKb9pcQiziDbdTK1n8maP/ItOictNcTiMEBV0R+n AGV8YGev8fBwwWmmoSv5xPlAJiq2ys55DY/t1wEQuUocIE6PNx+6bgMzFCxNVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708502949; a=rsa-sha256; cv=none; b=wBaRPLlELriqEUYbKn6AaUglgL34bJytQzEZ8qeBXj+orH9eTuLmTmV2OeOdcmbeHGXNW1 1eG4qArmcxozkO2CaX8nOx0ffzfeKm9Ty7teCjTd9/bwHE3omTO2qvRZjbOHxGIPQKADps j+uiWBYINi5AAup6JCw9kucdBB92ndwvoGTH9rD8ZJuWSMNhaf60IK4VaxajA1OqlLbJEw gqk7VyLgJF/MK2JDHlGtlO90BMBF1J0F5lMIS6AcVvQCmpIVn3H0Wi0TfK35Dn+EgAXCuQ Vk0Eyg8V6RbZtiapSMmKk1FwSy/FJf0gHdUZGK1n6cNYscCfzM2RSdbwE+U+RA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Tfpnx2bkHztxy; Wed, 21 Feb 2024 08:09:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41L899Ak076859; Wed, 21 Feb 2024 08:09:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41L899xM076856; Wed, 21 Feb 2024 08:09:09 GMT (envelope-from git) Date: Wed, 21 Feb 2024 08:09:09 GMT Message-Id: <202402210809.41L899xM076856@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: 10365e3c34a7 - stable/14 - MFC: MFV: zlib 1.3.1. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 10365e3c34a7fdb31b40a2771fd98f31a442cc52 Auto-Submitted: auto-generated The branch stable/14 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=10365e3c34a7fdb31b40a2771fd98f31a442cc52 commit 10365e3c34a7fdb31b40a2771fd98f31a442cc52 Author: Xin LI AuthorDate: 2024-02-18 06:12:51 +0000 Commit: Xin LI CommitDate: 2024-02-21 08:08:37 +0000 MFC: MFV: zlib 1.3.1. Approved by: re (cperciva, expedited MFC) (cherry picked from commit 6255c67c3d1a268535c50de74d3300fd86d8f15d) --- sys/contrib/zlib/ChangeLog | 10 ++++++++ sys/contrib/zlib/FAQ | 3 +-- sys/contrib/zlib/README | 6 ++--- sys/contrib/zlib/deflate.c | 47 +++++++++++++++++++++++++++++--------- sys/contrib/zlib/deflate.h | 35 ++++++++++++++++++++++++++-- sys/contrib/zlib/doc/algorithm.txt | 2 +- sys/contrib/zlib/gzguts.h | 8 ++----- sys/contrib/zlib/gzlib.c | 12 +++++----- sys/contrib/zlib/inflate.c | 2 +- sys/contrib/zlib/inftrees.c | 6 ++--- sys/contrib/zlib/inftrees.h | 4 ++-- sys/contrib/zlib/test/example.c | 3 ++- sys/contrib/zlib/test/minigzip.c | 2 +- sys/contrib/zlib/trees.c | 20 +++++++++++++--- sys/contrib/zlib/zconf.h | 10 +------- sys/contrib/zlib/zconf.h.in | 10 +------- sys/contrib/zlib/zlib.3 | 6 ++--- sys/contrib/zlib/zlib.h | 22 +++++++++--------- sys/contrib/zlib/zutil.h | 27 +++------------------- 19 files changed, 137 insertions(+), 98 deletions(-) diff --git a/sys/contrib/zlib/ChangeLog b/sys/contrib/zlib/ChangeLog index 8707988ac18c..b801a1031ec0 100644 --- a/sys/contrib/zlib/ChangeLog +++ b/sys/contrib/zlib/ChangeLog @@ -1,6 +1,16 @@ ChangeLog file for zlib +Changes in 1.3.1 (22 Jan 2024) +- Reject overflows of zip header fields in minizip +- Fix bug in inflateSync() for data held in bit buffer +- Add LIT_MEM define to use more memory for a small deflate speedup +- Fix decision on the emission of Zip64 end records in minizip +- Add bounds checking to ERR_MSG() macro, used by zError() +- Neutralize zip file traversal attacks in miniunz +- Fix a bug in ZLIB_DEBUG compiles in check_match() +- Various portability and appearance improvements + Changes in 1.3 (18 Aug 2023) - Remove K&R function definitions and zlib2ansi - Fix bug in deflateBound() for level 0 and memLevel 9 diff --git a/sys/contrib/zlib/FAQ b/sys/contrib/zlib/FAQ index 55f1cdc22f6b..92f5d3e29fab 100644 --- a/sys/contrib/zlib/FAQ +++ b/sys/contrib/zlib/FAQ @@ -14,8 +14,7 @@ The latest zlib FAQ is at http://zlib.net/zlib_faq.html 2. Where can I get a Windows DLL version? The zlib sources can be compiled without change to produce a DLL. See the - file win32/DLL_FAQ.txt in the zlib distribution. Pointers to the - precompiled DLL are found in the zlib web site at http://zlib.net/ . + file win32/DLL_FAQ.txt in the zlib distribution. 3. Where can I get a Visual Basic interface to zlib? diff --git a/sys/contrib/zlib/README b/sys/contrib/zlib/README index e02fc5aa206b..c5f917540b6f 100644 --- a/sys/contrib/zlib/README +++ b/sys/contrib/zlib/README @@ -1,6 +1,6 @@ ZLIB DATA COMPRESSION LIBRARY -zlib 1.3 is a general purpose data compression library. All the code is +zlib 1.3.1 is a general purpose data compression library. All the code is thread safe. The data format used by the zlib library is described by RFCs (Request for Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and @@ -31,7 +31,7 @@ Mark Nelson wrote an article about zlib for the Jan. 1997 issue of Dr. Dobb's Journal; a copy of the article is available at https://marknelson.us/posts/1997/01/01/zlib-engine.html . -The changes made in version 1.3 are documented in the file ChangeLog. +The changes made in version 1.3.1 are documented in the file ChangeLog. Unsupported third party contributions are provided in directory contrib/ . @@ -83,7 +83,7 @@ Acknowledgments: Copyright notice: - (C) 1995-2023 Jean-loup Gailly and Mark Adler + (C) 1995-2024 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/sys/contrib/zlib/deflate.c b/sys/contrib/zlib/deflate.c index 06eb2c0f6de5..97b184a82868 100644 --- a/sys/contrib/zlib/deflate.c +++ b/sys/contrib/zlib/deflate.c @@ -1,5 +1,5 @@ /* deflate.c -- compress data using the deflation algorithm - * Copyright (C) 1995-2023 Jean-loup Gailly and Mark Adler + * Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -52,7 +52,7 @@ #include "deflate.h" const char deflate_copyright[] = - " deflate 1.3 Copyright 1995-2023 Jean-loup Gailly and Mark Adler "; + " deflate 1.3.1 Copyright 1995-2024 Jean-loup Gailly and Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -493,7 +493,7 @@ int ZEXPORT deflateInit2_(z_streamp strm, int level, int method, * symbols from which it is being constructed. */ - s->pending_buf = (uchf *) ZALLOC(strm, s->lit_bufsize, 4); + s->pending_buf = (uchf *) ZALLOC(strm, s->lit_bufsize, LIT_BUFS); s->pending_buf_size = (ulg)s->lit_bufsize * 4; if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL || @@ -503,8 +503,14 @@ int ZEXPORT deflateInit2_(z_streamp strm, int level, int method, deflateEnd (strm); return Z_MEM_ERROR; } +#ifdef LIT_MEM + s->d_buf = (ushf *)(s->pending_buf + (s->lit_bufsize << 1)); + s->l_buf = s->pending_buf + (s->lit_bufsize << 2); + s->sym_end = s->lit_bufsize - 1; +#else s->sym_buf = s->pending_buf + s->lit_bufsize; s->sym_end = (s->lit_bufsize - 1) * 3; +#endif /* We avoid equality with lit_bufsize*3 because of wraparound at 64K * on 16 bit machines and because stored blocks are restricted to * 64K-1 bytes. @@ -720,9 +726,15 @@ int ZEXPORT deflatePrime(z_streamp strm, int bits, int value) { if (deflateStateCheck(strm)) return Z_STREAM_ERROR; s = strm->state; +#ifdef LIT_MEM + if (bits < 0 || bits > 16 || + (uchf *)s->d_buf < s->pending_out + ((Buf_size + 7) >> 3)) + return Z_BUF_ERROR; +#else if (bits < 0 || bits > 16 || s->sym_buf < s->pending_out + ((Buf_size + 7) >> 3)) return Z_BUF_ERROR; +#endif do { put = Buf_size - s->bi_valid; if (put > bits) @@ -1294,7 +1306,7 @@ int ZEXPORT deflateCopy(z_streamp dest, z_streamp source) { ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte)); ds->prev = (Posf *) ZALLOC(dest, ds->w_size, sizeof(Pos)); ds->head = (Posf *) ZALLOC(dest, ds->hash_size, sizeof(Pos)); - ds->pending_buf = (uchf *) ZALLOC(dest, ds->lit_bufsize, 4); + ds->pending_buf = (uchf *) ZALLOC(dest, ds->lit_bufsize, LIT_BUFS); if (ds->window == Z_NULL || ds->prev == Z_NULL || ds->head == Z_NULL || ds->pending_buf == Z_NULL) { @@ -1305,10 +1317,15 @@ int ZEXPORT deflateCopy(z_streamp dest, z_streamp source) { zmemcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte)); zmemcpy((voidpf)ds->prev, (voidpf)ss->prev, ds->w_size * sizeof(Pos)); zmemcpy((voidpf)ds->head, (voidpf)ss->head, ds->hash_size * sizeof(Pos)); - zmemcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size); + zmemcpy(ds->pending_buf, ss->pending_buf, ds->lit_bufsize * LIT_BUFS); ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf); +#ifdef LIT_MEM + ds->d_buf = (ushf *)(ds->pending_buf + (ds->lit_bufsize << 1)); + ds->l_buf = ds->pending_buf + (ds->lit_bufsize << 2); +#else ds->sym_buf = ds->pending_buf + ds->lit_bufsize; +#endif ds->l_desc.dyn_tree = ds->dyn_ltree; ds->d_desc.dyn_tree = ds->dyn_dtree; @@ -1539,13 +1556,21 @@ local uInt longest_match(deflate_state *s, IPos cur_match) { */ local void check_match(deflate_state *s, IPos start, IPos match, int length) { /* check that the match is indeed a match */ - if (zmemcmp(s->window + match, - s->window + start, length) != EQUAL) { - fprintf(stderr, " start %u, match %u, length %d\n", - start, match, length); + Bytef *back = s->window + (int)match, *here = s->window + start; + IPos len = length; + if (match == (IPos)-1) { + /* match starts one byte before the current window -- just compare the + subsequent length-1 bytes */ + back++; + here++; + len--; + } + if (zmemcmp(back, here, len) != EQUAL) { + fprintf(stderr, " start %u, match %d, length %d\n", + start, (int)match, length); do { - fprintf(stderr, "%c%c", s->window[match++], s->window[start++]); - } while (--length != 0); + fprintf(stderr, "(%02x %02x)", *back++, *here++); + } while (--len != 0); z_error("invalid match"); } if (z_verbose > 1) { diff --git a/sys/contrib/zlib/deflate.h b/sys/contrib/zlib/deflate.h index 8696791429f2..300c6ada62b8 100644 --- a/sys/contrib/zlib/deflate.h +++ b/sys/contrib/zlib/deflate.h @@ -1,5 +1,5 @@ /* deflate.h -- internal compression state - * Copyright (C) 1995-2018 Jean-loup Gailly + * Copyright (C) 1995-2024 Jean-loup Gailly * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -23,6 +23,10 @@ # define GZIP #endif +/* define LIT_MEM to slightly increase the speed of deflate (order 1% to 2%) at + the cost of a larger memory footprint */ +/* #define LIT_MEM */ + /* =========================================================================== * Internal compression state. */ @@ -217,7 +221,14 @@ typedef struct internal_state { /* Depth of each subtree used as tie breaker for trees of equal frequency */ +#ifdef LIT_MEM +# define LIT_BUFS 5 + ushf *d_buf; /* buffer for distances */ + uchf *l_buf; /* buffer for literals/lengths */ +#else +# define LIT_BUFS 4 uchf *sym_buf; /* buffer for distances and literals/lengths */ +#endif uInt lit_bufsize; /* Size of match buffer for literals/lengths. There are 4 reasons for @@ -239,7 +250,7 @@ typedef struct internal_state { * - I can't count above 4 */ - uInt sym_next; /* running index in sym_buf */ + uInt sym_next; /* running index in symbol buffer */ uInt sym_end; /* symbol table full when sym_next reaches this */ ulg opt_len; /* bit length of current block with optimal trees */ @@ -318,6 +329,25 @@ void ZLIB_INTERNAL _tr_stored_block(deflate_state *s, charf *buf, extern const uch ZLIB_INTERNAL _dist_code[]; #endif +#ifdef LIT_MEM +# define _tr_tally_lit(s, c, flush) \ + { uch cc = (c); \ + s->d_buf[s->sym_next] = 0; \ + s->l_buf[s->sym_next++] = cc; \ + s->dyn_ltree[cc].Freq++; \ + flush = (s->sym_next == s->sym_end); \ + } +# define _tr_tally_dist(s, distance, length, flush) \ + { uch len = (uch)(length); \ + ush dist = (ush)(distance); \ + s->d_buf[s->sym_next] = dist; \ + s->l_buf[s->sym_next++] = len; \ + dist--; \ + s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \ + s->dyn_dtree[d_code(dist)].Freq++; \ + flush = (s->sym_next == s->sym_end); \ + } +#else # define _tr_tally_lit(s, c, flush) \ { uch cc = (c); \ s->sym_buf[s->sym_next++] = 0; \ @@ -337,6 +367,7 @@ void ZLIB_INTERNAL _tr_stored_block(deflate_state *s, charf *buf, s->dyn_dtree[d_code(dist)].Freq++; \ flush = (s->sym_next == s->sym_end); \ } +#endif #else # define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c) # define _tr_tally_dist(s, distance, length, flush) \ diff --git a/sys/contrib/zlib/doc/algorithm.txt b/sys/contrib/zlib/doc/algorithm.txt index c97f495020b4..029e5a313498 100644 --- a/sys/contrib/zlib/doc/algorithm.txt +++ b/sys/contrib/zlib/doc/algorithm.txt @@ -77,7 +77,7 @@ table took no time (and if you had infinite memory), then there would only be a first level table to cover all the way to the longest code. However, building the table ends up taking a lot longer for more bits since short codes are replicated many times in such a table. What inflate() does is -simply to make the number of bits in the first table a variable, and then +simply to make the number of bits in the first table a variable, and then to set that variable for the maximum speed. For inflate, which has 286 possible codes for the literal/length tree, the size diff --git a/sys/contrib/zlib/gzguts.h b/sys/contrib/zlib/gzguts.h index f9375047e8c5..eba72085bb75 100644 --- a/sys/contrib/zlib/gzguts.h +++ b/sys/contrib/zlib/gzguts.h @@ -1,5 +1,5 @@ /* gzguts.h -- zlib internal header definitions for gz* operations - * Copyright (C) 2004-2019 Mark Adler + * Copyright (C) 2004-2024 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -210,9 +210,5 @@ char ZLIB_INTERNAL *gz_strwinerror(DWORD error); /* GT_OFF(x), where x is an unsigned value, is true if x > maximum z_off64_t value -- needed when comparing unsigned to z_off64_t, which is signed (possible z_off64_t types off_t, off64_t, and long are all signed) */ -#ifdef INT_MAX -# define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > INT_MAX) -#else unsigned ZLIB_INTERNAL gz_intmax(void); -# define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax()) -#endif +#define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax()) diff --git a/sys/contrib/zlib/gzlib.c b/sys/contrib/zlib/gzlib.c index da6b2c56c380..75b3e675f5f7 100644 --- a/sys/contrib/zlib/gzlib.c +++ b/sys/contrib/zlib/gzlib.c @@ -1,5 +1,5 @@ /* gzlib.c -- zlib functions common to reading and writing gzip files - * Copyright (C) 2004-2019 Mark Adler + * Copyright (C) 2004-2024 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -565,20 +565,20 @@ void ZLIB_INTERNAL gz_error(gz_statep state, int err, const char *msg) { #endif } -#ifndef INT_MAX /* portably return maximum value for an int (when limits.h presumed not available) -- we need to do this to cover cases where 2's complement not used, since C standard permits 1's complement and sign-bit representations, otherwise we could just use ((unsigned)-1) >> 1 */ unsigned ZLIB_INTERNAL gz_intmax(void) { - unsigned p, q; - - p = 1; +#ifdef INT_MAX + return INT_MAX; +#else + unsigned p = 1, q; do { q = p; p <<= 1; p++; } while (p > q); return q >> 1; -} #endif +} diff --git a/sys/contrib/zlib/inflate.c b/sys/contrib/zlib/inflate.c index c58ee237956a..395ae51bbf56 100644 --- a/sys/contrib/zlib/inflate.c +++ b/sys/contrib/zlib/inflate.c @@ -1387,7 +1387,7 @@ int ZEXPORT inflateSync(z_streamp strm) { /* if first time, start search in bit buffer */ if (state->mode != SYNC) { state->mode = SYNC; - state->hold <<= state->bits & 7; + state->hold >>= state->bits & 7; state->bits -= state->bits & 7; len = 0; while (state->bits >= 8) { diff --git a/sys/contrib/zlib/inftrees.c b/sys/contrib/zlib/inftrees.c index 8a208c2daa8c..98cfe164458c 100644 --- a/sys/contrib/zlib/inftrees.c +++ b/sys/contrib/zlib/inftrees.c @@ -1,5 +1,5 @@ /* inftrees.c -- generate Huffman trees for efficient decoding - * Copyright (C) 1995-2023 Mark Adler + * Copyright (C) 1995-2024 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -9,7 +9,7 @@ #define MAXBITS 15 const char inflate_copyright[] = - " inflate 1.3 Copyright 1995-2023 Mark Adler "; + " inflate 1.3.1 Copyright 1995-2024 Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -57,7 +57,7 @@ int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; static const unsigned short lext[31] = { /* Length codes 257..285 extra */ 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, - 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 198, 203}; + 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 203, 77}; static const unsigned short dbase[32] = { /* Distance codes 0..29 base */ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, diff --git a/sys/contrib/zlib/inftrees.h b/sys/contrib/zlib/inftrees.h index a10712d8cb5a..396f74b5da79 100644 --- a/sys/contrib/zlib/inftrees.h +++ b/sys/contrib/zlib/inftrees.h @@ -41,8 +41,8 @@ typedef struct { examples/enough.c found in the zlib distribution. The arguments to that program are the number of symbols, the initial root table size, and the maximum bit length of a code. "enough 286 9 15" for literal/length codes - returns returns 852, and "enough 30 6 15" for distance codes returns 592. - The initial root table size (9 or 6) is found in the fifth argument of the + returns 852, and "enough 30 6 15" for distance codes returns 592. The + initial root table size (9 or 6) is found in the fifth argument of the inflate_table() calls in inflate.c and infback.c. If the root table size is changed, then these maximum sizes would be need to be recalculated and updated. */ diff --git a/sys/contrib/zlib/test/example.c b/sys/contrib/zlib/test/example.c index f27ba8e2fdcb..c3521dd5934f 100644 --- a/sys/contrib/zlib/test/example.c +++ b/sys/contrib/zlib/test/example.c @@ -364,7 +364,8 @@ static void test_flush(Byte *compr, uLong *comprLen) { /* =========================================================================== * Test inflateSync() */ -static void test_sync(Byte *compr, uLong comprLen, Byte *uncompr, uLong uncomprLen) { +static void test_sync(Byte *compr, uLong comprLen, Byte *uncompr, + uLong uncomprLen) { int err; z_stream d_stream; /* decompression stream */ diff --git a/sys/contrib/zlib/test/minigzip.c b/sys/contrib/zlib/test/minigzip.c index c72356dbccf2..134e10e6c3e9 100644 --- a/sys/contrib/zlib/test/minigzip.c +++ b/sys/contrib/zlib/test/minigzip.c @@ -303,7 +303,7 @@ static void error(const char *msg) { #ifdef USE_MMAP /* MMAP version, Miguel Albrecht */ /* Try compressing the input file at once using mmap. Return Z_OK if - * if success, Z_ERRNO otherwise. + * success, Z_ERRNO otherwise. */ static int gz_compress_mmap(FILE *in, gzFile out) { int len; diff --git a/sys/contrib/zlib/trees.c b/sys/contrib/zlib/trees.c index 8dbdc40bacce..6a523ef34e3c 100644 --- a/sys/contrib/zlib/trees.c +++ b/sys/contrib/zlib/trees.c @@ -1,5 +1,5 @@ /* trees.c -- output deflated data using Huffman coding - * Copyright (C) 1995-2021 Jean-loup Gailly + * Copyright (C) 1995-2024 Jean-loup Gailly * detect_data_type() function provided freely by Cosmin Truta, 2006 * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -899,14 +899,19 @@ local void compress_block(deflate_state *s, const ct_data *ltree, const ct_data *dtree) { unsigned dist; /* distance of matched string */ int lc; /* match length or unmatched char (if dist == 0) */ - unsigned sx = 0; /* running index in sym_buf */ + unsigned sx = 0; /* running index in symbol buffers */ unsigned code; /* the code to send */ int extra; /* number of extra bits to send */ if (s->sym_next != 0) do { +#ifdef LIT_MEM + dist = s->d_buf[sx]; + lc = s->l_buf[sx++]; +#else dist = s->sym_buf[sx++] & 0xff; dist += (unsigned)(s->sym_buf[sx++] & 0xff) << 8; lc = s->sym_buf[sx++]; +#endif if (dist == 0) { send_code(s, lc, ltree); /* send a literal byte */ Tracecv(isgraph(lc), (stderr," '%c' ", lc)); @@ -931,8 +936,12 @@ local void compress_block(deflate_state *s, const ct_data *ltree, } } /* literal or match pair ? */ - /* Check that the overlay between pending_buf and sym_buf is ok: */ + /* Check for no overlay of pending_buf on needed symbols */ +#ifdef LIT_MEM + Assert(s->pending < 2 * (s->lit_bufsize + sx), "pendingBuf overflow"); +#else Assert(s->pending < s->lit_bufsize + sx, "pendingBuf overflow"); +#endif } while (sx < s->sym_next); @@ -1082,9 +1091,14 @@ void ZLIB_INTERNAL _tr_flush_block(deflate_state *s, charf *buf, * the current block must be flushed. */ int ZLIB_INTERNAL _tr_tally(deflate_state *s, unsigned dist, unsigned lc) { +#ifdef LIT_MEM + s->d_buf[s->sym_next] = (ush)dist; + s->l_buf[s->sym_next++] = (uch)lc; +#else s->sym_buf[s->sym_next++] = (uch)dist; s->sym_buf[s->sym_next++] = (uch)(dist >> 8); s->sym_buf[s->sym_next++] = (uch)lc; +#endif if (dist == 0) { /* lc is the unmatched char */ s->dyn_ltree[lc].Freq++; diff --git a/sys/contrib/zlib/zconf.h b/sys/contrib/zlib/zconf.h index 4021363ba6c2..349914dbecca 100644 --- a/sys/contrib/zlib/zconf.h +++ b/sys/contrib/zlib/zconf.h @@ -1,5 +1,5 @@ /* zconf.h -- configuration of the zlib compression library - * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler + * Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -311,14 +311,6 @@ # endif #endif -#ifndef Z_ARG /* function prototypes for stdarg */ -# if defined(STDC) || defined(Z_HAVE_STDARG_H) -# define Z_ARG(args) args -# else -# define Z_ARG(args) () -# endif -#endif - /* The following definitions for FAR are needed only for MSDOS mixed * model programming (small or medium model with some far allocations). * This was tested only with MSC; for other MSDOS compilers you may have diff --git a/sys/contrib/zlib/zconf.h.in b/sys/contrib/zlib/zconf.h.in index fb76ffe312ae..62adc8d8431f 100644 --- a/sys/contrib/zlib/zconf.h.in +++ b/sys/contrib/zlib/zconf.h.in @@ -1,5 +1,5 @@ /* zconf.h -- configuration of the zlib compression library - * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler + * Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -300,14 +300,6 @@ # endif #endif -#ifndef Z_ARG /* function prototypes for stdarg */ -# if defined(STDC) || defined(Z_HAVE_STDARG_H) -# define Z_ARG(args) args -# else -# define Z_ARG(args) () -# endif -#endif - /* The following definitions for FAR are needed only for MSDOS mixed * model programming (small or medium model with some far allocations). * This was tested only with MSC; for other MSDOS compilers you may have diff --git a/sys/contrib/zlib/zlib.3 b/sys/contrib/zlib/zlib.3 index 4dd289675349..c716020ea9c4 100644 --- a/sys/contrib/zlib/zlib.3 +++ b/sys/contrib/zlib/zlib.3 @@ -1,4 +1,4 @@ -.TH ZLIB 3 "18 Aug 2023" +.TH ZLIB 3 "22 Jan 2024" .SH NAME zlib \- compression/decompression library .SH SYNOPSIS @@ -105,9 +105,9 @@ before asking for help. Send questions and/or comments to zlib@gzip.org, or (for the Windows DLL version) to Gilles Vollant (info@winimage.com). .SH AUTHORS AND LICENSE -Version 1.3 +Version 1.3.1 .LP -Copyright (C) 1995-2023 Jean-loup Gailly and Mark Adler +Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler .LP This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/sys/contrib/zlib/zlib.h b/sys/contrib/zlib/zlib.h index 48b95a64a830..04eaa04ce8d3 100644 --- a/sys/contrib/zlib/zlib.h +++ b/sys/contrib/zlib/zlib.h @@ -1,7 +1,7 @@ /* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.3, August 18th, 2023 + version 1.3.1, January 22nd, 2024 - Copyright (C) 1995-2023 Jean-loup Gailly and Mark Adler + Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -37,11 +37,11 @@ extern "C" { #endif -#define ZLIB_VERSION "1.3" -#define ZLIB_VERNUM 0x1300 +#define ZLIB_VERSION "1.3.1" +#define ZLIB_VERNUM 0x1310 #define ZLIB_VER_MAJOR 1 #define ZLIB_VER_MINOR 3 -#define ZLIB_VER_REVISION 0 +#define ZLIB_VER_REVISION 1 #define ZLIB_VER_SUBREVISION 0 /* @@ -936,10 +936,10 @@ ZEXTERN int ZEXPORT inflateSync(z_streamp strm); inflateSync returns Z_OK if a possible full flush point has been found, Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point has been found, or Z_STREAM_ERROR if the stream structure was inconsistent. - In the success case, the application may save the current current value of - total_in which indicates where valid compressed data was found. In the - error case, the application may repeatedly call inflateSync, providing more - input each time, until success or end of the input data. + In the success case, the application may save the current value of total_in + which indicates where valid compressed data was found. In the error case, + the application may repeatedly call inflateSync, providing more input each + time, until success or end of the input data. */ ZEXTERN int ZEXPORT inflateCopy(z_streamp dest, @@ -1761,14 +1761,14 @@ ZEXTERN uLong ZEXPORT crc32_combine(uLong crc1, uLong crc2, z_off_t len2); seq1 and seq2 with lengths len1 and len2, CRC-32 check values were calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and - len2. + len2. len2 must be non-negative. */ /* ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t len2); Return the operator corresponding to length len2, to be used with - crc32_combine_op(). + crc32_combine_op(). len2 must be non-negative. */ ZEXTERN uLong ZEXPORT crc32_combine_op(uLong crc1, uLong crc2, uLong op); diff --git a/sys/contrib/zlib/zutil.h b/sys/contrib/zlib/zutil.h index 9e0f3f9d0a2a..347597f50d3c 100644 --- a/sys/contrib/zlib/zutil.h +++ b/sys/contrib/zlib/zutil.h @@ -1,5 +1,5 @@ /* zutil.h -- internal interface and configuration of the compression library - * Copyright (C) 1995-2022 Jean-loup Gailly, Mark Adler + * Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -56,7 +56,7 @@ typedef unsigned long ulg; extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ /* (size given to avoid silly warnings with Visual C++) */ -#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)] +#define ERR_MSG(err) z_errmsg[(err) < -6 || (err) > 2 ? 9 : 2 - (err)] #define ERR_RETURN(strm,err) \ return (strm->msg = ERR_MSG(err), (err)) @@ -137,17 +137,8 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ # endif #endif -#if defined(MACOS) || defined(TARGET_OS_MAC) +#if defined(MACOS) # define OS_CODE 7 -# ifndef Z_SOLO -# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os -# include /* for fdopen */ -# else -# ifndef fdopen -# define fdopen(fd,mode) NULL /* No fdopen() */ -# endif -# endif -# endif #endif #ifdef __acorn @@ -170,18 +161,6 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ # define OS_CODE 19 #endif -#if defined(_BEOS_) || defined(RISCOS) -# define fdopen(fd,mode) NULL /* No fdopen() */ -#endif - -#if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX -# if defined(_WIN32_WCE) -# define fdopen(fd,mode) NULL /* No fdopen() */ -# else -# define fdopen(fd,type) _fdopen(fd,type) -# endif -#endif - #if defined(__BORLANDC__) && !defined(MSDOS) #pragma warn -8004 #pragma warn -8008 From nobody Wed Feb 21 08:09:40 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TfppY0pQzz5Bjcp; Wed, 21 Feb 2024 08: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TfppY0Jj4z41FJ; Wed, 21 Feb 2024 08: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=1708502981; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tph/u1gX8nLWKAxZeD3YwxZ0QVzPpYg9XWr1qyL7Fb4=; b=wC5KO0ztM4cSZRbkGe3hYnYOy9jgQbrvAUF1u9zd7+QURhO/8XVOU2BXX4J0YiFMBAVBii +WtkZtbG14V3SEORkobNXsuXGU6jzhicFGZ0jiHGEqA8+0ku4GVX69JPMQ9AiV2LEn4dFZ jvc3sY+HBXPvO+253uhIGJQraNKEUqg6nG5J9++1G1ooqYB4SQTtNTid6NGLGRD72Rbcpp HAoulUNjvuXBiBccL46Bx1HH2GgYUiajedsbyQiPqT5hWnsfWYieN0MHbJ49s+UWSGvLNa it5ROEuBMqNknUcCp/z+wfOXIStDp9XuSkmPvFKxOop1gPEqKNYS2IoxZrblbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708502981; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tph/u1gX8nLWKAxZeD3YwxZ0QVzPpYg9XWr1qyL7Fb4=; b=nPfqkksHXaN96Q3af2dJPo/JZl/Khp4LSui5znJgzp8od3rFBrQ/tQuPvAoy6u/G+z7iXE oDKYCQar08NIRO3WSehVzjcFUUoQtX5ZyDJXvOVKEbrmuN20vz9Q+XIelK1XE0zS94HVN1 ZWK+HpqZGYWhBVSmFK2I9kCweadIj2cP5vpv/viKr5eiNi1xzCaKZhyKMwGx+IEXKXdU7v VtnzQZOup9m7H90M+/gyaD/QCHRqZRa3+XMB+5wf823LWnWyXKW1Z4eqN0+LGwwJXgy7CT 1o6HZZJwcoPrhh1UQO0KSWlGa6gyS7G65IQCxRkpGGqasiP1mgZrhmVEoT/Zwg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708502981; a=rsa-sha256; cv=none; b=tQgeXqdtfq+Jgfhf1KgBWyYq/WEXdSiIboafdA0qwaSDglUI5su2Ee1FHAqoLkFSvvrXTA djCT4Nub/6AHbrwRqtYfRp5apa2i2JhR1EhWfQA8GYGmJBoKxNtO4xPqbmP7ORlsODTg8L 7k8jHVjnA46g3IhsrDOKjL/bo+bxvu/4P3qxjZmvpBX8T7uN7/vLrHCMtOHvVl38PJzRS2 nwAb1TmbJCv62UKSMIMvwncX7OXJkJEgQRyXSl08PKgBi8BeDd+207AOvkzL1tYYq/HayJ Eol+O9kZu4QcNm1yhpnubgxwSH6yavTtIR1rcQU7MgtT/tF2hw3vJTF1mCqDGQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TfppX6TkGzvLX; Wed, 21 Feb 2024 08:09:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41L89eck077057; Wed, 21 Feb 2024 08:09:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41L89e9E077054; Wed, 21 Feb 2024 08:09:40 GMT (envelope-from git) Date: Wed, 21 Feb 2024 08:09:40 GMT Message-Id: <202402210809.41L89e9E077054@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: f2de7ba78a49 - releng/13.3 - MFS: MFC: MFV: zlib 1.3.1. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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.3 X-Git-Reftype: branch X-Git-Commit: f2de7ba78a49427fc30964d1840454595239fc72 Auto-Submitted: auto-generated The branch releng/13.3 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=f2de7ba78a49427fc30964d1840454595239fc72 commit f2de7ba78a49427fc30964d1840454595239fc72 Author: Xin LI AuthorDate: 2024-02-18 06:12:51 +0000 Commit: Xin LI CommitDate: 2024-02-21 08:09:28 +0000 MFS: MFC: MFV: zlib 1.3.1. Approved by: re (cperciva) (cherry picked from commit 6255c67c3d1a268535c50de74d3300fd86d8f15d) (cherry picked from commit d111b1e4a0a78aa4de8c0b68f031fdcec3a15ea0) --- sys/contrib/zlib/ChangeLog | 10 ++++++++ sys/contrib/zlib/FAQ | 3 +-- sys/contrib/zlib/README | 6 ++--- sys/contrib/zlib/deflate.c | 47 +++++++++++++++++++++++++++++--------- sys/contrib/zlib/deflate.h | 35 ++++++++++++++++++++++++++-- sys/contrib/zlib/doc/algorithm.txt | 2 +- sys/contrib/zlib/gzguts.h | 8 ++----- sys/contrib/zlib/gzlib.c | 12 +++++----- sys/contrib/zlib/inflate.c | 2 +- sys/contrib/zlib/inftrees.c | 6 ++--- sys/contrib/zlib/inftrees.h | 4 ++-- sys/contrib/zlib/test/example.c | 3 ++- sys/contrib/zlib/test/minigzip.c | 2 +- sys/contrib/zlib/trees.c | 20 +++++++++++++--- sys/contrib/zlib/zconf.h | 10 +------- sys/contrib/zlib/zconf.h.in | 10 +------- sys/contrib/zlib/zlib.3 | 6 ++--- sys/contrib/zlib/zlib.h | 22 +++++++++--------- sys/contrib/zlib/zutil.h | 27 +++------------------- 19 files changed, 137 insertions(+), 98 deletions(-) diff --git a/sys/contrib/zlib/ChangeLog b/sys/contrib/zlib/ChangeLog index 8707988ac18c..b801a1031ec0 100644 --- a/sys/contrib/zlib/ChangeLog +++ b/sys/contrib/zlib/ChangeLog @@ -1,6 +1,16 @@ ChangeLog file for zlib +Changes in 1.3.1 (22 Jan 2024) +- Reject overflows of zip header fields in minizip +- Fix bug in inflateSync() for data held in bit buffer +- Add LIT_MEM define to use more memory for a small deflate speedup +- Fix decision on the emission of Zip64 end records in minizip +- Add bounds checking to ERR_MSG() macro, used by zError() +- Neutralize zip file traversal attacks in miniunz +- Fix a bug in ZLIB_DEBUG compiles in check_match() +- Various portability and appearance improvements + Changes in 1.3 (18 Aug 2023) - Remove K&R function definitions and zlib2ansi - Fix bug in deflateBound() for level 0 and memLevel 9 diff --git a/sys/contrib/zlib/FAQ b/sys/contrib/zlib/FAQ index 55f1cdc22f6b..92f5d3e29fab 100644 --- a/sys/contrib/zlib/FAQ +++ b/sys/contrib/zlib/FAQ @@ -14,8 +14,7 @@ The latest zlib FAQ is at http://zlib.net/zlib_faq.html 2. Where can I get a Windows DLL version? The zlib sources can be compiled without change to produce a DLL. See the - file win32/DLL_FAQ.txt in the zlib distribution. Pointers to the - precompiled DLL are found in the zlib web site at http://zlib.net/ . + file win32/DLL_FAQ.txt in the zlib distribution. 3. Where can I get a Visual Basic interface to zlib? diff --git a/sys/contrib/zlib/README b/sys/contrib/zlib/README index e02fc5aa206b..c5f917540b6f 100644 --- a/sys/contrib/zlib/README +++ b/sys/contrib/zlib/README @@ -1,6 +1,6 @@ ZLIB DATA COMPRESSION LIBRARY -zlib 1.3 is a general purpose data compression library. All the code is +zlib 1.3.1 is a general purpose data compression library. All the code is thread safe. The data format used by the zlib library is described by RFCs (Request for Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and @@ -31,7 +31,7 @@ Mark Nelson wrote an article about zlib for the Jan. 1997 issue of Dr. Dobb's Journal; a copy of the article is available at https://marknelson.us/posts/1997/01/01/zlib-engine.html . -The changes made in version 1.3 are documented in the file ChangeLog. +The changes made in version 1.3.1 are documented in the file ChangeLog. Unsupported third party contributions are provided in directory contrib/ . @@ -83,7 +83,7 @@ Acknowledgments: Copyright notice: - (C) 1995-2023 Jean-loup Gailly and Mark Adler + (C) 1995-2024 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/sys/contrib/zlib/deflate.c b/sys/contrib/zlib/deflate.c index 06eb2c0f6de5..97b184a82868 100644 --- a/sys/contrib/zlib/deflate.c +++ b/sys/contrib/zlib/deflate.c @@ -1,5 +1,5 @@ /* deflate.c -- compress data using the deflation algorithm - * Copyright (C) 1995-2023 Jean-loup Gailly and Mark Adler + * Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -52,7 +52,7 @@ #include "deflate.h" const char deflate_copyright[] = - " deflate 1.3 Copyright 1995-2023 Jean-loup Gailly and Mark Adler "; + " deflate 1.3.1 Copyright 1995-2024 Jean-loup Gailly and Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -493,7 +493,7 @@ int ZEXPORT deflateInit2_(z_streamp strm, int level, int method, * symbols from which it is being constructed. */ - s->pending_buf = (uchf *) ZALLOC(strm, s->lit_bufsize, 4); + s->pending_buf = (uchf *) ZALLOC(strm, s->lit_bufsize, LIT_BUFS); s->pending_buf_size = (ulg)s->lit_bufsize * 4; if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL || @@ -503,8 +503,14 @@ int ZEXPORT deflateInit2_(z_streamp strm, int level, int method, deflateEnd (strm); return Z_MEM_ERROR; } +#ifdef LIT_MEM + s->d_buf = (ushf *)(s->pending_buf + (s->lit_bufsize << 1)); + s->l_buf = s->pending_buf + (s->lit_bufsize << 2); + s->sym_end = s->lit_bufsize - 1; +#else s->sym_buf = s->pending_buf + s->lit_bufsize; s->sym_end = (s->lit_bufsize - 1) * 3; +#endif /* We avoid equality with lit_bufsize*3 because of wraparound at 64K * on 16 bit machines and because stored blocks are restricted to * 64K-1 bytes. @@ -720,9 +726,15 @@ int ZEXPORT deflatePrime(z_streamp strm, int bits, int value) { if (deflateStateCheck(strm)) return Z_STREAM_ERROR; s = strm->state; +#ifdef LIT_MEM + if (bits < 0 || bits > 16 || + (uchf *)s->d_buf < s->pending_out + ((Buf_size + 7) >> 3)) + return Z_BUF_ERROR; +#else if (bits < 0 || bits > 16 || s->sym_buf < s->pending_out + ((Buf_size + 7) >> 3)) return Z_BUF_ERROR; +#endif do { put = Buf_size - s->bi_valid; if (put > bits) @@ -1294,7 +1306,7 @@ int ZEXPORT deflateCopy(z_streamp dest, z_streamp source) { ds->window = (Bytef *) ZALLOC(dest, ds->w_size, 2*sizeof(Byte)); ds->prev = (Posf *) ZALLOC(dest, ds->w_size, sizeof(Pos)); ds->head = (Posf *) ZALLOC(dest, ds->hash_size, sizeof(Pos)); - ds->pending_buf = (uchf *) ZALLOC(dest, ds->lit_bufsize, 4); + ds->pending_buf = (uchf *) ZALLOC(dest, ds->lit_bufsize, LIT_BUFS); if (ds->window == Z_NULL || ds->prev == Z_NULL || ds->head == Z_NULL || ds->pending_buf == Z_NULL) { @@ -1305,10 +1317,15 @@ int ZEXPORT deflateCopy(z_streamp dest, z_streamp source) { zmemcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte)); zmemcpy((voidpf)ds->prev, (voidpf)ss->prev, ds->w_size * sizeof(Pos)); zmemcpy((voidpf)ds->head, (voidpf)ss->head, ds->hash_size * sizeof(Pos)); - zmemcpy(ds->pending_buf, ss->pending_buf, (uInt)ds->pending_buf_size); + zmemcpy(ds->pending_buf, ss->pending_buf, ds->lit_bufsize * LIT_BUFS); ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf); +#ifdef LIT_MEM + ds->d_buf = (ushf *)(ds->pending_buf + (ds->lit_bufsize << 1)); + ds->l_buf = ds->pending_buf + (ds->lit_bufsize << 2); +#else ds->sym_buf = ds->pending_buf + ds->lit_bufsize; +#endif ds->l_desc.dyn_tree = ds->dyn_ltree; ds->d_desc.dyn_tree = ds->dyn_dtree; @@ -1539,13 +1556,21 @@ local uInt longest_match(deflate_state *s, IPos cur_match) { */ local void check_match(deflate_state *s, IPos start, IPos match, int length) { /* check that the match is indeed a match */ - if (zmemcmp(s->window + match, - s->window + start, length) != EQUAL) { - fprintf(stderr, " start %u, match %u, length %d\n", - start, match, length); + Bytef *back = s->window + (int)match, *here = s->window + start; + IPos len = length; + if (match == (IPos)-1) { + /* match starts one byte before the current window -- just compare the + subsequent length-1 bytes */ + back++; + here++; + len--; + } + if (zmemcmp(back, here, len) != EQUAL) { + fprintf(stderr, " start %u, match %d, length %d\n", + start, (int)match, length); do { - fprintf(stderr, "%c%c", s->window[match++], s->window[start++]); - } while (--length != 0); + fprintf(stderr, "(%02x %02x)", *back++, *here++); + } while (--len != 0); z_error("invalid match"); } if (z_verbose > 1) { diff --git a/sys/contrib/zlib/deflate.h b/sys/contrib/zlib/deflate.h index 8696791429f2..300c6ada62b8 100644 --- a/sys/contrib/zlib/deflate.h +++ b/sys/contrib/zlib/deflate.h @@ -1,5 +1,5 @@ /* deflate.h -- internal compression state - * Copyright (C) 1995-2018 Jean-loup Gailly + * Copyright (C) 1995-2024 Jean-loup Gailly * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -23,6 +23,10 @@ # define GZIP #endif +/* define LIT_MEM to slightly increase the speed of deflate (order 1% to 2%) at + the cost of a larger memory footprint */ +/* #define LIT_MEM */ + /* =========================================================================== * Internal compression state. */ @@ -217,7 +221,14 @@ typedef struct internal_state { /* Depth of each subtree used as tie breaker for trees of equal frequency */ +#ifdef LIT_MEM +# define LIT_BUFS 5 + ushf *d_buf; /* buffer for distances */ + uchf *l_buf; /* buffer for literals/lengths */ +#else +# define LIT_BUFS 4 uchf *sym_buf; /* buffer for distances and literals/lengths */ +#endif uInt lit_bufsize; /* Size of match buffer for literals/lengths. There are 4 reasons for @@ -239,7 +250,7 @@ typedef struct internal_state { * - I can't count above 4 */ - uInt sym_next; /* running index in sym_buf */ + uInt sym_next; /* running index in symbol buffer */ uInt sym_end; /* symbol table full when sym_next reaches this */ ulg opt_len; /* bit length of current block with optimal trees */ @@ -318,6 +329,25 @@ void ZLIB_INTERNAL _tr_stored_block(deflate_state *s, charf *buf, extern const uch ZLIB_INTERNAL _dist_code[]; #endif +#ifdef LIT_MEM +# define _tr_tally_lit(s, c, flush) \ + { uch cc = (c); \ + s->d_buf[s->sym_next] = 0; \ + s->l_buf[s->sym_next++] = cc; \ + s->dyn_ltree[cc].Freq++; \ + flush = (s->sym_next == s->sym_end); \ + } +# define _tr_tally_dist(s, distance, length, flush) \ + { uch len = (uch)(length); \ + ush dist = (ush)(distance); \ + s->d_buf[s->sym_next] = dist; \ + s->l_buf[s->sym_next++] = len; \ + dist--; \ + s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \ + s->dyn_dtree[d_code(dist)].Freq++; \ + flush = (s->sym_next == s->sym_end); \ + } +#else # define _tr_tally_lit(s, c, flush) \ { uch cc = (c); \ s->sym_buf[s->sym_next++] = 0; \ @@ -337,6 +367,7 @@ void ZLIB_INTERNAL _tr_stored_block(deflate_state *s, charf *buf, s->dyn_dtree[d_code(dist)].Freq++; \ flush = (s->sym_next == s->sym_end); \ } +#endif #else # define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c) # define _tr_tally_dist(s, distance, length, flush) \ diff --git a/sys/contrib/zlib/doc/algorithm.txt b/sys/contrib/zlib/doc/algorithm.txt index c97f495020b4..029e5a313498 100644 --- a/sys/contrib/zlib/doc/algorithm.txt +++ b/sys/contrib/zlib/doc/algorithm.txt @@ -77,7 +77,7 @@ table took no time (and if you had infinite memory), then there would only be a first level table to cover all the way to the longest code. However, building the table ends up taking a lot longer for more bits since short codes are replicated many times in such a table. What inflate() does is -simply to make the number of bits in the first table a variable, and then +simply to make the number of bits in the first table a variable, and then to set that variable for the maximum speed. For inflate, which has 286 possible codes for the literal/length tree, the size diff --git a/sys/contrib/zlib/gzguts.h b/sys/contrib/zlib/gzguts.h index f9375047e8c5..eba72085bb75 100644 --- a/sys/contrib/zlib/gzguts.h +++ b/sys/contrib/zlib/gzguts.h @@ -1,5 +1,5 @@ /* gzguts.h -- zlib internal header definitions for gz* operations - * Copyright (C) 2004-2019 Mark Adler + * Copyright (C) 2004-2024 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -210,9 +210,5 @@ char ZLIB_INTERNAL *gz_strwinerror(DWORD error); /* GT_OFF(x), where x is an unsigned value, is true if x > maximum z_off64_t value -- needed when comparing unsigned to z_off64_t, which is signed (possible z_off64_t types off_t, off64_t, and long are all signed) */ -#ifdef INT_MAX -# define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > INT_MAX) -#else unsigned ZLIB_INTERNAL gz_intmax(void); -# define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax()) -#endif +#define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax()) diff --git a/sys/contrib/zlib/gzlib.c b/sys/contrib/zlib/gzlib.c index da6b2c56c380..75b3e675f5f7 100644 --- a/sys/contrib/zlib/gzlib.c +++ b/sys/contrib/zlib/gzlib.c @@ -1,5 +1,5 @@ /* gzlib.c -- zlib functions common to reading and writing gzip files - * Copyright (C) 2004-2019 Mark Adler + * Copyright (C) 2004-2024 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -565,20 +565,20 @@ void ZLIB_INTERNAL gz_error(gz_statep state, int err, const char *msg) { #endif } -#ifndef INT_MAX /* portably return maximum value for an int (when limits.h presumed not available) -- we need to do this to cover cases where 2's complement not used, since C standard permits 1's complement and sign-bit representations, otherwise we could just use ((unsigned)-1) >> 1 */ unsigned ZLIB_INTERNAL gz_intmax(void) { - unsigned p, q; - - p = 1; +#ifdef INT_MAX + return INT_MAX; +#else + unsigned p = 1, q; do { q = p; p <<= 1; p++; } while (p > q); return q >> 1; -} #endif +} diff --git a/sys/contrib/zlib/inflate.c b/sys/contrib/zlib/inflate.c index c58ee237956a..395ae51bbf56 100644 --- a/sys/contrib/zlib/inflate.c +++ b/sys/contrib/zlib/inflate.c @@ -1387,7 +1387,7 @@ int ZEXPORT inflateSync(z_streamp strm) { /* if first time, start search in bit buffer */ if (state->mode != SYNC) { state->mode = SYNC; - state->hold <<= state->bits & 7; + state->hold >>= state->bits & 7; state->bits -= state->bits & 7; len = 0; while (state->bits >= 8) { diff --git a/sys/contrib/zlib/inftrees.c b/sys/contrib/zlib/inftrees.c index 8a208c2daa8c..98cfe164458c 100644 --- a/sys/contrib/zlib/inftrees.c +++ b/sys/contrib/zlib/inftrees.c @@ -1,5 +1,5 @@ /* inftrees.c -- generate Huffman trees for efficient decoding - * Copyright (C) 1995-2023 Mark Adler + * Copyright (C) 1995-2024 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -9,7 +9,7 @@ #define MAXBITS 15 const char inflate_copyright[] = - " inflate 1.3 Copyright 1995-2023 Mark Adler "; + " inflate 1.3.1 Copyright 1995-2024 Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -57,7 +57,7 @@ int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; static const unsigned short lext[31] = { /* Length codes 257..285 extra */ 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, - 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 198, 203}; + 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 203, 77}; static const unsigned short dbase[32] = { /* Distance codes 0..29 base */ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, diff --git a/sys/contrib/zlib/inftrees.h b/sys/contrib/zlib/inftrees.h index a10712d8cb5a..396f74b5da79 100644 --- a/sys/contrib/zlib/inftrees.h +++ b/sys/contrib/zlib/inftrees.h @@ -41,8 +41,8 @@ typedef struct { examples/enough.c found in the zlib distribution. The arguments to that program are the number of symbols, the initial root table size, and the maximum bit length of a code. "enough 286 9 15" for literal/length codes - returns returns 852, and "enough 30 6 15" for distance codes returns 592. - The initial root table size (9 or 6) is found in the fifth argument of the + returns 852, and "enough 30 6 15" for distance codes returns 592. The + initial root table size (9 or 6) is found in the fifth argument of the inflate_table() calls in inflate.c and infback.c. If the root table size is changed, then these maximum sizes would be need to be recalculated and updated. */ diff --git a/sys/contrib/zlib/test/example.c b/sys/contrib/zlib/test/example.c index f27ba8e2fdcb..c3521dd5934f 100644 --- a/sys/contrib/zlib/test/example.c +++ b/sys/contrib/zlib/test/example.c @@ -364,7 +364,8 @@ static void test_flush(Byte *compr, uLong *comprLen) { /* =========================================================================== * Test inflateSync() */ -static void test_sync(Byte *compr, uLong comprLen, Byte *uncompr, uLong uncomprLen) { +static void test_sync(Byte *compr, uLong comprLen, Byte *uncompr, + uLong uncomprLen) { int err; z_stream d_stream; /* decompression stream */ diff --git a/sys/contrib/zlib/test/minigzip.c b/sys/contrib/zlib/test/minigzip.c index c72356dbccf2..134e10e6c3e9 100644 --- a/sys/contrib/zlib/test/minigzip.c +++ b/sys/contrib/zlib/test/minigzip.c @@ -303,7 +303,7 @@ static void error(const char *msg) { #ifdef USE_MMAP /* MMAP version, Miguel Albrecht */ /* Try compressing the input file at once using mmap. Return Z_OK if - * if success, Z_ERRNO otherwise. + * success, Z_ERRNO otherwise. */ static int gz_compress_mmap(FILE *in, gzFile out) { int len; diff --git a/sys/contrib/zlib/trees.c b/sys/contrib/zlib/trees.c index 8dbdc40bacce..6a523ef34e3c 100644 --- a/sys/contrib/zlib/trees.c +++ b/sys/contrib/zlib/trees.c @@ -1,5 +1,5 @@ /* trees.c -- output deflated data using Huffman coding - * Copyright (C) 1995-2021 Jean-loup Gailly + * Copyright (C) 1995-2024 Jean-loup Gailly * detect_data_type() function provided freely by Cosmin Truta, 2006 * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -899,14 +899,19 @@ local void compress_block(deflate_state *s, const ct_data *ltree, const ct_data *dtree) { unsigned dist; /* distance of matched string */ int lc; /* match length or unmatched char (if dist == 0) */ - unsigned sx = 0; /* running index in sym_buf */ + unsigned sx = 0; /* running index in symbol buffers */ unsigned code; /* the code to send */ int extra; /* number of extra bits to send */ if (s->sym_next != 0) do { +#ifdef LIT_MEM + dist = s->d_buf[sx]; + lc = s->l_buf[sx++]; +#else dist = s->sym_buf[sx++] & 0xff; dist += (unsigned)(s->sym_buf[sx++] & 0xff) << 8; lc = s->sym_buf[sx++]; +#endif if (dist == 0) { send_code(s, lc, ltree); /* send a literal byte */ Tracecv(isgraph(lc), (stderr," '%c' ", lc)); @@ -931,8 +936,12 @@ local void compress_block(deflate_state *s, const ct_data *ltree, } } /* literal or match pair ? */ - /* Check that the overlay between pending_buf and sym_buf is ok: */ + /* Check for no overlay of pending_buf on needed symbols */ +#ifdef LIT_MEM + Assert(s->pending < 2 * (s->lit_bufsize + sx), "pendingBuf overflow"); +#else Assert(s->pending < s->lit_bufsize + sx, "pendingBuf overflow"); +#endif } while (sx < s->sym_next); @@ -1082,9 +1091,14 @@ void ZLIB_INTERNAL _tr_flush_block(deflate_state *s, charf *buf, * the current block must be flushed. */ int ZLIB_INTERNAL _tr_tally(deflate_state *s, unsigned dist, unsigned lc) { +#ifdef LIT_MEM + s->d_buf[s->sym_next] = (ush)dist; + s->l_buf[s->sym_next++] = (uch)lc; +#else s->sym_buf[s->sym_next++] = (uch)dist; s->sym_buf[s->sym_next++] = (uch)(dist >> 8); s->sym_buf[s->sym_next++] = (uch)lc; +#endif if (dist == 0) { /* lc is the unmatched char */ s->dyn_ltree[lc].Freq++; diff --git a/sys/contrib/zlib/zconf.h b/sys/contrib/zlib/zconf.h index 4021363ba6c2..349914dbecca 100644 --- a/sys/contrib/zlib/zconf.h +++ b/sys/contrib/zlib/zconf.h @@ -1,5 +1,5 @@ /* zconf.h -- configuration of the zlib compression library - * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler + * Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -311,14 +311,6 @@ # endif #endif -#ifndef Z_ARG /* function prototypes for stdarg */ -# if defined(STDC) || defined(Z_HAVE_STDARG_H) -# define Z_ARG(args) args -# else -# define Z_ARG(args) () -# endif -#endif - /* The following definitions for FAR are needed only for MSDOS mixed * model programming (small or medium model with some far allocations). * This was tested only with MSC; for other MSDOS compilers you may have diff --git a/sys/contrib/zlib/zconf.h.in b/sys/contrib/zlib/zconf.h.in index fb76ffe312ae..62adc8d8431f 100644 --- a/sys/contrib/zlib/zconf.h.in +++ b/sys/contrib/zlib/zconf.h.in @@ -1,5 +1,5 @@ /* zconf.h -- configuration of the zlib compression library - * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler + * Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -300,14 +300,6 @@ # endif #endif -#ifndef Z_ARG /* function prototypes for stdarg */ -# if defined(STDC) || defined(Z_HAVE_STDARG_H) -# define Z_ARG(args) args -# else -# define Z_ARG(args) () -# endif -#endif - /* The following definitions for FAR are needed only for MSDOS mixed * model programming (small or medium model with some far allocations). * This was tested only with MSC; for other MSDOS compilers you may have diff --git a/sys/contrib/zlib/zlib.3 b/sys/contrib/zlib/zlib.3 index 4dd289675349..c716020ea9c4 100644 --- a/sys/contrib/zlib/zlib.3 +++ b/sys/contrib/zlib/zlib.3 @@ -1,4 +1,4 @@ -.TH ZLIB 3 "18 Aug 2023" +.TH ZLIB 3 "22 Jan 2024" .SH NAME zlib \- compression/decompression library .SH SYNOPSIS @@ -105,9 +105,9 @@ before asking for help. Send questions and/or comments to zlib@gzip.org, or (for the Windows DLL version) to Gilles Vollant (info@winimage.com). .SH AUTHORS AND LICENSE -Version 1.3 +Version 1.3.1 .LP -Copyright (C) 1995-2023 Jean-loup Gailly and Mark Adler +Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler .LP This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/sys/contrib/zlib/zlib.h b/sys/contrib/zlib/zlib.h index 48b95a64a830..04eaa04ce8d3 100644 --- a/sys/contrib/zlib/zlib.h +++ b/sys/contrib/zlib/zlib.h @@ -1,7 +1,7 @@ /* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.3, August 18th, 2023 + version 1.3.1, January 22nd, 2024 - Copyright (C) 1995-2023 Jean-loup Gailly and Mark Adler + Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -37,11 +37,11 @@ extern "C" { #endif -#define ZLIB_VERSION "1.3" -#define ZLIB_VERNUM 0x1300 +#define ZLIB_VERSION "1.3.1" +#define ZLIB_VERNUM 0x1310 #define ZLIB_VER_MAJOR 1 #define ZLIB_VER_MINOR 3 -#define ZLIB_VER_REVISION 0 +#define ZLIB_VER_REVISION 1 #define ZLIB_VER_SUBREVISION 0 /* @@ -936,10 +936,10 @@ ZEXTERN int ZEXPORT inflateSync(z_streamp strm); inflateSync returns Z_OK if a possible full flush point has been found, Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point has been found, or Z_STREAM_ERROR if the stream structure was inconsistent. - In the success case, the application may save the current current value of - total_in which indicates where valid compressed data was found. In the - error case, the application may repeatedly call inflateSync, providing more - input each time, until success or end of the input data. + In the success case, the application may save the current value of total_in + which indicates where valid compressed data was found. In the error case, + the application may repeatedly call inflateSync, providing more input each + time, until success or end of the input data. */ ZEXTERN int ZEXPORT inflateCopy(z_streamp dest, @@ -1761,14 +1761,14 @@ ZEXTERN uLong ZEXPORT crc32_combine(uLong crc1, uLong crc2, z_off_t len2); seq1 and seq2 with lengths len1 and len2, CRC-32 check values were calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and - len2. + len2. len2 must be non-negative. */ /* ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t len2); Return the operator corresponding to length len2, to be used with - crc32_combine_op(). + crc32_combine_op(). len2 must be non-negative. */ ZEXTERN uLong ZEXPORT crc32_combine_op(uLong crc1, uLong crc2, uLong op); diff --git a/sys/contrib/zlib/zutil.h b/sys/contrib/zlib/zutil.h index 9e0f3f9d0a2a..347597f50d3c 100644 --- a/sys/contrib/zlib/zutil.h +++ b/sys/contrib/zlib/zutil.h @@ -1,5 +1,5 @@ /* zutil.h -- internal interface and configuration of the compression library - * Copyright (C) 1995-2022 Jean-loup Gailly, Mark Adler + * Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -56,7 +56,7 @@ typedef unsigned long ulg; extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ /* (size given to avoid silly warnings with Visual C++) */ -#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)] +#define ERR_MSG(err) z_errmsg[(err) < -6 || (err) > 2 ? 9 : 2 - (err)] #define ERR_RETURN(strm,err) \ return (strm->msg = ERR_MSG(err), (err)) @@ -137,17 +137,8 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ # endif #endif -#if defined(MACOS) || defined(TARGET_OS_MAC) +#if defined(MACOS) # define OS_CODE 7 -# ifndef Z_SOLO -# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os -# include /* for fdopen */ -# else -# ifndef fdopen -# define fdopen(fd,mode) NULL /* No fdopen() */ -# endif -# endif -# endif #endif #ifdef __acorn @@ -170,18 +161,6 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ # define OS_CODE 19 #endif -#if defined(_BEOS_) || defined(RISCOS) -# define fdopen(fd,mode) NULL /* No fdopen() */ -#endif - -#if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX -# if defined(_WIN32_WCE) -# define fdopen(fd,mode) NULL /* No fdopen() */ -# else -# define fdopen(fd,type) _fdopen(fd,type) -# endif -#endif - #if defined(__BORLANDC__) && !defined(MSDOS) #pragma warn -8004 #pragma warn -8008 From nobody Wed Feb 21 13:24:32 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Tfxnr42Shz5CBKw; Wed, 21 Feb 2024 13:24:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Tfxnr375Tz4YmL; Wed, 21 Feb 2024 13:24:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708521872; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=55/N8biJUXWNfWZ6a0plToUgGW3D7WDGR1H5cgavSCE=; b=BreRGoQD9DGAVH4FrsilxlYqG5Sd84Qq2TPx8AywQBfbkj0ir0/gIN5oqt9BSUIM4OykkQ gCcMVBgVDO7lpBUQFK1oVsqkXm5pP/5OmZ0OLc6Y0NjM0eYI9qflbQSp7aEUegfqra2gFe KE/ELL2M/gIm79oKNFJU17PzoUgFEoOGO2svdu+PHE8D+WPgcN0QYq8TbdKlIhtR3kn0OK PjgadeScmgfEbJ5R+rkQMaO3QzPyXXRtupO0SU8hpsocnyRZRg72QIeR+kEDsaSsOJjTBa rV4e8c1+Im7pREDe2lPYXBEe2UnAnt649ECPL6qJLZMP/cNPRDeOuftPAjHoKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708521872; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=55/N8biJUXWNfWZ6a0plToUgGW3D7WDGR1H5cgavSCE=; b=LwOa3mCPWzzxCAFNjYlb/Hi9Dchxln3lxCxWkWG9R2G8EJi/Tn6Q0l+afwA9lAi69zQ94N B4Hlisx0TfutQWNRa8eFmpOUxKgjgjg5TswR/CCE4KJmCHCC8I1CRwidX55OdFGBe0thCS D+XKXbiU8AMT/g2BC5Oo2H2JZT5kopxM5lZiw9LZcTUipNbUPTmnW8IMP0AMIb7YHh+D2K kaHSmb6JbX2D7IWMWmEIFjZecy0aG6G2P+/Ubn6HZCvvssoLV23MsHBkz57yI4gASRK1Nc HF8cGOpZ6qXU0J8fXk/RQUZvovCSy8/M46KzLW4dMRdGuT+lhgVrbZ8SVntRYA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708521872; a=rsa-sha256; cv=none; b=d9eYrjLaXhEQrXcSd6stQkZM6p1c5S0ItXx6q/PXB08spa1NVix+K0brO3ddMlELP98GZD ej/3/yt9a3sFwEJnN1Q8VclEw6tK9llZysxtzJLI6vfqeRZu8DmIo6AD21bCGhBZp8XkVu S9uWEZWxrba4OlhRbUjWG4WULEMNnYoz1cJVo0zamkhAQmulBSryN3ojs0qHuN2TYzDurR Eavkvuk4YZv2X3niAnQqBOAdF0w2pPgFZKNfQ00djg7qEZPWvGXTAP7Ic/BK8m3JcsTiiP FDt9CpTIQq+pcrCZQIfHDatgdS3Mvm2Fu25a6Kari4uasMfnXSBQyK0vzVEBCw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Tfxnr20XSz145k; Wed, 21 Feb 2024 13:24:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41LDOWCm015473; Wed, 21 Feb 2024 13:24:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41LDOWbh015470; Wed, 21 Feb 2024 13:24:32 GMT (envelope-from git) Date: Wed, 21 Feb 2024 13:24:32 GMT Message-Id: <202402211324.41LDOWbh015470@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: c5f972e7fced - stable/14 - bhyve: Add support for the 'p' query List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c5f972e7fced3aa1825564d70b05e58c88fac678 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c5f972e7fced3aa1825564d70b05e58c88fac678 commit c5f972e7fced3aa1825564d70b05e58c88fac678 Author: Mark Johnston AuthorDate: 2024-02-07 13:46:59 +0000 Commit: Mark Johnston CommitDate: 2024-02-21 13:16:12 +0000 bhyve: Add support for the 'p' query This lets gdb query individual registers. It's easy to implement and is used by gdb when attaching to a CHERI target, so let's support it. Sponsored by: Innovate UK Reviewed by: corvink, jhb MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D43664 (cherry picked from commit e6516294f4c7afa9da40a39caab86a5cd2aeb35a) --- usr.sbin/bhyve/gdb.c | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/usr.sbin/bhyve/gdb.c b/usr.sbin/bhyve/gdb.c index f2976622c79a..6bdfbc5e8536 100644 --- a/usr.sbin/bhyve/gdb.c +++ b/usr.sbin/bhyve/gdb.c @@ -1036,6 +1036,29 @@ gdb_read_regs(void) finish_packet(); } +static void +gdb_read_one_reg(const uint8_t *data, size_t len) +{ + uint64_t regval; + uintmax_t reg; + + reg = parse_integer(data, len); + if (reg >= nitems(gdb_regset)) { + send_error(EINVAL); + return; + } + + if (vm_get_register(vcpus[cur_vcpu], gdb_regset[reg].id, ®val) == + -1) { + send_error(errno); + return; + } + + start_packet(); + append_unsigned_native(regval, gdb_regset[reg].size); + finish_packet(); +} + static void gdb_read_mem(const uint8_t *data, size_t len) { @@ -1598,10 +1621,12 @@ handle_command(const uint8_t *data, size_t len) /* TODO: Resume any stopped CPUs. */ break; - case 'g': { + case 'g': gdb_read_regs(); break; - } + case 'p': + gdb_read_one_reg(data + 1, len - 1); + break; case 'H': { int tid; @@ -1673,7 +1698,6 @@ handle_command(const uint8_t *data, size_t len) case 'v': /* Handle 'vCont' */ /* 'vCtrlC' */ - case 'p': /* TODO */ case 'P': /* TODO */ case 'Q': /* TODO */ case 't': /* TODO */ From nobody Wed Feb 21 13:24:33 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Tfxns4cHvz5CBbf; Wed, 21 Feb 2024 13:24:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Tfxns3YYdz4Z36; Wed, 21 Feb 2024 13:24:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708521873; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ogDovwIsFobZFrM7eNKdR+b3bA0lWrCNwEY1qV5hxSE=; b=v1xOy4vOYWC7XeRNgcHcr6QK4CaiP287rzSHR8vRIW2koy9dbzCLk8rEW6sp8056V2kxUG PoPeFNPlcZ0Y6LUPExiUkHvOG7u5/wmDCw5Pa4VkaURAiNjsi3Hd1opGc2BE/PM7fzuIS5 463Z7AgPY4lERLcF6jwy9R5gAgwXHiVGmQHiHOG/Uri/4pd6RvQ27FqxD8WQxrPnhbo6iW nMBtsmGZIstb4bgmRtNu0ym9d8WEnuKzXp+6L3zJYbQ4HVoeJHDGxf7hM38LRiFBQlUAkz xXvlEsSW1/aYi8K+7m79PbCvYv9LpVDGHIeXvH5VyYxhEEYSdGVDkc/pYJe1FA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708521873; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ogDovwIsFobZFrM7eNKdR+b3bA0lWrCNwEY1qV5hxSE=; b=S8E3tA32oalY9oUtx/JeifMAU1u23xi2gAfEQOoqiP74U4sXO/rwcWQQzI4ZaHdomn/R03 HXe3DzLiOAVz0Y1b/YUAVWU3NwFubHlkgnsPDE7jdskbDZppK+C5UeC79zoi11aWbwcNaO gVeLqK2V3R0jb4miDPK03FG0XnE93kclDdmc3+bAOQTf7fIb+9diKpIWcrHP8em3hh0y0c U1vE3tnvCRMS2rJrV5rXup3cuPcSlMFzCxpb0Il7wLOfHkAsTf/Z/zqJ9YFFTxg+aLiguV cZkmnjN1yLoUenMIp8TQidL/1EjMXIsPrfDVSPAJP1aa7jEqhLvIpaP4LtrWjA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708521873; a=rsa-sha256; cv=none; b=In25Cos0bqCDvsETmBeVckV47MtTI0d1srRhAz9yyYLip6y1TiEBib2XLewNNK/kFNqXgQ XACY7TRWrgjWcbATbkD7EtAneqT8C5F+s7n0tS4h6fBENGRt9HA8nXArdYD49STY1wZMtm PRQ8lTLoTZv6mYy5AWP4kR6QDredDBvuVk0Z71c3CLYe6vcuGq8FcmE4cK7Sl0V5EEd9Cv jqBMaOo/6oZmgR6ohpM/V5Jq44mhH9u9brG2tcgzDxN/OwStWn2ApucqCndI2EWpU0E93f iSNjo2TdBcL6rY9WwAlcuyNGlBVy3ir7Sf4kmYJGXTCmjbmO89hygQpcmnqpUQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Tfxns2fk9z13ws; Wed, 21 Feb 2024 13:24:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41LDOXBU015526; Wed, 21 Feb 2024 13:24:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41LDOXod015523; Wed, 21 Feb 2024 13:24:33 GMT (envelope-from git) Date: Wed, 21 Feb 2024 13:24:33 GMT Message-Id: <202402211324.41LDOXod015523@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 3b3ab2abb694 - stable/14 - build: Do not run ctfconvert on VDSO files List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3b3ab2abb694368ab27ab518963ca73564720305 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3b3ab2abb694368ab27ab518963ca73564720305 commit 3b3ab2abb694368ab27ab518963ca73564720305 Author: Mark Johnston AuthorDate: 2024-02-13 23:06:58 +0000 Commit: Mark Johnston CommitDate: 2024-02-21 13:16:22 +0000 build: Do not run ctfconvert on VDSO files Reviewed by: emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43877 (cherry picked from commit f48cd806e04a7d6f459cfd93dba283465d40e190) --- sys/conf/files.amd64 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64 index dfbe278f0c46..5ef285b70c55 100644 --- a/sys/conf/files.amd64 +++ b/sys/conf/files.amd64 @@ -14,12 +14,14 @@ include "conf/files.x86" elf-vdso.so.o standard \ dependency "$S/amd64/amd64/sigtramp.S assym.inc $S/conf/vdso_amd64.ldscript $S/tools/amd64_vdso.sh" \ compile-with "env AWK='${AWK}' NM='${NM}' LD='${LD}' CC='${CC}' DEBUG='${DEBUG}' OBJCOPY='${OBJCOPY}' ELFDUMP='${ELFDUMP}' S='${S}' sh $S/tools/amd64_vdso.sh" \ + no-ctfconvert \ no-implicit-rule before-depend \ clean "elf-vdso.so.o elf-vdso.so.1 vdso_offsets.h sigtramp.pico" # elf-vdso32.so.o optional compat_freebsd32 \ dependency "$S/amd64/ia32/ia32_sigtramp.S ia32_assym.h $S/conf/vdso_amd64_ia32.ldscript $S/tools/amd64_ia32_vdso.sh" \ compile-with "env AWK='${AWK}' NM='${NM}' LD='${LD}' CC='${CC}' DEBUG='${DEBUG}' OBJCOPY='${OBJCOPY}' ELFDUMP='${ELFDUMP}' S='${S}' sh $S/tools/amd64_ia32_vdso.sh" \ + no-ctfconvert \ no-implicit-rule before-depend \ clean "elf-vdso32.so.o elf-vdso32.so.1 vdso_ia32_offsets.h ia32_sigtramp.pico" # From nobody Wed Feb 21 13:31:49 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TfxyG2x1zz5CBn2; Wed, 21 Feb 2024 13:31:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TfxyG0Dwzz4Zhy; Wed, 21 Feb 2024 13:31:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708522310; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xxs7Fro/hGm2PZHLOrVC7TUAfgab9E4DJQuycfSC3rw=; b=re2vKm0AX4nsy6iowaH5q89i9wkQwLQjbl2s3yCw3rlzjLSh6z1a4hTMIiJHY3ahuVoa5n fVqMO3GG+iuobRCdgb1wc52QpOXPBxiAF7Ang/A7z6PjMuPKDn6/VNzNUM6ViMtX1ESqDj TldNqw+QBk/txupp3018f1HVDp4DAnAzAoYk28iaMTcoOsTqanNn999yo++gDUdXgN9Pnu gWB9MLUzd3XDo68ExSHqddbR95byRzQvML+AKuP7qcYLoNSG0IQeodJ3g61vtpzk1xP7/B zzujJI1VZJDvqoHT744LCtY0OPoJ6JePMzkTZTXbIpbsFTq7gFipNQcWEJedRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708522310; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xxs7Fro/hGm2PZHLOrVC7TUAfgab9E4DJQuycfSC3rw=; b=m718Lhlovw7JfiNVw5AKF7nPdBikG3nCohVQewdEsDHHNlwKhmyp4WNJ4hXJN1OwoT5h1R d4KgdjH1k0vSBAZ5N9KQewE48pWxNAByOyRcK5s/gaEppu9FmkuauYd3NbotS14E29LxaW 5ALb6HeWMWiZWqaAHP9VE6uxZT8XXimqr7lv7N9c6TjrtDTsF44t49cOwkqX5SjSlJa2qz XbZtMRIPoTJZ6Cf/uP4F3qaHZyyFa470pEGizJCgbJsprFQxURl49cFQiuwC1/Pc0Wpm+V OdSoraVH/7VWvLuDAmqSy0/dv7g4v+Zml2vMNWdOMkP7unlRNSOdTZPjOLZN0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708522310; a=rsa-sha256; cv=none; b=Kdh3rkbSP3E+7BK7x2UDmFvdVcjDvhfPHIlbj0+MFQEVsS/x4JatUsX/yehgG1Wt7T2RHi JTvLI8y7akkfr45s1coF3J+Qb+FSA6ehWQGoounKnNxdvDp09JmJ6AUN4wQ7nBr8CG+y3w Lu/MwNrm0PmneD3KIMuuRBhOBhm+30a+4TeQAGcZegFY+xvLQt5SxBxGoUU5hSuhBUUagn DconsTTCbVQQ4qn6jz5zkpCcq0rQrR8naYNoDq76harctZwf5e7Rmjd0QRQq7Kvt41EzK3 BKjq3qWbKrS2Aey34Q/Gubr9toTyzm61isCxmkyanbey32GOn/uUvaQcPk60sQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TfxyF6QJ2z14VR; Wed, 21 Feb 2024 13:31:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41LDVngq026014; Wed, 21 Feb 2024 13:31:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41LDVnL4026011; Wed, 21 Feb 2024 13:31:49 GMT (envelope-from git) Date: Wed, 21 Feb 2024 13:31:49 GMT Message-Id: <202402211331.41LDVnL4026011@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Stefan =?utf-8?Q?E=C3=9Fer?= Subject: git: 00c958f12c3d - releng/13.3 - msdosfs: fix directory corruption after rename operation List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/releng/13.3 X-Git-Reftype: branch X-Git-Commit: 00c958f12c3da158fe79c6976337eee870714fa3 Auto-Submitted: auto-generated The branch releng/13.3 has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=00c958f12c3da158fe79c6976337eee870714fa3 commit 00c958f12c3da158fe79c6976337eee870714fa3 Author: Stefan Eßer AuthorDate: 2024-02-17 21:04:49 +0000 Commit: Stefan Eßer CommitDate: 2024-02-21 13:31:26 +0000 msdosfs: fix directory corruption after rename operation PR: 268005 Reviewed by: mckusick Approved by: re (cperciva) (cherry picked from commit 8b67c670a49b4efe7e1557121b5bbae682ea3bc7) (cherry picked from commit 5f4753501e9cc59e0d15f849c9459478ea5c8dc7) --- sys/fs/msdosfs/msdosfs_vnops.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c index 1d296c019331..7d18ac623af4 100644 --- a/sys/fs/msdosfs/msdosfs_vnops.c +++ b/sys/fs/msdosfs/msdosfs_vnops.c @@ -1192,8 +1192,10 @@ relock: memcpy(oldname, fip->de_Name, 11); memcpy(fip->de_Name, toname, 11); /* update denode */ error = msdosfs_lookup_ino(tdvp, NULL, tcnp, &scn, &blkoff); - if (error == EJUSTRETURN) + if (error == EJUSTRETURN) { + tdip->de_fndoffset = to_diroffset; error = createde(fip, tdip, NULL, tcnp); + } if (error != 0) { memcpy(fip->de_Name, oldname, 11); goto unlock; From nobody Wed Feb 21 13:43:12 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TfyCN6HMKz5CCyX; Wed, 21 Feb 2024 13:43:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TfyCN5lZ0z4cfB; Wed, 21 Feb 2024 13:43:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708522992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dW/SaKMAx6lFa4eVnsACqKY+kWL5IygR58J30s/vR2I=; b=VXKOCLmfzVLCEfL4eKcPZMXAHIpnzJSNaZTSNvTSAwNVnLmf+sdkT/kT9N2NdjFSRWJMvG I9rJi36jkBkoIpFp3vLIOOZa/Va2Frg9mVgjTB8JUMT08mFKlEC5XO+ZedXRgRA9bvxara nFPvovqso2n4HrSkBnWz07iMA2q4y2i8ZjK7I/pS66yBR36lLezK9EzXdge2/WAFL5E/Nv w9UTSMbEXw6gzCccwTgdlgPNFOlEYcCqc5mSVE5W4lV0rjbdy7XQdxUE7OQLo+h547j7aQ 28lA4WOC2+uyHWUMynA5TT0azb3+qvNARwt41Al4fXHiAPG3GMSgPOq1Wl3SLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708522992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dW/SaKMAx6lFa4eVnsACqKY+kWL5IygR58J30s/vR2I=; b=VuUxFbqI3UbTeQvlNBCPU16QbjsP0g0BWmRRW2Bw0k3k6JLMhCD+PHH+sD854vv+XsND6V RDzvLrw2WECEaAVBN0a/XQyTqShsPayjdLqb08dwDoM42HHkAJZRaiaqZ/X4ndu+N5LYLu RkinE0RmbvCmQ9wdEmm2MNJnXUH4O9uNL9pwhBIpyV2euGV1bkcTRGLfchMmPORYirRAd/ VUb8kWWYR4QLjXsHIbQT2lwYqcQU6nDsDB9IT4rVgUIDvl/JYRaRt3AxpDfDVWemvfbbGl lyxNLw/+jYXjNede5LfrqQ9wyG8mF5dR2gXqirqWnntHpHk+OoWILh/OgjuqCw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708522992; a=rsa-sha256; cv=none; b=PKRcnzBqxg7BdNicwzzYcc6Nj+KEwh51JVDrIDr57Fcy98NOBxoTJ5plV6ca8pzEVW0rc8 meRJLEiyy+aI9eRylTAa9SsqfF+1f8wP4oA6Dz2V0xSKF1QCVCdA5WMwizp7PWEVC2l7rl lq3lhyg9BLusf3ZCL7QLl0WqdJSKmlHDdBGEzXrY/8kUzGIw4a1F5Pm117tkjN7pxgWCO3 Updw22wB9slSMNlAxdPAIVSPXkhcVZSJ1/Cm7dWK9P3REfXgGkypCMqLBC2R76fiVjEFi6 fwiJRmPY10HzDxk5sioNwOiADZ4nIBttPE+l22/6tT7AOLIpSji8cFjrAO1SMA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TfyCN4qLjz14cs; Wed, 21 Feb 2024 13:43:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41LDhCvi048281; Wed, 21 Feb 2024 13:43:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41LDhCaY048278; Wed, 21 Feb 2024 13:43:12 GMT (envelope-from git) Date: Wed, 21 Feb 2024 13:43:12 GMT Message-Id: <202402211343.41LDhCaY048278@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 4712696c8f46 - stable/14 - Heimdal: Fix transit path validation CVE-2017-6594 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 4712696c8f4697b4466407a3e1fa2318f7213eed Auto-Submitted: auto-generated The branch stable/14 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=4712696c8f4697b4466407a3e1fa2318f7213eed commit 4712696c8f4697b4466407a3e1fa2318f7213eed Author: Cy Schubert AuthorDate: 2024-02-14 19:56:18 +0000 Commit: Cy Schubert CommitDate: 2024-02-21 13:42:58 +0000 Heimdal: Fix transit path validation CVE-2017-6594 Apply upstream b1e699103. This fixes a bug introduced by upstream f469fc6 which may in some cases enable bypass of capath policy. Upstream writes in their commit log: Note, this may break sites that rely on the bug. With the bug some incomplete [capaths] worked, that should not have. These may now break authentication in some cross-realm configurations. Reported by: emaste Security: CVE-2017-6594 Obtained from: upstream b1e699103 (cherry picked from commit f8041e3628bd70cf5562a9c13eb3d6af8463e720) --- crypto/heimdal/kdc/krb5tgs.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/crypto/heimdal/kdc/krb5tgs.c b/crypto/heimdal/kdc/krb5tgs.c index 19d669798830..cde869522e23 100644 --- a/crypto/heimdal/kdc/krb5tgs.c +++ b/crypto/heimdal/kdc/krb5tgs.c @@ -655,8 +655,12 @@ fix_transited_encoding(krb5_context context, "Decoding transited encoding"); return ret; } + + /* + * If the realm of the presented tgt is neither the client nor the server + * realm, it is a transit realm and must be added to transited set. + */ if(strcmp(client_realm, tgt_realm) && strcmp(server_realm, tgt_realm)) { - /* not us, so add the previous realm to transited set */ if (num_realms + 1 > UINT_MAX/sizeof(*realms)) { ret = ERANGE; goto free_realms; @@ -737,6 +741,7 @@ tgs_make_reply(krb5_context context, const char *server_name, hdb_entry_ex *client, krb5_principal client_principal, + const char *tgt_realm, hdb_entry_ex *krbtgt, krb5_enctype krbtgt_etype, krb5_principals spp, @@ -798,7 +803,7 @@ tgs_make_reply(krb5_context context, &tgt->transited, &et, krb5_principal_get_realm(context, client_principal), krb5_principal_get_realm(context, server->entry.principal), - krb5_principal_get_realm(context, krbtgt->entry.principal)); + tgt_realm); if(ret) goto out; @@ -1494,6 +1499,8 @@ tgs_build_reply(krb5_context context, krb5_keyblock sessionkey; krb5_kvno kvno; krb5_data rspac; + const char *tgt_realm = /* Realm of TGT issuer */ + krb5_principal_get_realm(context, krbtgt->entry.principal); hdb_entry_ex *krbtgt_out = NULL; @@ -2240,6 +2247,7 @@ server_lookup: spn, client, cp, + tgt_realm, krbtgt_out, krbtgt_etype, spp, From nobody Wed Feb 21 13:43:13 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TfyCQ0Ghdz5CCp2; Wed, 21 Feb 2024 13:43:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TfyCP6lbPz4cbq; Wed, 21 Feb 2024 13:43:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708522994; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MyiLWUa46bVGY2bVO2tSDoDnwkjbv1rHA6txLrmVmnY=; b=Cg8zaImvEspIUjL3VI+y+u0/hToNjsStwBFn8KePbXKoSN6mgXcez+urjIUBf+jJp+dMLg Uw0nnJqH3G7vcdtNiRcXUUbLfZrMHDtj1wQtB9QR6uUGwTHxIfBQcRWZieEW79y6upM2fK /ac43hpjnXVKmoS+IQoDoy9Y3Oie0CnspSaA6MV50kZJvh64z3d02x47LdwHd4fI3bFs14 BVcv6XUkT9sPRPqo5uCYybI7NeTF1tqkfKCdUUgIi8/cb2VJAjaUZA9u719NMIO+i/RNBY U+IJI1VviIIq3ix7NpipUWTP7x67J9JqGWeOy/IPgGlIivUmBmIeG+WXnWm+Rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708522994; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MyiLWUa46bVGY2bVO2tSDoDnwkjbv1rHA6txLrmVmnY=; b=Jq8i9WNiWJLXH+h4TTEX6JaI7F8Q5OmK+aXpQR1mEDOuh0B1zPv9fBGPWnpPTMbIkQTTtX 93BAJp4MIQ0ncfbDrXlophrRdsUtQ4ypQUmzAXskpF3RYno62HA5pR9ceANDHLtnTnn9mn ycdT2Alrk/66VdsJlA0AGsYycoMr83B58vNxjtay2bfDDD4lUFPuQlARRDzr/yXIifNJTM Cz70u25KHKdtDeay8E66dLPYZuij3Q2d9VeYyCS3lBY9Utcty7czyEuul6JwLavT1OvSrR oWW1Zee5fl7ofASpjQKiHrFWMkWKYS3wcMB1YIJtkIQoqrI1aZM/CSazFOhfvw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708522994; a=rsa-sha256; cv=none; b=pbi8vjFLs0klGLiXxELdOo7aptk7XDx+WbZI+bGLWgrgKmot4cMM1RAH+hziiRV9LC7jqd /SnokR4qVY3U9XOmAcYLcgo/iMWiTrTTuP4mEvsg7rdze7LVEldVlbrHPnOzViMBvkILgY nJ8PUN2Wj2zkty3oj7nYR2FjiQDB65NKa8+LXK7LQKQ2onhF5dpjxGMT5wF5oDXkuuMD0E ZBTuhIWczg9LjU7ibFFhBtNnwMOVUYkyhjijwCZgc4Dgxji7dXy5Meucqjkr/tPlIXX+1l r5UALegkzjKa6eZPokoqc899HlipjuHI+1D6WqlPRjpOJJo1wrjp+tPxN+aRQw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TfyCP5Wj8z14L2; Wed, 21 Feb 2024 13:43:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41LDhD9J048335; Wed, 21 Feb 2024 13:43:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41LDhDDf048332; Wed, 21 Feb 2024 13:43:13 GMT (envelope-from git) Date: Wed, 21 Feb 2024 13:43:13 GMT Message-Id: <202402211343.41LDhDDf048332@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 5482dc8b9eaf - stable/14 - Heimdal: CVE-2018-16860 Heimdal KDC: Reject PA-S4U2Self with unkeyed checksum List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 5482dc8b9eaf455f4633a436460371f00fd1c355 Auto-Submitted: auto-generated The branch stable/14 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=5482dc8b9eaf455f4633a436460371f00fd1c355 commit 5482dc8b9eaf455f4633a436460371f00fd1c355 Author: Cy Schubert AuthorDate: 2024-02-14 20:04:30 +0000 Commit: Cy Schubert CommitDate: 2024-02-21 13:42:58 +0000 Heimdal: CVE-2018-16860 Heimdal KDC: Reject PA-S4U2Self with unkeyed checksum Upstream's explanation of the problem: S4U2Self is an extension to Kerberos used in Active Directory to allow a service to request a kerberos ticket to itself from the Kerberos Key Distribution Center (KDC) for a non-Kerberos authenticated user (principal in Kerboros parlance). This is useful to allow internal code paths to be standardized around Kerberos. S4U2Proxy (constrained-delegation) is an extension of this mechanism allowing this impersonation to a second service over the network. It allows a privileged server that obtained a S4U2Self ticket to itself to then assert the identity of that principal to a second service and present itself as that principal to get services from the second service. There is a flaw in Samba's AD DC in the Heimdal KDC. When the Heimdal KDC checks the checksum that is placed on the S4U2Self packet by the server to protect the requested principal against modification, it does not confirm that the checksum algorithm that protects the user name (principal) in the request is keyed. This allows a man-in-the-middle attacker who can intercept the request to the KDC to modify the packet by replacing the user name (principal) in the request with any desired user name (principal) that exists in the KDC and replace the checksum protecting that name with a CRC32 checksum (which requires no prior knowledge to compute). This would allow a S4U2Self ticket requested on behalf of user name (principal) user@EXAMPLE.COM to any service to be changed to a S4U2Self ticket with a user name (principal) of Administrator@EXAMPLE.COM. This ticket would then contain the PAC of the modified user name (principal). Reported by: emaste Security: CVE-2018-16860 Obtained from: Upstream c6257cc2c (cherry picked from commit 24339377490f9e362d040712b534d2963decd2d7) --- crypto/heimdal/kdc/krb5tgs.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crypto/heimdal/kdc/krb5tgs.c b/crypto/heimdal/kdc/krb5tgs.c index cde869522e23..cf1cd3dc1ad0 100644 --- a/crypto/heimdal/kdc/krb5tgs.c +++ b/crypto/heimdal/kdc/krb5tgs.c @@ -1892,6 +1892,13 @@ server_lookup: goto out; } + if (!krb5_checksum_is_keyed(context, self.cksum.cksumtype)) { + free_PA_S4U2Self(&self); + kdc_log(context, config, 0, "Reject PA-S4U2Self with unkeyed checksum"); + ret = KRB5KRB_AP_ERR_INAPP_CKSUM; + goto out; + } + ret = _krb5_s4u2self_to_checksumdata(context, &self, &datack); if (ret) goto out; From nobody Wed Feb 21 13:43:14 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TfyCR1nN1z5CCqZ; Wed, 21 Feb 2024 13:43:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TfyCR0fyBz4cYp; Wed, 21 Feb 2024 13:43:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708522995; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1MOi2jlwEfKoxD+IjmX95SeqNMB0tB6dC395mQUr0Q0=; b=chnCKKPsxvSuRlVwz0q4cqTwO/Kw3jYwMv31A5uhV8m83iTbjdmUctzmZjSl6CJOZXqGJi HMEBQPGMGEL5hB99Oy7BSGuxXPuV5ON+qA6+cax8BOQBh87ntzH9B3eLKj0ktRhAQC7+fE ljCq/iTh7/Q4JjkOrwE/2s+WBL4ge4NxcPL+Br4hAAkP8T8DcA7DaccWn87Bf1zW1PahQQ ObRzsPhFsmoawLB26IsLP4rczWBwU0Px1DIhe4Lv3VBila7fj22kIg5glSK8cZ0pyHOBRr CCUeifpt/rarpj9CXRhmCE+Ki95fX/vgeGlpo7ruiF5ArdROTKDAvf/CqZFUJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708522995; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1MOi2jlwEfKoxD+IjmX95SeqNMB0tB6dC395mQUr0Q0=; b=EvfQjlGlbeLTRopbUaAzOXp/yaGolCnjbjwsCIsyNwnfLfjScERFwT56LTGvAYkrBW8CU0 Ng2nw1uEWH62ur7HKYbcTgd5hxjerZ6yVSqM48LKKJ93nreLLc1ZsCRRnguTCbH3al3FJC taPg23IkILKy0NOB0q52bdsE+WraDwp/Ti4YBr0Xj8nh0i1ZAWrhl/LNxLF13IYmVFccUO 7TgVRsQrZ0KyaGJ0SLvkCKEWw897DbmQ71gvRqwwyY6mnzGdeiDAfJHX1Omjv4fl18HTr/ kFRPLYo6bW/NRSiMGFc4BIqoJJAxwgfJbgl/4QADIAimXnnN3g5Q6IKh1tfgsw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708522995; a=rsa-sha256; cv=none; b=wgV9X7c7vpQ6y+4bGMnaCbBbg8cPEgEgzqwoTqu3HjIxmJ0zkIJzdBfcZ8BJypHwFtvc6X ghCEsD7kJirSL7Nna7QU6WHABXYnOxpb3GnGCo1IX4eK75l7WwQOhFTiFQNHgO0ccjljVq UlTj5Q2E2M96An1jXscSAYpQQsSS87Qx0Jrprfjg7mSGaaKiAF9lLDlj0VjYxO36BVStcT DWsvo70pAkKYhvCfD6fTZzp9ji3+EsLdv8qGLoqmm3wdsoK/6xK0EmVtJFopXRkA18OiQo Zzz9yogNBRW5X7gv34WUreIP+u/DWOSEhOuZiiVWHLWk/elD/req3xnaCcqKjw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TfyCQ6YsYz14nP; Wed, 21 Feb 2024 13:43:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41LDhEAs048389; Wed, 21 Feb 2024 13:43:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41LDhE0Q048386; Wed, 21 Feb 2024 13:43:14 GMT (envelope-from git) Date: Wed, 21 Feb 2024 13:43:14 GMT Message-Id: <202402211343.41LDhE0Q048386@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: b1b256dd0f4d - stable/14 - heimdal: always confirm PA-PKINIT-KX for anon PKINIT List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: b1b256dd0f4dd9ec7c03caf5a60e9928dc0fe39a Auto-Submitted: auto-generated The branch stable/14 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=b1b256dd0f4dd9ec7c03caf5a60e9928dc0fe39a commit b1b256dd0f4dd9ec7c03caf5a60e9928dc0fe39a Author: Cy Schubert AuthorDate: 2024-02-15 01:58:06 +0000 Commit: Cy Schubert CommitDate: 2024-02-21 13:42:58 +0000 heimdal: always confirm PA-PKINIT-KX for anon PKINIT Import upstream 38c797e1a. Upstream notes: RFC8062 Section 7 requires verification of the PA-PKINIT-KX key excahnge when anonymous PKINIT is used. Failure to do so can permit an active attacker to become a man-in-the-middle. Reported by: emaste Obtained from: upstream 38c797e1a Security: CVE-2019-12098 (cherry picked from commit 60616b445eb5b01597092fef5b14549f95000130) --- crypto/heimdal/lib/krb5/krb5_locl.h | 1 + crypto/heimdal/lib/krb5/pkinit.c | 92 +++++++++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+) diff --git a/crypto/heimdal/lib/krb5/krb5_locl.h b/crypto/heimdal/lib/krb5/krb5_locl.h index d0c68927ffbd..0ea132f94c82 100644 --- a/crypto/heimdal/lib/krb5/krb5_locl.h +++ b/crypto/heimdal/lib/krb5/krb5_locl.h @@ -240,6 +240,7 @@ struct _krb5_get_init_creds_opt_private { #define KRB5_INIT_CREDS_CANONICALIZE 1 #define KRB5_INIT_CREDS_NO_C_CANON_CHECK 2 #define KRB5_INIT_CREDS_NO_C_NO_EKU_CHECK 4 +#define KRB5_INIT_CREDS_PKINIT_KX_VALID 32 struct { krb5_gic_process_last_req func; void *ctx; diff --git a/crypto/heimdal/lib/krb5/pkinit.c b/crypto/heimdal/lib/krb5/pkinit.c index 7164a118c34a..3c914bb31f35 100644 --- a/crypto/heimdal/lib/krb5/pkinit.c +++ b/crypto/heimdal/lib/krb5/pkinit.c @@ -1306,6 +1306,98 @@ pk_rd_pa_reply_enckey(krb5_context context, return ret; } +/* + * RFC 8062 section 7: + * + * The client then decrypts the KDC contribution key and verifies that + * the ticket session key in the returned ticket is the combined key of + * the KDC contribution key and the reply key. + */ +KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL +_krb5_pk_kx_confirm(krb5_context context, + krb5_pk_init_ctx ctx, + krb5_keyblock *reply_key, + krb5_keyblock *session_key, + PA_DATA *pa_pkinit_kx) +{ + krb5_error_code ret; + EncryptedData ed; + krb5_keyblock ck, sk_verify; + krb5_crypto ck_crypto = NULL; + krb5_crypto rk_crypto = NULL; + size_t len; + krb5_data data; + krb5_data p1 = { sizeof("PKINIT") - 1, "PKINIT" }; + krb5_data p2 = { sizeof("KEYEXCHANGE") - 1, "KEYEXCHANGE" }; + + heim_assert(ctx != NULL, "PKINIT context is non-NULL"); + heim_assert(reply_key != NULL, "reply key is non-NULL"); + heim_assert(session_key != NULL, "session key is non-NULL"); + + /* PA-PKINIT-KX is optional unless anonymous */ + if (pa_pkinit_kx == NULL) + return ctx->anonymous ? KRB5_KDCREP_MODIFIED : 0; + + memset(&ed, 0, sizeof(ed)); + krb5_keyblock_zero(&ck); + krb5_keyblock_zero(&sk_verify); + krb5_data_zero(&data); + + ret = decode_EncryptedData(pa_pkinit_kx->padata_value.data, + pa_pkinit_kx->padata_value.length, + &ed, &len); + if (ret) + goto out; + + if (len != pa_pkinit_kx->padata_value.length) { + ret = KRB5_KDCREP_MODIFIED; + goto out; + } + + ret = krb5_crypto_init(context, reply_key, 0, &rk_crypto); + if (ret) + goto out; + + ret = krb5_decrypt_EncryptedData(context, rk_crypto, + KRB5_KU_PA_PKINIT_KX, + &ed, &data); + if (ret) + goto out; + + ret = decode_EncryptionKey(data.data, data.length, + &ck, &len); + if (ret) + goto out; + + ret = krb5_crypto_init(context, &ck, 0, &ck_crypto); + if (ret) + goto out; + + ret = krb5_crypto_fx_cf2(context, ck_crypto, rk_crypto, + &p1, &p2, session_key->keytype, + &sk_verify); + if (ret) + goto out; + + if (sk_verify.keytype != session_key->keytype || + krb5_data_ct_cmp(&sk_verify.keyvalue, &session_key->keyvalue) != 0) { + ret = KRB5_KDCREP_MODIFIED; + goto out; + } + +out: + free_EncryptedData(&ed); + krb5_free_keyblock_contents(context, &ck); + krb5_free_keyblock_contents(context, &sk_verify); + if (ck_crypto) + krb5_crypto_destroy(context, ck_crypto); + if (rk_crypto) + krb5_crypto_destroy(context, rk_crypto); + krb5_data_free(&data); + + return ret; +} + static krb5_error_code pk_rd_pa_reply_dh(krb5_context context, const heim_octet_string *indata, From nobody Wed Feb 21 13:43:15 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TfyCS3gRVz5CCqb; Wed, 21 Feb 2024 13:43:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TfyCS1P9Bz4ctm; Wed, 21 Feb 2024 13:43:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708522996; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=74MRrMgvoHMReNU73plaOVIMSNLMSMcp40tgviSi2Rg=; b=yvViM1C72xI39ri2rGupc9AEP/pu29HFpoApbYPgiHtkn5tAkXnevyqNM9PVV40NtvqXIV 4K1GnRGJqz8fTquPZwIi98ovVYQJyo4OLg9l6DI+nxQAO2AZsXtWIGhcsKkCvylR0fPDkY LSBN+X214ZsPIZm6pAqu7Jv0q6n6jcFfgr9Q37KQAuXQxl5htIrliqz25pVGaqBvhKAOF0 ESBy46GB/UUwfS/uouxIP/6Fo6AEQXjmY7iHNG8qvKOqhe++/NRBqplu2edxY71yB26f0R O8Pg45S2XHPBALDQWhUQzoiprbnb892gK0Zx9JJ+an+myI6enVpYsLVFJdzAZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708522996; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=74MRrMgvoHMReNU73plaOVIMSNLMSMcp40tgviSi2Rg=; b=YYgeFyBjv9lrQL2ROClfZIgjQjJO9qoXdvGReAP8PXJ7OY68TPh9Z+oi/t1vkGIaepv0Bu mGvLbK0yTUCkqX6bOIQKdqzWfJEtQGQndqQvhKPQlsS4a0yoI/JTzQcPTtJxmOT2Z3oyn7 PuRhtBIzMWL/pckSfjCOHQwNXgCO1AlXUDwTbqNvVvSS7Uc86mKYjx/IVShN02oeH+NWIF QTBA95y8HoyVpoobKc6w6wqKijI731S9uZIebh9lLuzT2h6lHC4Xhxx8caCibltH1BHQoY Evsh8xlFUoqa6zKQhq4N+haf1HynZQPvZZ96n9FemhEeRhheoBpLY5FiauzVqg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708522996; a=rsa-sha256; cv=none; b=igG/nGT2ZhAFPRIDLi7Az1583LJDrlBiys0rvEe61Tly+Zs56K3KZovmodBdYUqt9ZmIAg OX0eCXZaz8w/zOp8Kw0dvr/18jl3KJY29+T1eBmC1Gd3zhSSICcB6G0/zJ6QqAKh1a+//A LMtCe0pDxxeop814qSoWeRVWuheZJ0VUWj6Iwg3hybVq1+aKYo3Dl7gWeHgmzozmilv0Ca 5otxbRwXL6q2g7WPNquslZwktlrOfYpcyeWhvX2weqezQZ9Ie761K17SWACRcxgmUuUN6Q 8Z+pRB+x7IzyMCmY86w3SOGasnzYIgmZHcNN81EM74dhxkU+++x1ztf1VtL/qg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TfyCS0Ldhz14L3; Wed, 21 Feb 2024 13:43:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41LDhFuq048438; Wed, 21 Feb 2024 13:43:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41LDhFOm048435; Wed, 21 Feb 2024 13:43:15 GMT (envelope-from git) Date: Wed, 21 Feb 2024 13:43:15 GMT Message-Id: <202402211343.41LDhFOm048435@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 5b7c923d9581 - stable/14 - heimdal: Fix NULL deref List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 5b7c923d9581597ee30dece578e256f455ea09ce Auto-Submitted: auto-generated The branch stable/14 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=5b7c923d9581597ee30dece578e256f455ea09ce commit 5b7c923d9581597ee30dece578e256f455ea09ce Author: Cy Schubert AuthorDate: 2024-02-15 15:41:07 +0000 Commit: Cy Schubert CommitDate: 2024-02-21 13:42:58 +0000 heimdal: Fix NULL deref A flawed logical condition allows a malicious actor to remotely trigger a NULL pointer dereference using a crafted negTokenInit token. Upstream notes: Reported to Heimdal by Michał Kępień . From the report: Acknowledgement --------------- This flaw was found while working on addressing ZDI-CAN-12302: ISC BIND TKEY Query Heap-based Buffer Overflow Remote Code Execution Vulnerability, which was reported to ISC by Trend Micro's Zero Day Security: CVE-2022-3116 Obtained from: upstream 7a19658c1 (cherry picked from commit fc773115fa2dbb6c01377f2ed47dabf79a4e361a) --- crypto/heimdal/lib/gssapi/spnego/accept_sec_context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/heimdal/lib/gssapi/spnego/accept_sec_context.c b/crypto/heimdal/lib/gssapi/spnego/accept_sec_context.c index b60dc19ad8e3..48542f06fcbe 100644 --- a/crypto/heimdal/lib/gssapi/spnego/accept_sec_context.c +++ b/crypto/heimdal/lib/gssapi/spnego/accept_sec_context.c @@ -605,7 +605,7 @@ acceptor_start * If opportunistic token failed, lets try the other mechs. */ - if (!first_ok && ni->mechToken != NULL) { + if (!first_ok) { size_t j; preferred_mech_type = GSS_C_NO_OID; From nobody Wed Feb 21 13:44:19 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TfyDh0rSSz5CCyk; Wed, 21 Feb 2024 13:44:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TfyDh0HGbz4dcB; Wed, 21 Feb 2024 13:44:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708523060; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q6STD5yAN0Fvr/MnVsSowGXLjF6mt2UwpTlMfM9S0zs=; b=AHv5od/OMelFnI2cTfp5r++hM6FMwvvDubLzocdZap4PAdnT90atSawVjXZ/uJ8xuHJPlZ +KxlBEyJajkXX0NqtQRcfLq9fomzE2rZq1ykcMboFfW6T6rYElX/3rz0nr9UdPycccOF5u +aVj3BbTDlbc9di6Lvb0paboJqneDwJRb4maOa0cy+izaYb8Tw243fedRkZDUaOG8qyZ76 leI5ObcaZbtlKEis9KxD+0k6/y/ISiyit6xtiREcbBG2AAOKslYLLIGAtpBZjYRwJlv39r Ghhmiv11VMjKhheiyM1BYKAHfqYk1z3TZPrJLPE09Qb2/ZkwfS1vqxww1iPLNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708523060; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q6STD5yAN0Fvr/MnVsSowGXLjF6mt2UwpTlMfM9S0zs=; b=AjlkI1CJBqoAtaLwIDoV25pQV61rRcqknImj6hSNeLvGL9bt0NenzNggw8pCmoATUaxxT0 vts2ay4/spXR+fxz4i0zcvOVTMF4XBMqYsBooYgoSh2rOyEGL4eYNm9ZXEPAXVlJAkRXy2 Rjlz4+I83+DkcnR4GTjfsTROfk0WzvKI+OPSJ7yyIVpNYmuKErnf+zxxotN7TuCiDcghi8 +VsFag9+QPiM3kOljNkRg/28ePWc+Iivwu/Jynfr/V1Nr7j+FOzQD8uxQYKKZDUtJeRgqr xpQt5w53NYH05hdKXrdb7J1P0IeC8ApoBpdyrSH8uN5jdyepx+gi/Fvo7mIEfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708523060; a=rsa-sha256; cv=none; b=AIHj8XaOr6OtEWlgV24GY2w2D5QxkgNdtKawJLd8btSgs2up9COuVzqG/i7JISgx00f9w4 1TBCoXImG9uhQiSc7wqdDBnNCqbVHe+v17JjzOImsTt3AKhfCW1opjL8FJ+l2WFv6LxZpo WZ2t3V8anetu6e+NsuCZs4IM3CflH4MHpte9v0SEU0dwUNhLViTgRzVo24O3JVhQ+68ogA BMT9+hxZ2UBT+YUIyPxyTBIUl8/vCrY+G+Bbnr/e5tcOR/6kO+F7b4rBAhk5V9ePNAp4pX M9NDegAkGh8Cqj92FyRD5rF5Nem0OLHXmiusi+82bp0hlIwnG1gqqmc6DkfI1A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TfyDg6Spqz14L4; Wed, 21 Feb 2024 13:44:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41LDiJh6048752; Wed, 21 Feb 2024 13:44:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41LDiJSG048749; Wed, 21 Feb 2024 13:44:19 GMT (envelope-from git) Date: Wed, 21 Feb 2024 13:44:19 GMT Message-Id: <202402211344.41LDiJSG048749@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 9a7121454dc0 - stable/13 - Heimdal: Fix transit path validation CVE-2017-6594 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 9a7121454dc0f68af2687699d5feabf736692fa6 Auto-Submitted: auto-generated The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=9a7121454dc0f68af2687699d5feabf736692fa6 commit 9a7121454dc0f68af2687699d5feabf736692fa6 Author: Cy Schubert AuthorDate: 2024-02-14 19:56:18 +0000 Commit: Cy Schubert CommitDate: 2024-02-21 13:44:08 +0000 Heimdal: Fix transit path validation CVE-2017-6594 Apply upstream b1e699103. This fixes a bug introduced by upstream f469fc6 which may in some cases enable bypass of capath policy. Upstream writes in their commit log: Note, this may break sites that rely on the bug. With the bug some incomplete [capaths] worked, that should not have. These may now break authentication in some cross-realm configurations. Reported by: emaste Security: CVE-2017-6594 Obtained from: upstream b1e699103 (cherry picked from commit f8041e3628bd70cf5562a9c13eb3d6af8463e720) --- crypto/heimdal/kdc/krb5tgs.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/crypto/heimdal/kdc/krb5tgs.c b/crypto/heimdal/kdc/krb5tgs.c index 19d669798830..cde869522e23 100644 --- a/crypto/heimdal/kdc/krb5tgs.c +++ b/crypto/heimdal/kdc/krb5tgs.c @@ -655,8 +655,12 @@ fix_transited_encoding(krb5_context context, "Decoding transited encoding"); return ret; } + + /* + * If the realm of the presented tgt is neither the client nor the server + * realm, it is a transit realm and must be added to transited set. + */ if(strcmp(client_realm, tgt_realm) && strcmp(server_realm, tgt_realm)) { - /* not us, so add the previous realm to transited set */ if (num_realms + 1 > UINT_MAX/sizeof(*realms)) { ret = ERANGE; goto free_realms; @@ -737,6 +741,7 @@ tgs_make_reply(krb5_context context, const char *server_name, hdb_entry_ex *client, krb5_principal client_principal, + const char *tgt_realm, hdb_entry_ex *krbtgt, krb5_enctype krbtgt_etype, krb5_principals spp, @@ -798,7 +803,7 @@ tgs_make_reply(krb5_context context, &tgt->transited, &et, krb5_principal_get_realm(context, client_principal), krb5_principal_get_realm(context, server->entry.principal), - krb5_principal_get_realm(context, krbtgt->entry.principal)); + tgt_realm); if(ret) goto out; @@ -1494,6 +1499,8 @@ tgs_build_reply(krb5_context context, krb5_keyblock sessionkey; krb5_kvno kvno; krb5_data rspac; + const char *tgt_realm = /* Realm of TGT issuer */ + krb5_principal_get_realm(context, krbtgt->entry.principal); hdb_entry_ex *krbtgt_out = NULL; @@ -2240,6 +2247,7 @@ server_lookup: spn, client, cp, + tgt_realm, krbtgt_out, krbtgt_etype, spp, From nobody Wed Feb 21 13:44:20 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TfyDj2NPQz5CCZ8; Wed, 21 Feb 2024 13:44:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TfyDj1bz5z4dh7; Wed, 21 Feb 2024 13:44:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708523061; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DEPmYaEBk6QCh7ZVvWuAwE1eSo+Y3KZPd15jqgf0jEs=; b=G6alDlRXZ+LlBXVbRnLzJuZiwsn4sN6elQJuJrTJnCfV6PInTmn5iOd0cwQmiYHguLwp9q i3a3Fm1En8PDb/dfam3ATZyMqg4w1UNuyuKOZVX0OlEXvMUikGtIuSUoUvcmO3+SAurYvQ 07M+AH82eROBX0BP7fTy1TkiLxDOFoKk3Sy+OJ37pP13XMS4jQknh4tORbgq1sPPfobkXs MofmvZShj8J+81ONeQ8703rwfmYmFFmi6ReRsKUoLbUIpne8Hl3mHDXTOvwrBFPDLXL6IY xbvpkWv51JbpriDyKfsg8Ap/KRUdvU7REVjNYfxImvBby2Ioh2qYAVWRNFlNtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708523061; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DEPmYaEBk6QCh7ZVvWuAwE1eSo+Y3KZPd15jqgf0jEs=; b=UfEr2JUAOZZsojfZ4aEBg8fclgOuKH/LFI4348JQfL0lXqXbDCC694uX2nNH0chwOpyzvE ORlDDZdc0HwSwpGAMbkhj7YTTd+lQhAeKoUlppEvhtvNq00cy7fvt9JaWCWeT4Vih6W7q2 jOWFM7HdHlhU64Qo0FWDFNxRJFingq+m472kB8ulPna+DM2Nphd7D3M9Q4U0694Dpx2sz5 UZdsqR6jr+LXmtMOygGdNq/p/bWsst9lqm6m2cPwpWDdJaZq4EC+7+JGYIwzxYPjERBTYx 19uu2phiuh0m1JiQpwp5sJCTl9kHuTce9Gm6EAYq2Y7kXiTwcc2ObjOO545tAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708523061; a=rsa-sha256; cv=none; b=pDSN8wsjt0t+p0Qr2nrInXDS1btDrHdyjFbkikK5fqszX3VuVLb5ImS8BFStHWjEF6pfnB UXxJC1WR19a9iKCxkF+8dhJ2DiAN28nGmYDwbWkcMMaSJVR3fy02js5YoU0+eBolwZSXMK FdXis7+Y/1QlAzuE3jq97l0UTwV1MqC6ISLfVsa21QSVFDsWsxy1UgE1W8YujmC18yPt/w ON9DII6KSdumqIbUkHDQNRMdr8kWLWJR0VfiYGz/gDjBiAyRSd72qJuYgDIo4oU9JS2u8U XKWOXszzz28NjS8oF1F/g9nqyQG/D3cZ80AuA/lFqTvcy6i642TrDtsikJWP2A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TfyDj0NFGz14ct; Wed, 21 Feb 2024 13:44:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41LDiKFD048806; Wed, 21 Feb 2024 13:44:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41LDiKqM048803; Wed, 21 Feb 2024 13:44:20 GMT (envelope-from git) Date: Wed, 21 Feb 2024 13:44:20 GMT Message-Id: <202402211344.41LDiKqM048803@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 143a962d0e87 - stable/13 - Heimdal: CVE-2018-16860 Heimdal KDC: Reject PA-S4U2Self with unkeyed checksum List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 143a962d0e871c60b91589aa1045afdeca13742b Auto-Submitted: auto-generated The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=143a962d0e871c60b91589aa1045afdeca13742b commit 143a962d0e871c60b91589aa1045afdeca13742b Author: Cy Schubert AuthorDate: 2024-02-14 20:04:30 +0000 Commit: Cy Schubert CommitDate: 2024-02-21 13:44:08 +0000 Heimdal: CVE-2018-16860 Heimdal KDC: Reject PA-S4U2Self with unkeyed checksum Upstream's explanation of the problem: S4U2Self is an extension to Kerberos used in Active Directory to allow a service to request a kerberos ticket to itself from the Kerberos Key Distribution Center (KDC) for a non-Kerberos authenticated user (principal in Kerboros parlance). This is useful to allow internal code paths to be standardized around Kerberos. S4U2Proxy (constrained-delegation) is an extension of this mechanism allowing this impersonation to a second service over the network. It allows a privileged server that obtained a S4U2Self ticket to itself to then assert the identity of that principal to a second service and present itself as that principal to get services from the second service. There is a flaw in Samba's AD DC in the Heimdal KDC. When the Heimdal KDC checks the checksum that is placed on the S4U2Self packet by the server to protect the requested principal against modification, it does not confirm that the checksum algorithm that protects the user name (principal) in the request is keyed. This allows a man-in-the-middle attacker who can intercept the request to the KDC to modify the packet by replacing the user name (principal) in the request with any desired user name (principal) that exists in the KDC and replace the checksum protecting that name with a CRC32 checksum (which requires no prior knowledge to compute). This would allow a S4U2Self ticket requested on behalf of user name (principal) user@EXAMPLE.COM to any service to be changed to a S4U2Self ticket with a user name (principal) of Administrator@EXAMPLE.COM. This ticket would then contain the PAC of the modified user name (principal). Reported by: emaste Security: CVE-2018-16860 Obtained from: Upstream c6257cc2c (cherry picked from commit 24339377490f9e362d040712b534d2963decd2d7) --- crypto/heimdal/kdc/krb5tgs.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crypto/heimdal/kdc/krb5tgs.c b/crypto/heimdal/kdc/krb5tgs.c index cde869522e23..cf1cd3dc1ad0 100644 --- a/crypto/heimdal/kdc/krb5tgs.c +++ b/crypto/heimdal/kdc/krb5tgs.c @@ -1892,6 +1892,13 @@ server_lookup: goto out; } + if (!krb5_checksum_is_keyed(context, self.cksum.cksumtype)) { + free_PA_S4U2Self(&self); + kdc_log(context, config, 0, "Reject PA-S4U2Self with unkeyed checksum"); + ret = KRB5KRB_AP_ERR_INAPP_CKSUM; + goto out; + } + ret = _krb5_s4u2self_to_checksumdata(context, &self, &datack); if (ret) goto out; From nobody Wed Feb 21 13:44:23 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TfyDl5SNxz5CCZD; Wed, 21 Feb 2024 13:44:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TfyDl3HvMz4dmk; Wed, 21 Feb 2024 13:44:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708523063; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/c4vY/MwaQSOm/b+g/a0CgeetAxQV6GNPVyhSE22UIo=; b=MjmQxr5Rr2TCZAR/SeXqHz4JR67Auvzdv4kStZJ+d077Eq0r8dSwHKNUwKr+lcRGkdKABQ e1r1t7KaRuj0Vt5bdCtkWeQgd/5Bz2+xoiRacriJkszJBwoOhVfypEFG07QR28tCEyK6J5 UJCJfT7XBaxzChj4VaOPBiakpjYPCvyyG1UVGoKOIAAaA5JQcVyp0k+D+yljK8E2nurXlW IyPjb78YVLr2jHgoZXxWF3J6svlgxiL31bvMRWByC211jm7ebyP0JDVz9A8v/4RZl2/U4G 8kzOLd5uL57amnwy2HOfR1tZdZI3T/h5HRrEsEFLn7ca+SDDPLQVxNt+QHLtlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708523063; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/c4vY/MwaQSOm/b+g/a0CgeetAxQV6GNPVyhSE22UIo=; b=ZK9SxmPsQ5cyvLf6hDU/N18nUEIvhjSbubG0dahFYwIoa5VRHJqpzUi4C0SBxTlPOrPfcX C/DzWjidaK1VPLwy4DZZAVAKzMDapmREfOP2e3Z3mipBdn/LV9AG4/DfMz133UsjbHJato NX2EXXETQGWCmlPU1vnZ7wQVKOB1xaIhU0rdup3TkMbkf/ZTVRI0RQeh2IwkQJu0UtMnAc uZ0x9AAIl5HUwqsfCCmKHOLVKZ9cipr79+Omk2FRaVXV0UpbeM6Re5rgVMa73D1Are/l9N d4/aQcgALAjH7HNBSEZiTvHeqhovRBFBkao44h+vnNdpe6pIDalWgZJBNl1HBg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708523063; a=rsa-sha256; cv=none; b=ENMOTnCt7LMt4gAVgqwhisOt6EZgcE16EQR9g8Vsp7UXvaQx3O3wa/ghZwlcTIpobyDQlR OVwYBKvX1WTTscKr5PpvZ+hF1xcpNphsVSWcHrXKwwwr9mSYmyJHh3AZQEZSQz1A8beIkJ 2WSu0/+vXqX+u6eeJOCzCXKjDBr2OLugNl26wEFxTyyF0bHSUfeLYeYCnZxOJhADfIu1eS FDa2xuvra2i3iitfiVJv3Onz6TQ7HUTj0bL2DgZ7kCWe8i9kPmrhbIC2j0mVR+XsEOj57U 9VGwI3Xg4TMjQxvaB7AOesw1M6ZY4rpYNoYHtUPiC1XPYw6lOYcRC8m2BeMMjw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TfyDl2NfJz14hh; Wed, 21 Feb 2024 13:44:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41LDiNvu048896; Wed, 21 Feb 2024 13:44:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41LDiNH4048893; Wed, 21 Feb 2024 13:44:23 GMT (envelope-from git) Date: Wed, 21 Feb 2024 13:44:23 GMT Message-Id: <202402211344.41LDiNH4048893@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 6b421e431a2d - stable/13 - heimdal: Fix NULL deref List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 6b421e431a2de6eb9e8bd670efffe76e6617d520 Auto-Submitted: auto-generated The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=6b421e431a2de6eb9e8bd670efffe76e6617d520 commit 6b421e431a2de6eb9e8bd670efffe76e6617d520 Author: Cy Schubert AuthorDate: 2024-02-15 15:41:07 +0000 Commit: Cy Schubert CommitDate: 2024-02-21 13:44:09 +0000 heimdal: Fix NULL deref A flawed logical condition allows a malicious actor to remotely trigger a NULL pointer dereference using a crafted negTokenInit token. Upstream notes: Reported to Heimdal by Michał Kępień . From the report: Acknowledgement --------------- This flaw was found while working on addressing ZDI-CAN-12302: ISC BIND TKEY Query Heap-based Buffer Overflow Remote Code Execution Vulnerability, which was reported to ISC by Trend Micro's Zero Day Security: CVE-2022-3116 Obtained from: upstream 7a19658c1 (cherry picked from commit fc773115fa2dbb6c01377f2ed47dabf79a4e361a) --- crypto/heimdal/lib/gssapi/spnego/accept_sec_context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/heimdal/lib/gssapi/spnego/accept_sec_context.c b/crypto/heimdal/lib/gssapi/spnego/accept_sec_context.c index b60dc19ad8e3..48542f06fcbe 100644 --- a/crypto/heimdal/lib/gssapi/spnego/accept_sec_context.c +++ b/crypto/heimdal/lib/gssapi/spnego/accept_sec_context.c @@ -605,7 +605,7 @@ acceptor_start * If opportunistic token failed, lets try the other mechs. */ - if (!first_ok && ni->mechToken != NULL) { + if (!first_ok) { size_t j; preferred_mech_type = GSS_C_NO_OID; From nobody Wed Feb 21 13:44:22 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TfyDk3rJ6z5CCp9; Wed, 21 Feb 2024 13:44:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TfyDk21Frz4dhC; Wed, 21 Feb 2024 13:44:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708523062; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RbOifIY4PA2bJCXVHcqgEqvvftoNDgTAl0Sd10Ou3nk=; b=sJ7l+cobafr9K0l41YQHb5q8kH+KPHhvDkjCw0wWXJ3j5J4y3dqzzYdjxScmDWpuujVfkE RsZM1k0PIxdVBaybeR1al3/QEXJJWhVgYM7fLbcDZr30IcAUlJvC3bUhgipk1++263MQ21 GtRPh3+Jay4GKfePQ2t6wsAUjPIo85+0D7TbMpQWOiyfTylo/tMLzhh7RmcQekOR4zK5sM tB09RdsK9ou/jFKqzgKkiygNiV9fB0/anVpHKRLDDrng2xM50BfOIto7J+ZkRDEGIZIzAp qtz5zZzkMb0REE/l1tN0w00zBodZAkIAHiFLPlLo4Tovcu5xXul3rXZ8mDMQwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708523062; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RbOifIY4PA2bJCXVHcqgEqvvftoNDgTAl0Sd10Ou3nk=; b=P9DjuMd5uOno6R4qqcR4wNNn36OKj258jJ3BQndN0SOBUKR7Awz/bt6aH2Qfc8hXn7HI9d lMyYmrcyCYi6zIdppBknGEe2+Fiwy2X/Q++CqRYcYrgNknMM1x2iB/JNH/gWxn05QkXFhm pTr+/SQn/8CzQG0WGavDyutV6p8yDSfS1JXUF8BiC5jcmdaOw4roHmgbXYoXm8Jkm4PQvb GPy4IO+KmQvB9FO0JknfK+SrKY4rce+kpT2MpBaNH6bmMlBHU4QdXIRaoivS8NPJhm5a8E anZHbcRovbDYDeu/1G6grRiZxcOud6yKx/JuPoGu7SeZ2uu8FLEA3cNcVzxQDw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708523062; a=rsa-sha256; cv=none; b=Dh3Ef7sIL00lpR2qksc/5rJdMvFzVbqasxldFxxjSDG5gTJC8bC0LKt6GOa43P7oKeG2TU STe5gF0Vt4t3RzslaMfrEwfCe9dnaLpaQrl4mbqeqJU9kmBokbFSIRX9xVsG//AV/2G5iP 3iaCaOEVR9QMIEl3oQgsUiTC4nE/RxMc3QbxliUdyZ7hqUb469ed37hCgC0a0PQ9hfM4bx 4PeY9hrmELOnHFQMoc4IC+1mpQbn2wDBOedTnRb7bNeCFEcnkjRSHxytCwS2FfilDTutk+ AQ/D9LVK5kKOJ5PB1SdGO79rz4n6wNett93CFRhG05iCsh9GQhch2Ui1mVXqOQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TfyDk16rYz14w6; Wed, 21 Feb 2024 13:44:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41LDiM7x048854; Wed, 21 Feb 2024 13:44:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41LDiMeR048851; Wed, 21 Feb 2024 13:44:22 GMT (envelope-from git) Date: Wed, 21 Feb 2024 13:44:22 GMT Message-Id: <202402211344.41LDiMeR048851@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: a311b9d70863 - stable/13 - heimdal: always confirm PA-PKINIT-KX for anon PKINIT List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: a311b9d70863f78c232d5622ee579c6cd45bb1d8 Auto-Submitted: auto-generated The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=a311b9d70863f78c232d5622ee579c6cd45bb1d8 commit a311b9d70863f78c232d5622ee579c6cd45bb1d8 Author: Cy Schubert AuthorDate: 2024-02-15 01:58:06 +0000 Commit: Cy Schubert CommitDate: 2024-02-21 13:44:09 +0000 heimdal: always confirm PA-PKINIT-KX for anon PKINIT Import upstream 38c797e1a. Upstream notes: RFC8062 Section 7 requires verification of the PA-PKINIT-KX key excahnge when anonymous PKINIT is used. Failure to do so can permit an active attacker to become a man-in-the-middle. Reported by: emaste Obtained from: upstream 38c797e1a Security: CVE-2019-12098 (cherry picked from commit 60616b445eb5b01597092fef5b14549f95000130) --- crypto/heimdal/lib/krb5/krb5_locl.h | 1 + crypto/heimdal/lib/krb5/pkinit.c | 92 +++++++++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+) diff --git a/crypto/heimdal/lib/krb5/krb5_locl.h b/crypto/heimdal/lib/krb5/krb5_locl.h index d0c68927ffbd..0ea132f94c82 100644 --- a/crypto/heimdal/lib/krb5/krb5_locl.h +++ b/crypto/heimdal/lib/krb5/krb5_locl.h @@ -240,6 +240,7 @@ struct _krb5_get_init_creds_opt_private { #define KRB5_INIT_CREDS_CANONICALIZE 1 #define KRB5_INIT_CREDS_NO_C_CANON_CHECK 2 #define KRB5_INIT_CREDS_NO_C_NO_EKU_CHECK 4 +#define KRB5_INIT_CREDS_PKINIT_KX_VALID 32 struct { krb5_gic_process_last_req func; void *ctx; diff --git a/crypto/heimdal/lib/krb5/pkinit.c b/crypto/heimdal/lib/krb5/pkinit.c index 7164a118c34a..3c914bb31f35 100644 --- a/crypto/heimdal/lib/krb5/pkinit.c +++ b/crypto/heimdal/lib/krb5/pkinit.c @@ -1306,6 +1306,98 @@ pk_rd_pa_reply_enckey(krb5_context context, return ret; } +/* + * RFC 8062 section 7: + * + * The client then decrypts the KDC contribution key and verifies that + * the ticket session key in the returned ticket is the combined key of + * the KDC contribution key and the reply key. + */ +KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL +_krb5_pk_kx_confirm(krb5_context context, + krb5_pk_init_ctx ctx, + krb5_keyblock *reply_key, + krb5_keyblock *session_key, + PA_DATA *pa_pkinit_kx) +{ + krb5_error_code ret; + EncryptedData ed; + krb5_keyblock ck, sk_verify; + krb5_crypto ck_crypto = NULL; + krb5_crypto rk_crypto = NULL; + size_t len; + krb5_data data; + krb5_data p1 = { sizeof("PKINIT") - 1, "PKINIT" }; + krb5_data p2 = { sizeof("KEYEXCHANGE") - 1, "KEYEXCHANGE" }; + + heim_assert(ctx != NULL, "PKINIT context is non-NULL"); + heim_assert(reply_key != NULL, "reply key is non-NULL"); + heim_assert(session_key != NULL, "session key is non-NULL"); + + /* PA-PKINIT-KX is optional unless anonymous */ + if (pa_pkinit_kx == NULL) + return ctx->anonymous ? KRB5_KDCREP_MODIFIED : 0; + + memset(&ed, 0, sizeof(ed)); + krb5_keyblock_zero(&ck); + krb5_keyblock_zero(&sk_verify); + krb5_data_zero(&data); + + ret = decode_EncryptedData(pa_pkinit_kx->padata_value.data, + pa_pkinit_kx->padata_value.length, + &ed, &len); + if (ret) + goto out; + + if (len != pa_pkinit_kx->padata_value.length) { + ret = KRB5_KDCREP_MODIFIED; + goto out; + } + + ret = krb5_crypto_init(context, reply_key, 0, &rk_crypto); + if (ret) + goto out; + + ret = krb5_decrypt_EncryptedData(context, rk_crypto, + KRB5_KU_PA_PKINIT_KX, + &ed, &data); + if (ret) + goto out; + + ret = decode_EncryptionKey(data.data, data.length, + &ck, &len); + if (ret) + goto out; + + ret = krb5_crypto_init(context, &ck, 0, &ck_crypto); + if (ret) + goto out; + + ret = krb5_crypto_fx_cf2(context, ck_crypto, rk_crypto, + &p1, &p2, session_key->keytype, + &sk_verify); + if (ret) + goto out; + + if (sk_verify.keytype != session_key->keytype || + krb5_data_ct_cmp(&sk_verify.keyvalue, &session_key->keyvalue) != 0) { + ret = KRB5_KDCREP_MODIFIED; + goto out; + } + +out: + free_EncryptedData(&ed); + krb5_free_keyblock_contents(context, &ck); + krb5_free_keyblock_contents(context, &sk_verify); + if (ck_crypto) + krb5_crypto_destroy(context, ck_crypto); + if (rk_crypto) + krb5_crypto_destroy(context, rk_crypto); + krb5_data_free(&data); + + return ret; +} + static krb5_error_code pk_rd_pa_reply_dh(krb5_context context, const heim_octet_string *indata, From nobody Wed Feb 21 14:01:53 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Tfycy0Ft3z5CF0N; Wed, 21 Feb 2024 14:01:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Tfycx6ky5z4gbB; Wed, 21 Feb 2024 14:01:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708524113; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AUHeoH+AqH5WVl/rCQaDGoRvZTtBu1MDDU4VzJZ1GyI=; b=wlfoPdLzf4bIoKp76FX9T9y4dvhdQhB1048I9DdfTGXEi7LjOBoiQmHG7B1uNI7dbjiSYA o+tw6WWzSch8tJtIiiafhiKL3JrpJd6XcohjzWkSw2ez1SZnlPI3c1RR+FVKFqn4dCNPX0 NV+CDLzEq/007Bo0fOBJ/DDRHPb3LSjN+1HLbRU/aDebp4palBpnPVbSdBbyiaO+7w/qC9 w9Vau5ye3eD74e90bgxEv9RehmY0RMNulD6y4HpQi9mnmN3pImYrOi9RDlF2GwWxua/vjf 0ujAl+VtFuLia4vJB75QbyX6hdHsSJRxbHaNMtDq5hY+4FqyHZw4b/4ax35BlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708524113; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AUHeoH+AqH5WVl/rCQaDGoRvZTtBu1MDDU4VzJZ1GyI=; b=iKS4hosWawY1auFNvzXuw9oTp0A1aLX3gc2w70pJQaVb97YOwlon3prpFQPfaLB6C4/oLt HhgKi1d7ic9ocZD65GI0ii/Pm0+ROM0qZ1U+zobhjZieoNL2Bqypob5NJ/0XJXAge/SWYL bSHZwjQSXSD9hAaRP0OI+1xVpKNrwLRpFJ8FSUlKp4ukrDuqkuDU9lvLMXTxObKo8eGXwQ CQ6RuYAenWr7U+fGbr2orTSDtJPHGvWFUZQIkr5aOddSiyq4apNpvAbLOtmNMsHuldPUdx hQm40cGl1XlWDwwOq2sDXkR9yUMe4S4sU42LvpdHODD8bhqUH8uUYv0+MqymXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708524113; a=rsa-sha256; cv=none; b=CRzuUJfBIkYhdp8VIwbPhQcmkBZ+k7JYt/xYpdCMHPN/e3mM/FO/nHMG+nHbMLObjEPoER FkV7XiuZXK2P5GSgqFIPCRQAnU7uiJuy7T+eTnmS9Bbzx804UoqmLS493/V2/2KpipdPoM /6qF2dxFQZRuTTnAgejYjl+hNP1Gcz+NmQ1MykUF59s9BG928vEv1SvFE9Ljg7Wmg2llwM 7VC/exW45GxE3jG8HgU+NzUVwl6IjyTZ7fabUCNCRks4bqti4lf2/mkqH2Gglf6LNpmWaZ jWsPgjVjQ7bc6S1xa+EAJUSlJRXUHXdamBKtkhNMZyYl6vOX8FaEsCm8hrJXcg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Tfycx5p7gz158T; Wed, 21 Feb 2024 14:01:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41LE1rwR080196; Wed, 21 Feb 2024 14:01:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41LE1rde080193; Wed, 21 Feb 2024 14:01:53 GMT (envelope-from git) Date: Wed, 21 Feb 2024 14:01:53 GMT Message-Id: <202402211401.41LE1rde080193@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: aac9dda7f844 - releng/13.3 - Heimdal: Fix transit path validation CVE-2017-6594 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/releng/13.3 X-Git-Reftype: branch X-Git-Commit: aac9dda7f8446c2c3badecb9fa3473ab008ee59b Auto-Submitted: auto-generated The branch releng/13.3 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=aac9dda7f8446c2c3badecb9fa3473ab008ee59b commit aac9dda7f8446c2c3badecb9fa3473ab008ee59b Author: Cy Schubert AuthorDate: 2024-02-14 19:56:18 +0000 Commit: Cy Schubert CommitDate: 2024-02-21 14:01:48 +0000 Heimdal: Fix transit path validation CVE-2017-6594 Apply upstream b1e699103. This fixes a bug introduced by upstream f469fc6 which may in some cases enable bypass of capath policy. Upstream writes in their commit log: Note, this may break sites that rely on the bug. With the bug some incomplete [capaths] worked, that should not have. These may now break authentication in some cross-realm configurations. Reported by: emaste Security: CVE-2017-6594 Obtained from: upstream b1e699103 MFS requested by: re (cperciva Approved by: re (cperciva) (cherry picked from commit f8041e3628bd70cf5562a9c13eb3d6af8463e720) (cherry picked from commit 9a7121454dc0f68af2687699d5feabf736692fa6) --- crypto/heimdal/kdc/krb5tgs.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/crypto/heimdal/kdc/krb5tgs.c b/crypto/heimdal/kdc/krb5tgs.c index 19d669798830..cde869522e23 100644 --- a/crypto/heimdal/kdc/krb5tgs.c +++ b/crypto/heimdal/kdc/krb5tgs.c @@ -655,8 +655,12 @@ fix_transited_encoding(krb5_context context, "Decoding transited encoding"); return ret; } + + /* + * If the realm of the presented tgt is neither the client nor the server + * realm, it is a transit realm and must be added to transited set. + */ if(strcmp(client_realm, tgt_realm) && strcmp(server_realm, tgt_realm)) { - /* not us, so add the previous realm to transited set */ if (num_realms + 1 > UINT_MAX/sizeof(*realms)) { ret = ERANGE; goto free_realms; @@ -737,6 +741,7 @@ tgs_make_reply(krb5_context context, const char *server_name, hdb_entry_ex *client, krb5_principal client_principal, + const char *tgt_realm, hdb_entry_ex *krbtgt, krb5_enctype krbtgt_etype, krb5_principals spp, @@ -798,7 +803,7 @@ tgs_make_reply(krb5_context context, &tgt->transited, &et, krb5_principal_get_realm(context, client_principal), krb5_principal_get_realm(context, server->entry.principal), - krb5_principal_get_realm(context, krbtgt->entry.principal)); + tgt_realm); if(ret) goto out; @@ -1494,6 +1499,8 @@ tgs_build_reply(krb5_context context, krb5_keyblock sessionkey; krb5_kvno kvno; krb5_data rspac; + const char *tgt_realm = /* Realm of TGT issuer */ + krb5_principal_get_realm(context, krbtgt->entry.principal); hdb_entry_ex *krbtgt_out = NULL; @@ -2240,6 +2247,7 @@ server_lookup: spn, client, cp, + tgt_realm, krbtgt_out, krbtgt_etype, spp, From nobody Wed Feb 21 14:01:54 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Tfycz2Kp3z5CDxH; Wed, 21 Feb 2024 14:01:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Tfycz0Wjcz4gfw; Wed, 21 Feb 2024 14:01:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708524115; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wC9k7C7RZ+mrU+ftGabS1WJKzjjeXJzLfr59KJWqGuk=; b=WA18zbKmu5zWT6p5F1wlZ6WQVOvZv6IRl3GLIzqJAI/3/wyDYDMEr0Z9W2QHUq0nSMvJtF J26uFcWjifNng13jVsQyGzpIpM62pim3xTDTIJ262q8Zny7gcqrKe9v7CvXAWWsgPmDVIS OmpFqaS5jkgH7VEPOr3rDFOqwoJA+NTIRFMaU46RIWcJIS+GfeQ8e+1W/kfawo/sg6YZhd GKR+xmXA4yb+7OFjjsidsuJzgnAbhTxEWpkwaAQTGrB5XQHcueyGMbyctV88fzVx16nq0K 6iFB1cbTzPNdjJB943FlmR5eBgviBx8Xd4tAixXrbQG8+v4YaInW0ST6dkDTXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708524115; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wC9k7C7RZ+mrU+ftGabS1WJKzjjeXJzLfr59KJWqGuk=; b=PCWPEnMKauBI97lwxreBVL5haMd3YR86OOa9Ms3PLOwj3nH7AihKsxFJVNjXE8OHsdlEsP IggG5L2woqe9JwY+S7WyQjRGI2f+lZC07kD/Lx5h8lVmf4aIEe24UmbT9pl+6xTikeWH5d PtSaaVTONUCNTm66/ofuKqyd6JLWkQ+62ZaiVT+1QgNrcpYfyKEMZhIHo9X+d2lq0hNZmb yXYM/LyIHaHPR6fnXd4LrGCOc4PeVhw6r6xa2TmqdJ4Hw8HyaI+fLwezILCXghJjgc2Iry /MGcNV5HchQHr9ARm2VtJemMSYPom9Vcovjlu+bjqdaBDkEO8b1rGo/YUDkbZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708524115; a=rsa-sha256; cv=none; b=fVLorKPk7OUFWu0rQmjUFlhNySgADJMNYQiMBpWS1qtogoAvmbLNWo6zA6qCGc2L14fcWN TDvI4rA4s0Of0oiSjItw9MSmElWbTqsly9iGKx2OtzkoPJXSLTMJlvMkfm3JPfbrXSjGhB bIm85WsfdFHsq8E5gJOCR4AQrdBUzT3RIG543ct1gblLoY+ut2W7eueD98F7d/m2uxHtBY DtaE9cNUAzlRyzGlq9O9G7UlWshonAGc9XlPajBBxpZEkLcr5NjKRc41dD6YHPL854hTDW zg3JB1KuWazVdV6oD/vMbvZfjFNIQI7zKME7qxVBJXOiFu67PALU63XaOjtGPw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Tfycy6h2Gz15Mm; Wed, 21 Feb 2024 14:01:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41LE1s0x080250; Wed, 21 Feb 2024 14:01:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41LE1sQV080247; Wed, 21 Feb 2024 14:01:54 GMT (envelope-from git) Date: Wed, 21 Feb 2024 14:01:54 GMT Message-Id: <202402211401.41LE1sQV080247@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 776fe3ce5799 - releng/13.3 - Heimdal: CVE-2018-16860 Heimdal KDC: Reject PA-S4U2Self with unkeyed checksum List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/releng/13.3 X-Git-Reftype: branch X-Git-Commit: 776fe3ce57994f404a12a7b74e27fb50d6d530af Auto-Submitted: auto-generated The branch releng/13.3 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=776fe3ce57994f404a12a7b74e27fb50d6d530af commit 776fe3ce57994f404a12a7b74e27fb50d6d530af Author: Cy Schubert AuthorDate: 2024-02-14 20:04:30 +0000 Commit: Cy Schubert CommitDate: 2024-02-21 14:01:48 +0000 Heimdal: CVE-2018-16860 Heimdal KDC: Reject PA-S4U2Self with unkeyed checksum Upstream's explanation of the problem: S4U2Self is an extension to Kerberos used in Active Directory to allow a service to request a kerberos ticket to itself from the Kerberos Key Distribution Center (KDC) for a non-Kerberos authenticated user (principal in Kerboros parlance). This is useful to allow internal code paths to be standardized around Kerberos. S4U2Proxy (constrained-delegation) is an extension of this mechanism allowing this impersonation to a second service over the network. It allows a privileged server that obtained a S4U2Self ticket to itself to then assert the identity of that principal to a second service and present itself as that principal to get services from the second service. There is a flaw in Samba's AD DC in the Heimdal KDC. When the Heimdal KDC checks the checksum that is placed on the S4U2Self packet by the server to protect the requested principal against modification, it does not confirm that the checksum algorithm that protects the user name (principal) in the request is keyed. This allows a man-in-the-middle attacker who can intercept the request to the KDC to modify the packet by replacing the user name (principal) in the request with any desired user name (principal) that exists in the KDC and replace the checksum protecting that name with a CRC32 checksum (which requires no prior knowledge to compute). This would allow a S4U2Self ticket requested on behalf of user name (principal) user@EXAMPLE.COM to any service to be changed to a S4U2Self ticket with a user name (principal) of Administrator@EXAMPLE.COM. This ticket would then contain the PAC of the modified user name (principal). Reported by: emaste Security: CVE-2018-16860 Obtained from: Upstream c6257cc2c MFS requested by: re (cperciva) Approved by: re (cperciva) (cherry picked from commit 24339377490f9e362d040712b534d2963decd2d7) (cherry picked from commit 143a962d0e871c60b91589aa1045afdeca13742b) --- crypto/heimdal/kdc/krb5tgs.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crypto/heimdal/kdc/krb5tgs.c b/crypto/heimdal/kdc/krb5tgs.c index cde869522e23..cf1cd3dc1ad0 100644 --- a/crypto/heimdal/kdc/krb5tgs.c +++ b/crypto/heimdal/kdc/krb5tgs.c @@ -1892,6 +1892,13 @@ server_lookup: goto out; } + if (!krb5_checksum_is_keyed(context, self.cksum.cksumtype)) { + free_PA_S4U2Self(&self); + kdc_log(context, config, 0, "Reject PA-S4U2Self with unkeyed checksum"); + ret = KRB5KRB_AP_ERR_INAPP_CKSUM; + goto out; + } + ret = _krb5_s4u2self_to_checksumdata(context, &self, &datack); if (ret) goto out; From nobody Wed Feb 21 14:01:55 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Tfyd069gJz5CF0Q; Wed, 21 Feb 2024 14:01:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Tfyd01b9wz4h0g; Wed, 21 Feb 2024 14:01:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708524116; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/9iL6LcGMYQQXHsLtxchKyJ9eg1eGp0mTSEy3poJDo8=; b=p+k8YubMSNoLqaO6rsDvdOBbhNy7H6nG0NV6yzOuUh/1OXdqSRBWp7L2BYeEfCdGpio8p8 JZ65NHuBL5zTRnISBLj3YYmZ/Aw0aoIrkfVaVGPS13hVLwD88bu0KI7g3PsP6XN39SkrOu CSGdKOp5iJ8v2X1MuwuQfLnZnZlJJWMSX0UtKBjwngZvpSxuYl+S6cY6+1lgkLc+V9tIO/ miNXpfxdKWpC+bHEWtrPRXVfkGz4F6nj/iD4JGThU4CS5jfGzUBjY0CcQQeuwztIW2gP7m WuBv5BguJbcRfkDQRSMlS/1qcH5Nkn4mH8Z2d2ycnrdJJ6zwWnFNkwPVL8I40A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708524116; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/9iL6LcGMYQQXHsLtxchKyJ9eg1eGp0mTSEy3poJDo8=; b=OacTE117pnFFGrkp4ePKqSY6U4AXW0QQDToEaeQnGXyHRc9f32/QAEkzc6QZ2uCquFgpvB CtHZpcne8CQZc1hOr7gNswda5548+Zgg/LoS/748iKCtEr+cQwobZVX1r3mTGv0qTqbTjE 1hZfEAhsQYZUPOo8cWhKT1eMcoYo0tcgSDf7hzu54B+PvNrEdZQLC/5iaij0zgVKY8nd8R HDAV3SY5qMX1SqzcXRfo0bvL15RLrNcl93Ci5tfjTfbf+ctubarJUC5mGNofUNza36gRQa 2yPiYu0f28kNIyimsnVHWBZ4Zqt+DjVng/SLI+rUjQcul0VRuQzpoBLZMqnfxw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708524116; a=rsa-sha256; cv=none; b=EnZWaKiYyBkDidhjmpWSHN8Ow6CTxP5AqIqvgRzBDkhwwxsn0xN4Cw7+DMFNS5r8hKynM4 Q4ZneVJ13GPfvWU8IPJ1jwyv2gH6gfajXbGM+UNSDdm4joeUL4nK3aRGwdefVWtKyfBBRJ ZPB4E0Ztq2ey1foNgiE9Ujf5WmL6WyUJFGG79HJYeL0cb+bRu9n3Ij5y3uNYmehQ7Bu516 cnjdaH2Tzqfa8OJvMKHy4T34Y5R8XKYQABQL6zL11AVUJva+EYV0SkyMxAPFBAsPD4TH3t dNcPGETmL+8bLMEWhkLMwBFfa7CKZN+mn3JkMuot3/EQEGhyDFIE5KEKIaDWzA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Tfyd00dBbz14jc; Wed, 21 Feb 2024 14:01:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41LE1tHe080298; Wed, 21 Feb 2024 14:01:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41LE1teR080295; Wed, 21 Feb 2024 14:01:55 GMT (envelope-from git) Date: Wed, 21 Feb 2024 14:01:55 GMT Message-Id: <202402211401.41LE1teR080295@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 9f2e70a87d6e - releng/13.3 - heimdal: always confirm PA-PKINIT-KX for anon PKINIT List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/releng/13.3 X-Git-Reftype: branch X-Git-Commit: 9f2e70a87d6ed48df418e1f7a3ccc09b469c2dad Auto-Submitted: auto-generated The branch releng/13.3 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=9f2e70a87d6ed48df418e1f7a3ccc09b469c2dad commit 9f2e70a87d6ed48df418e1f7a3ccc09b469c2dad Author: Cy Schubert AuthorDate: 2024-02-15 01:58:06 +0000 Commit: Cy Schubert CommitDate: 2024-02-21 14:01:48 +0000 heimdal: always confirm PA-PKINIT-KX for anon PKINIT Import upstream 38c797e1a. Upstream notes: RFC8062 Section 7 requires verification of the PA-PKINIT-KX key excahnge when anonymous PKINIT is used. Failure to do so can permit an active attacker to become a man-in-the-middle. Reported by: emaste Obtained from: upstream 38c797e1a Security: CVE-2019-12098 MFS requested by: re (cperciva) Approved by: re (cperciva) (cherry picked from commit 60616b445eb5b01597092fef5b14549f95000130) (cherry picked from commit a311b9d70863f78c232d5622ee579c6cd45bb1d8) --- crypto/heimdal/lib/krb5/krb5_locl.h | 1 + crypto/heimdal/lib/krb5/pkinit.c | 92 +++++++++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+) diff --git a/crypto/heimdal/lib/krb5/krb5_locl.h b/crypto/heimdal/lib/krb5/krb5_locl.h index d0c68927ffbd..0ea132f94c82 100644 --- a/crypto/heimdal/lib/krb5/krb5_locl.h +++ b/crypto/heimdal/lib/krb5/krb5_locl.h @@ -240,6 +240,7 @@ struct _krb5_get_init_creds_opt_private { #define KRB5_INIT_CREDS_CANONICALIZE 1 #define KRB5_INIT_CREDS_NO_C_CANON_CHECK 2 #define KRB5_INIT_CREDS_NO_C_NO_EKU_CHECK 4 +#define KRB5_INIT_CREDS_PKINIT_KX_VALID 32 struct { krb5_gic_process_last_req func; void *ctx; diff --git a/crypto/heimdal/lib/krb5/pkinit.c b/crypto/heimdal/lib/krb5/pkinit.c index 7164a118c34a..3c914bb31f35 100644 --- a/crypto/heimdal/lib/krb5/pkinit.c +++ b/crypto/heimdal/lib/krb5/pkinit.c @@ -1306,6 +1306,98 @@ pk_rd_pa_reply_enckey(krb5_context context, return ret; } +/* + * RFC 8062 section 7: + * + * The client then decrypts the KDC contribution key and verifies that + * the ticket session key in the returned ticket is the combined key of + * the KDC contribution key and the reply key. + */ +KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL +_krb5_pk_kx_confirm(krb5_context context, + krb5_pk_init_ctx ctx, + krb5_keyblock *reply_key, + krb5_keyblock *session_key, + PA_DATA *pa_pkinit_kx) +{ + krb5_error_code ret; + EncryptedData ed; + krb5_keyblock ck, sk_verify; + krb5_crypto ck_crypto = NULL; + krb5_crypto rk_crypto = NULL; + size_t len; + krb5_data data; + krb5_data p1 = { sizeof("PKINIT") - 1, "PKINIT" }; + krb5_data p2 = { sizeof("KEYEXCHANGE") - 1, "KEYEXCHANGE" }; + + heim_assert(ctx != NULL, "PKINIT context is non-NULL"); + heim_assert(reply_key != NULL, "reply key is non-NULL"); + heim_assert(session_key != NULL, "session key is non-NULL"); + + /* PA-PKINIT-KX is optional unless anonymous */ + if (pa_pkinit_kx == NULL) + return ctx->anonymous ? KRB5_KDCREP_MODIFIED : 0; + + memset(&ed, 0, sizeof(ed)); + krb5_keyblock_zero(&ck); + krb5_keyblock_zero(&sk_verify); + krb5_data_zero(&data); + + ret = decode_EncryptedData(pa_pkinit_kx->padata_value.data, + pa_pkinit_kx->padata_value.length, + &ed, &len); + if (ret) + goto out; + + if (len != pa_pkinit_kx->padata_value.length) { + ret = KRB5_KDCREP_MODIFIED; + goto out; + } + + ret = krb5_crypto_init(context, reply_key, 0, &rk_crypto); + if (ret) + goto out; + + ret = krb5_decrypt_EncryptedData(context, rk_crypto, + KRB5_KU_PA_PKINIT_KX, + &ed, &data); + if (ret) + goto out; + + ret = decode_EncryptionKey(data.data, data.length, + &ck, &len); + if (ret) + goto out; + + ret = krb5_crypto_init(context, &ck, 0, &ck_crypto); + if (ret) + goto out; + + ret = krb5_crypto_fx_cf2(context, ck_crypto, rk_crypto, + &p1, &p2, session_key->keytype, + &sk_verify); + if (ret) + goto out; + + if (sk_verify.keytype != session_key->keytype || + krb5_data_ct_cmp(&sk_verify.keyvalue, &session_key->keyvalue) != 0) { + ret = KRB5_KDCREP_MODIFIED; + goto out; + } + +out: + free_EncryptedData(&ed); + krb5_free_keyblock_contents(context, &ck); + krb5_free_keyblock_contents(context, &sk_verify); + if (ck_crypto) + krb5_crypto_destroy(context, ck_crypto); + if (rk_crypto) + krb5_crypto_destroy(context, rk_crypto); + krb5_data_free(&data); + + return ret; +} + static krb5_error_code pk_rd_pa_reply_dh(krb5_context context, const heim_octet_string *indata, From nobody Wed Feb 21 14:01:57 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Tfyd14GFHz5CF0T; Wed, 21 Feb 2024 14:01:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Tfyd12FyGz4gdh; Wed, 21 Feb 2024 14:01:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708524117; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eetsiB6vW2oZBJfO8zwI/8y4PPfUSt8jQk4r8Q606j8=; b=PV47524qj9/jgre8P3ywC79MQZ2ASj+YUFWDl0olg8WxtlQeBA6YbpxUrqud/3QHL6mFSZ nPjg4EQ5ppIwH7/9QtvWuvlZuNc55S7TvhX3EPMW0hWwdC8XL2YVKGCrikYAVy6aOC9deh 7RS3VWmmKh1Y/37Q/Rt5KK8tmLcVvY9heg32mYGjhY1lXLnH+/LSoyWV3AQR05ARwbItUm DZZHJTJ0YQLpy8DRDH5VN09IRI7EFKvxauXb5npC9oGNVM8qpMRfHcPRDeSDbNxalmwACq jMi5zD+nwUkS5r+YzcS6iJUx5G/LVjWG1qdpWFd7+21pHQRIw+Qu6uaL1qdkMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708524117; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eetsiB6vW2oZBJfO8zwI/8y4PPfUSt8jQk4r8Q606j8=; b=xHGBnY4JDBNWFU2E4ZwHKeCpb7pwtcTBW+K5ZLeeUi0KkbaZyKS8sLT7ji7uF27AfR+IoV wzOeUOMGEw5CDvMYWy/RyahDKu2BL19Bu7K/WP8BPbp7y7nZDsqf/zWQrLMW22Yg/indjm g3IIm1OUx0/TgvtMmvzmHgldy5WKTcsVs/NhF1jupD8UKBnJowv3/gRF5AOqiF4qge8Rjt vwU/XHlLhTgH4HeAejSnjF+WU3ObLaYZySZvBdFREPhfI1Be0J8L81osbs5pSDGcnJEPj5 PThWcy0Rxuv+Aps8bFQGQNt+r9st9G70nJCrBiLLQL1nnrp7+/xvt7eftZe7+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708524117; a=rsa-sha256; cv=none; b=NVD0/dFrQEA+Cb3gg8Jz7Tf/AgOPuHz9mn0PDMSupmtJHubIUI+B2BiHcoIiXta04+RiIg CH9QrLzPq/emb5tIDF5srLjMfcyGG7RnwVbb5HuAJRX0qPix7fanqSSzXZGpYhxI1fRQPG 3jj0E3y1VyC+H0bqXCl+fge8osa6wkjvREarFjH0dPQAxCpbHB4fnnrF2vTbiBTxSW1vg1 ckFvQwU5lOIuYih8SFs0FEZ6aCPJ/WWyVsIm5+DrgXWosCtZJCpuHlYp9ngotW0DgalRsH F45aVa6Sd9Z4h79nDtbyLUMN2w1OgccCwKOWFY12mtseYGVUoM9FYTO+p9pFRw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Tfyd11MTPz1569; Wed, 21 Feb 2024 14:01:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41LE1vNi080339; Wed, 21 Feb 2024 14:01:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41LE1vSv080336; Wed, 21 Feb 2024 14:01:57 GMT (envelope-from git) Date: Wed, 21 Feb 2024 14:01:57 GMT Message-Id: <202402211401.41LE1vSv080336@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 88bdc4bb60df - releng/13.3 - heimdal: Fix NULL deref List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/releng/13.3 X-Git-Reftype: branch X-Git-Commit: 88bdc4bb60df6aab4457d244c5fbf4b56b22ff6d Auto-Submitted: auto-generated The branch releng/13.3 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=88bdc4bb60df6aab4457d244c5fbf4b56b22ff6d commit 88bdc4bb60df6aab4457d244c5fbf4b56b22ff6d Author: Cy Schubert AuthorDate: 2024-02-15 15:41:07 +0000 Commit: Cy Schubert CommitDate: 2024-02-21 14:01:48 +0000 heimdal: Fix NULL deref A flawed logical condition allows a malicious actor to remotely trigger a NULL pointer dereference using a crafted negTokenInit token. Upstream notes: Reported to Heimdal by Michał Kępień . From the report: Acknowledgement --------------- This flaw was found while working on addressing ZDI-CAN-12302: ISC BIND TKEY Query Heap-based Buffer Overflow Remote Code Execution Vulnerability, which was reported to ISC by Trend Micro's Zero Day Security: CVE-2022-3116 Obtained from: upstream 7a19658c1 MFS requested by: re (cperciva) Approved by: re (cperciva) (cherry picked from commit fc773115fa2dbb6c01377f2ed47dabf79a4e361a) (cherry picked from commit 6b421e431a2de6eb9e8bd670efffe76e6617d520) --- crypto/heimdal/lib/gssapi/spnego/accept_sec_context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/heimdal/lib/gssapi/spnego/accept_sec_context.c b/crypto/heimdal/lib/gssapi/spnego/accept_sec_context.c index b60dc19ad8e3..48542f06fcbe 100644 --- a/crypto/heimdal/lib/gssapi/spnego/accept_sec_context.c +++ b/crypto/heimdal/lib/gssapi/spnego/accept_sec_context.c @@ -605,7 +605,7 @@ acceptor_start * If opportunistic token failed, lets try the other mechs. */ - if (!first_ok && ni->mechToken != NULL) { + if (!first_ok) { size_t j; preferred_mech_type = GSS_C_NO_OID; From nobody Wed Feb 21 20:26:02 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Tg78B675Zz5BJ5P; Wed, 21 Feb 2024 20:26:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Tg78B5gSyz4Ck5; Wed, 21 Feb 2024 20:26:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708547162; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fPJN8VZN0EHFOH5wzRub/UaaE+DMxnr8pDVsjS3zyow=; b=bNaumxq7HGm4RW28a/BFvXrOCsR4TWOYdQGYQG6ir0vrZeOxkfv6ipcxns1eF6RLLTDLsh Kn7Wk89OD6URUUiCnbfFEju9rZROsr1arBYkabQYy5FQAZpq4t4lDNcXzhFIrC5obslqdK Ui/8wr1ZVAXahR8SbKVZgec3Motg3QTkgplOHwsTPpuq/WxYOLahnNIiDTDQKrdH7qaclg gx4zbNpLcjyHLvqU0a/tka2+7oKR0bvsEz3C6zQy64lPFAm63NEUdeuYE72PP9pmorpGBf CLYmC5aA4Jb+nuVd/SvnisorSQuJa1VdLbaMcOk8gLF9B7QIDBWzMwF5/MMuvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708547162; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fPJN8VZN0EHFOH5wzRub/UaaE+DMxnr8pDVsjS3zyow=; b=Uz/N6pOqc0RxHWWHiPXNwr8uwbLKtokRwlqcMpTBlIvL6NitlqKCq8wM9m8YYn4sX1UxD9 7EgeEHmirlXNAk9ZlRZLXvuLijEMIE8eqmH97JFVDOpCF6XDUsH++eUkhTP/Ssbhk5zoCO dCQz4NJTrIwNt3IIo/KQLBKCKdjmFqkJqLOICOVFSiWg5XKZ7IaK2oaHvKBNscXgYrq1Wj iXW0gakrcua2wG0QLwbC0c1hfbPACvymrgDJVnOzLlm71ZRv04a9BDeVToISpGOmdEiJ4z Twr+Ar/Kd+uc9HfQDnI9piJjHb695Jldqn8ZscJwqBrV4WafO4dvGCUG/thfXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708547162; a=rsa-sha256; cv=none; b=wIhZ/GNZpi6ZmXQgv9AvJW5XGmuaOQfTk6WSrpBs7arm1usS7XccLqAqs3tonkwjSs8NrL dR4VzPu3TSYS1iWX7MAI48ohrA5xKK2CYYBo7B0t3NmxTz4PPscVnc28O4f/FXh9V0ijZi l96r9P/QrfLIrW1yDoUxiT+XSsb/+12SkCN+UZXKuo/78tpWzA3hlPPYE0xe1LXjoRIfN6 kJNwA4BaIaUZr6VE7HWORTdHzmdjfrlboGv0zCP5ZwQHrWL9Bv56fHwfOaGMCtp/VvSUPu qQ1/XeqEQhCZg/2X3NPJQpaPjso6jvxULn5FkVh6qJsFutSh8/HXkZUre0vxww== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Tg78B4Z1rz1H8x; Wed, 21 Feb 2024 20:26:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41LKQ2HJ086115; Wed, 21 Feb 2024 20:26:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41LKQ2Ow086112; Wed, 21 Feb 2024 20:26:02 GMT (envelope-from git) Date: Wed, 21 Feb 2024 20:26:02 GMT Message-Id: <202402212026.41LKQ2Ow086112@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: bec5e729ceef - stable/12 - heimdal: Fix NULL deref List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: bec5e729ceef12259609dbd8f5191e19464be95d Auto-Submitted: auto-generated The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=bec5e729ceef12259609dbd8f5191e19464be95d commit bec5e729ceef12259609dbd8f5191e19464be95d Author: Cy Schubert AuthorDate: 2024-02-15 15:41:07 +0000 Commit: Ed Maste CommitDate: 2024-02-21 20:24:16 +0000 heimdal: Fix NULL deref A flawed logical condition allows a malicious actor to remotely trigger a NULL pointer dereference using a crafted negTokenInit token. Upstream notes: Reported to Heimdal by Michał Kępień . From the report: Acknowledgement --------------- This flaw was found while working on addressing ZDI-CAN-12302: ISC BIND TKEY Query Heap-based Buffer Overflow Remote Code Execution Vulnerability, which was reported to ISC by Trend Micro's Zero Day Security: CVE-2022-3116 Obtained from: upstream 7a19658c1 (cherry picked from commit fc773115fa2dbb6c01377f2ed47dabf79a4e361a) (cherry picked from commit 6b421e431a2de6eb9e8bd670efffe76e6617d520) --- crypto/heimdal/lib/gssapi/spnego/accept_sec_context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/heimdal/lib/gssapi/spnego/accept_sec_context.c b/crypto/heimdal/lib/gssapi/spnego/accept_sec_context.c index b60dc19ad8e3..48542f06fcbe 100644 --- a/crypto/heimdal/lib/gssapi/spnego/accept_sec_context.c +++ b/crypto/heimdal/lib/gssapi/spnego/accept_sec_context.c @@ -605,7 +605,7 @@ acceptor_start * If opportunistic token failed, lets try the other mechs. */ - if (!first_ok && ni->mechToken != NULL) { + if (!first_ok) { size_t j; preferred_mech_type = GSS_C_NO_OID; From nobody Wed Feb 21 20:59:18 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Tg7tb0fl6z5BMFt; Wed, 21 Feb 2024 20:59:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Tg7tb07VRz4H6b; Wed, 21 Feb 2024 20:59:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708549159; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=onoGPZ7QNl5xM3EXkOgDHS9cdoFQVDKGbwGVv7PAY2o=; b=kWTlUDlu2O15gQ5xJnD5nskczy3F5PJKhKoht7eCcZ49EnnSwEHfzzb2hZlLECDdOQgsbd 4Dkkt6TPj+9aToooGiZ/mw3AjCTXyCFZ8EdIluaNVxC7KhbKudH/h/JJJUPK3uDI1wFzP6 3FhFyrD4JiChmZL2Clvyj6JqC9jAY/DQaI6Nh6ipwil2DYZZ15ZPlo3C6GZi+9/zJEJqOg Zcq4d7sUY0MfBVJhjOOJMJ6IOBxBS0h2ctPhT/H42/GdVDF6y2ikguwT5vNn4iJDsh5a5F GDeD4ZSu9tlwzPQgdSi5HY0clbqdOx4OkxKZcEwgKBTVrv8WT3z9WRCgZIoXLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708549159; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=onoGPZ7QNl5xM3EXkOgDHS9cdoFQVDKGbwGVv7PAY2o=; b=Mg85d0ITeViCr7GSVyOR4T+IVOkUQLePfxebWGpE/k8U4CITBk9Dgl2udgDSOIRIgtqPRM T9OsjvQTuIA8SsOhNpWTDnak8453E0XdsBdQMTyuER1U9kZ4yMMdvX5UofFlsGOsxRCwQA ZSNn0X15YOeD210tqBnRTCLHxzqAbxXl4xPKqFVWgGFyxogZ9zYQBaonXZ87Z0Q4Zn69E7 l45gC1boRKdSW+Aa6izK0L8I5jMOAXv0Qg9gLdUVGmPDR46kTYZNkRTLSo8kTooaEKT/HA /WRYLehwKU/LUzNCX3ZAxQtsJdReptLJ+G/nG1qyKNuBlYP8koxRFUhUZ/WJcQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708549159; a=rsa-sha256; cv=none; b=RzQ8Vfl+gty0QeAuW+JuxSi5Sb/uku/GBvnAC0hyXg0/xvIy3PrIFk9lFW8j2sAezlDmXz pFLwgsBUIfV8D9j4V3Ae4A+rvIiynoG1NfjFTmj4CgVo6mKklh2DQpchg1TA0YTc6VZiBV chf/1O9GzfHgifD74/ebAl+8MoVtORhms9EP4kfw1LqONTPlcY+HkDCjuv/mIkNkxg8yIW P4Vk3Ipnp1fLe2Fpuu6R9dNdBy4mqOMwtZeSwUhPUgqWPOENkxn9J7FehHLpN4Hw3md0Fb K9CUs7YymHaFl4I4xU9vsBYAFp3VbOFc74UTe+rZ/SLwGKwuEsAmb3115QDxsw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Tg7tZ6BV6z1HyT; Wed, 21 Feb 2024 20:59:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41LKxIE8036950; Wed, 21 Feb 2024 20:59:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41LKxIeJ036947; Wed, 21 Feb 2024 20:59:18 GMT (envelope-from git) Date: Wed, 21 Feb 2024 20:59:18 GMT Message-Id: <202402212059.41LKxIeJ036947@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: e257a38de4d5 - stable/14 - Update tzcode to 2024a. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: e257a38de4d57bb1884d5c7196131a81192d5252 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=e257a38de4d57bb1884d5c7196131a81192d5252 commit e257a38de4d57bb1884d5c7196131a81192d5252 Author: Dag-Erling Smørgrav AuthorDate: 2024-02-13 20:20:44 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-02-21 20:33:23 +0000 Update tzcode to 2024a. MFC after: 3 weeks Sponsored by: Klara, Inc. (cherry picked from commit 46c599340f187db577b9212ab18022f3c7380c68) --- contrib/tzcode/Makefile | 261 +++++++---- contrib/tzcode/NEWS | 193 +++++++- contrib/tzcode/README | 19 +- contrib/tzcode/date.1 | 14 +- contrib/tzcode/localtime.c | 128 +++--- contrib/tzcode/newctime.3 | 16 +- contrib/tzcode/newstrftime.3 | 152 ++++++- contrib/tzcode/newtzset.3 | 206 +++++---- contrib/tzcode/private.h | 44 +- contrib/tzcode/strftime.c | 7 +- contrib/tzcode/theory.html | 37 +- contrib/tzcode/tz-art.html | 419 ++++++++---------- contrib/tzcode/tz-link.html | 118 +++-- contrib/tzcode/tzdir.h | 6 + contrib/tzcode/tzfile.5 | 32 +- contrib/tzcode/tzfile.h | 14 +- contrib/tzcode/tzselect.8 | 2 +- contrib/tzcode/tzselect.ksh | 1006 +++++++++++++++++++++++------------------- contrib/tzcode/version | 2 +- contrib/tzcode/zdump.c | 2 +- contrib/tzcode/zic.8 | 35 +- contrib/tzcode/zic.c | 239 +++++----- lib/libc/gen/sysconf.c | 2 +- lib/libc/stdtime/strftime.c | 2 +- 24 files changed, 1767 insertions(+), 1189 deletions(-) diff --git a/contrib/tzcode/Makefile b/contrib/tzcode/Makefile index 0e56af89e2a4..d48354c72df4 100644 --- a/contrib/tzcode/Makefile +++ b/contrib/tzcode/Makefile @@ -1,7 +1,25 @@ # Make and install tzdb code and data. - # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. +# Request POSIX conformance; this must be the first non-comment line. +.POSIX: +# On older platforms you may need to scrounge for a POSIX-conforming 'make'. +# For example, on Solaris 10 (2005), use /usr/sfw/bin/gmake or +# /usr/xpg4/bin/make, not /usr/ccs/bin/make. + +# To affect how this Makefile works, you can run a shell script like this: +# +# #!/bin/sh +# make CC='gcc -std=gnu11' "$@" +# +# This example script is appropriate for a pre-2017 GNU/Linux system +# where a non-default setting is needed to support this package's use of C99. +# +# Alternatively, you can simply edit this Makefile to tailor the following +# macro definitions. + +############################################################################### +# Start of macros that one plausibly might want to tailor. # Package name for the code distribution. PACKAGE= tzcode @@ -35,7 +53,7 @@ DATAFORM= main LOCALTIME= Factory -# The POSIXRULES macro controls interpretation of POSIX-like TZ +# The POSIXRULES macro controls interpretation of POSIX-2017.1-like TZ # settings like TZ='EET-2EEST' that lack DST transition rules. # If POSIXRULES is '-', no template is installed; this is the default. # Any other value for POSIXRULES is obsolete and should not be relied on, as: @@ -191,8 +209,9 @@ UTF8_LOCALE= en_US.utf8 # On some hosts, this should have -lintl unless CFLAGS has -DHAVE_GETTEXT=0. LDLIBS= -# Add the following to the end of the "CFLAGS=" line as needed to override -# defaults specified in the source code. "-DFOO" is equivalent to "-DFOO=1". +# Add the following to an uncommented "CFLAGS=" line as needed +# to override defaults specified in the source code or by the system. +# "-DFOO" is equivalent to "-DFOO=1". # -DDEPRECATE_TWO_DIGIT_YEARS for optional runtime warnings about strftime # formats that generate only the last two digits of year numbers # -DEPOCH_LOCAL if the 'time' function returns local time not UT @@ -234,11 +253,16 @@ LDLIBS= # -DHAVE_UNISTD_H=0 if does not work* # -DHAVE_UTMPX_H=0 if does not work* # -Dlocale_t=XXX if your system uses XXX instead of locale_t -# -DPORT_TO_C89 if tzcode should also run on C89 platforms+ +# -DPORT_TO_C89 if tzcode should also run on mostly-C89 platforms+ +# Typically it is better to use a later standard. For example, +# with GCC 4.9.4 (2016), prefer '-std=gnu11' to '-DPORT_TO_C89'. +# Even with -DPORT_TO_C89, the code needs at least one C99 +# feature (integers at least 64 bits wide) and maybe more. # -DRESERVE_STD_EXT_IDS if your platform reserves standard identifiers # with external linkage, e.g., applications cannot define 'localtime'. # -Dssize_t=long on hosts like MS-Windows that lack ssize_t # -DSUPPORT_C89 if the tzcode library should support C89 callers+ +# However, this might trigger latent bugs in C99-or-later callers. # -DSUPPRESS_TZDIR to not prepend TZDIR to file names; this has # security implications and is not recommended for general use # -DTHREAD_SAFE to make localtime.c thread-safe, as POSIX requires; @@ -250,7 +274,7 @@ LDLIBS= # -DTZ_DOMAINDIR=\"/path\" to use "/path" for gettext directory; # the default is system-supplied, typically "/usr/lib/locale" # -DTZDEFRULESTRING=\",date/time,date/time\" to default to the specified -# DST transitions for POSIX-style TZ strings lacking them, +# DST transitions for POSIX.1-2017-style TZ strings lacking them, # in the usual case where POSIXRULES is '-'. If not specified, # TZDEFRULESTRING defaults to US rules for future DST transitions. # This mishandles some past timestamps, as US DST rules have changed. @@ -270,11 +294,15 @@ LDLIBS= # -DZIC_MAX_ABBR_LEN_WO_WARN=3 # (or some other number) to set the maximum time zone abbreviation length # that zic will accept without a warning (the default is 6) +# -g to generate symbolic debugging info +# -Idir to include from directory 'dir' +# -O0 to disable optimization; other -O options to enable more optimization +# -Uname to remove any definition of the macro 'name' # $(GCC_DEBUG_FLAGS) if you are using recent GCC and want lots of checking # # * Options marked "*" can be omitted if your compiler is C23 compatible. # * Options marked "+" are obsolescent and are planned to be removed -# once the code assumes C99 or later. +# once the code assumes C99 or later, say in the year 2029. # # Select instrumentation via "make GCC_INSTRUMENT='whatever'". GCC_INSTRUMENT = \ @@ -312,9 +340,10 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \ # guess TM_GMTOFF from other macros; define NO_TM_GMTOFF to suppress this. # Similarly, if your system has a "zone abbreviation" field, define # -DTM_ZONE=tm_zone -# and define NO_TM_ZONE to suppress any guessing. Although these two fields -# not required by POSIX, a future version of POSIX is planned to require them -# and they are widely available on GNU/Linux and BSD systems. +# and define NO_TM_ZONE to suppress any guessing. +# Although these two fields are not required by POSIX.1-2017, +# POSIX 202x/D4 requires them and they are widely available +# on GNU/Linux and BSD systems. # # The next batch of options control support for external variables # exported by tzcode. In practice these variables are less useful @@ -324,7 +353,7 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \ # # -DHAVE_TZNAME=0 # do not support "tzname" # # -DHAVE_TZNAME=1 # support "tzname", which is defined by system library # # -DHAVE_TZNAME=2 # support and define "tzname" -# # to the "CFLAGS=" line. "tzname" is required by POSIX 1988 and later. +# # to the "CFLAGS=" line. "tzname" is required by POSIX.1-1988 and later. # # If not defined, the code attempts to guess HAVE_TZNAME from other macros. # # Warning: unless time_tz is also defined, HAVE_TZNAME=1 can cause # # crashes when combined with some platforms' standard libraries, @@ -334,8 +363,8 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \ # # -DUSG_COMPAT=0 # do not support # # -DUSG_COMPAT=1 # support, and variables are defined by system library # # -DUSG_COMPAT=2 # support and define variables -# # to the "CFLAGS=" line; "timezone" and "daylight" are inspired by -# # Unix Systems Group code and are required by POSIX 2008 (with XSI) and later. +# # to the "CFLAGS=" line; "timezone" and "daylight" are inspired by Unix +# # Systems Group code and are required by POSIX.1-2008 and later (with XSI). # # If not defined, the code attempts to guess USG_COMPAT from other macros. # # # # To support the external variable "altzone", add @@ -353,10 +382,11 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \ # functions to be added to the time conversion library. # "offtime" is like "gmtime" except that it accepts a second (long) argument # that gives an offset to add to the time_t when converting it. -# "offtime_r" is to "offtime" what "gmtime_r" is to "gmtime". -# "timelocal" is equivalent to "mktime". +# I.e., "offtime" is like calling "localtime_rz" with a fixed-offset zone. +# "timelocal" is nearly equivalent to "mktime". # "timeoff" is like "timegm" except that it accepts a second (long) argument # that gives an offset to use when converting to a time_t. +# I.e., "timeoff" is like calling "mktime_z" with a fixed-offset zone. # "posix2time" and "time2posix" are described in an included manual page. # X3J11's work does not describe any of these functions. # These functions may well disappear in future releases of the time @@ -379,7 +409,7 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \ # # NIST-PCTS:151-2, Version 1.4, (1993-12-03) is a test suite put # out by the National Institute of Standards and Technology -# which claims to test C and Posix conformance. If you want to pass PCTS, add +# which claims to test C and POSIX conformance. If you want to pass PCTS, add # -DPCTS # to the end of the "CFLAGS=" line. # @@ -389,19 +419,33 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \ # 53 as a week number (rather than 52 or 53) for January days before # January's first Monday when a "%V" format is used and January 1 # falls on a Friday, Saturday, or Sunday. +# +# POSIX says CFLAGS defaults to "-O 1". +# Uncomment the following line and edit its contents as needed. -CFLAGS= +#CFLAGS= -O 1 -# Linker flags. Default to $(LFLAGS) for backwards compatibility -# to release 2012h and earlier. -LDFLAGS= $(LFLAGS) +# The name of a POSIX-like library archiver, its flags, C compiler, +# linker flags, and 'make' utility. Ordinarily the defaults suffice. +# The commented-out values are the defaults specified by POSIX.1-202x/D4. +#AR = ar +#ARFLAGS = -rv +#CC = c17 +#LDFLAGS = +#MAKE = make # For leap seconds, this Makefile uses LEAPSECONDS='-L leapseconds' in # submake command lines. The default is no leap seconds. LEAPSECONDS= +# Where to fetch leap-seconds.list from. +leaplist_URI = \ + https://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-seconds.list +# The file is generated by the IERS Earth Orientation Centre, in Paris. +leaplist_TZ = Europe/Paris + # The zic command and its arguments. zic= ./zic @@ -419,22 +463,23 @@ ZFLAGS= ZIC_INSTALL= $(ZIC) -d '$(DESTDIR)$(TZDIR)' $(LEAPSECONDS) -# The name of a Posix-compliant 'awk' on your system. +# The name of a POSIX-compliant 'awk' on your system. # mawk 1.3.3 and Solaris 10 /usr/bin/awk do not work. # Also, it is better (though not essential) if 'awk' supports UTF-8, # and unfortunately mawk and busybox awk do not support UTF-8. # Try AWK=gawk or AWK=nawk if your awk has the abovementioned problems. AWK= awk -# The full path name of a Posix-compliant shell, preferably one that supports +# The full path name of a POSIX-compliant shell, preferably one that supports # the Korn shell's 'select' statement as an extension. # These days, Bash is the most popular. # It should be OK to set this to /bin/sh, on platforms where /bin/sh -# lacks 'select' or doesn't completely conform to Posix, but /bin/bash +# lacks 'select' or doesn't completely conform to POSIX, but /bin/bash # is typically nicer if it works. KSHELL= /bin/bash -# Name of curl , used for HTML validation. +# Name of curl , used for HTML validation +# and to fetch leap-seconds.list from upstream. CURL= curl # Name of GNU Privacy Guard , used to sign distributions. @@ -504,17 +549,16 @@ GZIPFLAGS= -9n DIFF_TZS= diff -u$$(! diff -u -F'^TZ=' - - <>/dev/null >&0 2>&1 \ || echo ' -F^TZ=') -############################################################################### - -#MAKE= make +# ':' on typical hosts; 'ranlib' on the ancient hosts that still need ranlib. +RANLIB= : -cc= cc -CC= $(cc) -DTZDIR='"$(TZDIR)"' +# POSIX prohibits defining or using SHELL. However, csh users on systems +# that use the user shell for Makefile commands may need to define SHELL. +#SHELL= /bin/sh -AR= ar +# End of macros that one plausibly might want to tailor. +############################################################################### -# ':' on typical hosts; 'ranlib' on the ancient hosts that still need ranlib. -RANLIB= : TZCOBJS= zic.o TZDOBJS= zdump.o localtime.o asctime.o strftime.o @@ -544,7 +588,7 @@ YDATA= $(PRIMARY_YDATA) etcetera NDATA= factory TDATA_TO_CHECK= $(YDATA) $(NDATA) backward TDATA= $(YDATA) $(NDATA) $(BACKWARD) -ZONETABLES= zone1970.tab zone.tab +ZONETABLES= zone.tab zone1970.tab zonenow.tab TABDATA= iso3166.tab $(TZDATA_TEXT) $(ZONETABLES) LEAP_DEPS= leapseconds.awk leap-seconds.list TZDATA_ZI_DEPS= ziguard.awk zishrink.awk version $(TDATA) \ @@ -552,7 +596,7 @@ TZDATA_ZI_DEPS= ziguard.awk zishrink.awk version $(TDATA) \ DSTDATA_ZI_DEPS= ziguard.awk $(TDATA) $(PACKRATDATA) $(PACKRATLIST) DATA= $(TDATA_TO_CHECK) backzone iso3166.tab leap-seconds.list \ leapseconds $(ZONETABLES) -AWK_SCRIPTS= checklinks.awk checktab.awk leapseconds.awk \ +AWK_SCRIPTS= checklinks.awk checknow.awk checktab.awk leapseconds.awk \ ziguard.awk zishrink.awk MISC= $(AWK_SCRIPTS) TZS_YEAR= 2050 @@ -573,7 +617,7 @@ VERSION_DEPS= \ calendars CONTRIBUTING LICENSE Makefile NEWS README SECURITY \ africa antarctica asctime.c asia australasia \ backward backzone \ - checklinks.awk checktab.awk \ + checklinks.awk checknow.awk checktab.awk \ date.1 date.c difftime.c \ etcetera europe factory iso3166.tab \ leap-seconds.list leapseconds.awk localtime.c \ @@ -583,12 +627,7 @@ VERSION_DEPS= \ tzfile.5 tzfile.h tzselect.8 tzselect.ksh \ workman.sh zdump.8 zdump.c zic.8 zic.c \ ziguard.awk zishrink.awk \ - zone.tab zone1970.tab - -# And for the benefit of csh users on systems that assume the user -# shell should be used to handle commands in Makefiles. . . - -SHELL= /bin/sh + zone.tab zone1970.tab zonenow.tab all: tzselect zic zdump libtz.a $(TABDATA) \ vanguard.zi main.zi rearguard.zi @@ -658,6 +697,16 @@ tzdata.zi: $(DATAFORM).zi version zishrink.awk $(DATAFORM).zi >$@.out mv $@.out $@ +tzdir.h: + printf '%s\n' >$@.out \ + '#ifndef TZDEFAULT' \ + '# define TZDEFAULT "$(TZDEFAULT)" /* default zone */' \ + '#endif' \ + '#ifndef TZDIR' \ + '# define TZDIR "$(TZDIR)" /* TZif directory */' \ + '#endif' + mv $@.out $@ + version.h: version VERSION=`cat version` && printf '%s\n' \ 'static char const PKGVERSION[]="($(PACKAGE)) ";' \ @@ -677,6 +726,28 @@ leapseconds: $(LEAP_DEPS) -f leapseconds.awk leap-seconds.list >$@.out mv $@.out $@ +# Awk script to extract a Git-style author from leap-seconds.list comments. +EXTRACT_AUTHOR = \ + author_line { sub(/^.[[:space:]]*/, ""); \ + sub(/:[[:space:]]*/, " <"); \ + printf "%s>\n", $$0; \ + success = 1; \ + exit \ + } \ + /Questions or comments to:/ { author_line = 1 } \ + END { exit !success } + +# Fetch leap-seconds.list from upstream. +fetch-leap-seconds.list: + $(CURL) -OR $(leaplist_URI) + +# Fetch leap-seconds.list from upstream and commit it to the local repository. +commit-leap-seconds.list: fetch-leap-seconds.list + author=$$($(AWK) '$(EXTRACT_AUTHOR)' leap-seconds.list) && \ + date=$$(TZ=$(leaplist_TZ) stat -c%y leap-seconds.list) && \ + git commit --author="$$author" --date="$$date" -m'make $@' \ + leap-seconds.list + # Arguments to pass to submakes of install_data. # They can be overridden by later submake arguments. INSTALLARGS = \ @@ -764,7 +835,7 @@ force_tzs: $(TZS_NEW) libtz.a: $(LIBOBJS) rm -f $@ - $(AR) -rc $@ $(LIBOBJS) + $(AR) $(ARFLAGS) $@ $(LIBOBJS) $(RANLIB) $@ date: $(DATEOBJS) @@ -772,26 +843,32 @@ date: $(DATEOBJS) tzselect: tzselect.ksh version VERSION=`cat version` && sed \ - -e 's|#!/bin/bash|#!$(KSHELL)|g' \ - -e 's|AWK=[^}]*|AWK='\''$(AWK)'\''|g' \ - -e 's|\(PKGVERSION\)=.*|\1='\''($(PACKAGE)) '\''|' \ - -e 's|\(REPORT_BUGS_TO\)=.*|\1=$(BUGEMAIL)|' \ - -e 's|TZDIR=[^}]*|TZDIR=$(TZDIR)|' \ - -e 's|\(TZVERSION\)=.*|\1='"$$VERSION"'|' \ - <$@.ksh >$@.out + -e "s'#!/bin/bash'#!"'$(KSHELL)'\' \ + -e s\''\(AWK\)=[^}]*'\''\1=\'\''$(AWK)\'\'\' \ + -e s\''\(PKGVERSION\)=.*'\''\1=\'\''($(PACKAGE)) \'\'\' \ + -e s\''\(REPORT_BUGS_TO\)=.*'\''\1=\'\''$(BUGEMAIL)\'\'\' \ + -e s\''\(TZDIR\)=[^}]*'\''\1=\'\''$(TZDIR)\'\'\' \ + -e s\''\(TZVERSION\)=.*'\''\1=\'"'$$VERSION\\''" \ + <$@.ksh >$@.out chmod +x $@.out mv $@.out $@ check: check_back check_mild check_mild: check_character_set check_white_space check_links \ - check_name_lengths check_slashed_abbrs check_sorted \ + check_name_lengths check_now \ + check_slashed_abbrs check_sorted \ check_tables check_web check_ziguard check_zishrink check_tzs +# True if UTF8_LOCALE does not work; +# otherwise, false but with LC_ALL set to $(UTF8_LOCALE). +UTF8_LOCALE_MISSING = \ + { test ! '$(UTF8_LOCALE)' \ + || ! printf 'A\304\200B\n' \ + | LC_ALL='$(UTF8_LOCALE)' grep -q '^A.B$$' >/dev/null 2>&1 \ + || { LC_ALL='$(UTF8_LOCALE)'; export LC_ALL; false; }; } + check_character_set: $(ENCHILADA) - test ! '$(UTF8_LOCALE)' || \ - ! printf 'A\304\200B\n' | \ - LC_ALL='$(UTF8_LOCALE)' grep -q '^A.B$$' >/dev/null 2>&1 || { \ - LC_ALL='$(UTF8_LOCALE)' && export LC_ALL && \ + $(UTF8_LOCALE_MISSING) || { \ sharp='#' && \ ! grep -Env $(SAFE_LINE) $(MANS) date.1 $(MANTXTS) \ $(MISC) $(SOURCES) $(WEB_PAGES) \ @@ -806,12 +883,12 @@ check_character_set: $(ENCHILADA) touch $@ check_white_space: $(ENCHILADA) + $(UTF8_LOCALE_MISSING) || { \ patfmt=' \t|[\f\r\v]' && pat=`printf "$$patfmt\\n"` && \ - ! grep -En "$$pat" \ - $$(ls $(ENCHILADA) | grep -Fvx leap-seconds.list) - ! grep -n '[$s]$$' \ - $$(ls $(ENCHILADA) | grep -Fvx leap-seconds.list) - touch $@ + ! grep -En "$$pat|[$s]\$$" \ + $$(ls $(ENCHILADA) | grep -Fvx leap-seconds.list); \ + } + touch $@ PRECEDES_FILE_NAME = ^(Zone|Link[$s]+[^$s]+)[$s]+ FILE_NAME_COMPONENT_TOO_LONG = $(PRECEDES_FILE_NAME)[^$s]*[^/$s]{15} @@ -852,7 +929,29 @@ check_links: checklinks.awk tzdata.zi -f checklinks.awk tzdata.zi touch $@ -check_tables: checktab.awk $(YDATA) backward $(ZONETABLES) +# Check timestamps from now through 28 years from now, to make sure +# that zonenow.tab contains all sequences of planned timestamps, +# without any duplicate sequences. In theory this might require +# 2800 years but that would take a long time to check. +CHECK_NOW_TIMESTAMP = `./date +%s` +CHECK_NOW_FUTURE_YEARS = 28 +CHECK_NOW_FUTURE_SECS = $(CHECK_NOW_FUTURE_YEARS) '*' 366 '*' 24 '*' 60 '*' 60 +check_now: checknow.awk date tzdata.zi zdump zic zone1970.tab zonenow.tab + rm -fr $@.dir + mkdir $@.dir + ./zic -d $@.dir tzdata.zi + now=$(CHECK_NOW_TIMESTAMP) && \ + future=`expr $(CHECK_NOW_FUTURE_SECS) + $$now` && \ + ./zdump -i -t $$now,$$future \ + $$(find $$PWD/$@.dir/????*/ -type f) \ + >$@.dir/zdump.tab + $(AWK) \ + -v zdump_table=$@.dir/zdump.tab \ + -f checknow.awk zonenow.tab + rm -fr $@.dir + touch $@ + +check_tables: checktab.awk $(YDATA) backward zone.tab zone1970.tab for tab in $(ZONETABLES); do \ test "$$tab" = zone.tab && links='$(BACKWARD)' || links=''; \ $(AWK) -f checktab.awk -v zone_table=$$tab $(YDATA) $$links \ @@ -912,10 +1011,10 @@ check_zishrink_posix check_zishrink_right: \ touch $@ clean_misc: - rm -fr check_*.dir + rm -fr check_*.dir typecheck_*.dir rm -f *.o *.out $(TIME_T_ALTERNATIVES) \ check_* core typecheck_* \ - date tzselect version.h zdump zic libtz.a + date tzdir.h tzselect version.h zdump zic libtz.a clean: clean_misc rm -fr *.dir tzdb-*/ rm -f *.zi $(TZS_NEW) @@ -953,12 +1052,18 @@ $(MANTXTS): workman.sh # plus N if GNU ls and touch are available. SET_TIMESTAMP_N = sh -c '\ n=$$0 dest=$$1; shift; \ - touch -cmr `ls -t "$$@" | sed 1q` "$$dest" && \ + <"$$dest" && \ if test $$n != 0 && \ - lsout=`ls -n --time-style="+%s" "$$dest" 2>/dev/null`; then \ + lsout=`ls -nt --time-style="+%s" "$$@" 2>/dev/null`; then \ set x $$lsout && \ - touch -cmd @`expr $$7 + $$n` "$$dest"; \ - else :; fi' + timestamp=`expr $$7 + $$n` && \ + echo "+ touch -md @$$timestamp $$dest" && \ + touch -md @$$timestamp "$$dest"; \ + else \ + newest=`ls -t "$$@" | sed 1q` && \ + echo "+ touch -mr $$newest $$dest" && \ + touch -mr "$$newest" "$$dest"; \ + fi' # If DEST depends on A B C ... in this Makefile, callers should use # $(SET_TIMESTAMP_DEP) DEST A B C ..., for the benefit of any # downstream 'make' that considers equal timestamps to be out of date. @@ -983,8 +1088,12 @@ set-timestamps.out: $(EIGHT_YARDS) rm -f test.out && \ for file in $$files; do \ if git diff --quiet $$file; then \ - time=`git log -1 --format='tformat:%ct' $$file` && \ - touch -cmd @$$time $$file; \ + time=`TZ=UTC0 git log -1 \ + --format='tformat:%cd' \ + --date='format:%Y-%m-%dT%H:%M:%SZ' \ + $$file` && \ + echo "+ touch -md $$time $$file" && \ + touch -md $$time $$file; \ else \ echo >&2 "$$file: warning: does not match repository"; \ fi || exit; \ @@ -1009,7 +1118,8 @@ check_public: $(VERSION_DEPS) rm -fr public.dir mkdir public.dir ln $(VERSION_DEPS) public.dir - cd public.dir && $(MAKE) CFLAGS='$(GCC_DEBUG_FLAGS)' ALL + cd public.dir \ + && $(MAKE) CFLAGS='$(GCC_DEBUG_FLAGS)' TZDIR='$(TZDIR)' ALL for i in $(TDATA_TO_CHECK) public.dir/tzdata.zi \ public.dir/vanguard.zi public.dir/main.zi \ public.dir/rearguard.zi; \ @@ -1140,7 +1250,7 @@ tzdata$(VERSION)-rearguard.tar.gz: rearguard.zi set-timestamps.out sed '1s/$$/-rearguard/' $@.dir/version : The dummy pacificnew pacifies TZUpdater 2.3.1 and earlier. $(CREATE_EMPTY) $@.dir/pacificnew - touch -cmr version $@.dir/version + touch -mr version $@.dir/version LC_ALL=C && export LC_ALL && \ (cd $@.dir && \ tar $(TARFLAGS) -cf - \ @@ -1164,7 +1274,7 @@ tzdata$(VERSION)-tailored.tar.gz: set-timestamps.out `test $(DATAFORM) = vanguard || echo pacificnew` (grep '^#' tzdata.zi && echo && cat $(DATAFORM).zi) \ >$@.dir/etcetera - touch -cmr tzdata.zi $@.dir/etcetera + touch -mr tzdata.zi $@.dir/etcetera sed -n \ -e '/^# *version *\(.*\)/h' \ -e '/^# *ddeps */H' \ @@ -1175,7 +1285,7 @@ tzdata$(VERSION)-tailored.tar.gz: set-timestamps.out -e 's/ /-/g' \ -e 'p' \ $@.dir/version - touch -cmr version $@.dir/version + touch -mr version $@.dir/version links= && \ for file in $(TZDATA_DIST); do \ test -f $@.dir/$$file || links="$$links $$file"; \ @@ -1227,15 +1337,16 @@ zonenames: tzdata.zi asctime.o: private.h tzfile.h date.o: private.h difftime.o: private.h -localtime.o: private.h tzfile.h +localtime.o: private.h tzfile.h tzdir.h strftime.o: private.h tzfile.h zdump.o: version.h -zic.o: private.h tzfile.h version.h +zic.o: private.h tzfile.h tzdir.h version.h .PHONY: ALL INSTALL all .PHONY: check check_mild check_time_t_alternatives .PHONY: check_web check_zishrink -.PHONY: clean clean_misc dummy.zd force_tzs +.PHONY: clean clean_misc commit-leap-seconds.list dummy.zd +.PHONY: fetch-leap-seconds.list force_tzs .PHONY: install install_data maintainer-clean names .PHONY: posix_only posix_right public .PHONY: rearguard_signatures rearguard_signatures_version diff --git a/contrib/tzcode/NEWS b/contrib/tzcode/NEWS index b54538aa4a82..d407342a50e6 100644 --- a/contrib/tzcode/NEWS +++ b/contrib/tzcode/NEWS @@ -1,5 +1,177 @@ News for the tz database +Release 2024a - 2024-02-01 09:28:56 -0800 + + Briefly: + Kazakhstan unifies on UTC+5 beginning 2024-03-01. + Palestine springs forward a week later after Ramadan. + zic no longer pretends to support indefinite-past DST. + localtime no longer mishandles Ciudad Juárez in 2422. + + Changes to future timestamps + + Kazakhstan unifies on UTC+5. This affects Asia/Almaty and + Asia/Qostanay which together represent the eastern portion of the + country that will transition from UTC+6 on 2024-03-01 at 00:00 to + join the western portion. (Thanks to Zhanbolat Raimbekov.) + + Palestine springs forward a week later than previously predicted + in 2024 and 2025. (Thanks to Heba Hamad.) Change spring-forward + predictions to the second Saturday after Ramadan, not the first; + this also affects other predictions starting in 2039. + + Changes to past timestamps + + Asia/Ho_Chi_Minh's 1955-07-01 transition occurred at 01:00 + not 00:00. (Thanks to Đoàn Trần Công Danh.) + + From 1947 through 1949, Toronto's transitions occurred at 02:00 + not 00:00. (Thanks to Chris Walton.) + + In 1911 Miquelon adopted standard time on June 15, not May 15. + + Changes to code + + The FROM and TO columns of Rule lines can no longer be "minimum" + or an abbreviation of "minimum", because TZif files do not support + DST rules that extend into the indefinite past - although these + rules were supported when TZif files had only 32-bit data, this + stopped working when 64-bit TZif files were introduced in 1995. + This should not be a problem for realistic data, since DST was + first used in the 20th century. As a transition aid, FROM columns + like "minimum" are now diagnosed and then treated as if they were + the year 1900; this should suffice for TZif files on old systems + with only 32-bit time_t, and it is more compatible with bugs in + 2023c-and-earlier localtime.c. (Problem reported by Yoshito + Umaoka.) + + localtime and related functions no longer mishandle some + timestamps that occur about 400 years after a switch to a time + zone with a DST schedule. In 2023d data this problem was visible + for some timestamps in November 2422, November 2822, etc. in + America/Ciudad_Juarez. (Problem reported by Gilmore Davidson.) + + strftime %s now uses tm_gmtoff if available. (Problem and draft + patch reported by Dag-Erling Smørgrav.) + + Changes to build procedure + + The leap-seconds.list file is now copied from the IERS instead of + from its downstream counterpart at NIST, as the IERS version is + now in the public domain too and tends to be more up-to-date. + (Thanks to Martin Burnicki for liaisoning with the IERS.) + + Changes to documentation + + The strftime man page documents which struct tm members affect + which conversion specs, and that tzset is called. (Problems + reported by Robert Elz and Steve Summit.) + + +Release 2023d - 2023-12-21 20:02:24 -0800 + + Briefly: + Ittoqqortoormiit, Greenland changes time zones on 2024-03-31. + Vostok, Antarctica changed time zones on 2023-12-18. + Casey, Antarctica changed time zones five times since 2020. + Code and data fixes for Palestine timestamps starting in 2072. + A new data file zonenow.tab for timestamps starting now. + + Changes to future timestamps + + Ittoqqortoormiit, Greenland (America/Scoresbysund) joins most of + the rest of Greenland's timekeeping practice on 2024-03-31, by + changing its time zone from -01/+00 to -02/-01 at the same moment + as the spring-forward transition. Its clocks will therefore not + spring forward as previously scheduled. The time zone change + reverts to its common practice before 1981. + + Fix predictions for DST transitions in Palestine in 2072-2075, + correcting a typo introduced in 2023a. + + Changes to past and future timestamps + + Vostok, Antarctica changed to +05 on 2023-12-18. It had been at + +07 (not +06) for years. (Thanks to Zakhary V. Akulov.) + + Change data for Casey, Antarctica to agree with timeanddate.com, + by adding five time zone changes since 2020. Casey is now at +08 + instead of +11. + + Changes to past tm_isdst flags + + Much of Greenland, represented by America/Nuuk, changed its + standard time from -03 to -02 on 2023-03-25, not on 2023-10-28. + This does not affect UTC offsets, only the tm_isdst flag. + (Thanks to Thomas M. Steenholdt.) + + New data file + + A new data file zonenow.tab helps configure applications that use + timestamps dated from now on. This simplifies configuration, + since users choose from a smaller Zone set. The file's format is + experimental and subject to change. + + Changes to code + + localtime.c no longer mishandles TZif files that contain a single + transition into a DST regime. Previously, it incorrectly assumed + DST was in effect before the transition too. (Thanks to Alois + Treindl for debugging help.) + + localtime.c's timeoff no longer collides with OpenBSD 7.4. + + The C code now uses _Generic only if __STDC_VERSION__ says the + compiler is C11 or later. + + tzselect now optionally reads zonenow.tab, to simplify when + configuring only for timestamps dated from now on. + + tzselect no longer creates temporary files. + + tzselect no longer mishandles the following: + + Spaces and most other special characters in BUGEMAIL, PACKAGE, + TZDIR, and VERSION. + + TZ strings when using mawk 1.4.3, which mishandles regular + expressions of the form /X{2,}/. + + ISO 6709 coordinates when using an awk that lacks the GNU + extension of newlines in -v option-arguments. + + Non UTF-8 locales when using an iconv command that lacks the GNU + //TRANSLIT extension. + + zic no longer mishandles data for Palestine after the year 2075. + Previously, it incorrectly omitted post-2075 transitions that are + predicted for just before and just after Ramadan. (Thanks to Ken + Murchison for debugging help.) + + zic now works again on Linux 2.6.16 and 2.6.17 (2006). + (Problem reported by Rune Torgersen.) + + Changes to build procedure + + The Makefile is now more compatible with POSIX: + * It no longer defines AR, CC, CFLAGS, LDFLAGS, and SHELL. + * It no longer uses its own 'cc' in place of CC. + * It now uses ARFLAGS, with default specified by POSIX. + * It does not use LFLAGS incompatibly with POSIX. + * It uses the special .POSIX target. + * It quotes special characters more carefully. + * It no longer mishandles builds in an ISO 8859 locale. + Due to the CC changes, TZDIR is now #defined in a file tzfile.h + built by 'make', not in a $(CC) -D option. Also, TZDEFAULT is + now treated like TZDIR as they have similar roles. + + Changes to commentary + + Limitations and hazards of the optional support for obsolescent + C89 platforms are documented better, along with a tentative + schedule for removing this support. + + Release 2023c - 2023-03-28 12:42:14 -0700 Changes to past and future timestamps @@ -76,11 +248,14 @@ Release 2023a - 2023-03-22 12:39:33 -0700 platform dependent and abbreviations were silently truncated to 16 bytes even when the limit was greater than 16. - The code by default is now designed for C99 or later. To build in - a C89 environment, compile with -DPORT_TO_C89. To support C89 - callers of the tzcode library, compile with -DSUPPORT_C89. The - two new macros are transitional aids planned to be removed in a - future version, when C99 or later will be required. + The code by default is now designed for C99 or later. To build on + a mostly-C89 platform, compile with -DPORT_TO_C89; this should + work on C89 platforms that also support C99 'long long' and + perhaps a few other extensions to C89. To support C89 callers of + tzcode's library, compile with -DSUPPORT_C89; however, this could + trigger latent bugs in C99-or-later callers. The two new macros + are transitional aids planned to be removed in a future version + (say, in 2029), when C99 or later will be required. The code now builds again on pre-C99 platforms, if you compile with -DPORT_TO_C89. This fixes a bug introduced in 2022f. @@ -723,6 +898,8 @@ Release 2021b - 2021-09-24 16:23:00 -0700 them, set the EXPIRES_LINE Makefile variable. If a TZif file uses this new feature it is marked with a new TZif version number 4, a format intended to be documented in a successor to RFC 8536. + The old-format "#expires" comments are now treated solely as + comments and have no effect on the TZif files. zic -L LEAPFILE -r @LO no longer generates an invalid TZif file that omits leap second information for the range LO..B when LO @@ -4302,7 +4479,7 @@ Release 2012j - 2012-11-12 18:34:49 -0800 now uses tz@iana.org rather than the old elsie address. zic -v now complains about abbreviations that are less than 3 - or more than 6 characters, as per Posix. Formerly, it checked + or more than 6 characters, as per POSIX. Formerly, it checked for abbreviations that were more than 3. 'make public' no longer puts its temporary directory under /tmp, @@ -4467,8 +4644,8 @@ Release data2011m - 2011-10-24 21:42:16 +0700 In particular, the typos in comments in the data (2011-11-17 should have been 2011-10-17 as Alan Barrett noted, and spelling of Tiraspol that Tim Parenti noted) have been fixed, and the change for Ukraine has been - made in all 4 Ukrainian zones, rather than just Kiev (again, thanks to - Tim Parenti, and also Denys Gavrysh) + made in all 4 Ukrainian zones, rather than just Europe/Kiev + (again, thanks to Tim Parenti, and also Denys Gavrysh). In addition, I added Europe/Tiraspol to zone.tab. diff --git a/contrib/tzcode/README b/contrib/tzcode/README index 145aacd495b7..edabd2e0690f 100644 --- a/contrib/tzcode/README +++ b/contrib/tzcode/README @@ -11,14 +11,17 @@ changes made by political bodies to time zone boundaries, UTC offsets, and daylight-saving rules. See or the -file tz-link.html for how to acquire the code and data. Once acquired, -read the comments in the file 'Makefile' and make any changes needed -to make things right for your system, especially if you are using some -platform other than GNU/Linux. Then run the following commands, -substituting your desired installation directory for "$HOME/tzdir": - - make TOPDIR=$HOME/tzdir install - $HOME/tzdir/usr/bin/zdump -v America/Los_Angeles +file tz-link.html for how to acquire the code and data. + +Once acquired, read the leading comments in the file "Makefile" +and make any changes needed to make things right for your system, +especially when using a platform other than current GNU/Linux. + +Then run the following commands, substituting your desired +installation directory for "$HOME/tzdir": + + make TOPDIR="$HOME/tzdir" install + "$HOME/tzdir/usr/bin/zdump" -v America/Los_Angeles See the file tz-how-to.html for examples of how to read the data files. diff --git a/contrib/tzcode/date.1 b/contrib/tzcode/date.1 index e8107212364d..01907bc76e2c 100644 --- a/contrib/tzcode/date.1 +++ b/contrib/tzcode/date.1 @@ -154,15 +154,11 @@ hexadecimal (leading 0x), preceded by an optional sign. .br /usr/lib/locale/\f2L\fP/LC_TIME description of time locale \f2L\fP .br -/usr/share/zoneinfo timezone information directory +/usr/share/zoneinfo timezone directory .br -/usr/share/zoneinfo/posixrules default DST rules (obsolete, - and can cause bugs if present) +/usr/share/zoneinfo/posixrules default DST rules (obsolete) .br /usr/share/zoneinfo/GMT for UTC leap seconds -.sp -If -.B /usr/share/zoneinfo/GMT -is absent, -UTC leap seconds are loaded from -.BR /usr/share/zoneinfo/posixrules . +.PP +If /usr/share/zoneinfo/GMT is absent, +UTC leap seconds are loaded from /usr/share/zoneinfo/GMT0 if present. diff --git a/contrib/tzcode/localtime.c b/contrib/tzcode/localtime.c index 3bf9378fe673..2b33cce1ec50 100644 --- a/contrib/tzcode/localtime.c +++ b/contrib/tzcode/localtime.c @@ -7,7 +7,7 @@ /* ** Leap second handling from Bradley White. -** POSIX-style TZ environment variable handling from Guy Harris. +** POSIX.1-1988 style TZ environment variable handling from Guy Harris. */ /*LINTLIBRARY*/ @@ -27,6 +27,7 @@ #include "private.h" #include "un-namespace.h" +#include "tzdir.h" #include "tzfile.h" #include "libc_private.h" @@ -124,12 +125,17 @@ static char const UNSPEC[] = "-00"; for ttunspecified to work without crashing. */ enum { CHARS_EXTRA = max(sizeof UNSPEC, 2) - 1 }; -/* Limit to time zone abbreviation length in POSIX-style TZ strings. +/* Limit to time zone abbreviation length in POSIX.1-2017-style TZ strings. This is distinct from TZ_MAX_CHARS, which limits TZif file contents. */ #ifndef TZNAME_MAXIMUM # define TZNAME_MAXIMUM 255 #endif +/* A representation of the contents of a TZif file. Ideally this + would have no size limits; the following sizes should suffice for + practical use. This struct should not be too large, as instances + are put on the stack and stacks are relatively small on some platforms. + See tzfile.h for more about the sizes. */ struct state { int leapcnt; int timecnt; @@ -172,8 +178,7 @@ static int_fast32_t leapcorr(struct state const *, time_t); static bool normalize_overflow32(int_fast32_t *, int *, int); static struct tm *timesub(time_t const *, int_fast32_t, struct state const *, struct tm *); -static bool typesequiv(struct state const *, int, int); -static bool tzparse(char const *, struct state *, struct state *); +static bool tzparse(char const *, struct state *, struct state const *); #ifdef ALL_STATE static struct state * lclptr; @@ -438,7 +443,8 @@ union input_buffer { /* The first part of the buffer, interpreted as a header. */ struct tzhead tzhead; - /* The entire buffer. */ + /* The entire buffer. Ideally this would have no size limits; + the following should suffice for practical use. */ char buf[2 * sizeof(struct tzhead) + 2 * sizeof(struct state) + 4 * TZ_MAX_TIMES]; }; @@ -457,7 +463,12 @@ union local_storage { struct state st; } u; - /* The file name to be opened. */ + /* The name of the file to be opened. Ideally this would have no + size limits, to support arbitrarily long Zone names. + Limiting Zone names to 1024 bytes should suffice for practical use. + However, there is no need for this to be smaller than struct + file_analysis as that struct is allocated anyway, as the other + union member. */ char fullname[max(sizeof(struct file_analysis), sizeof tzdirslash + 1024)]; }; @@ -737,14 +748,18 @@ tzloadbody(char const *name, struct state *sp, bool doextend, == sp->types[sp->timecnt - 2])) sp->timecnt--; - for (i = 0; - i < ts->timecnt && sp->timecnt < TZ_MAX_TIMES; - i++) { + sp->goahead = ts->goahead; + + for (i = 0; i < ts->timecnt; i++) { time_t t = ts->ats[i]; if (increment_overflow_time(&t, leapcorr(sp, t)) || (0 < sp->timecnt && t <= sp->ats[sp->timecnt - 1])) continue; + if (TZ_MAX_TIMES <= sp->timecnt) { + sp->goahead = false; + break; + } sp->ats[sp->timecnt] = t; sp->types[sp->timecnt] = (sp->typecnt + ts->types[i]); @@ -757,28 +772,6 @@ tzloadbody(char const *name, struct state *sp, bool doextend, } if (sp->typecnt == 0) return EINVAL; - if (sp->timecnt > 1) { - if (sp->ats[0] <= TIME_T_MAX - SECSPERREPEAT) { - time_t repeatat = sp->ats[0] + SECSPERREPEAT; - int repeattype = sp->types[0]; - for (i = 1; i < sp->timecnt; ++i) - if (sp->ats[i] == repeatat - && typesequiv(sp, sp->types[i], repeattype)) { - sp->goback = true; - break; - } - } - if (TIME_T_MIN + SECSPERREPEAT <= sp->ats[sp->timecnt - 1]) { - time_t repeatat = sp->ats[sp->timecnt - 1] - SECSPERREPEAT; - int repeattype = sp->types[sp->timecnt - 1]; - for (i = sp->timecnt - 2; i >= 0; --i) - if (sp->ats[i] == repeatat *** 3862 LINES SKIPPED *** From nobody Wed Feb 21 20:59:19 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Tg7tc1wyWz5BM6T; Wed, 21 Feb 2024 20:59:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Tg7tc0lX7z4HWL; Wed, 21 Feb 2024 20:59:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708549160; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=louh48h4odhmqZBou2vPIdpyotU3qPuzhVDPhTA2emE=; b=A/n0txwJIE365abmjtfHcDAhlAxmgK8f9yvrgyYgIoAGGQ1B6njfuktRdhrx7h4UXDccff 3khZkE0vBMzymg/pueiQ+mcI47USmAd1zDY3AxKq8TLBUZ9WWvZxacWX4sqUVO06FnavSx BVoQQyHhL6bfS+ADshZnmhN4QIrBfRBYyWjP0nn6heBk+rBMjUjOxkJULblZKmSA5Jw6p1 U2bfVHZkacXd8QQNNymhYPQMi6HgccBLiNcVOpmR9CSbYtBVObdPMCdlEe/XDjlIbhgGui Q26m1WZrB/5UUp63LdrAllKFyaFhloIuyUHPRdOJfVp/1NRhTnugeb8pyl0Fjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708549160; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=louh48h4odhmqZBou2vPIdpyotU3qPuzhVDPhTA2emE=; b=Wl/Gxsnf3NysDvfXvw+K+07pAcqBWka0OLhT/IwDGAnLMGSYQsIMCSe9/q1v/HLTiMcEz1 S2NKCS4yfjlPCxFXT3Xd2OmbDRdEfy8RpyRelmFYz2RmIMs7Fjt7KZ7zFkHcEpEMAzaViv jM6e7ytXGKXXPrDfRgr/GiZVwQsNYvUjQ1UFKrGt8qJTfnaWWOc+u8Ruk6JT2ZSX2fskJp 6lZuLCf1rDQUT+t5/5Lxucr5CNXYY5Gm9pSYijxrJhsenh/OvWLLEjMZjzM75Q7KaM3S5R Wa0afpdt5kQazke2KJxPluJTFq8TY8aI1BTkS4/JHKeoHMze4kV7RypSqwlqAw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708549160; a=rsa-sha256; cv=none; b=hA0HxvWcmWIblQp3J0ZiJ9BaAJVIDlHhnlwNwLqH6SPAhJhe1m8HbTNVWcWd9wAa69no1d yzOslIt/43QKB+XsjTvQ6xg65/LXyX565Uit4Ag33YnE2jDnIQoNfhceXS/DYUsW3XksEb 5TizghJSkw9IJmh995Hkklkx1B19Yy2H+O9v0/jX0UKBtqv8WPLurOYzYAEHSyLLq2FpRL 5T5z4nxbI2B+khWewdR3rarNtQaxgN7A6xIgWBPyKJoVEf3noY0lB2alFBuGuft/s5Fu9C UYYT/bWVFySI/QtU35YDouiAZAFyFW0ge/S7lV+UtK3mDHzYPjpEymafQ109rg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Tg7tb6yWqz1JFx; Wed, 21 Feb 2024 20:59:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41LKxJqB037001; Wed, 21 Feb 2024 20:59:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41LKxJ0e036998; Wed, 21 Feb 2024 20:59:19 GMT (envelope-from git) Date: Wed, 21 Feb 2024 20:59:19 GMT Message-Id: <202402212059.41LKxJ0e036998@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 245844372d7e - stable/14 - tzcode: Fix overflow handling in TZ parser. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 245844372d7e4dd7c633816b67c0da59be75b812 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=245844372d7e4dd7c633816b67c0da59be75b812 commit 245844372d7e4dd7c633816b67c0da59be75b812 Author: Dag-Erling Smørgrav AuthorDate: 2024-02-18 09:48:08 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-02-21 20:33:23 +0000 tzcode: Fix overflow handling in TZ parser. Obtained from: upstream 9fc11a27 MFC after: 1 week PR: 276281 (cherry picked from commit 1365bb722af1365baee6ea1e3d44917533908d53) --- contrib/tzcode/localtime.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/tzcode/localtime.c b/contrib/tzcode/localtime.c index 2b33cce1ec50..25a65385256b 100644 --- a/contrib/tzcode/localtime.c +++ b/contrib/tzcode/localtime.c @@ -1246,11 +1246,13 @@ tzparse(const char *name, struct state *sp, struct state const *basep) do { int_fast32_t yearsecs = year_lengths[isleap(yearbeg - 1)] * SECSPERDAY; + time_t janfirst1 = janfirst; yearbeg--; - if (increment_overflow_time(&janfirst, -yearsecs)) { + if (increment_overflow_time(&janfirst1, -yearsecs)) { janoffset = -yearsecs; break; } + janfirst = janfirst1; } while (atlo < janfirst && EPOCH_YEAR - YEARSPERREPEAT / 2 < yearbeg); From nobody Wed Feb 21 20:59:36 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Tg7tx0bB5z5BLjD; Wed, 21 Feb 2024 20:59:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Tg7tx04crz4Hy6; Wed, 21 Feb 2024 20:59:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708549177; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qxVf6EW4m5rFDkHpXrCce9NmyrH41L06vRTfIQBjKFY=; b=t/B5fvwDUTTGWxBb+j07lbE9QtY/R1ApuxATn1FnrW5NcCc/FAZkbaQ6uh/3QETqLlQGOG D3mQzDJGJKmF3VGyAfNFy2L2/hucJGTiVAVp4WN7GoYLDJY1pKyF+/z6NG1YGR3p5nitEY QN4udDdzl/DBpR/t9xEL1oS/NwlLKYx1Dd7d4Rb5OZxBzyfSVvdqaRNRbiALrgifrpNLPz ENvh9h+mzalriWCon77SK7hWIvZUC6/t0f6Va/QWRMRgYoULx3oJ2Yf26GdQrDJqoMmLW+ 9c+Rid8zheOGw/NeKezwYxQ4JguP5lpFp+voVEVbkLt0sT4RbQUifhZQOwGSFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708549177; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qxVf6EW4m5rFDkHpXrCce9NmyrH41L06vRTfIQBjKFY=; b=LyGSodqI4hS6GfWNEPLccFK42rIliQDTBxzgS2/jyC1GaQTgmc2JP+9YnfZf0rz8kkENvJ e2mD3bdhxgLhBNp9msDMdgQ0a17WaFNV2oRj67FSZDy3QXqAHsBGQ9SlOwTtEOB2fjh5vS j+IMRNN4FlxftbsAzEoirUswid0c+d2dNdRbt0zY5XArBsp2sPIKkl/odwT/Fb0Tjj5zU0 8pueLhB8Ga0vzqOmyIhMrmV+D0oMMgDuEeE6JtDXnalS90OBov0odqoC+3jy8c2itBnzWC WutWAU9T9eV6GNmgAxgF+gqHXUsJSs9DKlT+RksWewurOL+WA3iJsQdyKQD/eg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708549177; a=rsa-sha256; cv=none; b=Ci3f3x5pufcWejnOueRpuHf3xpcLAosECFZ2QAveiSSuwKfMjS9VtY+YPddvqqcTAa1NdK 1JdPsMNqanWT679p9AFHZl+TvhrxEeGV8q0kPQgEkH6nWCWsMxSA1+bz4vTcRyiAec42+I pAdWRZDADcpli6rcoOHsKLhdk3J4OjGZEzrNDn6L2NzbeR+rR6+hf119gtsR+AjhDf03hF oW/axdxbxamL+pxDuww955WkHiEs5BeZsyeru7ShPgib4anSDUTg0Y+ZaH4EXLTdh6Tqef 8lEXb8qRM9cNNWzIUWHAk89qQbbp5I5pHiKSPR0Kop7GvoxvYs7ynujoylJ7kQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Tg7tw6F7wz1JCR; Wed, 21 Feb 2024 20:59:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41LKxawM037202; Wed, 21 Feb 2024 20:59:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41LKxaJo037199; Wed, 21 Feb 2024 20:59:36 GMT (envelope-from git) Date: Wed, 21 Feb 2024 20:59:36 GMT Message-Id: <202402212059.41LKxaJo037199@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: beb958dca02a - stable/13 - tzcode: Fix overflow handling in TZ parser. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: beb958dca02abf79a2172e702c2d24bbccde60fa Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=beb958dca02abf79a2172e702c2d24bbccde60fa commit beb958dca02abf79a2172e702c2d24bbccde60fa Author: Dag-Erling Smørgrav AuthorDate: 2024-02-18 09:48:08 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-02-21 20:59:26 +0000 tzcode: Fix overflow handling in TZ parser. Obtained from: upstream 9fc11a27 MFC after: 1 week PR: 276281 Approved by: re (cperciva) (cherry picked from commit 1365bb722af1365baee6ea1e3d44917533908d53) --- contrib/tzcode/localtime.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/tzcode/localtime.c b/contrib/tzcode/localtime.c index 3bf9378fe673..8bf4fcb17d2d 100644 --- a/contrib/tzcode/localtime.c +++ b/contrib/tzcode/localtime.c @@ -1277,11 +1277,13 @@ tzparse(const char *name, struct state *sp, struct state *basep) do { int_fast32_t yearsecs = year_lengths[isleap(yearbeg - 1)] * SECSPERDAY; + time_t janfirst1 = janfirst; yearbeg--; - if (increment_overflow_time(&janfirst, -yearsecs)) { + if (increment_overflow_time(&janfirst1, -yearsecs)) { janoffset = -yearsecs; break; } + janfirst = janfirst1; } while (atlo < janfirst && EPOCH_YEAR - YEARSPERREPEAT / 2 < yearbeg); From nobody Thu Feb 22 09:39:04 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TgSlF0FNsz5CHCW; Thu, 22 Feb 2024 09:39:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TgSlD6XgKz4dw1; Thu, 22 Feb 2024 09: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=1708594744; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=brwLjS70IXNS4WPsmIddeOsPSjq65rphxfhjS9aHcck=; b=Uyx0ddf9mu/fiIcx0TPTTdrGXWGA4RdGVkUcxuR6e7Wt7nn/BAPEMSC1rVidjl24nWgwfx 8sOQpjjJ89InLaqmcJrVgC/w2hbEg2hD0ipOSdF2ln2q+oti+EZs/lYq33pa3tGZOqNV7Y Hkg8ryjpQUMblBlqJYTlWU58QUT/74Y2v8xUGTe2mFv2jWJTBxIpJp4EYjoq+Po3zXGjCE qU9TMLYYytE9D7HDAWL0XAHXrzi+R80RlZQGQjQc/bsxe5QNcoQcuLY/nSLNMKLtqli21G 0XpP8HOxY9CBV/ldyte4DMGKWEJJe05MR5jLm6IiwNiaIieuD137OZHukm4PkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708594744; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=brwLjS70IXNS4WPsmIddeOsPSjq65rphxfhjS9aHcck=; b=RvgiN8LyoJH1gmJPf7IRoOGPO52a16XaNFpu+g5l1Msiq7KgNyOcDzO8mm/RUB9DxDRRKe 5Kdl8xFoCV9p3r7MulB3TSvT0ZXxLZnyeOOlxmlfoqI16crKgR2LueXVjOBE0ZkYQwNYNJ dCBZ/k0BXyjAWuq6lxeQTdridbiBOCIlKGLEYKSm4Qql44xerC/OQnTbDeIdz2DfHwZaJy ktAZabIILANWMrVV6mEuBRtkLX8GUevM96rKDyp+UpCF8ZdUye9//SoWz9fTkpoAFj2dej itkd3dYtWQ6VX/Drb2QQ5XqoJsJqr9wViL8NupQYrRJMPb3bwfHMYGI4MS15hA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708594744; a=rsa-sha256; cv=none; b=P1BFR15ZV7hku1A21SaLyPHtXpMey5CkB9GlJoMP5sDeR6e6Xe4B9EVSW0yLnNq+1ePUKd HKUUIovJZH3xkDfZ17e0HEpuV26RT5XV/0AUwdJp2K0TyEscKQZNEfkP1FW8cXY65Owhry gADH/CGnkFpaqGGb8/ZCZE3lx6Y2moVq7YTrky7eyBjKF2gYElKTRa8H+Nu3H0+jjf6Ahy elnpBIp5I38HFRkyieW1RaOvcusu4Zlia9GBQOWMwH+1NmzZ1ofPuWKEfp7ghFv+csXkRD uhH3H8cZ/6wO93dwwAfE5zwtImmVkBrxXPrUFvAofnRT7m3Q/4crUzu8PZINew== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TgSlD5bp5zR0V; Thu, 22 Feb 2024 09:39:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41M9d4Pn020888; Thu, 22 Feb 2024 09:39:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41M9d4Aj020885; Thu, 22 Feb 2024 09:39:04 GMT (envelope-from git) Date: Thu, 22 Feb 2024 09:39:04 GMT Message-Id: <202402220939.41M9d4Aj020885@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 13c7c0e5659b - stable/12 - iov.h: Fix a typo in a source code comment List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 13c7c0e5659b5632720e2d20cc34da07de482988 Auto-Submitted: auto-generated The branch stable/12 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=13c7c0e5659b5632720e2d20cc34da07de482988 commit 13c7c0e5659b5632720e2d20cc34da07de482988 Author: Gordon Bergling AuthorDate: 2024-02-19 11:02:57 +0000 Commit: Gordon Bergling CommitDate: 2024-02-22 09:38:54 +0000 iov.h: Fix a typo in a source code comment - s/subystem/subsystem/ (cherry picked from commit f24c816daa00852f4a1d37649d00905a0d67f1b3) --- sys/sys/iov.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/iov.h b/sys/sys/iov.h index 3be01180a107..e1ec11a4dd7f 100644 --- a/sys/sys/iov.h +++ b/sys/sys/iov.h @@ -211,7 +211,7 @@ struct pci_iov_schema * (PF or individual VF). * Note: We will refer to the section of the configuration schema that * specifies the parameters for this subsystem and device - * configuration as the device/subystem schema. + * configuration as the device/subsystem schema. * 2) The subsystem node must contain only keys that correspond to parameters * that are specified in the device/subsystem schema. * 3) Every parameter specified as required in the device/subsystem schema is From nobody Thu Feb 22 09:39:14 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TgSlQ49qDz5CHHK; Thu, 22 Feb 2024 09:39:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TgSlQ3k6Qz4dv8; Thu, 22 Feb 2024 09:39:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708594754; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FAHQNxHSYyD6jzXDZ32s3hli7DJQvilUI7baOTCsO4E=; b=L1EKpLzVkV61cTivr2eR7p8Tw3fWDM9BNpWO9oRfeWyi1+TkRJid1hG4Ae0y/f1QHqIJfd sWRls1/4bvHTMF4SE+cikPT7/5ZJNGwE1hOE3fmxe6chH1UI/Y8Rda6Vw9GBIrK4DdHa7w itVdRgxL2pBegbKtwjokyM/rndaJSmfo5Qqm8B89r+niOhA8j66Cd7Un6Zd0GOtqpUKEKv SPANb1nicPwmbcncbRWdVaUgGUuhz9O2CMZU8YkJsu2lKQFZ00OhcnRCx6KoZWZVe1VXeM SHxhrxS4tvoWGQGe359PFW09QU8coYyH6wrJZuu+yo0zweoBT12zLSrP2GBLiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708594754; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FAHQNxHSYyD6jzXDZ32s3hli7DJQvilUI7baOTCsO4E=; b=GQ/vq/W4m4SLC5Hz5yBAyZoVSbu26bxulfLqxvJqC21N2BVgAlkJP/oWpjx6uMhB6Rnqng U5wHMQUaRMbQrUDuHlOCvAL2NGWznCfdsSdgtmMuoxdK80xf35aRS1V6RfSYnlgGahMAa1 bS6+gHdwxqlo4wKCII9kYsn7+n0qzE5mx3luz0n2rZin0zPgeWiCL+wTwz2HrkZnFxw7XU RLI6jLVG/8FkXj+UOYF0JEjyAXTwhYvUUhwMVSTQaZ8cad2nWusPYwUKJ3HK7NxjKiaYOL EyraMbxVdCztiwqwaKS+rKXSM9rR8SBpPB/ZpKlH9MBcv+H3uXbxc5PNPcqm+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708594754; a=rsa-sha256; cv=none; b=JlIMxVT/j6z7aC8d/7sdPSnPQLk9ATLSkox7T8LSmRmjTXESuWXCrhhoKGb4TOoUuXFzlC sScwntqYGMPIxlWtkxO+0xp9VElgYDVwD/qX8KLbpjL8yRnZvOeUgzvUHPviomG76HgYbK xVBHat58u1fyMpC+2Y5TutXIehyS9Ss36+LvC20ry/kYOy7Aq2F9z170ouBpFWYZ7ZlMpr o4IYTtyDe0HGZ5F4lOoW7uo/WrHc7SpV87S0FIaHohXdM7oJtU4Je1DVZ4TnzsnKoHzY/i GKUQHs3zsn2hxwND2s6Legdwr+YlEC2TmGTuyf04iUl23SxX0S7aUFEkYUmHFA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TgSlQ2pd8zR0W; Thu, 22 Feb 2024 09:39:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41M9dEYG021051; Thu, 22 Feb 2024 09:39:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41M9dEpP021048; Thu, 22 Feb 2024 09:39:14 GMT (envelope-from git) Date: Thu, 22 Feb 2024 09:39:14 GMT Message-Id: <202402220939.41M9dEpP021048@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: f7a47daa384e - stable/13 - iov.h: Fix a typo in a source code comment List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f7a47daa384e6d4f366e6f13530cc425021d90dc Auto-Submitted: auto-generated The branch stable/13 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=f7a47daa384e6d4f366e6f13530cc425021d90dc commit f7a47daa384e6d4f366e6f13530cc425021d90dc Author: Gordon Bergling AuthorDate: 2024-02-19 11:02:57 +0000 Commit: Gordon Bergling CommitDate: 2024-02-22 09:38:41 +0000 iov.h: Fix a typo in a source code comment - s/subystem/subsystem/ (cherry picked from commit f24c816daa00852f4a1d37649d00905a0d67f1b3) --- sys/sys/iov.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/iov.h b/sys/sys/iov.h index cc9074489559..0171fc5a98cf 100644 --- a/sys/sys/iov.h +++ b/sys/sys/iov.h @@ -209,7 +209,7 @@ struct pci_iov_schema * (PF or individual VF). * Note: We will refer to the section of the configuration schema that * specifies the parameters for this subsystem and device - * configuration as the device/subystem schema. + * configuration as the device/subsystem schema. * 2) The subsystem node must contain only keys that correspond to parameters * that are specified in the device/subsystem schema. * 3) Every parameter specified as required in the device/subsystem schema is From nobody Thu Feb 22 09:39:22 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TgSlZ6ncXz5CHHM; Thu, 22 Feb 2024 09:39:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TgSlZ5jMXz4fBZ; Thu, 22 Feb 2024 09:39:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708594762; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LDzCHSymDx6yaFAPDYw115tbDKSS4lN+91gbV6mq7pk=; b=G2xWdOHM0oAiy5Yrdf8WEl3htU+EfcvgZXtb/MsliAiwa60ofd6Cwt28Juv65iM/pvApxQ FOTkHt4PTpIwi+295+3dgyQpWofrFhbQNrTnVRAoxCySrjwr39l0gaPVkBrAOtHGcgyadV 70eqI1Ztah2eiWMp3VHqKB9YxKzMczS+Gd8RuePSy9Sdau5UgVOPi1WzPFKMe5TtJQH2lc GSH5ykDdH6XNWW5ggAU8pz6p8wQ/2dBWSz8FxzYc5UJaBh2RkUdS9Yexg+8YwktWuRHlP1 TkfIbMw4MiDiz8GOit6xlrvyfc4E8UanHjGW2fj0z3IltRdsN4QA0bc9UrKbYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708594762; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LDzCHSymDx6yaFAPDYw115tbDKSS4lN+91gbV6mq7pk=; b=uOJMDKzFyLGOIBxb4bw1xLAHJgE/1gUQJJFs8O7yyjSQKzEVKo8xIOmxsX4DMio+Vykpag 3WJmyvqfoh/vfVwHIByaNGxzWFk3Z7GZQu3W+s2ktbfint7u6AVPJkRGY8KK6iEUK1KcVg gGebTbEf8XIA6WEZfDBp8J366hfVFHR6hYi4REbNM+x09iIOKpj0nIndwE8tvjPb7NR5li KpoMwhaV0UZwmkdfqf7bS8yNzfgztA/pSPV456FukUyNTMKZygupYV02RNahtWfuGyHPqt DpouslNNT2UPFMEy2x+ZkxzHbU4B+WoTDDdFk9Uoi8XdMln4QgyrUf1W/vIoGQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708594762; a=rsa-sha256; cv=none; b=KVg367eRB2zVqnQIeCXZfUOlI68DQYlngaLC+ht9Xqis/iQY9wfFD/uMVN/PsV5TkDqa56 GhN5It+LVD7jpaLDVjn4HTTqfJ/D41evrNq1jeo2IaXA3R8mIC0JPRcQKQlkDEqRaQbj96 emUaeB6oVFSF72nxrIPRrS/1Fg7hYd0txfdBJP0qSCUlYIc0GBKwxj+cZNGYI6XT396jce iWKG2mKxEevFI90Iszlln9RoRGwhDTWVBvDT8RVsbpASrJiyAgiPS1Z9Nunn/8KYAnYvdf I9/Ag6MxKVW6XNU3JA6RMmV/ZFwhBUeCNJE48b2yTq3tR1r5qvnZ/Tmp0tEB3w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TgSlZ4nR7zRGX; Thu, 22 Feb 2024 09:39:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41M9dMIZ021212; Thu, 22 Feb 2024 09:39:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41M9dMZg021209; Thu, 22 Feb 2024 09:39:22 GMT (envelope-from git) Date: Thu, 22 Feb 2024 09:39:22 GMT Message-Id: <202402220939.41M9dMZg021209@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 2710ac0c9c92 - stable/14 - iov.h: Fix a typo in a source code comment List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2710ac0c9c92dd77170eeb6b93db0fbf8861efb0 Auto-Submitted: auto-generated The branch stable/14 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=2710ac0c9c92dd77170eeb6b93db0fbf8861efb0 commit 2710ac0c9c92dd77170eeb6b93db0fbf8861efb0 Author: Gordon Bergling AuthorDate: 2024-02-19 11:02:57 +0000 Commit: Gordon Bergling CommitDate: 2024-02-22 09:38:28 +0000 iov.h: Fix a typo in a source code comment - s/subystem/subsystem/ (cherry picked from commit f24c816daa00852f4a1d37649d00905a0d67f1b3) --- sys/sys/iov.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/iov.h b/sys/sys/iov.h index cc9074489559..0171fc5a98cf 100644 --- a/sys/sys/iov.h +++ b/sys/sys/iov.h @@ -209,7 +209,7 @@ struct pci_iov_schema * (PF or individual VF). * Note: We will refer to the section of the configuration schema that * specifies the parameters for this subsystem and device - * configuration as the device/subystem schema. + * configuration as the device/subsystem schema. * 2) The subsystem node must contain only keys that correspond to parameters * that are specified in the device/subsystem schema. * 3) Every parameter specified as required in the device/subsystem schema is From nobody Fri Feb 23 05:20:42 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Tgyyf4FGfz5Bl9f; Fri, 23 Feb 2024 05:20:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Tgyyf3mFvz4rfv; Fri, 23 Feb 2024 05:20:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708665642; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SXTe/mrqJo5fsTjPeMBqI6POE4wH3fYrzoPasTCdynU=; b=EdkQ+l77dCEF3vtdk5xDjOqLt+IJne2MhDopG16X8QHep785WW9EqdBSre8FLc/HDU6N4O zsqmzNeFWUEsHQDoSwHA2e+nT4xCeJwN/oy91WXb+HExp4nFQqofMM0MKaazytrQLBHBBz RnPL5fLuLOVZU+NautW+enqGIkr59OD6sEoy+OkSiQhq/HKAMxwnBoyXOgpOTmlrttTN1k 56eiEvFMPI09+/VwI9Ml5HWvMqnLazYn/4+wQTLjE5Lt9AjaM9f2vOkLqcAhrn6pxYlAm4 wPG/qVv9JqiYXGYRXH/AzyoZIm49cJaWPlLiQeYCfS0jUSAwY4WGbjVpMIXtFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708665642; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SXTe/mrqJo5fsTjPeMBqI6POE4wH3fYrzoPasTCdynU=; b=ShFuzdmo5KXTk/KphrXm6Kqvo0wbNw1Qr/MiKShWtkb0VEa/xfrj9BoFbCnaxx9kBwnHmO KrXMQqVFOyTEvJ0B7MR5I5tW7OIlXpNMYzrNFq9dXvQKsG+oTXqgAmQxP9CxbwMUR7/taG otjOlPc7Si+d04NEQsxKd5ToSy/AgRPyNNjQwSFBg246yJUaXythDBONWL4tXFdLyk7irg 7RcWiN9A8/L1tBBF+SynaILrPu61lIk0ge8jGrNcpZoxtS5p2SXoCcJRi6aoMs5BhFnrHh igU0vEsiFC329kxyRfJITRqKd9svQk+4Qbppie4WJYtG4bdVJ9aLMuer/WKgRA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708665642; a=rsa-sha256; cv=none; b=P/Jso4VTbgWU97uJQ4Jpvn5qjt3h9Wvz3u7Roi3SiILUwxU6KloozWYU8euZjTEczoP4Ji iKNmR7rxcM4jAqiGWNSqxBFMjtcqO1jBr41hXo9v7R32XpujF3QhbhGPctUok6fpX9FFhT Sxe4+Y/H+ya1+KULFWOw9K0YRS5Drot/kAGiw4sosg0cd9VB+BXkfm2hMJg3lHxH76rwst CEG2qcv9zn7CyKu6g6BR5ZhPzGoCDTQiv4PX+KTcwmwvoVd7lk5z2ohnhfqMX686fBjJPW 81dACeZj0SL6l5GLdVLJ6sPBd91frMUiy2B4W24Hzq7JkLSfN66DqmBONYUp0A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Tgyyf2qhDz12VX; Fri, 23 Feb 2024 05:20:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41N5KgvK029073; Fri, 23 Feb 2024 05:20:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41N5KgED029070; Fri, 23 Feb 2024 05:20:42 GMT (envelope-from git) Date: Fri, 23 Feb 2024 05:20:42 GMT Message-Id: <202402230520.41N5KgED029070@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: c76878c656e9 - stable/14 - acpi: Defer reserving resources for ACPI devices List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: c76878c656e91aa595c2c81e86ac5adb59a15c98 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c76878c656e91aa595c2c81e86ac5adb59a15c98 commit c76878c656e91aa595c2c81e86ac5adb59a15c98 Author: John Baldwin AuthorDate: 2024-02-22 18:43:43 +0000 Commit: John Baldwin CommitDate: 2024-02-23 00:48:35 +0000 acpi: Defer reserving resources for ACPI devices The goal of reserving firmware-assigned resources is to ensure that "wildcard" resource allocation requests will not claim an address range that is actually in use even if no attached driver is actively using that range. However, the current approach can break in some cases. In particular, ACPI can enumerate devices behind PCI bridges that don't show up in a normal PCI scan, but those device_t objects can end up as direct children of acpi0. Reserving resources for those devices directly from acpi0 ends up conflicting with later attempts to reserve the PCI bridge windows. As a workaround, defer reserving unclaimed resources until after the initial probe and attach scan. Eventually this pass of reserving unclaimed resources can be moved earlier, but it requires changes to other drivers in the tree to permit enumerating devices and reserving firmware-assigned resources in a depth-first traversal before attaching devices whose drivers request wildcard allocations. PR: 272507 Reported by: Justin Tocci Reported by: john@feith.com, many others Tested by: Oleg Sidorkin , dch (cherry picked from commit f2fcb68074a51a8b399dc80d4c03fbe98a0ab92c) --- sys/dev/acpica/acpi.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 7d1fc10afb9e..61df797c7393 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -1367,8 +1367,17 @@ acpi_sysres_alloc(device_t dev) } /* - * Reserve declared resources for devices found during attach once system - * resources have been allocated. + * Reserve declared resources for active devices found during the + * namespace scan once the boot-time attach of devices has completed. + * + * Ideally reserving firmware-assigned resources would work in a + * depth-first traversal of the device namespace, but this is + * complicated. In particular, not all resources are enumerated by + * ACPI (e.g. PCI bridges and devices enumerate their resources via + * other means). Some systems also enumerate devices via ACPI behind + * PCI bridges but without a matching a PCI device_t enumerated via + * PCI bus scanning, the device_t's end up as direct children of + * acpi0. Doing this scan late is not ideal, but works for now. */ static void acpi_reserve_resources(device_t dev) @@ -2256,9 +2265,6 @@ acpi_probe_children(device_t bus) /* Pre-allocate resources for our rman from any sysresource devices. */ acpi_sysres_alloc(bus); - /* Reserve resources already allocated to children. */ - acpi_reserve_resources(bus); - /* Create any static children by calling device identify methods. */ ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "device identify routines\n")); bus_generic_probe(bus); @@ -2267,6 +2273,12 @@ acpi_probe_children(device_t bus) ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "acpi bus_generic_attach\n")); bus_generic_attach(bus); + /* + * Reserve resources allocated to children but not yet allocated + * by a driver. + */ + acpi_reserve_resources(bus); + /* Attach wake sysctls. */ acpi_wake_sysctl_walk(bus); From nobody Fri Feb 23 05:20:47 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Tgyym0ngTz5Bl7C; Fri, 23 Feb 2024 05:20:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Tgyym00L4z4rhR; Fri, 23 Feb 2024 05:20:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708665648; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7UES41y1bdgKxOphLufZbGoX/hVLDgyg3cpF1m2aDew=; b=Pj5IVqQ4kAIaOPrGVCzPFM+9FLFYHJDdDhPjmtII2Fy9bdhWgjcR45wSNW8TSx8j1Tlux0 c/2f4KOxJP55Aba3YlHyCpusg15FaK2Wn5VhQSamaUp6eFWncpdD6ymHVbvFXrUM/EZXUB UDOIw/ad8yVzz00p9wcikoVtZb+0I34Hn91/6Q9fA0qP5SEhUMgxbz1eS88HwBvs6NdONN VeHsHxng3eOhRu/wYIoFQpy4xHuz7rA0VejVkQkY4KPKeQrDXhq52tx27/5FOlToB0jDjz QH/3tLd+6HiEdkrCzsXq2cagn455wWPJKFAckwnxXzz1yt7dXnAg7e3kSZE6Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708665648; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7UES41y1bdgKxOphLufZbGoX/hVLDgyg3cpF1m2aDew=; b=xEDwfRxB4Zk5xRBAeuT8tGSCpOiITeGM4cfB4lSGneKHNfGdzJfvQdothHRSYMx7DZDEDo yab/b1vP/qRAC5BZ5Aawlu+qwyvNctqaHnytj1/QV6Q2wjpVn+726U0+2HA2jseB1RzTcP l45WuPX/g8+8K6wjLMnbUm/FCt15fV3YJAXWl8pOgzT0Acp302ayhkGKNLgLr3UfhAElOY xEiz9WU7YOGOXO/+Nh5qPDYiWE/sflwtEuLFYmQl8tR86TkFFjovk0aAaXUjS3xmrismSZ 7bKad3aJnmq26zrjhS6EufpQxy+DsQGZMfB+rzcKRAnY5Ynh+vfTck82dJCNfQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708665648; a=rsa-sha256; cv=none; b=cmqOfkZ3oTpegx3QpxEGZIaY2ShLPFy2S66TL3K/5LMwpvD1PV3eTKytQ1upamioZrK94/ EV1RJgpFiOTUnkA9iwSc6gfz/mz3Pu5pHCtXQEbdm+HdIgqMZtzknf7WDl1VxIlT10pt3r gA6wJIVIkAwVeKo2qcOuYg0wdz05pNU/gGBLGfFW3p+RlAw4Pj3YAq39aEk6gI0oUS37dl H0DdKjAXcjCy/FhAuIrtS0gWaApcgBdFrCLNb9w0i50F6f4ViPRwndGoWfEoSEx0Wke8wN sgSY3aCH+ryWPSWJHY8M3Mdk5mXY48SiXRLDydT9tzzu2K1Ct1srIn67SpBOxw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Tgyyl6DSDz12ql; Fri, 23 Feb 2024 05:20:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41N5Kl26030141; Fri, 23 Feb 2024 05:20:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41N5KlcI030138; Fri, 23 Feb 2024 05:20:47 GMT (envelope-from git) Date: Fri, 23 Feb 2024 05:20:47 GMT Message-Id: <202402230520.41N5KlcI030138@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: eaa51e59e560 - stable/13 - acpi: Defer reserving resources for ACPI devices List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/13 X-Git-Reftype: branch X-Git-Commit: eaa51e59e560c556d0a8273d29eea4309e6b6a4f Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=eaa51e59e560c556d0a8273d29eea4309e6b6a4f commit eaa51e59e560c556d0a8273d29eea4309e6b6a4f Author: John Baldwin AuthorDate: 2024-02-22 18:43:43 +0000 Commit: John Baldwin CommitDate: 2024-02-23 00:48:39 +0000 acpi: Defer reserving resources for ACPI devices The goal of reserving firmware-assigned resources is to ensure that "wildcard" resource allocation requests will not claim an address range that is actually in use even if no attached driver is actively using that range. However, the current approach can break in some cases. In particular, ACPI can enumerate devices behind PCI bridges that don't show up in a normal PCI scan, but those device_t objects can end up as direct children of acpi0. Reserving resources for those devices directly from acpi0 ends up conflicting with later attempts to reserve the PCI bridge windows. As a workaround, defer reserving unclaimed resources until after the initial probe and attach scan. Eventually this pass of reserving unclaimed resources can be moved earlier, but it requires changes to other drivers in the tree to permit enumerating devices and reserving firmware-assigned resources in a depth-first traversal before attaching devices whose drivers request wildcard allocations. PR: 272507 Reported by: Justin Tocci Reported by: john@feith.com, many others Tested by: Oleg Sidorkin , dch (cherry picked from commit f2fcb68074a51a8b399dc80d4c03fbe98a0ab92c) --- sys/dev/acpica/acpi.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index cd390ada512c..49153eedbcc0 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -1268,8 +1268,17 @@ acpi_sysres_alloc(device_t dev) } /* - * Reserve declared resources for devices found during attach once system - * resources have been allocated. + * Reserve declared resources for active devices found during the + * namespace scan once the boot-time attach of devices has completed. + * + * Ideally reserving firmware-assigned resources would work in a + * depth-first traversal of the device namespace, but this is + * complicated. In particular, not all resources are enumerated by + * ACPI (e.g. PCI bridges and devices enumerate their resources via + * other means). Some systems also enumerate devices via ACPI behind + * PCI bridges but without a matching a PCI device_t enumerated via + * PCI bus scanning, the device_t's end up as direct children of + * acpi0. Doing this scan late is not ideal, but works for now. */ static void acpi_reserve_resources(device_t dev) @@ -2157,9 +2166,6 @@ acpi_probe_children(device_t bus) /* Pre-allocate resources for our rman from any sysresource devices. */ acpi_sysres_alloc(bus); - /* Reserve resources already allocated to children. */ - acpi_reserve_resources(bus); - /* Create any static children by calling device identify methods. */ ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "device identify routines\n")); bus_generic_probe(bus); @@ -2168,6 +2174,12 @@ acpi_probe_children(device_t bus) ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "acpi bus_generic_attach\n")); bus_generic_attach(bus); + /* + * Reserve resources allocated to children but not yet allocated + * by a driver. + */ + acpi_reserve_resources(bus); + /* Attach wake sysctls. */ acpi_wake_sysctl_walk(bus); From nobody Fri Feb 23 05:26:18 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Tgz563tVqz5Blk5; Fri, 23 Feb 2024 05:26:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Tgz5630kGz4slw; Fri, 23 Feb 2024 05:26:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708665978; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J4ISOT9S8tUKIRm9WR2D74GQ5oeqpbSxU3wDM+AZjl0=; b=GTEPRaNdjg5QccNFW+B4R9hmIagnkg8USPwkmjC/DWufzRA9A0I4LIoGxU61k2VWfrcWAd DfVZ2cd6Yf6fdY/JLtW5apJMEM1aKheGBBDXXy4OcSODPEtOK3NYP0G4qvylPyteDlWxxh j+lP0MCMYzCiN8foCVuJD3CbRyFXm1NQfNWHRVCycp656T7vvwvMbOS1OH9dSdU7E3HVN5 raj+SHMvT4USYI/EWR2XDl38ExUodzzsQTNG500hzPvC0+ibSJ0LM23mhAbuWGUInkRp+F u1bpc9eldArP7Gf1Qtz/us9EHJ5YmtWLuoW4bjapviXIgE692Nn4FZZxqtG8gA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708665978; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J4ISOT9S8tUKIRm9WR2D74GQ5oeqpbSxU3wDM+AZjl0=; b=LgArgA8x26Srh0Vi/w4DAYQli5a54TmOGp7/RgCDLjWmRo01UnhiC+uhS0hYWD/3rCDk9R vpyMnykVPUVFx3RtxXtl5KQw7VBge8qmGSeMS6pHwdDhnkjps6XH5SYhb6evdDS70NmYlI YD1mEq3yaCyG2gQy2CJ0pLVs5yUfNJQcCtoGk2zqRZw+M9ydZPEWnHfYZzJdMJYnk2JC/N IB4moTFd84af0we+ocvSysEk1AzxflkeJ/+AJnU4RFeCzgQ/ND98eZvFGMktn6W/veWjym dcL7cME7xzvKZOhALu+9x+neCBAiOAX/dkZOsOvvBkU3fcMx9eFxMecg+dOwQQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708665978; a=rsa-sha256; cv=none; b=D98lTKw+Q0wfI/qShf1blvfnkek66TEWldQ7PFql25RWcqEuypDjsrT/sn9upQkK3BkiKJ VdxntJ1Eu4+9LE0FCnVrmqVnAxxhEpbfR6UpDq3fsEhZLkNtFNQgPUPEHlAsjfwB1+hM+k GKL7xhn230LdmjTUkIZDbzlY4bgnqRS/dB3c68afTe725PxKOMz66v+TgmgfDQucObmSf7 obfI/Ml9KgR1trhfScgeloI1Vda+dQjgWhnnZmJ9KnSk2diRb4hwhPWK68JFdX7p63sqWD pVPrbWH1+ofDvx5RvLN4iGVHLMbd6zAsX7f91cFn2Zh1UgyVNXsiVdQHg/tsiQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Tgz5624bbz12rX; Fri, 23 Feb 2024 05:26:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41N5QIgt036542; Fri, 23 Feb 2024 05:26:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41N5QIF1036539; Fri, 23 Feb 2024 05:26:18 GMT (envelope-from git) Date: Fri, 23 Feb 2024 05:26:18 GMT Message-Id: <202402230526.41N5QIF1036539@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: f15ff67ef937 - releng/13.3 - acpi: Defer reserving resources for ACPI devices List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/releng/13.3 X-Git-Reftype: branch X-Git-Commit: f15ff67ef9379e2fe4909c96fb8e4153c32bafe1 Auto-Submitted: auto-generated The branch releng/13.3 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=f15ff67ef9379e2fe4909c96fb8e4153c32bafe1 commit f15ff67ef9379e2fe4909c96fb8e4153c32bafe1 Author: John Baldwin AuthorDate: 2024-02-22 18:43:43 +0000 Commit: John Baldwin CommitDate: 2024-02-23 05:23:38 +0000 acpi: Defer reserving resources for ACPI devices The goal of reserving firmware-assigned resources is to ensure that "wildcard" resource allocation requests will not claim an address range that is actually in use even if no attached driver is actively using that range. However, the current approach can break in some cases. In particular, ACPI can enumerate devices behind PCI bridges that don't show up in a normal PCI scan, but those device_t objects can end up as direct children of acpi0. Reserving resources for those devices directly from acpi0 ends up conflicting with later attempts to reserve the PCI bridge windows. As a workaround, defer reserving unclaimed resources until after the initial probe and attach scan. Eventually this pass of reserving unclaimed resources can be moved earlier, but it requires changes to other drivers in the tree to permit enumerating devices and reserving firmware-assigned resources in a depth-first traversal before attaching devices whose drivers request wildcard allocations. PR: 272507 Reported by: Justin Tocci Reported by: john@feith.com, many others Tested by: Oleg Sidorkin , dch (cherry picked from commit f2fcb68074a51a8b399dc80d4c03fbe98a0ab92c) (cherry picked from commit eaa51e59e560c556d0a8273d29eea4309e6b6a4f) Approved by: re (cperciva) --- sys/dev/acpica/acpi.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index fbb3c2bc7c1c..01b2b1c06566 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -1268,8 +1268,17 @@ acpi_sysres_alloc(device_t dev) } /* - * Reserve declared resources for devices found during attach once system - * resources have been allocated. + * Reserve declared resources for active devices found during the + * namespace scan once the boot-time attach of devices has completed. + * + * Ideally reserving firmware-assigned resources would work in a + * depth-first traversal of the device namespace, but this is + * complicated. In particular, not all resources are enumerated by + * ACPI (e.g. PCI bridges and devices enumerate their resources via + * other means). Some systems also enumerate devices via ACPI behind + * PCI bridges but without a matching a PCI device_t enumerated via + * PCI bus scanning, the device_t's end up as direct children of + * acpi0. Doing this scan late is not ideal, but works for now. */ static void acpi_reserve_resources(device_t dev) @@ -2157,9 +2166,6 @@ acpi_probe_children(device_t bus) /* Pre-allocate resources for our rman from any sysresource devices. */ acpi_sysres_alloc(bus); - /* Reserve resources already allocated to children. */ - acpi_reserve_resources(bus); - /* Create any static children by calling device identify methods. */ ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "device identify routines\n")); bus_generic_probe(bus); @@ -2168,6 +2174,12 @@ acpi_probe_children(device_t bus) ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "acpi bus_generic_attach\n")); bus_generic_attach(bus); + /* + * Reserve resources allocated to children but not yet allocated + * by a driver. + */ + acpi_reserve_resources(bus); + /* Attach wake sysctls. */ acpi_wake_sysctl_walk(bus); From nobody Fri Feb 23 10:49:50 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Th6GQ3DGMz5CF7j; Fri, 23 Feb 2024 10:49:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Th6GQ2n5xz4Z8v; Fri, 23 Feb 2024 10:49:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708685390; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oCoebOZIZpUUZe56RTuu8tVTV6dApa88vDtIH/j7dLk=; b=TgLuXkN3WXgiM6kEJ4M/tasio7aaWzgJDEQqxaQ4H+IC3DxiYVrRnYkKn6JFqVLrWjwadb 2BfoXlUgOU3dHNraPB7vXqyfaRBm5mxwiLQohcSx31yKq0d3DjjX19h6fy9xMHx0pZ3Ar6 8tSocjTbswNUQZafgBVZiEXNQ+FjFcpaX/RW/JnRq/mQ6MEB+fax3b6ESq/jKhdQriaCKG VkhOdrhXRgfI2Nty7Syrw9jzdAjGpFpetGdFODHf3/LxNoIx8PN64GbGZeBzDYMVDq1UQs UvRAVLTnRv/v8yRJ2pxfBYRIsWf28ZZC8zPYHs4q4fzf+pWQk8MD3XR1Q6gWBQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708685390; a=rsa-sha256; cv=none; b=NyxFWQ0/GN7nIy5ZY/Sn6p1bAC7glnArmra1Sp4MkK0zLj2+Od3uJJPSv+BJWniJTOIYX9 iGdS03AVRoKOO6T8QqZLxhUBNKO7PT0KNKDNffXKbyofDTIAOdEMIjRkImSC9v2rkIFL46 dIlkBuKCLMMQ/R+2Vb1EB5jjbYGqcmRM3+lsn/o5UrrSmynxrd2IedHlPT0DBxSkhW4ce4 l2cyvlh54F6cZunVp4Ah/QMrh5CGKgLvwXKWnsykfuS91ygxmbZXgigkPU8Ll72X5T0CRE q+nlbGAEGqC/TDeDbBxInI9p31DcSSTBQoXdLvxOSLHubQ6ketDl/7+PM3BC6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708685390; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oCoebOZIZpUUZe56RTuu8tVTV6dApa88vDtIH/j7dLk=; b=m1QwWzbYkknjTa2HMgxd/foLa3/YczwrGh3wbiaamlJ9Vww/alnGMaBMJjaF4WJ0nXKm8L WMEHvolOOwfVBY6Q3oW9ObcF14dl3xviu02OSuQPWfia+RGMmwQddJny6UgcmFd8vpdTLy +p4HxM2yECgpkaz27IwpVb5B3ju/TCVrAXw7G2cDBkRP3Jbfmch5+jcXrK7WjBhKq1OBos iU5SzIECwG40mwDzOrlCeIgZkA93jAY1t0Yl95bIXU6nMns6wJPl1zs1SBFzl7fJcCY7Xw qv7ZaB31df2XRXW23sQbzQg57hfrBPNeBd2yrsEwCHD2n8r2Qv64ATqKy7tjLA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Th6GQ1qy2z1BWr; Fri, 23 Feb 2024 10:49:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41NAnom8079583; Fri, 23 Feb 2024 10:49:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41NAnoUf079580; Fri, 23 Feb 2024 10:49:50 GMT (envelope-from git) Date: Fri, 23 Feb 2024 10:49:50 GMT Message-Id: <202402231049.41NAnoUf079580@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Stefan =?utf-8?Q?E=C3=9Fer?= Subject: git: fba1a994acfe - stable/14 - msdosfs: fix potential inode collision on FAT12 and FAT16 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: fba1a994acfe31d957e9e26a5f12a6fdd1689bd2 Auto-Submitted: auto-generated The branch stable/14 has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=fba1a994acfe31d957e9e26a5f12a6fdd1689bd2 commit fba1a994acfe31d957e9e26a5f12a6fdd1689bd2 Author: Stefan Eßer AuthorDate: 2024-02-20 12:02:24 +0000 Commit: Stefan Eßer CommitDate: 2024-02-23 10:47:58 +0000 msdosfs: fix potential inode collision on FAT12 and FAT16 PR: 277239 Approved by: mckusick (cherry picked from commit 445d3d227e68f85157d0301d1706aa488e8423da) --- sys/fs/msdosfs/denode.h | 8 +++++++- sys/fs/msdosfs/msdosfs_denode.c | 19 ++++++++++++++++--- sys/fs/msdosfs/msdosfs_lookup.c | 2 +- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/sys/fs/msdosfs/denode.h b/sys/fs/msdosfs/denode.h index ad52a736592c..0d31b0583fa6 100644 --- a/sys/fs/msdosfs/denode.h +++ b/sys/fs/msdosfs/denode.h @@ -162,7 +162,7 @@ struct denode { u_long de_FileSize; /* size of file in bytes */ struct fatcache de_fc[FC_SIZE]; /* FAT cache */ u_quad_t de_modrev; /* Revision level for lease. */ - uint64_t de_inode; /* Inode number (really byte offset of direntry) */ + uint64_t de_inode; /* Inode number (really index of DOS style direntry) */ }; /* @@ -217,6 +217,12 @@ struct denode { #define VTODE(vp) ((struct denode *)(vp)->v_data) #define DETOV(de) ((de)->de_vnode) +#define DETOI(pmp, cn, off) \ + ((cn) == MSDOSFSROOT \ + ? (((uint64_t)(off) >> 5)) \ + : (((((uint64_t)pmp->pm_bpcluster * ((cn) - 2) + (off))) >> 5) \ + + pmp->pm_RootDirEnts)) + #define DETIMES(dep, acc, mod, cre) do { \ if ((dep)->de_flag & DE_UPDATE) { \ (dep)->de_flag |= DE_MODIFIED; \ diff --git a/sys/fs/msdosfs/msdosfs_denode.c b/sys/fs/msdosfs/msdosfs_denode.c index 612b318ce6e8..7f275d387a25 100644 --- a/sys/fs/msdosfs/msdosfs_denode.c +++ b/sys/fs/msdosfs/msdosfs_denode.c @@ -133,10 +133,13 @@ deget(struct msdosfsmount *pmp, u_long dirclust, u_long diroffset, * entry that represented the file happens to be reused while the * deleted file is still open. */ - inode = (uint64_t)pmp->pm_bpcluster * dirclust + diroffset; + inode = DETOI(pmp, dirclust, diroffset); error = vfs_hash_get(mntp, inode, lkflags, curthread, &nvp, de_vncmpf, &inode); +#ifdef MSDOSFS_DEBUG + printf("vfs_hash_get(inode %lu) error %d\n", inode, error); +#endif if (error) return (error); if (nvp != NULL) { @@ -191,6 +194,9 @@ badoff: } error = vfs_hash_insert(nvp, inode, lkflags, curthread, &xvp, de_vncmpf, &inode); +#ifdef MSDOSFS_DEBUG + printf("vfs_hash_insert(inode %lu) error %d\n", inode, error); +#endif if (error) { *depp = NULL; return (error); @@ -589,8 +595,11 @@ reinsert(struct denode *dep) return; #endif vp = DETOV(dep); - dep->de_inode = (uint64_t)dep->de_pmp->pm_bpcluster * dep->de_dirclust + - dep->de_diroffset; + dep->de_inode = DETOI(dep->de_pmp, dep->de_dirclust, dep->de_diroffset); +#ifdef MSDOSFS_DEBUG + printf("vfs_hash_rehash(inode %lu, refcnt %lu, vp %p)\n", + dep->de_inode, dep->de_refcnt, vp); +#endif vfs_hash_rehash(vp, dep->de_inode); } @@ -608,6 +617,10 @@ msdosfs_reclaim(struct vop_reclaim_args *ap) /* * Remove the denode from its hash chain. */ +#ifdef MSDOSFS_DEBUG + printf("vfs_hash_remove(inode %lu, refcnt %lu, vp %p)\n", + dep->de_inode, dep->de_refcnt, vp); +#endif vfs_hash_remove(vp); /* * Purge old data structures associated with the denode. diff --git a/sys/fs/msdosfs/msdosfs_lookup.c b/sys/fs/msdosfs/msdosfs_lookup.c index eb4cbaa21ab7..2a90339d0878 100644 --- a/sys/fs/msdosfs/msdosfs_lookup.c +++ b/sys/fs/msdosfs/msdosfs_lookup.c @@ -586,7 +586,7 @@ foundroot: } if (FAT32(pmp) && scn == MSDOSFSROOT) scn = pmp->pm_rootdirblk; - inode1 = scn * pmp->pm_bpcluster + blkoff; + inode1 = DETOI(pmp, scn, blkoff); if (VTODE(*vpp)->de_inode != inode1) { vput(*vpp); goto restart; From nobody Fri Feb 23 10:52:09 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Th6K53pMcz5CDvk; Fri, 23 Feb 2024 10:52:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Th6K53G7Fz4ZT5; Fri, 23 Feb 2024 10:52:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708685529; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pzoMoOa5f5rTN++Dv/T1KvCFY/NytXyhbstPaSHCQ8Q=; b=b/yZRK46qRmpFHlpEPPmSd4Mc0TDvm78NiT7MbNgSa5zOMipyxDUwnR5mHEB44y0p6ruRY 6hIjNFQg8qAkK4uYYvhbXWAl/x+4qiaiFM9ZBkhWvNC6mERTxejJVcV0EL7YVH28RItxEq kTH83oBXW1ZsuWNoGwwol1DKJlJt5e+qys4DO4HXNA2gZ+iDCcHDDA4FjAiXUr+hOkKE3X an7I4+UDeqlWIKF4BYqtgFg/pyWutUbdbuLYxA7FNQKBMycscPAMNWTxfCbzZK67963UnL 0UflusLl5UQ9MA6YBXZV6cm2GAWdHGRG8ZQGdadukOExZRkZQrvay7KgoJfjJQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708685529; a=rsa-sha256; cv=none; b=UbLzyd+9xMUP2pC7bTlNSAVpoYLU/mCZFnNpxwut6xEZBSt0uSRSRkJFzxRtk24ZuQ1z4s IuTJtR7iQFKlFKo095qR3iGrIFqf9OBmhYhIZdPZkTcbzmvh6AGDQUsFp09bt7kjAAKyoE D/rloJDptbQZrjaZbfETeDATfkMDWhyj/EPwQeChDUj9mTxPYsefuMrBEzQsHIMAhQuO7U 97qTW9FLy2NmfYAbPRwMvd/9dcwTSZDqJulRRQD5XtuUMjK+QUHhcY8YUVJnObSpiTC1uS 2BzKeHBzGTSeGIKYNhKwGxIPdIPcDGxLRWRrCWYvgLsjDqR3eGEbMCCHS8GrVw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708685529; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pzoMoOa5f5rTN++Dv/T1KvCFY/NytXyhbstPaSHCQ8Q=; b=yIMHBDJE5JZsOkRGB/jYnTAHe7+tJDfH3xWj8kE6Yw6KayEJZd1vuFElMX4hIWZccF7D6q zGK6EJtoUHvZVZHhwhyfcVUg1720ERmktsANpRHZbn+JE9bgcJ9LJ122xUlsnrJ6LHWpzG A+iKhXTfi/MCHYI7AyWizpEv5XTLazSYFOkOwJkTHJ0cqYyInxZIWoMMU52eEmFATfPtsK i2Kr4VLqWiVuwIMBmNEdF8xsL1bKC0Q7M2F+6ukmt6kyu6qgcRl7JHgjjoWRd40DRHP2aK oABXtD2h8qgg0F19IsIfqHQrmWau1r6+uXRB2ns/oki+j/U0lT4+cOJRAMAY2g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Th6K52JTSz1C4k; Fri, 23 Feb 2024 10:52:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41NAq9LT094250; Fri, 23 Feb 2024 10:52:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41NAq9KH094247; Fri, 23 Feb 2024 10:52:09 GMT (envelope-from git) Date: Fri, 23 Feb 2024 10:52:09 GMT Message-Id: <202402231052.41NAq9KH094247@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Stefan =?utf-8?Q?E=C3=9Fer?= Subject: git: a495e7f5c5c2 - stable/13 - msdosfs: fix potential inode collision on FAT12 and FAT16 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: a495e7f5c5c2088bf32cd7349e2ca344ee089552 Auto-Submitted: auto-generated The branch stable/13 has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=a495e7f5c5c2088bf32cd7349e2ca344ee089552 commit a495e7f5c5c2088bf32cd7349e2ca344ee089552 Author: Stefan Eßer AuthorDate: 2024-02-20 12:02:24 +0000 Commit: Stefan Eßer CommitDate: 2024-02-23 10:50:31 +0000 msdosfs: fix potential inode collision on FAT12 and FAT16 PR: 277239 Approved by: mckusick (cherry picked from commit 445d3d227e68f85157d0301d1706aa488e8423da) --- sys/fs/msdosfs/denode.h | 8 +++++++- sys/fs/msdosfs/msdosfs_denode.c | 19 ++++++++++++++++--- sys/fs/msdosfs/msdosfs_lookup.c | 2 +- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/sys/fs/msdosfs/denode.h b/sys/fs/msdosfs/denode.h index 9ac5c2a2f5e1..881e27bc3874 100644 --- a/sys/fs/msdosfs/denode.h +++ b/sys/fs/msdosfs/denode.h @@ -161,7 +161,7 @@ struct denode { u_long de_FileSize; /* size of file in bytes */ struct fatcache de_fc[FC_SIZE]; /* FAT cache */ u_quad_t de_modrev; /* Revision level for lease. */ - uint64_t de_inode; /* Inode number (really byte offset of direntry) */ + uint64_t de_inode; /* Inode number (really index of DOS style direntry) */ }; /* @@ -216,6 +216,12 @@ struct denode { #define VTODE(vp) ((struct denode *)(vp)->v_data) #define DETOV(de) ((de)->de_vnode) +#define DETOI(pmp, cn, off) \ + ((cn) == MSDOSFSROOT \ + ? (((uint64_t)(off) >> 5)) \ + : (((((uint64_t)pmp->pm_bpcluster * ((cn) - 2) + (off))) >> 5) \ + + pmp->pm_RootDirEnts)) + #define DETIMES(dep, acc, mod, cre) do { \ if ((dep)->de_flag & DE_UPDATE) { \ (dep)->de_flag |= DE_MODIFIED; \ diff --git a/sys/fs/msdosfs/msdosfs_denode.c b/sys/fs/msdosfs/msdosfs_denode.c index e131d8f5eac3..2c44d49be197 100644 --- a/sys/fs/msdosfs/msdosfs_denode.c +++ b/sys/fs/msdosfs/msdosfs_denode.c @@ -133,10 +133,13 @@ deget(struct msdosfsmount *pmp, u_long dirclust, u_long diroffset, * entry that represented the file happens to be reused while the * deleted file is still open. */ - inode = (uint64_t)pmp->pm_bpcluster * dirclust + diroffset; + inode = DETOI(pmp, dirclust, diroffset); error = vfs_hash_get(mntp, inode, lkflags, curthread, &nvp, de_vncmpf, &inode); +#ifdef MSDOSFS_DEBUG + printf("vfs_hash_get(inode %lu) error %d\n", inode, error); +#endif if (error) return (error); if (nvp != NULL) { @@ -190,6 +193,9 @@ badoff: } error = vfs_hash_insert(nvp, inode, lkflags, curthread, &xvp, de_vncmpf, &inode); +#ifdef MSDOSFS_DEBUG + printf("vfs_hash_insert(inode %lu) error %d\n", inode, error); +#endif if (error) { *depp = NULL; return (error); @@ -587,8 +593,11 @@ reinsert(struct denode *dep) return; #endif vp = DETOV(dep); - dep->de_inode = (uint64_t)dep->de_pmp->pm_bpcluster * dep->de_dirclust + - dep->de_diroffset; + dep->de_inode = DETOI(dep->de_pmp, dep->de_dirclust, dep->de_diroffset); +#ifdef MSDOSFS_DEBUG + printf("vfs_hash_rehash(inode %lu, refcnt %lu, vp %p)\n", + dep->de_inode, dep->de_refcnt, vp); +#endif vfs_hash_rehash(vp, dep->de_inode); } @@ -606,6 +615,10 @@ msdosfs_reclaim(struct vop_reclaim_args *ap) /* * Remove the denode from its hash chain. */ +#ifdef MSDOSFS_DEBUG + printf("vfs_hash_remove(inode %lu, refcnt %lu, vp %p)\n", + dep->de_inode, dep->de_refcnt, vp); +#endif vfs_hash_remove(vp); /* * Purge old data structures associated with the denode. diff --git a/sys/fs/msdosfs/msdosfs_lookup.c b/sys/fs/msdosfs/msdosfs_lookup.c index 252f237af2d6..d34a670e2fc9 100644 --- a/sys/fs/msdosfs/msdosfs_lookup.c +++ b/sys/fs/msdosfs/msdosfs_lookup.c @@ -590,7 +590,7 @@ foundroot: } if (FAT32(pmp) && scn == MSDOSFSROOT) scn = pmp->pm_rootdirblk; - inode1 = scn * pmp->pm_bpcluster + blkoff; + inode1 = DETOI(pmp, scn, blkoff); if (VTODE(*vpp)->de_inode != inode1) { vput(*vpp); goto restart; From nobody Fri Feb 23 11:41:32 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Th7Q442Mlz5CJjK; Fri, 23 Feb 2024 11:41:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Th7Q43cVDz4jyh; Fri, 23 Feb 2024 11:41:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708688492; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HZg0+H/usjasNl0wv0D4Rpaya5xMFQIN3Ga/FG0XPzM=; b=oJyOYAZonbzry/Cyoptpiho+3/A8NhBIlUbmHdXwRQYojszFwCqn9WYA0D3V7KfpttLsaC itatBjDmOCr9FHfwkGvKuz4+Mpnn0o2BICw0Snc0Eikxs1xj/EslpjgctGR4Pl4jj2oDIj c0MkmLyOfGFyEry3znt6sDCZYUSKh4VVcR4qiKcaHx0Fmz9EsrsKZdxACflWVMmNn/Zy+n M1ZQn9VorkLD0gu9Y8iyC+li32jXqG8I2L7J4mW5+o+jqaVZ2ROFLOYHiZwDp/T5V2RRoK dudTTg5o55hsEzTyMHrDud9ae743CSS1hfRlbswc5jODkxSIood/lhriiZOTXA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708688492; a=rsa-sha256; cv=none; b=FWfGtAit78bDFayJsOLwsakWRG/eiVGQknON3KHPizxxSFTDFPB6SkWMtPximTHVnHna28 zuowsCMnXfgnzGj8WbHKTjxRgs4vZXK66XUHNctAiCLsJQVvhOqpwcTHJbtZTisBRIGUH0 HU/WPVIzWfwZJKlM1AZnzM3jhlMyHSwBzt0ANgJ3hC3EjeWu8uGLufAGT2bbuOvk2FR1s7 k0gBcKTS2QuzSERfxFr0ViluMh72KcVs//VjEfkOoMGqGD9qKyD+l5em+Q0+rS80TlFLlY 9TCdDl2FwDyN5wdAYetk4v1yAOShk7aXX0wPtZirQB3WUD9flmgDnS0ImMQGkA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708688492; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HZg0+H/usjasNl0wv0D4Rpaya5xMFQIN3Ga/FG0XPzM=; b=iG4tiEKhvGKga30oxNfSHCXMctmTYwl/oecFDfHJTyYToNKYwkcZ/ihpYJcSrMvC9aWPuS OzqmVsR5l6VALelPr1uynQ28nIBLCYostK452NlqkIRt6m3kSyKAWkH6plbZ+XdpaShl5v 0kqKAdYDopF9mBTZTpwmGZjY/yUEscjLo8qgGVRAoI6vgr69eb1Y88xRO5qdDhYdVPcfGg KKqkLjhLuMcBzB1rsy4SQBILRVBqqk/dfiSx3hgNxhjH9F1DTe2o8nfa7t1m+iWJ2WXU3h s12ZxN/gRjZgNVL6XcA/RT5YUHLo17sZWoWm7YhaarqkF1jxs52ZmO5dSNCEGg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Th7Q42g3TzF9k; Fri, 23 Feb 2024 11:41:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41NBfWrM078563; Fri, 23 Feb 2024 11:41:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41NBfW7Y078561; Fri, 23 Feb 2024 11:41:32 GMT (envelope-from git) Date: Fri, 23 Feb 2024 11:41:32 GMT Message-Id: <202402231141.41NBfW7Y078561@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: e99479f817c4 - releng/13.3 - tzcode: Fix overflow handling in TZ parser. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/releng/13.3 X-Git-Reftype: branch X-Git-Commit: e99479f817c4714d396de1d403daa6f9bc3a32bb Auto-Submitted: auto-generated The branch releng/13.3 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=e99479f817c4714d396de1d403daa6f9bc3a32bb commit e99479f817c4714d396de1d403daa6f9bc3a32bb Author: Dag-Erling Smørgrav AuthorDate: 2024-02-18 09:48:08 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-02-23 11:41:25 +0000 tzcode: Fix overflow handling in TZ parser. Obtained from: upstream 9fc11a27 MFC after: 1 week PR: 276281 Approved by: re (cperciva) (cherry picked from commit 1365bb722af1365baee6ea1e3d44917533908d53) (cherry picked from commit beb958dca02abf79a2172e702c2d24bbccde60fa) --- contrib/tzcode/localtime.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/tzcode/localtime.c b/contrib/tzcode/localtime.c index 3bf9378fe673..8bf4fcb17d2d 100644 --- a/contrib/tzcode/localtime.c +++ b/contrib/tzcode/localtime.c @@ -1277,11 +1277,13 @@ tzparse(const char *name, struct state *sp, struct state *basep) do { int_fast32_t yearsecs = year_lengths[isleap(yearbeg - 1)] * SECSPERDAY; + time_t janfirst1 = janfirst; yearbeg--; - if (increment_overflow_time(&janfirst, -yearsecs)) { + if (increment_overflow_time(&janfirst1, -yearsecs)) { janoffset = -yearsecs; break; } + janfirst = janfirst1; } while (atlo < janfirst && EPOCH_YEAR - YEARSPERREPEAT / 2 < yearbeg); From nobody Fri Feb 23 17:36:57 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ThHJB0zRzz5B9W4; Fri, 23 Feb 2024 17:36:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ThHJB0Pvjz4hf9; Fri, 23 Feb 2024 17:36:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708709818; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o9C9Rrsm7uiB7opKpL7M53smV4dx0n1+AWg63uqftJM=; b=Lo+oA+M6ny39x41sCH70NnKJMKkuhgZp/+bCCyTYTJdzoy0Zf3/mQHMuxRpgeKHEGJLGvA rlNF+XLF/Wi6uB5rlGt2f3y5RP+YjKw0zsVzV+aIqCPHMiSM1L315x4i/RUsnnr0xya4th oq0lDY944Dyz4CR6KUzxkvRLNe7aw+s0EJgk7t0MtaHO/F6jKhndKU1lerVLF6JFuhAvng CKWQwtSg/Y2VI+R2DUzt+LOpE7qLCEd5yHRLeghpvc5ZIyJNq8L5GM6+24sH7dYoJBAZ0l 6MUbyEWE90DCJLgMYP704OptvMMC30tN8tl4qhaFH/IDV65jbSr7B4TakWKXMA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708709818; a=rsa-sha256; cv=none; b=ECnHj5GuqunobemZeJ5O8KXBrEZDzfq7yRoGhULGmUYo0JzwrmZzOHCoy8H8sKmFrE3Qc7 sbgKwuXhDeqt/RYYMHsaDiy6y36k9Pj3r8AdR6Szoot0iBzq+hjB9IVaC2ZcpZgLdtJEB8 AbfzIMWqkyL0bu30sfJzMAZjgOUH/YBBNGDWoowyWbaLwNtr14lxI5rLm4CAlC7QLvpmfP 9WbaCiYf6Us1dS4d99yvlx9BhYgumQdaZAQo9BNqdAZGd9CTc9XlJgm82qVrDK7XaN1+mF V5vmEu8EoAKbM0uV+5UGikEUyzKIQJqIEW3jV3KopP/f2hqlIBTzjisllzNS+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=1708709818; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o9C9Rrsm7uiB7opKpL7M53smV4dx0n1+AWg63uqftJM=; b=xRc18MSbG4cSIsLSBdvL2qutvb0pMv5iteVeWU+jePw9M9cNCqF9h4VzhqWvimsqUF37G4 VgO3fFylD0wKMMi9yQivhKWbw5DLEfedXYhW5KX8fwla4TjkyFvBsARcIewEyilShhB1sc tlJdpMFWLmUmgwgscqjscWmLzhK2qWgs+zWeNUqwhUu4JiuyrrA2NjKTBfGQ1UXDC3whzl UVNdiclxEcfVPwprLHsg4vjOvjnOiF1HiCYyHNdrNOq7y7zkXjCfQCoHOLoUZKLnuDz5gf lnPyji0CtTK8sJtccnpxfz8GCi8uW12Crj9XmtUIlhSXRGStRraIjnfMzFKJdQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ThHJ96GqrzQ8c; Fri, 23 Feb 2024 17:36:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41NHavXV083775; Fri, 23 Feb 2024 17:36:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41NHav16083772; Fri, 23 Feb 2024 17:36:57 GMT (envelope-from git) Date: Fri, 23 Feb 2024 17:36:57 GMT Message-Id: <202402231736.41NHav16083772@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Stefan =?utf-8?Q?E=C3=9Fer?= Subject: git: 6831288c8c40 - releng/13.3 - msdosfs: fix potential inode collision on FAT12 and FAT16 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/releng/13.3 X-Git-Reftype: branch X-Git-Commit: 6831288c8c4091c533c590d2d3cbb07459f2d28b Auto-Submitted: auto-generated The branch releng/13.3 has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=6831288c8c4091c533c590d2d3cbb07459f2d28b commit 6831288c8c4091c533c590d2d3cbb07459f2d28b Author: Stefan Eßer AuthorDate: 2024-02-20 12:02:24 +0000 Commit: Stefan Eßer CommitDate: 2024-02-23 12:42:34 +0000 msdosfs: fix potential inode collision on FAT12 and FAT16 FAT file systems do not use inodes, instead all file meta-information is stored in directory entries. FAT12 and FAT16 use a fixed size area for root directories, with typically 512 entries of 32 bytes each (for a total of 16 KB) on hard disk formats. The file system data is stored in clusters of typically 512 to 4096 bytes, depending on the size of the file system. The current code uses the offset of a DOS 8.3 style directory entry as a pseudo-inode, which leads to inode values of 0 to 16368 for typical root directories with 512 entries. Sub-directories use 2 cluster length plus the byte offset of the directory entry in the data area for the pseudo-inode, which may be as low as 1024 in case of 512 byte clusters. A sub-directory in cluster 2 and with 512 byte clusters will therefore lead to a re-use of inode 1024 when there are at least 32 DOS 8.3 style filenames in the root directory (or 11 14-character Windows long file names, each of which takes up 3 directory entries). FAT32 file systems are not affected by this issue and FAT12/FAT16 file systems with larger cluster sizes are unlikely to have as many directory entries in the root directory as are required to cause the collision. This commit leads to inode numbers that are guaranteed to not collide for all valid FAT12 and FAT16 file system parameters. It does also provide a small speed-up due to more efficient use of the vnode cache. PR: 277239 Reviewed by: mckusick Approved by: re (cperciva) (cherry picked from commit 445d3d227e68f85157d0301d1706aa488e8423da) (cherry picked from commit a495e7f5c5c2088bf32cd7349e2ca344ee089552) --- sys/fs/msdosfs/denode.h | 8 +++++++- sys/fs/msdosfs/msdosfs_denode.c | 19 ++++++++++++++++--- sys/fs/msdosfs/msdosfs_lookup.c | 2 +- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/sys/fs/msdosfs/denode.h b/sys/fs/msdosfs/denode.h index 9ac5c2a2f5e1..881e27bc3874 100644 --- a/sys/fs/msdosfs/denode.h +++ b/sys/fs/msdosfs/denode.h @@ -161,7 +161,7 @@ struct denode { u_long de_FileSize; /* size of file in bytes */ struct fatcache de_fc[FC_SIZE]; /* FAT cache */ u_quad_t de_modrev; /* Revision level for lease. */ - uint64_t de_inode; /* Inode number (really byte offset of direntry) */ + uint64_t de_inode; /* Inode number (really index of DOS style direntry) */ }; /* @@ -216,6 +216,12 @@ struct denode { #define VTODE(vp) ((struct denode *)(vp)->v_data) #define DETOV(de) ((de)->de_vnode) +#define DETOI(pmp, cn, off) \ + ((cn) == MSDOSFSROOT \ + ? (((uint64_t)(off) >> 5)) \ + : (((((uint64_t)pmp->pm_bpcluster * ((cn) - 2) + (off))) >> 5) \ + + pmp->pm_RootDirEnts)) + #define DETIMES(dep, acc, mod, cre) do { \ if ((dep)->de_flag & DE_UPDATE) { \ (dep)->de_flag |= DE_MODIFIED; \ diff --git a/sys/fs/msdosfs/msdosfs_denode.c b/sys/fs/msdosfs/msdosfs_denode.c index e131d8f5eac3..2c44d49be197 100644 --- a/sys/fs/msdosfs/msdosfs_denode.c +++ b/sys/fs/msdosfs/msdosfs_denode.c @@ -133,10 +133,13 @@ deget(struct msdosfsmount *pmp, u_long dirclust, u_long diroffset, * entry that represented the file happens to be reused while the * deleted file is still open. */ - inode = (uint64_t)pmp->pm_bpcluster * dirclust + diroffset; + inode = DETOI(pmp, dirclust, diroffset); error = vfs_hash_get(mntp, inode, lkflags, curthread, &nvp, de_vncmpf, &inode); +#ifdef MSDOSFS_DEBUG + printf("vfs_hash_get(inode %lu) error %d\n", inode, error); +#endif if (error) return (error); if (nvp != NULL) { @@ -190,6 +193,9 @@ badoff: } error = vfs_hash_insert(nvp, inode, lkflags, curthread, &xvp, de_vncmpf, &inode); +#ifdef MSDOSFS_DEBUG + printf("vfs_hash_insert(inode %lu) error %d\n", inode, error); +#endif if (error) { *depp = NULL; return (error); @@ -587,8 +593,11 @@ reinsert(struct denode *dep) return; #endif vp = DETOV(dep); - dep->de_inode = (uint64_t)dep->de_pmp->pm_bpcluster * dep->de_dirclust + - dep->de_diroffset; + dep->de_inode = DETOI(dep->de_pmp, dep->de_dirclust, dep->de_diroffset); +#ifdef MSDOSFS_DEBUG + printf("vfs_hash_rehash(inode %lu, refcnt %lu, vp %p)\n", + dep->de_inode, dep->de_refcnt, vp); +#endif vfs_hash_rehash(vp, dep->de_inode); } @@ -606,6 +615,10 @@ msdosfs_reclaim(struct vop_reclaim_args *ap) /* * Remove the denode from its hash chain. */ +#ifdef MSDOSFS_DEBUG + printf("vfs_hash_remove(inode %lu, refcnt %lu, vp %p)\n", + dep->de_inode, dep->de_refcnt, vp); +#endif vfs_hash_remove(vp); /* * Purge old data structures associated with the denode. diff --git a/sys/fs/msdosfs/msdosfs_lookup.c b/sys/fs/msdosfs/msdosfs_lookup.c index 252f237af2d6..d34a670e2fc9 100644 --- a/sys/fs/msdosfs/msdosfs_lookup.c +++ b/sys/fs/msdosfs/msdosfs_lookup.c @@ -590,7 +590,7 @@ foundroot: } if (FAT32(pmp) && scn == MSDOSFSROOT) scn = pmp->pm_rootdirblk; - inode1 = scn * pmp->pm_bpcluster + blkoff; + inode1 = DETOI(pmp, scn, blkoff); if (VTODE(*vpp)->de_inode != inode1) { vput(*vpp); goto restart; From nobody Fri Feb 23 18:38:14 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ThJfy5MrZz5BGvM; Fri, 23 Feb 2024 18:38:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ThJfy4rG6z4wRT; Fri, 23 Feb 2024 18:38:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708713498; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cry0/yDIh9cy6L/n1eX9qQ0Vs4URqzY5gj71TgMgki4=; b=l9M/bB6RRVYXTJ1fmRvnDNANkYhn62VLEHnR4WGzNLr4U+tK87SHz2paqrWfNfEm0SUnkB Su45mWc5NVyQPaNVNFYKZE7HU+jHLuVGAJyYXX4wVhyd3C6w2ojO8d/RCbxJb3Hjumbog4 CT4nlBARTGu0t0Qpcdb1TceeEmRYFDuov2AUpTWdHzCeQmSgPLmuOZUEyuJ08JGWmyvw4W 92knZmfdrVci4pxfPpGWSLaTDnE8JAEy29DnK2wlBgJpNQ6NoR7AY+Q+yeNV+UHjUwkatT knND+Gstg00ZoMcSCOiyBw0kJc9zCnJ7C60EWlFeV+TW5jLpFFrYzOyIW7z8WQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708713498; a=rsa-sha256; cv=none; b=aivGrw+By2uWWtJBQn/BlUvy4Hesy33uWNZAu65Dx4/L8XOwBPt94IGL3ckKBP5MV+rrpS ZwxUUXgTAvZ9H2uMf7nza0W1lmKHtV2Y2RxQ7aAm2WX6Lz/wyza8TH2cQBtAFPrdBxgoj0 Rm+K7Usz1WW8Z1dMNXHaGVRvcjP4ymu/2zooVAUxTJ7s6lGFgkk3/ZTIood6eSbxTo7UCI ChsYP3u4NTx71SzQeMytzHxvDkfgHr5q04Q0g8wswEiJSQE2bTSPsE2GGZGSeCGtEaCRa3 DqUuNhE/A1QFWQ2v5htj5auaSR4lXJ7iFu3cngPUxFQSXmJGhCAKLRM+73eR4g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708713498; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cry0/yDIh9cy6L/n1eX9qQ0Vs4URqzY5gj71TgMgki4=; b=DRaQ29j1YbgEaJxx8ke8yR1b235jdLmq2xWYLMWYnR5ggNBA1o3oxfyRg1xqnhBSbEuFX/ 6/4CVIM2kcCTBKFN2StHdAKPhDtiHAyGKqoo/aUWGcNjM0w7XOGlrhMBne4nGdzfOgBCBp EpD8wwwsLZDt0iraSlQDAXGWe0ZAGzTV9z97jCapFPOnempAdZAEJ5K30elpj1LAL66Rvi 9ZWB1xmfdcABa7lfJyCFij1dAEi1tm0SrfRD+8F64Qkce6aVMALaGpeZhG0pZeiycy7AKA MMhMEr+ZyVciMgdkQVfdrVrJ7N0C7QjaPviCBHh0uyY3F1XgjQSVWvZmSbisig== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ThJfy3stlzRP0; Fri, 23 Feb 2024 18:38:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41NIcI27087461; Fri, 23 Feb 2024 18:38:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41NIcEgt087454; Fri, 23 Feb 2024 18:38:14 GMT (envelope-from git) Date: Fri, 23 Feb 2024 18:38:14 GMT Message-Id: <202402231838.41NIcEgt087454@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: 81be5a55d9bb - stable/14 - zfs: merge openzfs/zfs@c883088df (zfs-2.2-release) into stable/14 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 81be5a55d9bb8717e280433cd8927dfe9bf9b814 Auto-Submitted: auto-generated The branch stable/14 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=81be5a55d9bb8717e280433cd8927dfe9bf9b814 commit 81be5a55d9bb8717e280433cd8927dfe9bf9b814 Merge: fba1a994acfe c883088df83c Author: Martin Matuska AuthorDate: 2024-02-23 18:37:08 +0000 Commit: Martin Matuska CommitDate: 2024-02-23 18:37:36 +0000 zfs: merge openzfs/zfs@c883088df (zfs-2.2-release) into stable/14 OpenZFS release 2.2.3 Notable upstream pull request merges: #15428 2a59b6bfa ABD: Be more assertive in iterators #15486 c34fe8dcb Update the kstat dataset_name when renaming a zvol #15495 f13593619 FreeBSD: Optimize large kstat outputs #15517 ad47eca19 ZIL: Assert record sizes in different places #15519 2e259c6f0 L2ARC: Restrict write size to 1/4 of the device #15544 121924575 Allow block cloning across encrypted datasets #15553 e48195c81 ZIO: Add overflow checks for linear buffers #15612 3b8f22736 ZIL: Remove TX_CLONE_RANGE replay for ZVOLs #15617 e11b3eb1c ZIL: Do not clone blocks from the future #15625 e09356fa0 BRT: Limit brt_vdev_dump() to only one vdev #15629 dea2d3c6c zdb: Dump encrypted write and clone ZIL records #15630 3425484eb Fix file descriptor leak on pool import #15634 1e1d748ca ZIL: Remove 128K into 2x68K LWB split optimization #15644 b13c91bb2 DMU: Fix lock leak on dbuf_hold() error #15653 a701548eb dbuf: Handle arcbuf assignment after block cloning #15656 9c40ae021 dbuf: Set dr_data when unoverriding after clone #15660 4db88c37c fix(mount): do not truncate shares not zfs mount #15665 c0c4866f8 dmu: Allow buffer fills to fail #15675 db2db50e3 spa: make read/write queues configurable #15677 f71c16a66 Don't panic on unencrypted block in encrypted dataset #15719 9181e94f0 spa: Fix FreeBSD sysctl handlers #15719 a00231a3f spa: Let spa_taskq_param_get()'s addition of a newline be optional #15721 4d4972ed9 Stop wasting time on malloc in snprintf_zstd_header #15726 7bccf98a7 Make zdb -R scale less poorly #15732 ac592318b Fix livelist assertions for dedup and cloning #15735 152a775ea Improve block sizes checks during cloning #15737 52cee9a3e fix: Uber block label not always found for aux vdevs #15737 eb4a36bce Extend aux label to add path information #15737 a2e71db66 Add path handling for aux vdevs in `label_path` #15747 2006ac1f4 Fix "out of memory" error #15752 8b1c6db3d Fix a potential use-after-free in zfs_setsecattr() #15769 40e20d808 Add 'zpool status -e' flag to see unhealthy vdevs #15772 ef527958c Fix cloning into mmaped and cached file #15780 09a796136 FreeBSD: Fix bootstrapping tools under Linux/musl #15781 07cf973fe Autotrim High Load Average Fix #15783 c1161e285 fix: variable type with zfs-tests/cmd/clonefile.c #15816 dd3a0a271 Update vdev devid and physpath if changed between imports #15818 ab653603f Don't assert mg_initialized due to device addition race #15823 acc7cd8e9 Update man pages to time(1) from time(2) #15825 0606ce205 zpool wait: print timestamp before the header #15847 d22bf6a9b LUA: Backport CVE-2020-24370's patch #15864 36116b461 zfs list: add '-t fs' and '-t vol' options #15874 fc3d34bd0 BRT: Fix slop space calculation with block cloning #15882 a4978d260 zdb: Fix false leak report for BRT objects Obtained from: OpenZFS OpenZFS commit: c883088df83ced3a2b8b38e6d89a5e63fb153ee4 OpenZFS tag: zfs-2.2.3 sys/contrib/openzfs/.github/codeql-cpp.yml | 4 + sys/contrib/openzfs/.github/codeql-python.yml | 4 + .../custom-queries/cpp/deprecatedFunctionUsage.ql | 59 ++++ .../.github/codeql/custom-queries/cpp/qlpack.yml | 4 + sys/contrib/openzfs/.github/workflows/README.md | 46 +-- .../openzfs/.github/workflows/checkstyle.yaml | 4 +- sys/contrib/openzfs/.github/workflows/codeql.yml | 3 +- .../.github/workflows/scripts/generate-summary.sh | 2 +- .../workflows/scripts/setup-dependencies.sh | 35 +-- .../openzfs/.github/workflows/zfs-linux-tests.yml | 22 +- .../openzfs/.github/workflows/zfs-linux.yml | 8 +- sys/contrib/openzfs/META | 4 +- sys/contrib/openzfs/cmd/zdb/zdb.c | 24 +- sys/contrib/openzfs/cmd/zdb/zdb_il.c | 60 +++- sys/contrib/openzfs/cmd/zed/agents/zfs_mod.c | 4 + .../openzfs/cmd/zed/zed.d/statechange-slot_off.sh | 6 +- sys/contrib/openzfs/cmd/zed/zed.d/zed-functions.sh | 98 +++++++ sys/contrib/openzfs/cmd/zed/zed.d/zed.rc | 24 +- sys/contrib/openzfs/cmd/zed/zed_event.c | 31 ++ sys/contrib/openzfs/cmd/zfs/zfs_main.c | 25 +- .../openzfs/cmd/zpool/os/freebsd/zpool_vdev_os.c | 21 ++ .../openzfs/cmd/zpool/os/linux/zpool_vdev_os.c | 255 +++++++++++++++++ sys/contrib/openzfs/cmd/zpool/zpool.d/ses | 12 +- sys/contrib/openzfs/cmd/zpool/zpool_iter.c | 4 + sys/contrib/openzfs/cmd/zpool/zpool_main.c | 301 +++++++++++++++++--- sys/contrib/openzfs/cmd/zpool/zpool_util.h | 3 + sys/contrib/openzfs/cmd/zpool/zpool_vdev.c | 4 + sys/contrib/openzfs/config/Rules.am | 15 - sys/contrib/openzfs/config/kernel-acl.m4 | 14 +- sys/contrib/openzfs/config/kernel-automount.m4 | 2 +- sys/contrib/openzfs/config/kernel-bio.m4 | 2 +- sys/contrib/openzfs/config/kernel-blkdev.m4 | 90 +++++- .../config/kernel-block-device-operations.m4 | 8 +- .../openzfs/config/kernel-commit-metadata.m4 | 2 +- sys/contrib/openzfs/config/kernel-current-time.m4 | 5 +- .../openzfs/config/kernel-dentry-operations.m4 | 2 +- sys/contrib/openzfs/config/kernel-dirty-inode.m4 | 2 +- .../openzfs/config/kernel-encode-fh-inode.m4 | 2 +- sys/contrib/openzfs/config/kernel-evict-inode.m4 | 2 +- sys/contrib/openzfs/config/kernel-fallocate.m4 | 2 +- .../openzfs/config/kernel-flush_dcache_page.m4 | 5 +- sys/contrib/openzfs/config/kernel-fpu.m4 | 23 +- sys/contrib/openzfs/config/kernel-fsync.m4 | 4 +- sys/contrib/openzfs/config/kernel-get-link.m4 | 8 +- sys/contrib/openzfs/config/kernel-idmap_mnt_api.m4 | 25 ++ sys/contrib/openzfs/config/kernel-inode-create.m4 | 6 +- sys/contrib/openzfs/config/kernel-inode-getattr.m4 | 8 +- sys/contrib/openzfs/config/kernel-inode-lookup.m4 | 2 +- .../openzfs/config/kernel-inode-permission.m4 | 8 +- sys/contrib/openzfs/config/kernel-inode-setattr.m4 | 6 +- sys/contrib/openzfs/config/kernel-inode-times.m4 | 78 +++++ .../openzfs/config/kernel-make-request-fn.m4 | 8 +- sys/contrib/openzfs/config/kernel-mkdir.m4 | 6 +- sys/contrib/openzfs/config/kernel-mknod.m4 | 4 +- .../openzfs/config/kernel-proc-operations.m4 | 10 +- sys/contrib/openzfs/config/kernel-put-link.m4 | 4 +- sys/contrib/openzfs/config/kernel-rename.m4 | 10 +- sys/contrib/openzfs/config/kernel-show-options.m4 | 2 +- sys/contrib/openzfs/config/kernel-shrink.m4 | 96 ++++++- sys/contrib/openzfs/config/kernel-strlcpy.m4 | 47 +++ sys/contrib/openzfs/config/kernel-symlink.m4 | 4 +- sys/contrib/openzfs/config/kernel-timer.m4 | 4 +- sys/contrib/openzfs/config/kernel-tmpfile.m4 | 8 +- sys/contrib/openzfs/config/kernel-vfs-direct_IO.m4 | 8 +- sys/contrib/openzfs/config/kernel-vfs-iterate.m4 | 6 +- .../openzfs/config/kernel-vfs-rw-iterate.m4 | 4 +- sys/contrib/openzfs/config/kernel-writepage_t.m4 | 2 +- sys/contrib/openzfs/config/kernel-xattr-handler.m4 | 24 +- sys/contrib/openzfs/config/kernel.m4 | 12 + sys/contrib/openzfs/config/rpm.am | 10 + sys/contrib/openzfs/include/libzfs.h | 3 + sys/contrib/openzfs/include/libzutil.h | 59 ++++ .../openzfs/include/os/freebsd/spl/sys/mod_os.h | 6 + .../openzfs/include/os/freebsd/spl/sys/uio.h | 2 +- .../include/os/freebsd/zfs/sys/zfs_vfsops_os.h | 1 - .../include/os/linux/kernel/linux/dcache_compat.h | 15 +- .../include/os/linux/kernel/linux/simd_aarch64.h | 6 + .../include/os/linux/kernel/linux/simd_arm.h | 6 + .../openzfs/include/os/linux/spl/sys/cred.h | 55 +++- .../openzfs/include/os/linux/spl/sys/kmem_cache.h | 2 - .../openzfs/include/os/linux/spl/sys/shrinker.h | 66 ++--- .../openzfs/include/os/linux/spl/sys/string.h | 49 ++++ .../openzfs/include/os/linux/spl/sys/types.h | 11 + sys/contrib/openzfs/include/os/linux/spl/sys/uio.h | 2 +- .../include/os/linux/zfs/sys/zfs_vfsops_os.h | 2 - sys/contrib/openzfs/include/os/linux/zfs/sys/zpl.h | 20 ++ sys/contrib/openzfs/include/sys/dataset_kstats.h | 1 + sys/contrib/openzfs/include/sys/dbuf.h | 4 +- sys/contrib/openzfs/include/sys/dsl_crypt.h | 1 + sys/contrib/openzfs/include/sys/spa_impl.h | 1 + sys/contrib/openzfs/include/sys/zfs_vnops.h | 3 + sys/contrib/openzfs/lib/libspl/include/assert.h | 3 + .../lib/libspl/include/os/freebsd/sys/stat.h | 6 +- sys/contrib/openzfs/lib/libspl/include/sys/uio.h | 2 +- sys/contrib/openzfs/lib/libzfs/libzfs.abi | 104 +++++-- sys/contrib/openzfs/lib/libzfs/libzfs_import.c | 4 +- sys/contrib/openzfs/lib/libzfs/libzfs_pool.c | 49 +++- .../lib/libzutil/os/freebsd/zutil_import_os.c | 17 ++ .../lib/libzutil/os/linux/zutil_import_os.c | 55 +++- sys/contrib/openzfs/lib/libzutil/zutil_import.c | 130 ++++++++- sys/contrib/openzfs/lib/libzutil/zutil_pool.c | 31 ++ sys/contrib/openzfs/man/man4/spl.4 | 8 - sys/contrib/openzfs/man/man4/zfs.4 | 19 ++ sys/contrib/openzfs/man/man7/zpool-features.7 | 9 +- sys/contrib/openzfs/man/man8/zfs-list.8 | 11 +- sys/contrib/openzfs/man/man8/zpool-clear.8 | 11 + sys/contrib/openzfs/man/man8/zpool-iostat.8 | 2 +- sys/contrib/openzfs/man/man8/zpool-list.8 | 2 +- sys/contrib/openzfs/man/man8/zpool-offline.8 | 18 +- sys/contrib/openzfs/man/man8/zpool-status.8 | 8 +- sys/contrib/openzfs/man/man8/zpool-wait.8 | 2 +- sys/contrib/openzfs/man/man8/zpool.8 | 19 +- sys/contrib/openzfs/module/Kbuild.in | 1 + sys/contrib/openzfs/module/lua/ldebug.c | 7 +- .../openzfs/module/os/freebsd/spl/spl_kstat.c | 38 ++- sys/contrib/openzfs/module/os/freebsd/zfs/dmu_os.c | 4 +- .../openzfs/module/os/freebsd/zfs/zfs_file_os.c | 63 ++++- .../openzfs/module/os/freebsd/zfs/zfs_vfsops.c | 4 - .../openzfs/module/os/freebsd/zfs/zio_crypt.c | 9 +- .../openzfs/module/os/freebsd/zfs/zvol_os.c | 1 + .../openzfs/module/os/linux/spl/spl-condvar.c | 2 +- .../openzfs/module/os/linux/spl/spl-kmem-cache.c | 17 +- .../openzfs/module/os/linux/spl/spl-kstat.c | 1 + .../openzfs/module/os/linux/spl/spl-shrinker.c | 115 ++++++++ .../openzfs/module/os/linux/spl/spl-thread.c | 1 + sys/contrib/openzfs/module/os/linux/spl/spl-zone.c | 1 + sys/contrib/openzfs/module/os/linux/zfs/abd_os.c | 27 +- sys/contrib/openzfs/module/os/linux/zfs/arc_os.c | 11 +- .../openzfs/module/os/linux/zfs/vdev_disk.c | 217 +++++++++----- .../openzfs/module/os/linux/zfs/zfs_ctldir.c | 4 +- .../openzfs/module/os/linux/zfs/zfs_vfsops.c | 10 +- .../openzfs/module/os/linux/zfs/zfs_vnops_os.c | 40 +-- .../openzfs/module/os/linux/zfs/zfs_znode.c | 45 +-- .../openzfs/module/os/linux/zfs/zio_crypt.c | 9 +- .../openzfs/module/os/linux/zfs/zpl_file_range.c | 48 ++-- .../openzfs/module/os/linux/zfs/zpl_inode.c | 3 +- sys/contrib/openzfs/module/os/linux/zfs/zvol_os.c | 2 + sys/contrib/openzfs/module/zfs/abd.c | 104 ++----- sys/contrib/openzfs/module/zfs/arc.c | 30 +- sys/contrib/openzfs/module/zfs/brt.c | 86 +++--- sys/contrib/openzfs/module/zfs/dataset_kstats.c | 12 + sys/contrib/openzfs/module/zfs/dbuf.c | 55 +++- sys/contrib/openzfs/module/zfs/dmu.c | 38 ++- sys/contrib/openzfs/module/zfs/dmu_recv.c | 2 +- sys/contrib/openzfs/module/zfs/dmu_send.c | 2 - sys/contrib/openzfs/module/zfs/dsl_crypt.c | 34 +++ sys/contrib/openzfs/module/zfs/dsl_deadlist.c | 31 +- sys/contrib/openzfs/module/zfs/metaslab.c | 3 - sys/contrib/openzfs/module/zfs/spa.c | 280 +++++++++++++++++- sys/contrib/openzfs/module/zfs/spa_misc.c | 3 +- sys/contrib/openzfs/module/zfs/vdev.c | 40 ++- sys/contrib/openzfs/module/zfs/vdev_label.c | 85 ++++-- sys/contrib/openzfs/module/zfs/vdev_trim.c | 3 +- sys/contrib/openzfs/module/zfs/zfs_replay.c | 50 +++- sys/contrib/openzfs/module/zfs/zfs_vnops.c | 107 +++++-- sys/contrib/openzfs/module/zfs/zil.c | 100 ++++--- sys/contrib/openzfs/module/zfs/zio.c | 57 +++- sys/contrib/openzfs/module/zfs/zio_checksum.c | 16 +- sys/contrib/openzfs/module/zfs/zvol.c | 60 +--- sys/contrib/openzfs/rpm/generic/zfs-kmod.spec.in | 24 ++ sys/contrib/openzfs/rpm/redhat/zfs-kmod.spec.in | 24 ++ sys/contrib/openzfs/tests/Makefile.am | 1 + sys/contrib/openzfs/tests/runfiles/bclone.run | 46 +++ sys/contrib/openzfs/tests/runfiles/common.run | 40 ++- sys/contrib/openzfs/tests/runfiles/linux.run | 11 +- .../openzfs/tests/test-runner/bin/zts-report.py.in | 93 ++++-- sys/contrib/openzfs/tests/zfs-tests/Makefile.am | 3 + sys/contrib/openzfs/tests/zfs-tests/cmd/.gitignore | 2 + .../openzfs/tests/zfs-tests/cmd/Makefile.am | 4 +- .../tests/zfs-tests/cmd/clone_mmap_cached.c | 146 ++++++++++ .../openzfs/tests/zfs-tests/cmd/clone_mmap_write.c | 123 ++++++++ .../openzfs/tests/zfs-tests/cmd/clonefile.c | 82 ++++-- sys/contrib/openzfs/tests/zfs-tests/cmd/ctime.c | 14 +- .../openzfs/tests/zfs-tests/include/commands.cfg | 5 +- .../openzfs/tests/zfs-tests/include/libtest.shlib | 27 +- .../openzfs/tests/zfs-tests/include/math.shlib | 13 +- .../openzfs/tests/zfs-tests/include/tunables.cfg | 3 +- .../openzfs/tests/zfs-tests/tests/Makefile.am | 31 ++ .../tests/zfs-tests/tests/functional/bclone/TODO | 4 + .../zfs-tests/tests/functional/bclone/bclone.cfg | 32 +++ .../tests/functional/bclone/bclone_common.kshlib | 286 +++++++++++++++++++ .../functional/bclone/bclone_corner_cases.kshlib | 315 +++++++++++++++++++++ .../bclone/bclone_crossfs_corner_cases.ksh | 45 +++ .../bclone/bclone_crossfs_corner_cases_limited.ksh | 45 +++ .../functional/bclone/bclone_crossfs_data.ksh | 46 +++ .../functional/bclone/bclone_crossfs_embedded.ksh | 50 ++++ .../functional/bclone/bclone_crossfs_hole.ksh | 45 +++ .../functional/bclone/bclone_diffprops_all.ksh | 86 ++++++ .../bclone/bclone_diffprops_checksum.ksh | 62 ++++ .../bclone/bclone_diffprops_compress.ksh | 59 ++++ .../functional/bclone/bclone_diffprops_copies.ksh | 59 ++++ .../bclone/bclone_diffprops_recordsize.ksh | 65 +++++ .../tests/functional/bclone/bclone_prop_sync.ksh | 66 +++++ .../bclone/bclone_samefs_corner_cases.ksh | 42 +++ .../bclone/bclone_samefs_corner_cases_limited.ksh | 42 +++ .../tests/functional/bclone/bclone_samefs_data.ksh | 44 +++ .../functional/bclone/bclone_samefs_embedded.ksh | 48 ++++ .../tests/functional/bclone/bclone_samefs_hole.ksh | 44 +++ .../zfs-tests/tests/functional/bclone/cleanup.ksh | 44 +++ .../zfs-tests/tests/functional/bclone/setup.ksh | 50 ++++ .../functional/block_cloning/block_cloning.kshlib | 14 +- .../block_cloning_clone_mmap_cached.ksh | 86 ++++++ .../block_cloning_clone_mmap_write.ksh | 79 ++++++ .../block_cloning/block_cloning_copyfilerange.ksh | 2 +- .../block_cloning_copyfilerange_cross_dataset.ksh | 5 +- .../block_cloning_copyfilerange_fallback.ksh | 2 +- ...ock_cloning_copyfilerange_fallback_same_txg.ksh | 2 +- .../block_cloning_copyfilerange_partial.ksh | 2 +- .../block_cloning_cross_enc_dataset.ksh | 169 +++++++++++ .../block_cloning_disabled_copyfilerange.ksh | 2 +- .../block_cloning_lwb_buffer_overflow.ksh | 90 ++++++ .../block_cloning/block_cloning_replay.ksh | 132 +++++++++ .../block_cloning_replay_encrypted.ksh | 134 +++++++++ .../tests/functional/block_cloning/setup.ksh | 3 + .../tests/functional/cache/cache_012_pos.ksh | 20 +- .../cli_root/zfs_share/zfs_share_after_mount.ksh | 62 ++++ .../cli_root/zpool_status/zpool_status_002_pos.ksh | 4 +- .../cli_root/zpool_status/zpool_status_003_pos.ksh | 2 + .../cli_root/zpool_status/zpool_status_008_pos.ksh | 104 +++++++ .../zfs-tests/tests/functional/cp_files/.gitignore | 1 + .../tests/functional/cp_files/cleanup.ksh | 4 + .../tests/functional/cp_files/cp_files_002_pos.ksh | 161 +++++++++++ .../tests/functional/cp_files/cp_stress.ksh | 73 +++++ .../tests/functional/cp_files/seekflood.c | 180 ++++++++++++ .../zfs-tests/tests/functional/cp_files/setup.ksh | 6 + .../zfs-tests/tests/functional/io/io_uring.ksh | 7 + .../tests/functional/redundancy/redundancy.kshlib | 22 -- sys/modules/zfs/zfs_config.h | 50 +++- sys/modules/zfs/zfs_gitrev.h | 2 +- 229 files changed, 6970 insertions(+), 1081 deletions(-) diff --cc sys/contrib/openzfs/.github/codeql-cpp.yml index 000000000000,88b8c6086025..88b8c6086025 mode 000000,100644..100644 --- a/sys/contrib/openzfs/.github/codeql-cpp.yml +++ b/sys/contrib/openzfs/.github/codeql-cpp.yml diff --cc sys/contrib/openzfs/.github/codeql-python.yml index 000000000000,93cb4a435ed9..93cb4a435ed9 mode 000000,100644..100644 --- a/sys/contrib/openzfs/.github/codeql-python.yml +++ b/sys/contrib/openzfs/.github/codeql-python.yml diff --cc sys/contrib/openzfs/.github/codeql/custom-queries/cpp/deprecatedFunctionUsage.ql index 000000000000,eb4b7bd6299b..eb4b7bd6299b mode 000000,100644..100644 --- a/sys/contrib/openzfs/.github/codeql/custom-queries/cpp/deprecatedFunctionUsage.ql +++ b/sys/contrib/openzfs/.github/codeql/custom-queries/cpp/deprecatedFunctionUsage.ql diff --cc sys/contrib/openzfs/.github/codeql/custom-queries/cpp/qlpack.yml index 000000000000,cbe0f1cbe3c4..cbe0f1cbe3c4 mode 000000,100644..100644 --- a/sys/contrib/openzfs/.github/codeql/custom-queries/cpp/qlpack.yml +++ b/sys/contrib/openzfs/.github/codeql/custom-queries/cpp/qlpack.yml diff --cc sys/contrib/openzfs/config/kernel-strlcpy.m4 index 000000000000,c31cf52d78b0..c31cf52d78b0 mode 000000,100644..100644 --- a/sys/contrib/openzfs/config/kernel-strlcpy.m4 +++ b/sys/contrib/openzfs/config/kernel-strlcpy.m4 diff --cc sys/contrib/openzfs/module/os/linux/spl/spl-shrinker.c index 000000000000,d5c8da471cbb..d5c8da471cbb mode 000000,100644..100644 --- a/sys/contrib/openzfs/module/os/linux/spl/spl-shrinker.c +++ b/sys/contrib/openzfs/module/os/linux/spl/spl-shrinker.c diff --cc sys/contrib/openzfs/tests/runfiles/bclone.run index 000000000000,3d0f545d9226..3d0f545d9226 mode 000000,100644..100644 --- a/sys/contrib/openzfs/tests/runfiles/bclone.run +++ b/sys/contrib/openzfs/tests/runfiles/bclone.run diff --cc sys/contrib/openzfs/tests/zfs-tests/cmd/clone_mmap_cached.c index 000000000000,c1cdf796cfb4..c1cdf796cfb4 mode 000000,100644..100644 --- a/sys/contrib/openzfs/tests/zfs-tests/cmd/clone_mmap_cached.c +++ b/sys/contrib/openzfs/tests/zfs-tests/cmd/clone_mmap_cached.c diff --cc sys/contrib/openzfs/tests/zfs-tests/cmd/clone_mmap_write.c index 000000000000,6a5cd8721c57..6a5cd8721c57 mode 000000,100644..100644 --- a/sys/contrib/openzfs/tests/zfs-tests/cmd/clone_mmap_write.c +++ b/sys/contrib/openzfs/tests/zfs-tests/cmd/clone_mmap_write.c diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/TODO index 000000000000,7cd4ee898fc4..7cd4ee898fc4 mode 000000,100644..100644 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/TODO +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/TODO diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone.cfg index 000000000000,f72d17c1beca..f72d17c1beca mode 000000,100644..100644 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone.cfg +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone.cfg diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_common.kshlib index 000000000000,3b8eaea5bb54..3b8eaea5bb54 mode 000000,100644..100644 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_common.kshlib +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_common.kshlib diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_corner_cases.kshlib index 000000000000,ddfbfc999c4e..ddfbfc999c4e mode 000000,100644..100644 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_corner_cases.kshlib +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_corner_cases.kshlib diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_crossfs_corner_cases.ksh index 000000000000,35188cddb063..35188cddb063 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_crossfs_corner_cases.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_crossfs_corner_cases.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_crossfs_corner_cases_limited.ksh index 000000000000,1fc1bbd07fd9..1fc1bbd07fd9 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_crossfs_corner_cases_limited.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_crossfs_corner_cases_limited.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_crossfs_data.ksh index 000000000000,e2fe25d451dd..e2fe25d451dd mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_crossfs_data.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_crossfs_data.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_crossfs_embedded.ksh index 000000000000,6a6fe1d309a9..6a6fe1d309a9 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_crossfs_embedded.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_crossfs_embedded.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_crossfs_hole.ksh index 000000000000,d4c33d6da30f..d4c33d6da30f mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_crossfs_hole.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_crossfs_hole.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_diffprops_all.ksh index 000000000000,a5e7282fe6a8..a5e7282fe6a8 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_diffprops_all.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_diffprops_all.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_diffprops_checksum.ksh index 000000000000,7e064a0dfd73..7e064a0dfd73 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_diffprops_checksum.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_diffprops_checksum.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_diffprops_compress.ksh index 000000000000,e1d6e5949218..e1d6e5949218 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_diffprops_compress.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_diffprops_compress.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_diffprops_copies.ksh index 000000000000,ac823e1ec394..ac823e1ec394 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_diffprops_copies.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_diffprops_copies.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_diffprops_recordsize.ksh index 000000000000,d833e6123106..d833e6123106 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_diffprops_recordsize.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_diffprops_recordsize.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_prop_sync.ksh index 000000000000,f8aa1c875c60..f8aa1c875c60 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_prop_sync.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_prop_sync.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_samefs_corner_cases.ksh index 000000000000,4aa2914da299..4aa2914da299 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_samefs_corner_cases.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_samefs_corner_cases.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_samefs_corner_cases_limited.ksh index 000000000000,b4737700eb7d..b4737700eb7d mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_samefs_corner_cases_limited.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_samefs_corner_cases_limited.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_samefs_data.ksh index 000000000000,e964f7bbf641..e964f7bbf641 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_samefs_data.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_samefs_data.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_samefs_embedded.ksh index 000000000000,df393a878015..df393a878015 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_samefs_embedded.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_samefs_embedded.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_samefs_hole.ksh index 000000000000,3c6e345e6e64..3c6e345e6e64 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_samefs_hole.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/bclone_samefs_hole.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/cleanup.ksh index 000000000000,0021ccb57ae0..0021ccb57ae0 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/cleanup.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/cleanup.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/setup.ksh index 000000000000,9d26088c5a8a..9d26088c5a8a mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/setup.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/bclone/setup.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/block_cloning/block_cloning_clone_mmap_cached.ksh index 000000000000,b0ef8ec99533..b0ef8ec99533 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/block_cloning/block_cloning_clone_mmap_cached.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/block_cloning/block_cloning_clone_mmap_cached.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/block_cloning/block_cloning_clone_mmap_write.ksh index 000000000000,6215b3178e7e..6215b3178e7e mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/block_cloning/block_cloning_clone_mmap_write.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/block_cloning/block_cloning_clone_mmap_write.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/block_cloning/block_cloning_cross_enc_dataset.ksh index 000000000000,702e23267f7e..702e23267f7e mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/block_cloning/block_cloning_cross_enc_dataset.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/block_cloning/block_cloning_cross_enc_dataset.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/block_cloning/block_cloning_lwb_buffer_overflow.ksh index 000000000000,919f320dea3f..919f320dea3f mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/block_cloning/block_cloning_lwb_buffer_overflow.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/block_cloning/block_cloning_lwb_buffer_overflow.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/block_cloning/block_cloning_replay.ksh index 000000000000,530152004686..530152004686 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/block_cloning/block_cloning_replay.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/block_cloning/block_cloning_replay.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/block_cloning/block_cloning_replay_encrypted.ksh index 000000000000,0967415b7b7b..0967415b7b7b mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/block_cloning/block_cloning_replay_encrypted.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/block_cloning/block_cloning_replay_encrypted.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_after_mount.ksh index 000000000000,0d4b66ea854c..0d4b66ea854c mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_after_mount.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_after_mount.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_008_pos.ksh index 000000000000,6be2ad5a7410..6be2ad5a7410 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_008_pos.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_status/zpool_status_008_pos.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cp_files/.gitignore index 000000000000,d15225ac8429..d15225ac8429 mode 000000,100644..100644 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cp_files/.gitignore +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cp_files/.gitignore diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cp_files/cp_files_002_pos.ksh index 000000000000,60817449ab03..60817449ab03 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cp_files/cp_files_002_pos.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cp_files/cp_files_002_pos.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cp_files/cp_stress.ksh index 000000000000,43bb8ab572d2..43bb8ab572d2 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cp_files/cp_stress.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cp_files/cp_stress.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cp_files/seekflood.c index 000000000000,02c2c8e6eca5..02c2c8e6eca5 mode 000000,100644..100644 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cp_files/seekflood.c +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cp_files/seekflood.c diff --cc sys/modules/zfs/zfs_config.h index 8fc8a9541740,000000000000..fe8580263185 mode 100644,000000..100644 --- a/sys/modules/zfs/zfs_config.h +++ b/sys/modules/zfs/zfs_config.h @@@ -1,1149 -1,0 +1,1191 @@@ +/* + */ + +/* zfs_config.h. Generated from zfs_config.h.in by configure. */ +/* zfs_config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +/* #undef ENABLE_NLS */ + +/* bio_end_io_t wants 1 arg */ +/* #undef HAVE_1ARG_BIO_END_IO_T */ + +/* lookup_bdev() wants 1 arg */ +/* #undef HAVE_1ARG_LOOKUP_BDEV */ + +/* submit_bio() wants 1 arg */ +/* #undef HAVE_1ARG_SUBMIT_BIO */ + +/* bdi_setup_and_register() wants 2 args */ +/* #undef HAVE_2ARGS_BDI_SETUP_AND_REGISTER */ + +/* vfs_getattr wants 2 args */ +/* #undef HAVE_2ARGS_VFS_GETATTR */ + +/* zlib_deflate_workspacesize() wants 2 args */ +/* #undef HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE */ + +/* bdi_setup_and_register() wants 3 args */ +/* #undef HAVE_3ARGS_BDI_SETUP_AND_REGISTER */ + +/* vfs_getattr wants 3 args */ +/* #undef HAVE_3ARGS_VFS_GETATTR */ + +/* vfs_getattr wants 4 args */ +/* #undef HAVE_4ARGS_VFS_GETATTR */ + +/* kernel has access_ok with 'type' parameter */ +/* #undef HAVE_ACCESS_OK_TYPE */ + +/* posix_acl has refcount_t */ +/* #undef HAVE_ACL_REFCOUNT */ + +/* add_disk() returns int */ +/* #undef HAVE_ADD_DISK_RET */ + +/* Define if host toolchain supports AES */ +#define HAVE_AES 1 + +/* Define if you have [rt] */ +#define HAVE_AIO_H 1 + +#ifdef __amd64__ +#ifndef RESCUE +/* Define if host toolchain supports AVX */ +#define HAVE_AVX 1 +#endif + +/* Define if host toolchain supports AVX2 */ +#define HAVE_AVX2 1 + +/* Define if host toolchain supports AVX512BW */ +#define HAVE_AVX512BW 1 + +/* Define if host toolchain supports AVX512CD */ +#define HAVE_AVX512CD 1 + +/* Define if host toolchain supports AVX512DQ */ +#define HAVE_AVX512DQ 1 + +/* Define if host toolchain supports AVX512ER */ +#define HAVE_AVX512ER 1 + +/* Define if host toolchain supports AVX512F */ +#define HAVE_AVX512F 1 + +/* Define if host toolchain supports AVX512IFMA */ +#define HAVE_AVX512IFMA 1 + +/* Define if host toolchain supports AVX512PF */ +#define HAVE_AVX512PF 1 + +/* Define if host toolchain supports AVX512VBMI */ +#define HAVE_AVX512VBMI 1 + +/* Define if host toolchain supports AVX512VL */ +#define HAVE_AVX512VL 1 +#endif + +/* bdevname() is available */ +/* #undef HAVE_BDEVNAME */ + +/* bdev_check_media_change() exists */ +/* #undef HAVE_BDEV_CHECK_MEDIA_CHANGE */ + +/* bdev_*_io_acct() available */ +/* #undef HAVE_BDEV_IO_ACCT_63 */ + +/* bdev_*_io_acct() available */ +/* #undef HAVE_BDEV_IO_ACCT_OLD */ + +/* bdev_kobj() exists */ +/* #undef HAVE_BDEV_KOBJ */ + +/* bdev_max_discard_sectors() is available */ +/* #undef HAVE_BDEV_MAX_DISCARD_SECTORS */ + +/* bdev_max_secure_erase_sectors() is available */ +/* #undef HAVE_BDEV_MAX_SECURE_ERASE_SECTORS */ + ++/* bdev_open_by_path() exists */ ++/* #undef HAVE_BDEV_OPEN_BY_PATH */ ++ ++/* bdev_release() exists */ ++/* #undef HAVE_BDEV_RELEASE */ ++ +/* block_device_operations->submit_bio() returns void */ +/* #undef HAVE_BDEV_SUBMIT_BIO_RETURNS_VOID */ + +/* bdev_whole() is available */ +/* #undef HAVE_BDEV_WHOLE */ + +/* bio_alloc() takes 4 arguments */ +/* #undef HAVE_BIO_ALLOC_4ARG */ + +/* bio->bi_bdev->bd_disk exists */ +/* #undef HAVE_BIO_BDEV_DISK */ + +/* bio->bi_opf is defined */ +/* #undef HAVE_BIO_BI_OPF */ + +/* bio->bi_status exists */ +/* #undef HAVE_BIO_BI_STATUS */ + +/* bio has bi_iter */ +/* #undef HAVE_BIO_BVEC_ITER */ + +/* bio_*_io_acct() available */ +/* #undef HAVE_BIO_IO_ACCT */ + +/* bio_max_segs() is implemented */ +/* #undef HAVE_BIO_MAX_SEGS */ + +/* bio_set_dev() is available */ +/* #undef HAVE_BIO_SET_DEV */ + +/* bio_set_dev() GPL-only */ +/* #undef HAVE_BIO_SET_DEV_GPL_ONLY */ + +/* bio_set_dev() is a macro */ +/* #undef HAVE_BIO_SET_DEV_MACRO */ + +/* bio_set_op_attrs is available */ +/* #undef HAVE_BIO_SET_OP_ATTRS */ + +/* blkdev_get_by_path() exists and takes 4 args */ +/* #undef HAVE_BLKDEV_GET_BY_PATH_4ARG */ + +/* blkdev_get_by_path() handles ERESTARTSYS */ +/* #undef HAVE_BLKDEV_GET_ERESTARTSYS */ + +/* blkdev_issue_discard() is available */ +/* #undef HAVE_BLKDEV_ISSUE_DISCARD */ + ++/* __blkdev_issue_discard() is available */ ++/* #undef HAVE_BLKDEV_ISSUE_DISCARD_ASYNC */ ++ +/* blkdev_issue_secure_erase() is available */ +/* #undef HAVE_BLKDEV_ISSUE_SECURE_ERASE */ + +/* blkdev_put() accepts void* as arg 2 */ +/* #undef HAVE_BLKDEV_PUT_HOLDER */ + +/* blkdev_reread_part() exists */ +/* #undef HAVE_BLKDEV_REREAD_PART */ + +/* blkg_tryget() is available */ +/* #undef HAVE_BLKG_TRYGET */ + +/* blkg_tryget() GPL-only */ +/* #undef HAVE_BLKG_TRYGET_GPL_ONLY */ + +/* blk_alloc_disk() exists */ +/* #undef HAVE_BLK_ALLOC_DISK */ + +/* blk_alloc_queue() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN */ + +/* blk_alloc_queue_rh() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN_RH */ + +/* blk_cleanup_disk() exists */ +/* #undef HAVE_BLK_CLEANUP_DISK */ + +/* blk_mode_t is defined */ +/* #undef HAVE_BLK_MODE_T */ + +/* block multiqueue is available */ +/* #undef HAVE_BLK_MQ */ + +/* blk queue backing_dev_info is dynamic */ +/* #undef HAVE_BLK_QUEUE_BDI_DYNAMIC */ + +/* blk_queue_discard() is available */ +/* #undef HAVE_BLK_QUEUE_DISCARD */ + +/* blk_queue_flag_clear() exists */ +/* #undef HAVE_BLK_QUEUE_FLAG_CLEAR */ + +/* blk_queue_flag_set() exists */ +/* #undef HAVE_BLK_QUEUE_FLAG_SET */ + +/* blk_queue_flush() is available */ +/* #undef HAVE_BLK_QUEUE_FLUSH */ + +/* blk_queue_flush() is GPL-only */ +/* #undef HAVE_BLK_QUEUE_FLUSH_GPL_ONLY */ + +/* blk_queue_secdiscard() is available */ +/* #undef HAVE_BLK_QUEUE_SECDISCARD */ + +/* blk_queue_secure_erase() is available */ +/* #undef HAVE_BLK_QUEUE_SECURE_ERASE */ + +/* blk_queue_update_readahead() exists */ +/* #undef HAVE_BLK_QUEUE_UPDATE_READAHEAD */ + +/* blk_queue_write_cache() exists */ +/* #undef HAVE_BLK_QUEUE_WRITE_CACHE */ + +/* blk_queue_write_cache() is GPL-only */ +/* #undef HAVE_BLK_QUEUE_WRITE_CACHE_GPL_ONLY */ + +/* BLK_STS_RESV_CONFLICT is defined */ +/* #undef HAVE_BLK_STS_RESV_CONFLICT */ + +/* Define if release() in block_device_operations takes 1 arg */ +/* #undef HAVE_BLOCK_DEVICE_OPERATIONS_RELEASE_1ARG */ + +/* Define if revalidate_disk() in block_device_operations */ +/* #undef HAVE_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK */ + +/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYCURRENT */ + +/* Define to 1 if you have the Mac OS X function + CFLocaleCopyPreferredLanguages in the CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES */ + +/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ + +/* check_disk_change() exists */ +/* #undef HAVE_CHECK_DISK_CHANGE */ + +/* clear_inode() is available */ +/* #undef HAVE_CLEAR_INODE */ + +/* dentry uses const struct dentry_operations */ +/* #undef HAVE_CONST_DENTRY_OPERATIONS */ + +/* copy_from_iter() is available */ +/* #undef HAVE_COPY_FROM_ITER */ + +/* copy_splice_read exists */ +/* #undef HAVE_COPY_SPLICE_READ */ + +/* copy_to_iter() is available */ +/* #undef HAVE_COPY_TO_ITER */ + +/* cpu_has_feature() is GPL-only */ +/* #undef HAVE_CPU_HAS_FEATURE_GPL_ONLY */ + +/* yes */ +/* #undef HAVE_CPU_HOTPLUG */ + +/* current_time() exists */ +/* #undef HAVE_CURRENT_TIME */ + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +/* #undef HAVE_DCGETTEXT */ + +/* DECLARE_EVENT_CLASS() is available */ +/* #undef HAVE_DECLARE_EVENT_CLASS */ + +/* dentry aliases are in d_u member */ +/* #undef HAVE_DENTRY_D_U_ALIASES */ + +/* dequeue_signal() takes 4 arguments */ +/* #undef HAVE_DEQUEUE_SIGNAL_4ARG */ + +/* lookup_bdev() wants dev_t arg */ +/* #undef HAVE_DEVT_LOOKUP_BDEV */ + +/* sops->dirty_inode() wants flags */ +/* #undef HAVE_DIRTY_INODE_WITH_FLAGS */ + +/* disk_check_media_change() exists */ +/* #undef HAVE_DISK_CHECK_MEDIA_CHANGE */ + +/* disk_*_io_acct() available */ +/* #undef HAVE_DISK_IO_ACCT */ + +/* disk_update_readahead() exists */ +/* #undef HAVE_DISK_UPDATE_READAHEAD */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* d_make_root() is available */ +/* #undef HAVE_D_MAKE_ROOT */ + +/* d_prune_aliases() is available */ +/* #undef HAVE_D_PRUNE_ALIASES */ + +/* dops->d_revalidate() operation takes nameidata */ +/* #undef HAVE_D_REVALIDATE_NAMEIDATA */ + +/* eops->encode_fh() wants child and parent inodes */ +/* #undef HAVE_ENCODE_FH_WITH_INODE */ + +/* sops->evict_inode() exists */ +/* #undef HAVE_EVICT_INODE */ + +/* FALLOC_FL_ZERO_RANGE is defined */ +/* #undef HAVE_FALLOC_FL_ZERO_RANGE */ + +/* fault_in_iov_iter_readable() is available */ +/* #undef HAVE_FAULT_IN_IOV_ITER_READABLE */ + +/* filemap_range_has_page() is available */ +/* #undef HAVE_FILEMAP_RANGE_HAS_PAGE */ + +/* fops->aio_fsync() exists */ +/* #undef HAVE_FILE_AIO_FSYNC */ + +/* file_dentry() is available */ +/* #undef HAVE_FILE_DENTRY */ + +/* fops->fadvise() exists */ +/* #undef HAVE_FILE_FADVISE */ + +/* file_inode() is available */ +/* #undef HAVE_FILE_INODE */ + +/* flush_dcache_page() is GPL-only */ +/* #undef HAVE_FLUSH_DCACHE_PAGE_GPL_ONLY */ + +/* iops->follow_link() cookie */ +/* #undef HAVE_FOLLOW_LINK_COOKIE */ + +/* iops->follow_link() nameidata */ +/* #undef HAVE_FOLLOW_LINK_NAMEIDATA */ + +/* Define if compiler supports -Wformat-overflow */ +/* #undef HAVE_FORMAT_OVERFLOW */ + +/* fsync_bdev() is declared in include/blkdev.h */ +/* #undef HAVE_FSYNC_BDEV */ + +/* fops->fsync() with range */ +/* #undef HAVE_FSYNC_RANGE */ + +/* fops->fsync() without dentry */ +/* #undef HAVE_FSYNC_WITHOUT_DENTRY */ + +/* yes */ +/* #undef HAVE_GENERIC_FADVISE */ + +/* generic_fillattr requires struct mnt_idmap* */ +/* #undef HAVE_GENERIC_FILLATTR_IDMAP */ + +/* generic_fillattr requires struct mnt_idmap* and u32 request_mask */ +/* #undef HAVE_GENERIC_FILLATTR_IDMAP_REQMASK */ + +/* generic_fillattr requires struct user_namespace* */ +/* #undef HAVE_GENERIC_FILLATTR_USERNS */ + +/* generic_*_io_acct() 3 arg available */ +/* #undef HAVE_GENERIC_IO_ACCT_3ARG */ + +/* generic_*_io_acct() 4 arg available */ +/* #undef HAVE_GENERIC_IO_ACCT_4ARG */ + +/* generic_readlink is global */ +/* #undef HAVE_GENERIC_READLINK */ + +/* generic_setxattr() exists */ +/* #undef HAVE_GENERIC_SETXATTR */ + +/* generic_write_checks() takes kiocb */ +/* #undef HAVE_GENERIC_WRITE_CHECKS_KIOCB */ + +/* Define if the GNU gettext() function is already present or preinstalled. */ +/* #undef HAVE_GETTEXT */ + +/* iops->get_acl() exists */ +/* #undef HAVE_GET_ACL */ + +/* iops->get_acl() takes rcu */ +/* #undef HAVE_GET_ACL_RCU */ + +/* has iops->get_inode_acl() */ +/* #undef HAVE_GET_INODE_ACL */ + +/* iops->get_link() cookie */ +/* #undef HAVE_GET_LINK_COOKIE */ + +/* iops->get_link() delayed */ +/* #undef HAVE_GET_LINK_DELAYED */ + +/* group_info->gid exists */ +/* #undef HAVE_GROUP_INFO_GID */ + +/* has_capability() is available */ +/* #undef HAVE_HAS_CAPABILITY */ + +/* iattr->ia_vfsuid and iattr->ia_vfsgid exist */ +/* #undef HAVE_IATTR_VFSID */ + +/* Define if you have the iconv() function and it works. */ +#define HAVE_ICONV 1 + +/* iops->getattr() takes struct mnt_idmap* */ +/* #undef HAVE_IDMAP_IOPS_GETATTR */ + +/* iops->setattr() takes struct mnt_idmap* */ +/* #undef HAVE_IDMAP_IOPS_SETATTR */ + +/* APIs for idmapped mount are present */ +/* #undef HAVE_IDMAP_MNT_API */ + ++/* mnt_idmap does not have user_namespace */ ++/* #undef HAVE_IDMAP_NO_USERNS */ ++ +/* Define if compiler supports -Wimplicit-fallthrough */ +/* #undef HAVE_IMPLICIT_FALLTHROUGH */ + +/* Define if compiler supports -Winfinite-recursion */ +/* #undef HAVE_INFINITE_RECURSION */ + ++/* inode_get_atime() exists in linux/fs.h */ ++/* #undef HAVE_INODE_GET_ATIME */ ++ +/* inode_get_ctime() exists in linux/fs.h */ +/* #undef HAVE_INODE_GET_CTIME */ + ++/* inode_get_mtime() exists in linux/fs.h */ ++/* #undef HAVE_INODE_GET_MTIME */ ++ +/* yes */ +/* #undef HAVE_INODE_LOCK_SHARED */ + +/* inode_owner_or_capable() exists */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE */ + +/* inode_owner_or_capable() takes mnt_idmap */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE_IDMAP */ + +/* inode_owner_or_capable() takes user_ns */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE_USERNS */ + ++/* inode_set_atime_to_ts() exists in linux/fs.h */ ++/* #undef HAVE_INODE_SET_ATIME_TO_TS */ ++ +/* inode_set_ctime_to_ts() exists in linux/fs.h */ *** 734 LINES SKIPPED *** From nobody Fri Feb 23 22:26:44 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ThPkY2fyVz5Bdgx; Fri, 23 Feb 2024 22:26:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ThPkY2H99z4B82; Fri, 23 Feb 2024 22:26:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708727205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IzyQvpJiwToR1Zh+6ks9MryI9Ttf8AukbjVJN2tJoTc=; b=BsPVYJQwWd/glMJZihoGeAGx8BL/hQAlN68a8ccpsUAgahu8VAxBSx6oSwi6EgfzVDMGow 8YxFvHj7lq7O4PhGHU27TCGKUKdVe/tqcK04NHbfXk2BPkG+M8NgwS/U7ro5SZKJSgsoRR OuEhiO3GiIlA3a8TNn/KDZjyBPViWYEWUe5XvcOcnw7hIYH7lgcRL0RcK6RugtFzkbjJ+g r2aRIYxrz82HMQbARrjFQaSL/zDTs9LwcMw8/UOoBAZs20OLPNksmD1lvgMxYXHfaZRWXP pO+l+LUC/uRdbR8RePPA+S9vSvZD20wQYDLCtp4qySLlE3bVxfKsxo53NsC7sQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708727205; a=rsa-sha256; cv=none; b=LfwdqHlu1+V+ID1FSvy9l+QkpE2kLoJEPEhM8b7yRvsN1qsN8MQTMYEUDXEUAnSLj86Z/3 V5wYMuKrlNsG/I7TO5GA0x6JbKL/9J52U5OKOS5fBJFBQHmvFbgag+/j6IZseM8k06N9b5 b7Fehyq65jz8SMlkyPx7rAcOEaTlKDdZHHsivvhHQ4HdkungY9InFKjelhUvawykkv+im0 4czOV3zLIfI8OLMwGKqHyYy/ybkibEbVbt+6tsJG4BGb+9yjnKNDMBc3DqpHAivbRSugMk 0p9wsvMnUi/KkuLpMMSMZoXTJa8dzlX2iL21zzTq3hVt4kdqxTS/FAh9xXqS9Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708727205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IzyQvpJiwToR1Zh+6ks9MryI9Ttf8AukbjVJN2tJoTc=; b=HzLIJ7ZuG3R0hyRq4YFooPjk1i78opg+ukw6q+qeA2MroTfprVA/Jm/YMayP/1a9QZt6cI bOpNqfIdGzNSbVjO76CJXm7eZrhswl+hLaxFvebnnHpsEDMgCepV2uIaqi1wdpas8CfJ5t To0OorLHqzkd1M8GZr9fFBobsMMamVJYAbujTC0bqzhrYCGcY5t3bqhyNmIMncfjus8VzL xi4rKVEMGhMAXShwbB7PU+CdixmNPXNhKaff2Wu+LtgC5h3eY+31AucU4NqbJSdUR8Begy E9WkhrYP8LTq4Tq+WlwHmewhPq1Q626MMDSFp0wfMWrlWrdyFolaYvHK4SVwEw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ThPkY17vdzZhr; Fri, 23 Feb 2024 22:26:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41NMQjbd077396; Fri, 23 Feb 2024 22:26:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41NMQiJs077393; Fri, 23 Feb 2024 22:26:44 GMT (envelope-from git) Date: Fri, 23 Feb 2024 22:26:44 GMT Message-Id: <202402232226.41NMQiJs077393@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: b33556f035b4 - releng/13.3 - irdma(4): Upgrade to 1.2.36-k List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/releng/13.3 X-Git-Reftype: branch X-Git-Commit: b33556f035b4cf78b848f256d6218f49ab99c509 Auto-Submitted: auto-generated The branch releng/13.3 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=b33556f035b4cf78b848f256d6218f49ab99c509 commit b33556f035b4cf78b848f256d6218f49ab99c509 Author: Bartosz Sobczak AuthorDate: 2024-02-16 21:55:08 +0000 Commit: Eric Joyner CommitDate: 2024-02-23 22:25:31 +0000 irdma(4): Upgrade to 1.2.36-k Update Intel irdma driver to version 1.2.36-k. Notable changes: - Start using ib_sge directly instead of irdma_sge - Turn off flush completion generator for libirdma - Minor formatting changes Signed-off-by: Bartosz Sobczak Signed-off-by: Eric Joyner Reviewed by: erj@ Approved by: re (cperciva@) Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D43567 (cherry picked from commit 5b5f7d0e77a9eee73eb5d596f43aef4e1a3674d8) (cherry picked from commit a4510dafa8045bfa521303db7f23123a47d8749f) --- contrib/ofed/libirdma/abi.h | 8 +- contrib/ofed/libirdma/irdma-abi.h | 11 ++ contrib/ofed/libirdma/irdma.h | 1 - contrib/ofed/libirdma/irdma_defs.h | 13 --- contrib/ofed/libirdma/irdma_uk.c | 106 ++++++++---------- contrib/ofed/libirdma/irdma_umain.c | 2 +- contrib/ofed/libirdma/irdma_umain.h | 2 - contrib/ofed/libirdma/irdma_user.h | 198 ++-------------------------------- contrib/ofed/libirdma/irdma_uverbs.c | 89 +++++---------- contrib/ofed/libirdma/osdep.h | 1 - sys/dev/irdma/fbsd_kcompat.c | 5 +- sys/dev/irdma/fbsd_kcompat.h | 25 ++--- sys/dev/irdma/icrdma.c | 2 +- sys/dev/irdma/icrdma_hw.c | 7 +- sys/dev/irdma/icrdma_hw.h | 3 +- sys/dev/irdma/irdma-abi.h | 11 ++ sys/dev/irdma/irdma.h | 2 +- sys/dev/irdma/irdma_cm.c | 47 ++++---- sys/dev/irdma/irdma_cm.h | 2 +- sys/dev/irdma/irdma_ctrl.c | 99 ++++++++++------- sys/dev/irdma/irdma_defs.h | 3 - sys/dev/irdma/irdma_hw.c | 43 +++++--- sys/dev/irdma/irdma_kcompat.c | 96 +++++++---------- sys/dev/irdma/irdma_main.h | 13 ++- sys/dev/irdma/irdma_pble.h | 2 +- sys/dev/irdma/irdma_protos.h | 2 +- sys/dev/irdma/irdma_puda.c | 8 +- sys/dev/irdma/irdma_type.h | 29 +++-- sys/dev/irdma/irdma_uda.c | 2 +- sys/dev/irdma/irdma_uda.h | 3 +- sys/dev/irdma/irdma_uk.c | 80 +++++++------- sys/dev/irdma/irdma_user.h | 35 +++--- sys/dev/irdma/irdma_utils.c | 53 +++------ sys/dev/irdma/irdma_verbs.c | 202 ++++++++--------------------------- sys/dev/irdma/irdma_verbs.h | 4 +- sys/dev/irdma/irdma_ws.c | 4 +- sys/dev/irdma/irdma_ws.h | 2 +- 37 files changed, 424 insertions(+), 791 deletions(-) diff --git a/contrib/ofed/libirdma/abi.h b/contrib/ofed/libirdma/abi.h index 1d84fbc747f6..a3e159828bec 100644 --- a/contrib/ofed/libirdma/abi.h +++ b/contrib/ofed/libirdma/abi.h @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB * - * Copyright (C) 2019 - 2022 Intel Corporation + * Copyright (C) 2019 - 2023 Intel Corporation * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU @@ -85,6 +85,7 @@ struct irdma_ucreate_qp { struct ibv_create_qp ibv_cmd; __aligned_u64 user_wqe_bufs; __aligned_u64 user_compl_ctx; + __aligned_u64 comp_mask; }; struct irdma_ucreate_qp_resp { @@ -97,6 +98,9 @@ struct irdma_ucreate_qp_resp { __u8 lsmm; __u8 rsvd; __u32 qp_caps; + __aligned_u64 comp_mask; + __u8 start_wqe_idx; + __u8 rsvd2[7]; }; struct irdma_umodify_qp_resp { @@ -137,6 +141,8 @@ struct irdma_get_context_resp { __u8 hw_rev; __u8 rsvd2; __aligned_u64 comp_mask; + __u16 min_hw_wq_size; + __u8 rsvd3[6]; }; struct irdma_ureg_mr { diff --git a/contrib/ofed/libirdma/irdma-abi.h b/contrib/ofed/libirdma/irdma-abi.h index 8c04dcce2e8b..ae805919ea55 100644 --- a/contrib/ofed/libirdma/irdma-abi.h +++ b/contrib/ofed/libirdma/irdma-abi.h @@ -54,6 +54,11 @@ enum irdma_memreg_type { enum { IRDMA_ALLOC_UCTX_USE_RAW_ATTR = 1 << 0, + IRDMA_ALLOC_UCTX_MIN_HW_WQ_SIZE = 1 << 1, +}; + +enum { + IRDMA_CREATE_QP_USE_START_WQE_IDX = 1 << 0, }; struct irdma_alloc_ucontext_req { @@ -82,6 +87,8 @@ struct irdma_alloc_ucontext_resp { __u8 hw_rev; __u8 rsvd2; __aligned_u64 comp_mask; + __u16 min_hw_wq_size; + __u8 rsvd3[6]; }; struct irdma_alloc_pd_resp { @@ -101,6 +108,7 @@ struct irdma_create_cq_req { struct irdma_create_qp_req { __aligned_u64 user_wqe_bufs; __aligned_u64 user_compl_ctx; + __aligned_u64 comp_mask; }; struct irdma_mem_reg_req { @@ -130,6 +138,9 @@ struct irdma_create_qp_resp { __u8 lsmm; __u8 rsvd; __u32 qp_caps; + __aligned_u64 comp_mask; + __u8 start_wqe_idx; + __u8 rsvd2[7]; }; struct irdma_modify_qp_resp { diff --git a/contrib/ofed/libirdma/irdma.h b/contrib/ofed/libirdma/irdma.h index 0e2a5189acd1..f4a5a4796f82 100644 --- a/contrib/ofed/libirdma/irdma.h +++ b/contrib/ofed/libirdma/irdma.h @@ -46,7 +46,6 @@ enum irdma_vers { IRDMA_GEN_RSVD = 0, IRDMA_GEN_1 = 1, IRDMA_GEN_2 = 2, - IRDMA_GEN_MAX = 2, }; struct irdma_uk_attrs { diff --git a/contrib/ofed/libirdma/irdma_defs.h b/contrib/ofed/libirdma/irdma_defs.h index da9eea472568..39d4e7772c31 100644 --- a/contrib/ofed/libirdma/irdma_defs.h +++ b/contrib/ofed/libirdma/irdma_defs.h @@ -456,19 +456,6 @@ enum irdma_qp_wqe_size { IRDMA_WQE_SIZE_256 = 256, }; -enum irdma_ws_op_type { - IRDMA_WS_OP_TYPE_NODE = 0, - IRDMA_WS_OP_TYPE_LEAF_NODE_GROUP, -}; - -enum irdma_ws_rate_limit_flags { - IRDMA_WS_RATE_LIMIT_FLAGS_VALID = 0x1, - IRDMA_WS_NO_RDMA_RATE_LIMIT = 0x2, - IRDMA_WS_LEAF_NODE_IS_PART_GROUP = 0x4, - IRDMA_WS_TREE_RATE_LIMITING = 0x8, - IRDMA_WS_PACING_CONTROL = 0x10, -}; - /** * set_64bit_val - set 64 bit value to hw wqe * @wqe_words: wqe addr to write diff --git a/contrib/ofed/libirdma/irdma_uk.c b/contrib/ofed/libirdma/irdma_uk.c index 5fa9d792745f..115c5f0a27f0 100644 --- a/contrib/ofed/libirdma/irdma_uk.c +++ b/contrib/ofed/libirdma/irdma_uk.c @@ -45,16 +45,16 @@ * @valid: The wqe valid */ static void -irdma_set_fragment(__le64 * wqe, u32 offset, struct irdma_sge *sge, +irdma_set_fragment(__le64 * wqe, u32 offset, struct ibv_sge *sge, u8 valid) { if (sge) { set_64bit_val(wqe, offset, - FIELD_PREP(IRDMAQPSQ_FRAG_TO, sge->tag_off)); + FIELD_PREP(IRDMAQPSQ_FRAG_TO, sge->addr)); set_64bit_val(wqe, offset + IRDMA_BYTE_8, FIELD_PREP(IRDMAQPSQ_VALID, valid) | - FIELD_PREP(IRDMAQPSQ_FRAG_LEN, sge->len) | - FIELD_PREP(IRDMAQPSQ_FRAG_STAG, sge->stag)); + FIELD_PREP(IRDMAQPSQ_FRAG_LEN, sge->length) | + FIELD_PREP(IRDMAQPSQ_FRAG_STAG, sge->lkey)); } else { set_64bit_val(wqe, offset, 0); set_64bit_val(wqe, offset + IRDMA_BYTE_8, @@ -71,14 +71,14 @@ irdma_set_fragment(__le64 * wqe, u32 offset, struct irdma_sge *sge, */ static void irdma_set_fragment_gen_1(__le64 * wqe, u32 offset, - struct irdma_sge *sge, u8 valid) + struct ibv_sge *sge, u8 valid) { if (sge) { set_64bit_val(wqe, offset, - FIELD_PREP(IRDMAQPSQ_FRAG_TO, sge->tag_off)); + FIELD_PREP(IRDMAQPSQ_FRAG_TO, sge->addr)); set_64bit_val(wqe, offset + IRDMA_BYTE_8, - FIELD_PREP(IRDMAQPSQ_GEN1_FRAG_LEN, sge->len) | - FIELD_PREP(IRDMAQPSQ_GEN1_FRAG_STAG, sge->stag)); + FIELD_PREP(IRDMAQPSQ_GEN1_FRAG_LEN, sge->length) | + FIELD_PREP(IRDMAQPSQ_GEN1_FRAG_STAG, sge->lkey)); } else { set_64bit_val(wqe, offset, 0); set_64bit_val(wqe, offset + IRDMA_BYTE_8, 0); @@ -209,8 +209,7 @@ irdma_qp_push_wqe(struct irdma_qp_uk *qp, __le64 * wqe, u16 quanta, if (IRDMA_RING_CURRENT_HEAD(qp->initial_ring) != IRDMA_RING_CURRENT_TAIL(qp->sq_ring) && !qp->push_mode) { - if (post_sq) - irdma_uk_qp_post_wr(qp); + irdma_uk_qp_post_wr(qp); } else { push = (__le64 *) ((uintptr_t)qp->push_wqe + (wqe_idx & 0x7) * 0x20); @@ -338,7 +337,7 @@ irdma_uk_rdma_write(struct irdma_qp_uk *qp, struct irdma_post_sq_info *info, return EINVAL; for (i = 0; i < op_info->num_lo_sges; i++) - total_size += op_info->lo_sg_list[i].len; + total_size += op_info->lo_sg_list[i].length; read_fence |= info->read_fence; @@ -357,7 +356,7 @@ irdma_uk_rdma_write(struct irdma_qp_uk *qp, struct irdma_post_sq_info *info, qp->sq_wrtrk_array[wqe_idx].signaled = info->signaled; set_64bit_val(wqe, IRDMA_BYTE_16, - FIELD_PREP(IRDMAQPSQ_FRAG_TO, op_info->rem_addr.tag_off)); + FIELD_PREP(IRDMAQPSQ_FRAG_TO, op_info->rem_addr.addr)); if (info->imm_data_valid) { set_64bit_val(wqe, IRDMA_BYTE_0, @@ -386,7 +385,7 @@ irdma_uk_rdma_write(struct irdma_qp_uk *qp, struct irdma_post_sq_info *info, ++addl_frag_cnt; } - hdr = FIELD_PREP(IRDMAQPSQ_REMSTAG, op_info->rem_addr.stag) | + hdr = FIELD_PREP(IRDMAQPSQ_REMSTAG, op_info->rem_addr.lkey) | FIELD_PREP(IRDMAQPSQ_OPCODE, info->op_type) | FIELD_PREP(IRDMAQPSQ_IMMDATAFLAG, info->imm_data_valid) | FIELD_PREP(IRDMAQPSQ_REPORTRTT, info->report_rtt) | @@ -437,7 +436,7 @@ irdma_uk_rdma_read(struct irdma_qp_uk *qp, struct irdma_post_sq_info *info, return EINVAL; for (i = 0; i < op_info->num_lo_sges; i++) - total_size += op_info->lo_sg_list[i].len; + total_size += op_info->lo_sg_list[i].length; ret_code = irdma_fragcnt_to_quanta_sq(op_info->num_lo_sges, &quanta); if (ret_code) @@ -475,8 +474,8 @@ irdma_uk_rdma_read(struct irdma_qp_uk *qp, struct irdma_post_sq_info *info, ++addl_frag_cnt; } set_64bit_val(wqe, IRDMA_BYTE_16, - FIELD_PREP(IRDMAQPSQ_FRAG_TO, op_info->rem_addr.tag_off)); - hdr = FIELD_PREP(IRDMAQPSQ_REMSTAG, op_info->rem_addr.stag) | + FIELD_PREP(IRDMAQPSQ_FRAG_TO, op_info->rem_addr.addr)); + hdr = FIELD_PREP(IRDMAQPSQ_REMSTAG, op_info->rem_addr.lkey) | FIELD_PREP(IRDMAQPSQ_REPORTRTT, (info->report_rtt ? 1 : 0)) | FIELD_PREP(IRDMAQPSQ_ADDFRAGCNT, addl_frag_cnt) | FIELD_PREP(IRDMAQPSQ_OPCODE, @@ -525,7 +524,7 @@ irdma_uk_send(struct irdma_qp_uk *qp, struct irdma_post_sq_info *info, return EINVAL; for (i = 0; i < op_info->num_sges; i++) - total_size += op_info->sg_list[i].len; + total_size += op_info->sg_list[i].length; if (info->imm_data_valid) frag_cnt = op_info->num_sges + 1; @@ -620,15 +619,15 @@ irdma_set_mw_bind_wqe_gen_1(__le64 * wqe, * @polarity: compatibility parameter */ static void -irdma_copy_inline_data_gen_1(u8 *wqe, struct irdma_sge *sge_list, +irdma_copy_inline_data_gen_1(u8 *wqe, struct ibv_sge *sge_list, u32 num_sges, u8 polarity) { u32 quanta_bytes_remaining = 16; u32 i; for (i = 0; i < num_sges; i++) { - u8 *cur_sge = (u8 *)(uintptr_t)sge_list[i].tag_off; - u32 sge_len = sge_list[i].len; + u8 *cur_sge = (u8 *)(uintptr_t)sge_list[i].addr; + u32 sge_len = sge_list[i].length; while (sge_len) { u32 bytes_copied; @@ -683,7 +682,7 @@ irdma_set_mw_bind_wqe(__le64 * wqe, * @polarity: polarity of wqe valid bit */ static void -irdma_copy_inline_data(u8 *wqe, struct irdma_sge *sge_list, +irdma_copy_inline_data(u8 *wqe, struct ibv_sge *sge_list, u32 num_sges, u8 polarity) { u8 inline_valid = polarity << IRDMA_INLINE_VALID_S; @@ -694,8 +693,8 @@ irdma_copy_inline_data(u8 *wqe, struct irdma_sge *sge_list, wqe += 8; for (i = 0; i < num_sges; i++) { - u8 *cur_sge = (u8 *)(uintptr_t)sge_list[i].tag_off; - u32 sge_len = sge_list[i].len; + u8 *cur_sge = (u8 *)(uintptr_t)sge_list[i].addr; + u32 sge_len = sge_list[i].length; while (sge_len) { u32 bytes_copied; @@ -775,7 +774,7 @@ irdma_uk_inline_rdma_write(struct irdma_qp_uk *qp, return EINVAL; for (i = 0; i < op_info->num_lo_sges; i++) - total_size += op_info->lo_sg_list[i].len; + total_size += op_info->lo_sg_list[i].length; if (unlikely(total_size > qp->max_inline_data)) return EINVAL; @@ -788,9 +787,9 @@ irdma_uk_inline_rdma_write(struct irdma_qp_uk *qp, qp->sq_wrtrk_array[wqe_idx].signaled = info->signaled; read_fence |= info->read_fence; set_64bit_val(wqe, IRDMA_BYTE_16, - FIELD_PREP(IRDMAQPSQ_FRAG_TO, op_info->rem_addr.tag_off)); + FIELD_PREP(IRDMAQPSQ_FRAG_TO, op_info->rem_addr.addr)); - hdr = FIELD_PREP(IRDMAQPSQ_REMSTAG, op_info->rem_addr.stag) | + hdr = FIELD_PREP(IRDMAQPSQ_REMSTAG, op_info->rem_addr.lkey) | FIELD_PREP(IRDMAQPSQ_OPCODE, info->op_type) | FIELD_PREP(IRDMAQPSQ_INLINEDATALEN, total_size) | FIELD_PREP(IRDMAQPSQ_REPORTRTT, info->report_rtt ? 1 : 0) | @@ -846,7 +845,7 @@ irdma_uk_inline_send(struct irdma_qp_uk *qp, return EINVAL; for (i = 0; i < op_info->num_sges; i++) - total_size += op_info->sg_list[i].len; + total_size += op_info->sg_list[i].length; if (unlikely(total_size > qp->max_inline_data)) return EINVAL; @@ -911,7 +910,7 @@ irdma_uk_stag_local_invalidate(struct irdma_qp_uk *qp, u64 hdr; u32 wqe_idx; bool local_fence = false; - struct irdma_sge sge = {0}; + struct ibv_sge sge = {0}; u16 quanta = IRDMA_QP_WQE_MIN_QUANTA; info->push_wqe = qp->push_db ? true : false; @@ -922,7 +921,7 @@ irdma_uk_stag_local_invalidate(struct irdma_qp_uk *qp, if (!wqe) return ENOSPC; - sge.stag = op_info->target_stag; + sge.lkey = op_info->target_stag; qp->wqe_ops.iw_set_fragment(wqe, IRDMA_BYTE_0, &sge, 0); set_64bit_val(wqe, IRDMA_BYTE_16, 0); @@ -1436,8 +1435,7 @@ irdma_uk_cq_poll_cmpl(struct irdma_cq_uk *cq, IRDMA_RING_MOVE_TAIL(cq->cq_ring); set_64bit_val(cq->shadow_area, IRDMA_BYTE_0, IRDMA_RING_CURRENT_HEAD(cq->cq_ring)); - memset(info, 0, - sizeof(struct irdma_cq_poll_info)); + memset(info, 0, sizeof(*info)); return irdma_uk_cq_poll_cmpl(cq, info); } } @@ -1510,7 +1508,6 @@ exit: if (pring && IRDMA_RING_MORE_WORK(*pring)) move_cq_head = false; } - if (move_cq_head) { IRDMA_RING_MOVE_HEAD_NOCHECK(cq->cq_ring); if (!IRDMA_RING_CURRENT_HEAD(cq->cq_ring)) @@ -1591,10 +1588,12 @@ irdma_get_wqe_shift(struct irdma_uk_attrs *uk_attrs, u32 sge, int irdma_get_sqdepth(struct irdma_uk_attrs *uk_attrs, u32 sq_size, u8 shift, u32 *sqdepth) { + u32 min_size = (u32)uk_attrs->min_hw_wq_size << shift; + *sqdepth = irdma_round_up_wq((sq_size << shift) + IRDMA_SQ_RSVD); - if (*sqdepth < ((u32)uk_attrs->min_hw_wq_size << shift)) - *sqdepth = uk_attrs->min_hw_wq_size << shift; + if (*sqdepth < min_size) + *sqdepth = min_size; else if (*sqdepth > uk_attrs->max_hw_wq_quanta) return EINVAL; @@ -1608,10 +1607,12 @@ irdma_get_sqdepth(struct irdma_uk_attrs *uk_attrs, u32 sq_size, u8 shift, u32 *s int irdma_get_rqdepth(struct irdma_uk_attrs *uk_attrs, u32 rq_size, u8 shift, u32 *rqdepth) { + u32 min_size = (u32)uk_attrs->min_hw_wq_size << shift; + *rqdepth = irdma_round_up_wq((rq_size << shift) + IRDMA_RQ_RSVD); - if (*rqdepth < ((u32)uk_attrs->min_hw_wq_size << shift)) - *rqdepth = uk_attrs->min_hw_wq_size << shift; + if (*rqdepth < min_size) + *rqdepth = min_size; else if (*rqdepth > uk_attrs->max_hw_rq_quanta) return EINVAL; @@ -1644,41 +1645,16 @@ irdma_setup_connection_wqes(struct irdma_qp_uk *qp, { u16 move_cnt = 1; - if (qp->uk_attrs->feature_flags & IRDMA_FEATURE_RTS_AE) + if (info->start_wqe_idx) + move_cnt = info->start_wqe_idx; + else if (qp->uk_attrs->feature_flags & IRDMA_FEATURE_RTS_AE) move_cnt = 3; - qp->conn_wqes = move_cnt; IRDMA_RING_MOVE_HEAD_BY_COUNT_NOCHECK(qp->sq_ring, move_cnt); IRDMA_RING_MOVE_TAIL_BY_COUNT(qp->sq_ring, move_cnt); IRDMA_RING_MOVE_HEAD_BY_COUNT_NOCHECK(qp->initial_ring, move_cnt); } -/** - * irdma_uk_calc_shift_wq - calculate WQE shift for both SQ and RQ - * @ukinfo: qp initialization info - * @sq_shift: Returns shift of SQ - * @rq_shift: Returns shift of RQ - */ -void -irdma_uk_calc_shift_wq(struct irdma_qp_uk_init_info *ukinfo, u8 *sq_shift, - u8 *rq_shift) -{ - bool imm_support = ukinfo->uk_attrs->hw_rev >= IRDMA_GEN_2 ? true : false; - - irdma_get_wqe_shift(ukinfo->uk_attrs, - imm_support ? ukinfo->max_sq_frag_cnt + 1 : - ukinfo->max_sq_frag_cnt, - ukinfo->max_inline_data, sq_shift); - - irdma_get_wqe_shift(ukinfo->uk_attrs, ukinfo->max_rq_frag_cnt, 0, - rq_shift); - - if (ukinfo->uk_attrs->hw_rev == IRDMA_GEN_1) { - if (ukinfo->abi_ver > 4) - *rq_shift = IRDMA_MAX_RQ_WQE_SHIFT_GEN1; - } -} - /** * irdma_uk_calc_depth_shift_sq - calculate depth and shift for SQ size. * @ukinfo: qp initialization info @@ -1786,6 +1762,8 @@ irdma_uk_qp_init(struct irdma_qp_uk *qp, struct irdma_qp_uk_init_info *info) qp->wqe_ops = iw_wqe_uk_ops_gen_1; else qp->wqe_ops = iw_wqe_uk_ops; + qp->start_wqe_idx = info->start_wqe_idx; + return ret_code; } diff --git a/contrib/ofed/libirdma/irdma_umain.c b/contrib/ofed/libirdma/irdma_umain.c index 2902dd963e18..e8d27c31a0dc 100644 --- a/contrib/ofed/libirdma/irdma_umain.c +++ b/contrib/ofed/libirdma/irdma_umain.c @@ -48,7 +48,7 @@ /** * Driver version */ -char libirdma_version[] = "1.2.17-k"; +char libirdma_version[] = "1.2.36-k"; unsigned int irdma_dbg; diff --git a/contrib/ofed/libirdma/irdma_umain.h b/contrib/ofed/libirdma/irdma_umain.h index 1fa18dd7a847..269609f8c77f 100644 --- a/contrib/ofed/libirdma/irdma_umain.h +++ b/contrib/ofed/libirdma/irdma_umain.h @@ -96,7 +96,6 @@ struct irdma_cq_buf { LIST_ENTRY(irdma_cq_buf) list; struct irdma_cq_uk cq; struct verbs_mr vmr; - size_t buf_size; }; extern pthread_mutex_t sigusr1_wait_mutex; @@ -142,7 +141,6 @@ struct irdma_uqp { struct ibv_recv_wr *pend_rx_wr; struct irdma_qp_uk qp; enum ibv_qp_type qp_type; - struct irdma_sge *recv_sges; }; /* irdma_uverbs.c */ diff --git a/contrib/ofed/libirdma/irdma_user.h b/contrib/ofed/libirdma/irdma_user.h index 0f0aa30bec91..aeb6aa9feebd 100644 --- a/contrib/ofed/libirdma/irdma_user.h +++ b/contrib/ofed/libirdma/irdma_user.h @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB * - * Copyright (c) 2015 - 2022 Intel Corporation + * Copyright (c) 2015 - 2023 Intel Corporation * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU @@ -50,7 +50,7 @@ #define irdma_access_privileges u32 #define irdma_physical_fragment u64 #define irdma_address_list u64 * -#define irdma_sgl struct irdma_sge * +#define irdma_sgl struct ibv_sge * #define IRDMA_MAX_MR_SIZE 0x200000000000ULL @@ -80,96 +80,6 @@ #define IRDMA_OP_TYPE_REC_IMM 0x3f #define IRDMA_FLUSH_MAJOR_ERR 1 -#define IRDMA_SRQFLUSH_RSVD_MAJOR_ERR 0xfffe - -/* Async Events codes */ -#define IRDMA_AE_AMP_UNALLOCATED_STAG 0x0102 -#define IRDMA_AE_AMP_INVALID_STAG 0x0103 -#define IRDMA_AE_AMP_BAD_QP 0x0104 -#define IRDMA_AE_AMP_BAD_PD 0x0105 -#define IRDMA_AE_AMP_BAD_STAG_KEY 0x0106 -#define IRDMA_AE_AMP_BAD_STAG_INDEX 0x0107 -#define IRDMA_AE_AMP_BOUNDS_VIOLATION 0x0108 -#define IRDMA_AE_AMP_RIGHTS_VIOLATION 0x0109 -#define IRDMA_AE_AMP_TO_WRAP 0x010a -#define IRDMA_AE_AMP_FASTREG_VALID_STAG 0x010c -#define IRDMA_AE_AMP_FASTREG_MW_STAG 0x010d -#define IRDMA_AE_AMP_FASTREG_INVALID_RIGHTS 0x010e -#define IRDMA_AE_AMP_FASTREG_INVALID_LENGTH 0x0110 -#define IRDMA_AE_AMP_INVALIDATE_SHARED 0x0111 -#define IRDMA_AE_AMP_INVALIDATE_NO_REMOTE_ACCESS_RIGHTS 0x0112 -#define IRDMA_AE_AMP_INVALIDATE_MR_WITH_BOUND_WINDOWS 0x0113 -#define IRDMA_AE_AMP_MWBIND_VALID_STAG 0x0114 -#define IRDMA_AE_AMP_MWBIND_OF_MR_STAG 0x0115 -#define IRDMA_AE_AMP_MWBIND_TO_ZERO_BASED_STAG 0x0116 -#define IRDMA_AE_AMP_MWBIND_TO_MW_STAG 0x0117 -#define IRDMA_AE_AMP_MWBIND_INVALID_RIGHTS 0x0118 -#define IRDMA_AE_AMP_MWBIND_INVALID_BOUNDS 0x0119 -#define IRDMA_AE_AMP_MWBIND_TO_INVALID_PARENT 0x011a -#define IRDMA_AE_AMP_MWBIND_BIND_DISABLED 0x011b -#define IRDMA_AE_PRIV_OPERATION_DENIED 0x011c -#define IRDMA_AE_AMP_INVALIDATE_TYPE1_MW 0x011d -#define IRDMA_AE_AMP_MWBIND_ZERO_BASED_TYPE1_MW 0x011e -#define IRDMA_AE_AMP_FASTREG_INVALID_PBL_HPS_CFG 0x011f -#define IRDMA_AE_AMP_MWBIND_WRONG_TYPE 0x0120 -#define IRDMA_AE_AMP_FASTREG_PBLE_MISMATCH 0x0121 -#define IRDMA_AE_UDA_XMIT_DGRAM_TOO_LONG 0x0132 -#define IRDMA_AE_UDA_XMIT_BAD_PD 0x0133 -#define IRDMA_AE_UDA_XMIT_DGRAM_TOO_SHORT 0x0134 -#define IRDMA_AE_UDA_L4LEN_INVALID 0x0135 -#define IRDMA_AE_BAD_CLOSE 0x0201 -#define IRDMA_AE_RDMAP_ROE_BAD_LLP_CLOSE 0x0202 -#define IRDMA_AE_CQ_OPERATION_ERROR 0x0203 -#define IRDMA_AE_RDMA_READ_WHILE_ORD_ZERO 0x0205 -#define IRDMA_AE_STAG_ZERO_INVALID 0x0206 -#define IRDMA_AE_IB_RREQ_AND_Q1_FULL 0x0207 -#define IRDMA_AE_IB_INVALID_REQUEST 0x0208 -#define IRDMA_AE_WQE_UNEXPECTED_OPCODE 0x020a -#define IRDMA_AE_WQE_INVALID_PARAMETER 0x020b -#define IRDMA_AE_WQE_INVALID_FRAG_DATA 0x020c -#define IRDMA_AE_IB_REMOTE_ACCESS_ERROR 0x020d -#define IRDMA_AE_IB_REMOTE_OP_ERROR 0x020e -#define IRDMA_AE_WQE_LSMM_TOO_LONG 0x0220 -#define IRDMA_AE_DDP_INVALID_MSN_GAP_IN_MSN 0x0301 -#define IRDMA_AE_DDP_UBE_DDP_MESSAGE_TOO_LONG_FOR_AVAILABLE_BUFFER 0x0303 -#define IRDMA_AE_DDP_UBE_INVALID_DDP_VERSION 0x0304 -#define IRDMA_AE_DDP_UBE_INVALID_MO 0x0305 -#define IRDMA_AE_DDP_UBE_INVALID_MSN_NO_BUFFER_AVAILABLE 0x0306 -#define IRDMA_AE_DDP_UBE_INVALID_QN 0x0307 -#define IRDMA_AE_DDP_NO_L_BIT 0x0308 -#define IRDMA_AE_RDMAP_ROE_INVALID_RDMAP_VERSION 0x0311 -#define IRDMA_AE_RDMAP_ROE_UNEXPECTED_OPCODE 0x0312 -#define IRDMA_AE_ROE_INVALID_RDMA_READ_REQUEST 0x0313 -#define IRDMA_AE_ROE_INVALID_RDMA_WRITE_OR_READ_RESP 0x0314 -#define IRDMA_AE_ROCE_RSP_LENGTH_ERROR 0x0316 -#define IRDMA_AE_ROCE_EMPTY_MCG 0x0380 -#define IRDMA_AE_ROCE_BAD_MC_IP_ADDR 0x0381 -#define IRDMA_AE_ROCE_BAD_MC_QPID 0x0382 -#define IRDMA_AE_MCG_QP_PROTOCOL_MISMATCH 0x0383 -#define IRDMA_AE_INVALID_ARP_ENTRY 0x0401 -#define IRDMA_AE_INVALID_TCP_OPTION_RCVD 0x0402 -#define IRDMA_AE_STALE_ARP_ENTRY 0x0403 -#define IRDMA_AE_INVALID_AH_ENTRY 0x0406 -#define IRDMA_AE_LLP_CLOSE_COMPLETE 0x0501 -#define IRDMA_AE_LLP_CONNECTION_RESET 0x0502 -#define IRDMA_AE_LLP_FIN_RECEIVED 0x0503 -#define IRDMA_AE_LLP_RECEIVED_MARKER_AND_LENGTH_FIELDS_DONT_MATCH 0x0504 -#define IRDMA_AE_LLP_RECEIVED_MPA_CRC_ERROR 0x0505 -#define IRDMA_AE_LLP_SEGMENT_TOO_SMALL 0x0507 -#define IRDMA_AE_LLP_SYN_RECEIVED 0x0508 -#define IRDMA_AE_LLP_TERMINATE_RECEIVED 0x0509 -#define IRDMA_AE_LLP_TOO_MANY_RETRIES 0x050a -#define IRDMA_AE_LLP_TOO_MANY_KEEPALIVE_RETRIES 0x050b -#define IRDMA_AE_LLP_DOUBT_REACHABILITY 0x050c -#define IRDMA_AE_LLP_CONNECTION_ESTABLISHED 0x050e -#define IRDMA_AE_RESOURCE_EXHAUSTION 0x0520 -#define IRDMA_AE_RESET_SENT 0x0601 -#define IRDMA_AE_TERMINATE_SENT 0x0602 -#define IRDMA_AE_RESET_NOT_SENT 0x0603 -#define IRDMA_AE_LCE_QP_CATASTROPHIC 0x0700 -#define IRDMA_AE_LCE_FUNCTION_CATASTROPHIC 0x0701 -#define IRDMA_AE_LCE_CQ_CATASTROPHIC 0x0702 -#define IRDMA_AE_QP_SUSPEND_COMPLETE 0x0900 enum irdma_device_caps_const { IRDMA_WQE_SIZE = 4, @@ -201,8 +111,7 @@ enum irdma_device_caps_const { IRDMA_MAX_OUTBOUND_MSG_SIZE = 65537, /* 64K +1 */ IRDMA_MAX_INBOUND_MSG_SIZE = 65537, - IRDMA_MAX_PUSH_PAGE_COUNT = 1024, - IRDMA_MAX_PE_ENA_VF_COUNT = 32, + IRDMA_MAX_PE_ENA_VF_COUNT = 32, IRDMA_MAX_VF_FPM_ID = 47, IRDMA_MAX_SQ_PAYLOAD_SIZE = 2145386496, IRDMA_MAX_INLINE_DATA_SIZE = 101, @@ -229,12 +138,7 @@ enum irdma_flush_opcode { FLUSH_RETRY_EXC_ERR, FLUSH_MW_BIND_ERR, FLUSH_REM_INV_REQ_ERR, -}; - -enum irdma_qp_event_type { - IRDMA_QP_EVENT_CATASTROPHIC, - IRDMA_QP_EVENT_ACCESS_ERR, - IRDMA_QP_EVENT_REQ_ERR, + FLUSH_RNR_RETRY_EXC_ERR, }; enum irdma_cmpl_status { @@ -282,12 +186,6 @@ struct irdma_cq_uk; struct irdma_qp_uk_init_info; struct irdma_cq_uk_init_info; -struct irdma_sge { - irdma_tagged_offset tag_off; - u32 len; - irdma_stag stag; -}; - struct irdma_ring { volatile u32 head; volatile u32 tail; /* effective tail */ @@ -319,13 +217,13 @@ struct irdma_post_rq_info { struct irdma_rdma_write { irdma_sgl lo_sg_list; u32 num_lo_sges; - struct irdma_sge rem_addr; + struct ibv_sge rem_addr; }; struct irdma_rdma_read { irdma_sgl lo_sg_list; u32 num_lo_sges; - struct irdma_sge rem_addr; + struct ibv_sge rem_addr; }; struct irdma_bind_window { @@ -399,11 +297,6 @@ struct irdma_cq_poll_info { } stat; }; -struct qp_err_code { - enum irdma_flush_opcode flush_code; - enum irdma_qp_event_type event_type; -}; - int irdma_uk_inline_rdma_write(struct irdma_qp_uk *qp, struct irdma_post_sq_info *info, bool post_sq); int irdma_uk_inline_send(struct irdma_qp_uk *qp, @@ -426,9 +319,9 @@ int irdma_uk_stag_local_invalidate(struct irdma_qp_uk *qp, bool post_sq); struct irdma_wqe_uk_ops { - void (*iw_copy_inline_data)(u8 *dest, struct irdma_sge *sge_list, u32 num_sges, u8 polarity); + void (*iw_copy_inline_data)(u8 *dest, struct ibv_sge *sge_list, u32 num_sges, u8 polarity); u16 (*iw_inline_data_size_to_quanta)(u32 data_size); - void (*iw_set_fragment)(__le64 *wqe, u32 offset, struct irdma_sge *sge, + void (*iw_set_fragment)(__le64 *wqe, u32 offset, struct ibv_sge *sge, u8 valid); void (*iw_set_mw_bind_wqe)(__le64 *wqe, struct irdma_bind_window *op_info); @@ -444,8 +337,6 @@ int irdma_uk_cq_init(struct irdma_cq_uk *cq, struct irdma_cq_uk_init_info *info); int irdma_uk_qp_init(struct irdma_qp_uk *qp, struct irdma_qp_uk_init_info *info); -void irdma_uk_calc_shift_wq(struct irdma_qp_uk_init_info *ukinfo, u8 *sq_shift, - u8 *rq_shift); int irdma_uk_calc_depth_shift_sq(struct irdma_qp_uk_init_info *ukinfo, u32 *sq_depth, u8 *sq_shift); int irdma_uk_calc_depth_shift_rq(struct irdma_qp_uk_init_info *ukinfo, @@ -494,6 +385,7 @@ struct irdma_qp_uk { u8 rwqe_polarity; u8 rq_wqe_size; u8 rq_wqe_size_multiplier; + u8 start_wqe_idx; bool deferred_flag:1; bool push_mode:1; /* whether the last post wqe was pushed */ bool push_dropped:1; @@ -541,6 +433,7 @@ struct irdma_qp_uk_init_info { u32 sq_depth; u32 rq_depth; u8 first_sq_wq; + u8 start_wqe_idx; u8 type; u8 sq_shift; u8 rq_shift; @@ -574,75 +467,4 @@ int irdma_get_rqdepth(struct irdma_uk_attrs *uk_attrs, u32 rq_size, u8 shift, u3 void irdma_qp_push_wqe(struct irdma_qp_uk *qp, __le64 *wqe, u16 quanta, u32 wqe_idx, bool post_sq); void irdma_clr_wqes(struct irdma_qp_uk *qp, u32 qp_wqe_idx); - -static inline struct qp_err_code irdma_ae_to_qp_err_code(u16 ae_id) -{ - struct qp_err_code qp_err = { 0 }; - - switch (ae_id) { - case IRDMA_AE_AMP_BOUNDS_VIOLATION: - case IRDMA_AE_AMP_INVALID_STAG: - case IRDMA_AE_AMP_RIGHTS_VIOLATION: - case IRDMA_AE_AMP_UNALLOCATED_STAG: - case IRDMA_AE_AMP_BAD_PD: - case IRDMA_AE_AMP_BAD_QP: - case IRDMA_AE_AMP_BAD_STAG_KEY: - case IRDMA_AE_AMP_BAD_STAG_INDEX: - case IRDMA_AE_AMP_TO_WRAP: - case IRDMA_AE_PRIV_OPERATION_DENIED: - qp_err.flush_code = FLUSH_PROT_ERR; - qp_err.event_type = IRDMA_QP_EVENT_ACCESS_ERR; - break; - case IRDMA_AE_UDA_XMIT_BAD_PD: - case IRDMA_AE_WQE_UNEXPECTED_OPCODE: - qp_err.flush_code = FLUSH_LOC_QP_OP_ERR; - qp_err.event_type = IRDMA_QP_EVENT_CATASTROPHIC; - break; - case IRDMA_AE_UDA_XMIT_DGRAM_TOO_SHORT: - case IRDMA_AE_UDA_XMIT_DGRAM_TOO_LONG: - case IRDMA_AE_UDA_L4LEN_INVALID: - case IRDMA_AE_DDP_UBE_INVALID_MO: - case IRDMA_AE_DDP_UBE_DDP_MESSAGE_TOO_LONG_FOR_AVAILABLE_BUFFER: - qp_err.flush_code = FLUSH_LOC_LEN_ERR; - qp_err.event_type = IRDMA_QP_EVENT_CATASTROPHIC; - break; - case IRDMA_AE_AMP_INVALIDATE_NO_REMOTE_ACCESS_RIGHTS: - case IRDMA_AE_IB_REMOTE_ACCESS_ERROR: - qp_err.flush_code = FLUSH_REM_ACCESS_ERR; - qp_err.event_type = IRDMA_QP_EVENT_ACCESS_ERR; - break; - case IRDMA_AE_AMP_MWBIND_INVALID_RIGHTS: - case IRDMA_AE_AMP_MWBIND_BIND_DISABLED: - case IRDMA_AE_AMP_MWBIND_INVALID_BOUNDS: - case IRDMA_AE_AMP_MWBIND_VALID_STAG: - qp_err.flush_code = FLUSH_MW_BIND_ERR; - qp_err.event_type = IRDMA_QP_EVENT_ACCESS_ERR; - break; - case IRDMA_AE_LLP_TOO_MANY_RETRIES: - qp_err.flush_code = FLUSH_RETRY_EXC_ERR; - qp_err.event_type = IRDMA_QP_EVENT_CATASTROPHIC; - break; - case IRDMA_AE_IB_INVALID_REQUEST: - qp_err.flush_code = FLUSH_REM_INV_REQ_ERR; - qp_err.event_type = IRDMA_QP_EVENT_REQ_ERR; - break; - case IRDMA_AE_LLP_SEGMENT_TOO_SMALL: - case IRDMA_AE_LLP_RECEIVED_MPA_CRC_ERROR: - case IRDMA_AE_ROCE_RSP_LENGTH_ERROR: - case IRDMA_AE_IB_REMOTE_OP_ERROR: - qp_err.flush_code = FLUSH_REM_OP_ERR; - qp_err.event_type = IRDMA_QP_EVENT_CATASTROPHIC; - break; - case IRDMA_AE_LCE_QP_CATASTROPHIC: - qp_err.flush_code = FLUSH_FATAL_ERR; - qp_err.event_type = IRDMA_QP_EVENT_CATASTROPHIC; - break; - default: - qp_err.flush_code = FLUSH_GENERAL_ERR; - qp_err.event_type = IRDMA_QP_EVENT_CATASTROPHIC; - break; - } - - return qp_err; -} #endif /* IRDMA_USER_H */ diff --git a/contrib/ofed/libirdma/irdma_uverbs.c b/contrib/ofed/libirdma/irdma_uverbs.c index 962af399ed31..e52ce1cfa229 100644 --- a/contrib/ofed/libirdma/irdma_uverbs.c +++ b/contrib/ofed/libirdma/irdma_uverbs.c @@ -152,6 +152,7 @@ irdma_ualloc_pd(struct ibv_context *context) err_free: free(iwupd); + errno = err; return NULL; } @@ -163,7 +164,6 @@ err_free: int irdma_ufree_pd(struct ibv_pd *pd) { - struct irdma_uvcontext *iwvctx = container_of(pd->context, struct irdma_uvcontext, ibv_ctx); struct irdma_upd *iwupd; int ret; @@ -374,12 +374,12 @@ irdma_free_hw_buf(void *buf, size_t size) * @cqe_64byte_ena: enable 64byte cqe */ static inline int -get_cq_size(int ncqe, u8 hw_rev, bool cqe_64byte_ena) +get_cq_size(int ncqe, u8 hw_rev) { ncqe++; /* Completions with immediate require 1 extra entry */ - if (!cqe_64byte_ena && hw_rev > IRDMA_GEN_1) + if (hw_rev > IRDMA_GEN_1) ncqe *= 2; if (ncqe < IRDMA_U_MINCQ_SIZE) @@ -388,11 +388,8 @@ get_cq_size(int ncqe, u8 hw_rev, bool cqe_64byte_ena) return ncqe; } -static inline size_t get_cq_total_bytes(u32 cq_size, bool cqe_64byte_ena){ - if (cqe_64byte_ena) - return roundup(cq_size * sizeof(struct irdma_extended_cqe), IRDMA_HW_PAGE_SIZE); - else - return roundup(cq_size * sizeof(struct irdma_cqe), IRDMA_HW_PAGE_SIZE); +static inline size_t get_cq_total_bytes(u32 cq_size) { + return roundup(cq_size * sizeof(struct irdma_cqe), IRDMA_HW_PAGE_SIZE); } /** @@ -420,7 +417,6 @@ ucreate_cq(struct ibv_context *context, u32 cq_pages; int ret, ncqe; u8 hw_rev; - bool cqe_64byte_ena; iwvctx = container_of(context, struct irdma_uvcontext, ibv_ctx); uk_attrs = &iwvctx->uk_attrs; @@ -454,11 +450,10 @@ ucreate_cq(struct ibv_context *context, return NULL; } - cqe_64byte_ena = uk_attrs->feature_flags & IRDMA_FEATURE_64_BYTE_CQE ? true : false; - info.cq_size = get_cq_size(attr_ex->cqe, hw_rev, cqe_64byte_ena); + info.cq_size = get_cq_size(attr_ex->cqe, hw_rev); + total_size = get_cq_total_bytes(info.cq_size); iwucq->comp_vector = attr_ex->comp_vector; LIST_INIT(&iwucq->resize_list); - total_size = get_cq_total_bytes(info.cq_size, cqe_64byte_ena); cq_pages = total_size >> IRDMA_HW_PAGE_SHIFT; if (!(uk_attrs->feature_flags & IRDMA_FEATURE_CQ_RESIZE)) @@ -528,8 +523,6 @@ ucreate_cq(struct ibv_context *context, info.cq_id = resp.cq_id; /* Do not report the CQE's reserved for immediate and burned by HW */ iwucq->verbs_cq.cq.cqe = ncqe; - if (cqe_64byte_ena) - info.avoid_mem_cflct = true; info.cqe_alloc_db = (u32 *)((u8 *)iwvctx->db + IRDMA_DB_CQ_OFFSET); irdma_uk_cq_init(&iwucq->cq, &info); return &iwucq->verbs_cq.cq_ex; @@ -585,7 +578,7 @@ static void irdma_free_cq_buf(struct irdma_cq_buf *cq_buf) { ibv_cmd_dereg_mr(&cq_buf->vmr.ibv_mr); - irdma_free_hw_buf(cq_buf->cq.cq_base, cq_buf->buf_size); + irdma_free_hw_buf(cq_buf->cq.cq_base, get_cq_total_bytes(cq_buf->cq.cq_size)); free(cq_buf); } @@ -1322,6 +1315,8 @@ irdma_vmapped_qp(struct irdma_uqp *iwuqp, struct ibv_pd *pd, cmd.user_wqe_bufs = (__u64) ((uintptr_t)info->sq); cmd.user_compl_ctx = (__u64) (uintptr_t)&iwuqp->qp; + cmd.comp_mask |= IRDMA_CREATE_QP_USE_START_WQE_IDX; + ret = ibv_cmd_create_qp(pd, &iwuqp->ibv_qp, attr, &cmd.ibv_cmd, sizeof(cmd), &resp.ibv_resp, sizeof(struct irdma_ucreate_qp_resp)); @@ -1331,6 +1326,8 @@ irdma_vmapped_qp(struct irdma_uqp *iwuqp, struct ibv_pd *pd, info->sq_size = resp.actual_sq_size; info->rq_size = resp.actual_rq_size; info->first_sq_wq = legacy_mode ? 1 : resp.lsmm; + if (resp.comp_mask & IRDMA_CREATE_QP_USE_START_WQE_IDX) + info->start_wqe_idx = resp.start_wqe_idx; info->qp_caps = resp.qp_caps; info->qp_id = resp.qp_id; iwuqp->irdma_drv_opt = resp.irdma_drv_opt; @@ -1379,6 +1376,8 @@ irdma_ucreate_qp(struct ibv_pd *pd, if (attr->cap.max_send_sge > uk_attrs->max_hw_wq_frags || attr->cap.max_recv_sge > uk_attrs->max_hw_wq_frags || + attr->cap.max_send_wr > uk_attrs->max_hw_wq_quanta || + attr->cap.max_recv_wr > uk_attrs->max_hw_rq_quanta || attr->cap.max_inline_data > uk_attrs->max_hw_inline) { errno = EINVAL; return NULL; @@ -1430,18 +1429,12 @@ irdma_ucreate_qp(struct ibv_pd *pd, attr->cap.max_recv_wr = info.rq_size; } - iwuqp->recv_sges = calloc(attr->cap.max_recv_sge, sizeof(*iwuqp->recv_sges)); - if (!iwuqp->recv_sges) { - status = errno; /* preserve errno */ - goto err_destroy_lock; - } - info.wqe_alloc_db = (u32 *)iwvctx->db; info.legacy_mode = iwvctx->legacy_mode; info.sq_wrtrk_array = calloc(info.sq_depth, sizeof(*info.sq_wrtrk_array)); if (!info.sq_wrtrk_array) { status = errno; /* preserve errno */ - goto err_free_rsges; + goto err_destroy_lock; } info.rq_wrid_array = calloc(info.rq_depth, sizeof(*info.rq_wrid_array)); @@ -1475,8 +1468,6 @@ err_free_rq_wrid: free(info.rq_wrid_array); err_free_sq_wrtrk: free(info.sq_wrtrk_array); -err_free_rsges: - free(iwuqp->recv_sges); err_destroy_lock: pthread_spin_destroy(&iwuqp->lock); err_free_qp: @@ -1635,7 +1626,6 @@ irdma_udestroy_qp(struct ibv_qp *qp) free(iwuqp->qp.rq_wrid_array); irdma_free_hw_buf(iwuqp->qp.sq_base, iwuqp->buf_size); - free(iwuqp->recv_sges); free(iwuqp); return 0; @@ -1645,26 +1635,6 @@ err: return ret; } -/** - * irdma_copy_sg_list - copy sg list for qp - * @sg_list: copied into sg_list - * @sgl: copy from sgl - * @num_sges: count of sg entries - * @max_sges: count of max supported sg entries - */ -static void -irdma_copy_sg_list(struct irdma_sge *sg_list, struct ibv_sge *sgl, - int num_sges) -{ *** 2466 LINES SKIPPED *** From nobody Sat Feb 24 08:23:58 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Thfzf46Rdz5CKJK; Sat, 24 Feb 2024 08:23:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Thfzf3YJcz4MlB; Sat, 24 Feb 2024 08:23:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708763038; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A8QNycZ5+VQuvxIiirE1kSL+vMKC0vhl/G8XwqkkFEI=; b=byC5GpwBu+stXKV4ybzO5lCRO+g/GgZw1ZEklnVihJWUAozl86uZgeU1n7FLmjyLBeqruT r+Pn4aQu7DYNKvNibKrvY5/1fCg6w83qyjn2gVux6rdhYzZui2rgIAfC8T7l0E7TOQKLx9 4rHh/pnd3uESz+NiIKDr7I5iyIqbKyd+6JkqsScg9gNUgLkcAc26RyN8kCfn51n1pQSmat pBO3mOMVz9Y+G183TTxGVCcxYoWVMCGFqqNu5kqpP4ihcOXBo2F6tDewxAWN2JreI7rxje ukUXJFqLXMwrrEArBp4XMgWg89hJFcePVbHOzreOx/hVRiW5isO62Q7XGzEfcQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708763038; a=rsa-sha256; cv=none; b=FBiw/M9DocWp7ihCf2DcEu4Yr6bNTFLOqOsHTWdL3+gbn7sIK6AsHmtPj7L3/sDPsBQVat hKW2VChBbc1SuBLc39FfmXM72MDJ/P0HDU8e74n05adYSrF5yJ7vMYo06hmys/7RwsFvtZ xetRf+7wDnocY5Tt+PPQtQ9hZT6H0JAHdtUUc6O/2w1lUEFOi6H344yj1GoS4rzFYqYMQm 1+Ck/OINlnmqmyJY7OgVh9BYO2Um9HXdcOb+ch3AdHFp+mmvTr569KqxVl3aXz4Blq0Qdi MfGxRhHvPqlFUJ0bIDeRvbCY8/RaMWgvsw3SjyuSDmvzCMQ8e7K8xJCgJQFd3Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708763038; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A8QNycZ5+VQuvxIiirE1kSL+vMKC0vhl/G8XwqkkFEI=; b=ssjKbmcy551j0yDGQnwUgkvk8AU4SUuVzRqRjOVsTma1zGooMD2SMvIRc6rvHy1HbLicTd SfGYp6LGO0ipLryyBF2Sm4S+SU0syjfQZBKqFX/tOqn0oWVre0r645gr25nUw4hYOReoQB o9ZLu8PE3r48r7COQcrDbDZNkiUe9lrhENMUFWl+28q09zZ+NYMczHssws8nvUfifOjKGV B9NUORe3bZfs/CLsgVmd0RZ1Qs3khxSz8rdMgsGr6ayZtodmUsa7l0Ww9yUNcXnMdICtki TwxLxKbmg6L60JaLLuiwMr+Dl/bIyXUkJux2a5I502S6qs+2xwpxvUKyA3frpg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Thfzf2ZJPzsRJ; Sat, 24 Feb 2024 08:23:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41O8NwQN092508; Sat, 24 Feb 2024 08:23:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41O8Nwk4092505; Sat, 24 Feb 2024 08:23:58 GMT (envelope-from git) Date: Sat, 24 Feb 2024 08:23:58 GMT Message-Id: <202402240823.41O8Nwk4092505@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: e705ac7788b2 - stable/14 - net80211: Fix two typos in kernel messages List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e705ac7788b2b08a4a5d12dc150cc4d78253e485 Auto-Submitted: auto-generated The branch stable/14 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=e705ac7788b2b08a4a5d12dc150cc4d78253e485 commit e705ac7788b2b08a4a5d12dc150cc4d78253e485 Author: Gordon Bergling AuthorDate: 2024-02-19 11:08:07 +0000 Commit: Gordon Bergling CommitDate: 2024-02-24 08:23:47 +0000 net80211: Fix two typos in kernel messages - s/defered/deferred/ (cherry picked from commit 94fc800f5bf20f573bef0d407c2f61ebcdc15bae) --- sys/net80211/ieee80211_hostap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/net80211/ieee80211_hostap.c b/sys/net80211/ieee80211_hostap.c index b7a328ee06be..52832c308c7d 100644 --- a/sys/net80211/ieee80211_hostap.c +++ b/sys/net80211/ieee80211_hostap.c @@ -978,7 +978,7 @@ hostap_auth_open(struct ieee80211_node *ni, struct ieee80211_frame *wh, */ IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_AUTH | IEEE80211_MSG_ACL, ni->ni_macaddr, - "%s", "station authentication defered (radius acl)"); + "%s", "station authentication deferred (radius acl)"); ieee80211_notify_node_auth(ni); } else { IEEE80211_SEND_MGMT(ni, IEEE80211_FC0_SUBTYPE_AUTH, seq + 1); @@ -1128,7 +1128,7 @@ hostap_auth_shared(struct ieee80211_node *ni, struct ieee80211_frame *wh, IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_AUTH | IEEE80211_MSG_ACL, ni->ni_macaddr, - "%s", "station authentication defered (radius acl)"); + "%s", "station authentication deferred (radius acl)"); ieee80211_notify_node_auth(ni); return; } From nobody Sat Feb 24 08:24:38 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Thg0Q3Ts9z5CKGD; Sat, 24 Feb 2024 08:24:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Thg0Q2zxsz4Msp; Sat, 24 Feb 2024 08:24:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708763078; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eZKyl3Fkti1Z4QYUBYM+QYZgM7cKSRANNXrHbq6sqX8=; b=tMnzNm+OsMIG5Xh0364EYbAmo/MZgi6VTfeY6ynSn3lAOB02PToj5Si+M8NCBgUAcfW9NK HzMStQq3WulWMUdSG9JrNLNxL1fP2lXkbQOkqWRMMXSHp9LzlUYfU5z+k8KvBM/3YnbXE8 /K7SbcyqO/TBKMurbiy7O8GNQ9JdKF2zObO6eInOx16CIBdxWJmCwHYTiOjcpRRZjXGBJa Bznn9Ur8o/y3/dosJvhokMeayk9DpWxsbvwsZI7EYF7qD/4JjCz9fr7T8YGjEdUOdS2PLu n6Q4sJlOySpsNJ2KtAQVqTpJOA6zI/pMt5x6cuMpxvnrZ5/aDifooWHE1RhTlA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708763078; a=rsa-sha256; cv=none; b=SiLPfqto7xB83Fdk66tZE9PmFmK9LS2IxQKdJ8S1YbWcblCjZZhCSvjB4S4eScPDtqQH+t KQTXOGqF4rG2TwUWH0CbcDBB77AfGEpEgz6NLlUKhx/0l8HFp5zr2geodxwQc6AII1m+hd IOFDjRwNOmQvb/y9Th9XIwC98ogJI6orO9uWignaa5To9se7fOuJYtZV+d0HY5EAdfMlDF TcvKHvo/nm9P05Dj9FWVE+6B0TWKNW6Dm80m3CGu1he21ZVAVmS8SqY3FjRIXZ+5dhdRNv 4DujJFBCesj1NijguYOSuOBvyKT0i6Tosetc0zfb6meTC92R8vgG57RL+T/O/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=1708763078; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eZKyl3Fkti1Z4QYUBYM+QYZgM7cKSRANNXrHbq6sqX8=; b=QKK14fWZbLWKdcZWpm64Wlt/y6MtIpwoWofgcPKmHUOjlLPsVrg/RK+Sta1ctba92kw4Lf GEWIEnKBl5jbaQja0Uk8gpP5TJaY8x/YHgKjbdYzDR/iLYr9nuL+xjosfg6hPDmdwHuzau ibv4hNu8LYYIp33lBxt1xaQT+T4OOEundvNK7E9mrOwzX79Hs94e6NolGWVCu99oOsrR2X OcxXvsQezQs5W02EBMszZZhgNm4tCuSaNN8WaCVuERc/pLsGUikhRM9xyQDDZs5KwxnJdv XTTzI775nT8qV+EmwH3NEwY2avsYucXjfPUqgUAGNRzrGmDwsoXVM1vJJ0zdcw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Thg0Q23P1zsJC; Sat, 24 Feb 2024 08:24:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41O8Oces092744; Sat, 24 Feb 2024 08:24:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41O8OceP092741; Sat, 24 Feb 2024 08:24:38 GMT (envelope-from git) Date: Sat, 24 Feb 2024 08:24:38 GMT Message-Id: <202402240824.41O8OceP092741@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 3093fe97e126 - stable/13 - net80211: Fix two typos in kernel messages List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3093fe97e1263d8d8a392ba3f205284628cc0fcc Auto-Submitted: auto-generated The branch stable/13 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=3093fe97e1263d8d8a392ba3f205284628cc0fcc commit 3093fe97e1263d8d8a392ba3f205284628cc0fcc Author: Gordon Bergling AuthorDate: 2024-02-19 11:08:07 +0000 Commit: Gordon Bergling CommitDate: 2024-02-24 08:24:28 +0000 net80211: Fix two typos in kernel messages - s/defered/deferred/ (cherry picked from commit 94fc800f5bf20f573bef0d407c2f61ebcdc15bae) --- sys/net80211/ieee80211_hostap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/net80211/ieee80211_hostap.c b/sys/net80211/ieee80211_hostap.c index 2f6317d9d8de..dcbcffbe09a0 100644 --- a/sys/net80211/ieee80211_hostap.c +++ b/sys/net80211/ieee80211_hostap.c @@ -973,7 +973,7 @@ hostap_auth_open(struct ieee80211_node *ni, struct ieee80211_frame *wh, */ IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_AUTH | IEEE80211_MSG_ACL, ni->ni_macaddr, - "%s", "station authentication defered (radius acl)"); + "%s", "station authentication deferred (radius acl)"); ieee80211_notify_node_auth(ni); } else { IEEE80211_SEND_MGMT(ni, IEEE80211_FC0_SUBTYPE_AUTH, seq + 1); @@ -1123,7 +1123,7 @@ hostap_auth_shared(struct ieee80211_node *ni, struct ieee80211_frame *wh, IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_AUTH | IEEE80211_MSG_ACL, ni->ni_macaddr, - "%s", "station authentication defered (radius acl)"); + "%s", "station authentication deferred (radius acl)"); ieee80211_notify_node_auth(ni); return; } From nobody Sat Feb 24 12:14:59 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Thm6D03hfz5CfR3; Sat, 24 Feb 2024 12:15:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Thm6C6YTKz4pTx; Sat, 24 Feb 2024 12:14:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708776899; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VBCg4vgPDNSJll6bLJAvTERnmknuvCetjqo5fhYoFKM=; b=W//vbY/4b1Vp/qKjdtuuCg0nh6A6UrF2a9jXp7cKpSLSKmcX1JukM9e56cXeGVWTe0OMNk lZtRCfEVbaXTjnP7fBUpGPJU+I0Py0sHpdyPmayO8gVrA4kkboXWXIzIfbFbji2xr796zJ 4ROtSBSe8mzB0VlDgvokY7KT7mdsz9FaX2E6UsMv2DPng1v/xShxIki0uNpLYyKOemUwQ1 kcxyLNBUY96+hiYchRDELzbHmGHc1iUC7slAPAPD9OB60gT7sagKW+UOEiOoQ5ttU6mNAi u5oMwgPKrsidYXbNA1yiYFb9K2pzogsgVbEWKP2vDvY3eBZU0C0iX5a70wDb3w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708776899; a=rsa-sha256; cv=none; b=IrRBpAaf8Ol0ly469VED+zVEZOcWm4wOJdBIUyLGjxCmtFI7aGnYcY9bzGB11VCoobVzhc /+GcHeBG+yn00WJ59KxpeKRUtkCKnicfn2ek/EEBeB0lNNLt5+NZ+ntpeop6TIIc4vFCQp 4TE+ASbckWVWx0JcoCeiiZih8w0qZwhsBTcyDNfszyXitZe6xjtQNQIZ/xK9uRewRyeX8k ltxUuCQKqf2fHuUQpj/66OUw48LeY43QZgy52f+gQgTrlmB6AmlnrtpFuYH1VwXCLia7Vn v8dZNA4eY6n6aCOm9wtc5ssGembOAzaBZj6RjR55pJtPlYpVcRJFAa6M1p/2pw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708776899; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VBCg4vgPDNSJll6bLJAvTERnmknuvCetjqo5fhYoFKM=; b=ellKLZVCcrL0Z03IC4f82xqrtklfWQehnfc8OpXaZO4SRC8CHVAywSt3Ss0woPWhN46c4I a8dbgYH3gslFsvI9uAHnZMvOy46v8Cz7j7oJLKTzoQD+IziuNANPIyCJmmno48wuIm6ups fomOo4YHBc/ZfzG/FLDpT2mxksvy3ZbPiodO/+niSBcQNEMqZK2du4i8lDqCZgbhtlsPc4 edJ3LKfzOH04lGyfxjoyiG+Edoxgtf1MSdRRiD7ONQ/34BTIrHc5wyrCLdBdc4DbehRl7R WBx95H/qof5YMIoWyiy7wWl+QcC4ubKxH+kfbi3D4FiJa80hT/IeW/LzUWsxJQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Thm6C5bTqz10Q2; Sat, 24 Feb 2024 12:14:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41OCExra085047; Sat, 24 Feb 2024 12:14:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41OCExdQ085044; Sat, 24 Feb 2024 12:14:59 GMT (envelope-from git) Date: Sat, 24 Feb 2024 12:14:59 GMT Message-Id: <202402241214.41OCExdQ085044@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: fa778f0ce5ef - stable/14 - bintrans: Error out if writing to the output failed. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: fa778f0ce5ef2bee0ce288a7c8eef9a88ddda8be Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=fa778f0ce5ef2bee0ce288a7c8eef9a88ddda8be commit fa778f0ce5ef2bee0ce288a7c8eef9a88ddda8be Author: Dag-Erling Smørgrav AuthorDate: 2024-02-01 13:10:31 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-02-24 12:12:49 +0000 bintrans: Error out if writing to the output failed. - Cover all code paths. - When decoding, check all output files, not just the last one. - A simple `ferror()` check is not enough as an error may later occur while flushing whatever remains in the output buffer. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D43532 (cherry picked from commit 5cb28f7979773715615cc2131fe40e0c5879ed1d) bintrans: Fix uninitialized variable. `prev` may be used uninitialized if `body` starts with a newline. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: bapt, emaste Differential Revision: https://reviews.freebsd.org/D43534 (cherry picked from commit bce34cba07bcfed9cd519a658e594c9910c8f210) bintrans: Add base64 to name list in manual page. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: 0mp, pstef Differential Revision: https://reviews.freebsd.org/D43558 (cherry picked from commit 64028ac3ba9668cff31bfe2c79d85a3b89e10953) bintrans: Remove unused variable. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D43559 (cherry picked from commit bc2913d1736c2b299a265741a779014d001bd108) --- usr.bin/bintrans/bintrans.1 | 9 ++++----- usr.bin/bintrans/qp.c | 5 ++--- usr.bin/bintrans/uudecode.c | 33 ++++++++++++++++++++++----------- usr.bin/bintrans/uuencode.c | 4 ++-- 4 files changed, 30 insertions(+), 21 deletions(-) diff --git a/usr.bin/bintrans/bintrans.1 b/usr.bin/bintrans/bintrans.1 index e7e7f4c56cdf..16ae66aa21d1 100644 --- a/usr.bin/bintrans/bintrans.1 +++ b/usr.bin/bintrans/bintrans.1 @@ -25,9 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" From: @(#)uuencode.1 8.1 (Berkeley) 6/6/93 -.\" -.Dd April 18, 2022 +.Dd January 23, 2024 .Dt BINTRANS 1 .Os .Sh NAME @@ -35,8 +33,9 @@ .Nm uuencode , .Nm uudecode , .Nm b64encode , -.Nm b64decode -.Nd encode/decode a binary file +.Nm b64decode , +.Nm base64 +.Nd encode / decode a binary file .Sh SYNOPSIS .Nm .Op algorithm diff --git a/usr.bin/bintrans/qp.c b/usr.bin/bintrans/qp.c index 74fa1ec3ae90..c2c9dfa7a224 100644 --- a/usr.bin/bintrans/qp.c +++ b/usr.bin/bintrans/qp.c @@ -90,9 +90,9 @@ decode_quoted_printable(const char *body, FILE *fpo) static void encode_quoted_printable(const char *body, FILE *fpo) { - char prev; const char *end = body + strlen(body); size_t linelen = 0; + char prev = '\0'; while (*body != '\0') { if (linelen == 75) { @@ -138,12 +138,11 @@ qp(FILE *fp, FILE *fpo, bool encode) { char *line = NULL; size_t linecap = 0; - ssize_t linelen; void (*codec)(const char *line, FILE *f); codec = encode ? encode_quoted_printable : decode_quoted_printable ; - while ((linelen = getline(&line, &linecap, fp)) > 0) + while (getline(&line, &linecap, fp) > 0) codec(line, fpo); free(line); } diff --git a/usr.bin/bintrans/uudecode.c b/usr.bin/bintrans/uudecode.c index b0ab415486c8..6f716b0f2ec1 100644 --- a/usr.bin/bintrans/uudecode.c +++ b/usr.bin/bintrans/uudecode.c @@ -343,11 +343,22 @@ checkend(const char *ptr, const char *end, const char *msg) warnx("%s: %s: %s", infile, outfile, msg); return (1); } - if (fclose(outfp) != 0) { + return (0); +} + +static int +checkout(int rval) +{ + if (fflush(outfp) != 0) { warn("%s: %s", infile, outfile); - return (1); + rval = 1; } - return (0); + if (outfp != stdout) { + (void)fclose(outfp); + outfp = stdout; + } + outfile = "/dev/stdout"; + return (rval); } static int @@ -361,9 +372,9 @@ uu_decode(void) for (;;) { switch (get_line(buf, sizeof(buf))) { case 0: - return (0); + return (checkout(0)); case 1: - return (1); + return (checkout(1)); } #define DEC(c) (((c) - ' ') & 077) /* single character decode */ @@ -420,11 +431,11 @@ uu_decode(void) } switch (get_line(buf, sizeof(buf))) { case 0: - return (0); + return (checkout(0)); case 1: - return (1); + return (checkout(1)); default: - return (checkend(buf, "end", "no \"end\" line")); + return (checkout(checkend(buf, "end", "no \"end\" line"))); } } @@ -442,9 +453,9 @@ base64_decode(void) switch (get_line(inbuf + strlen(inbuf), sizeof(inbuf) - strlen(inbuf))) { case 0: - return (0); + return (checkout(0)); case 1: - return (1); + return (checkout(1)); } count = 0; @@ -471,7 +482,7 @@ base64_decode(void) break; fwrite(outbuf, 1, n, outfp); } - return (checkend(inbuf, "====", "error decoding base64 input stream")); + return (checkout(checkend(inbuf, "====", "error decoding base64 input stream"))); } static void diff --git a/usr.bin/bintrans/uuencode.c b/usr.bin/bintrans/uuencode.c index 267ab7deb8d1..d6a377fcabae 100644 --- a/usr.bin/bintrans/uuencode.c +++ b/usr.bin/bintrans/uuencode.c @@ -86,7 +86,7 @@ main_base64_encode(const char *in, const char *w) if (w != NULL) columns = arg_to_col(w); base64_encode(); - if (ferror(output)) + if (fflush(output) != 0) errx(1, "write error"); exit(0); } @@ -156,7 +156,7 @@ main_encode(int argc, char *argv[]) base64_encode(); else encode(); - if (ferror(output)) + if (fflush(output) != 0) errx(1, "write error"); exit(0); } From nobody Sat Feb 24 12:15:00 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Thm6F1grQz5Cf98; Sat, 24 Feb 2024 12:15:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Thm6F0SH0z4pB6; Sat, 24 Feb 2024 12:15:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708776901; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HH1D8t1vNXytuOEsC50C9ty7JfzbFYX/Nv1ze0AkeHY=; b=PuT9X5mFaDIOsiyi1rtXBz9T1PA2ZCgv5YslDQRbdpeFqD06sDlzz89xbOfsBZQGiEeQgJ gJ826xI5xYmGbppTjbwle6/Tia6hTDY/qV87SxRbOifQnqiccNsHkB+1SC7ItWz/DgslGi 4Ec6A/dYSIzujvDIsdNgXl5XsHLUyjo2/i2EnH493VVHbKpLu7lVn9L9pigMFA50CWPI1q PkjP0e3pyTxHUEuo6eORBzxfPOvOm1fSE2RGRMdotX62xaQQYjKRbbvOX2XzB3QqrMUda7 u9mN1tgAdpZu+YUVv5A+Nb7gr3ya033AnmNulB6FZgoPRvGkJv0sXJshfs4wpg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708776901; a=rsa-sha256; cv=none; b=qBEzn3Cyf7zi74/Yff7wBU8wvFgjIsf+oVsChZLS2DU5pBTpw33Z4EsWkNgFN3OV3dleIp uC5yt9gvwQbtfNeTE8CmYuRoNYdaqB+RjMkuUmpq9V80wIujIN8y821Ffq6G4YmviXrFQL lLyrIxXEJjWwEPwQdFcO0JZr3XK7Wz9lsJT8AXwCTEfan6Lyw7gTwQZ+ApQHsFENlHAFzx 7WMGXTyNQVNvwVHJCh2llC5Svphg1CtE/LXt0IQxHMWoOwJoHbfe3+xPsNsUAXT/HVOFaG 5VmVUt6VXS1lvu0ftMU1ykWZtYVZ46yIYm8I4BN7ScJKKVgxp3IB98Q8Pe1iEA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708776901; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HH1D8t1vNXytuOEsC50C9ty7JfzbFYX/Nv1ze0AkeHY=; b=XhI/TmGq6x1GLgZlVop7/ZBdthynW0X5FC9b10aj/l08uf2OkgrvrJyAH+a4V0Jy6ifYs0 wgu77crwtDf42wppBdBuQJss9BWlBfRenEeHumowDZdF9QxgHnVpUAQC4UmG23y/7wEdYK sxc+C7NDDlvSwrKi/e9StYvTE9NjMjDJNs/9aXiqwRTOSKUvEzdLeEyu5l8RFJM+eCJUcX Tv2C+lOjLgN1Tt0iTyu0jo27EjCCBnzlpQIIzGloy4CrAAkdoNDWQgVsW0D306CNK6DR3O s9dq3uITjpOcc3A4LFgjHsXCo9IQyq4g1zI6/qWz7+cA0YksxtenMa7gtRGjzg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Thm6D6d6Rz10Q3; Sat, 24 Feb 2024 12:15:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41OCF0dq085108; Sat, 24 Feb 2024 12:15:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41OCF0ZM085105; Sat, 24 Feb 2024 12:15:00 GMT (envelope-from git) Date: Sat, 24 Feb 2024 12:15:00 GMT Message-Id: <202402241215.41OCF0ZM085105@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 4ffc5ab03f83 - stable/14 - patch: Support long context lines. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 4ffc5ab03f8370dcffb1d0bb968e2152348cc709 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=4ffc5ab03f8370dcffb1d0bb968e2152348cc709 commit 4ffc5ab03f8370dcffb1d0bb968e2152348cc709 Author: Dag-Erling Smørgrav AuthorDate: 2024-02-12 18:26:13 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-02-24 12:12:49 +0000 patch: Support long context lines. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D43850 (cherry picked from commit 851a9da38f070675c42a6d69c41c47a5d29ee3d0) --- usr.bin/patch/patch.c | 2 +- usr.bin/patch/pch.c | 10 +++++----- usr.bin/patch/pch.h | 2 +- usr.bin/patch/tests/unified_patch_test.sh | 19 +++++++++++++++++++ 4 files changed, 26 insertions(+), 7 deletions(-) diff --git a/usr.bin/patch/patch.c b/usr.bin/patch/patch.c index ecaf799fe9b6..92ea4973e8f6 100644 --- a/usr.bin/patch/patch.c +++ b/usr.bin/patch/patch.c @@ -1083,7 +1083,7 @@ patch_match(LINENUM base, LINENUM offset, LINENUM fuzz) LINENUM pat_lines = pch_ptrn_lines() - fuzz; const char *ilineptr; const char *plineptr; - unsigned short plinelen; + size_t plinelen; /* Patch does not match if we don't have any more context to use */ if (pline > pat_lines) diff --git a/usr.bin/patch/pch.c b/usr.bin/patch/pch.c index d528f06235bf..fb53ff86f9ef 100644 --- a/usr.bin/patch/pch.c +++ b/usr.bin/patch/pch.c @@ -55,7 +55,7 @@ static LINENUM p_max; /* max allowed value of p_end */ static LINENUM p_context = 3; /* # of context lines */ static LINENUM p_input_line = 0; /* current line # from patch file */ static char **p_line = NULL;/* the text of the hunk */ -static unsigned short *p_len = NULL; /* length of each line */ +static size_t *p_len = NULL; /* length of each line */ static char *p_char = NULL; /* +, -, and ! */ static int hunkmax = INITHUNKMAX; /* size of above arrays to begin with */ static int p_indent; /* indent to patch */ @@ -137,7 +137,7 @@ set_hunkmax(void) if (p_line == NULL) p_line = malloc(hunkmax * sizeof(char *)); if (p_len == NULL) - p_len = malloc(hunkmax * sizeof(unsigned short)); + p_len = malloc(hunkmax * sizeof(size_t)); if (p_char == NULL) p_char = malloc(hunkmax * sizeof(char)); } @@ -154,7 +154,7 @@ grow_hunkmax(void) fatal("Internal memory allocation error\n"); p_line = reallocf(p_line, new_hunkmax * sizeof(char *)); - p_len = reallocf(p_len, new_hunkmax * sizeof(unsigned short)); + p_len = reallocf(p_len, new_hunkmax * sizeof(size_t)); p_char = reallocf(p_char, new_hunkmax * sizeof(char)); if (p_line != NULL && p_len != NULL && p_char != NULL) { @@ -1251,7 +1251,7 @@ bool pch_swap(void) { char **tp_line; /* the text of the hunk */ - unsigned short *tp_len;/* length of each line */ + size_t *tp_len; /* length of each line */ char *tp_char; /* +, -, and ! */ LINENUM i; LINENUM n; @@ -1408,7 +1408,7 @@ pch_context(void) /* * Return the length of a particular patch line. */ -unsigned short +size_t pch_line_len(LINENUM line) { return p_len[line]; diff --git a/usr.bin/patch/pch.h b/usr.bin/patch/pch.h index 5ce4f72497c7..b6c6363155a5 100644 --- a/usr.bin/patch/pch.h +++ b/usr.bin/patch/pch.h @@ -45,7 +45,7 @@ bool there_is_another_patch(void); bool another_hunk(void); bool pch_swap(void); char *pfetch(LINENUM); -unsigned short pch_line_len(LINENUM); +size_t pch_line_len(LINENUM); LINENUM pch_first(void); LINENUM pch_ptrn_lines(void); LINENUM pch_newfirst(void); diff --git a/usr.bin/patch/tests/unified_patch_test.sh b/usr.bin/patch/tests/unified_patch_test.sh index 43b0d8373cfa..7d4b74182c41 100755 --- a/usr.bin/patch/tests/unified_patch_test.sh +++ b/usr.bin/patch/tests/unified_patch_test.sh @@ -141,6 +141,24 @@ file_removal_body() atf_check -o inline:"y\n" cat foo } +atf_test_case plinelen +plinelen_body() +{ + hello="$(jot -b hello -s, 20000 | tee foo.txt)" + cp foo.txt bar.txt + echo "world" >>bar.txt + cat >foo.diff < To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 1288891878d9 - stable/14 - md5: Accept "-" as alias for stdin. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 1288891878d9a194af8c170bb6a33c06e306e0e0 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=1288891878d9a194af8c170bb6a33c06e306e0e0 commit 1288891878d9a194af8c170bb6a33c06e306e0e0 Author: Dag-Erling Smørgrav AuthorDate: 2024-02-16 12:36:58 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-02-24 12:12:49 +0000 md5: Accept "-" as alias for stdin. (based on a patch by jhb) MFC after: 1 week PR: 276915 Reported by: Hannes Hauswedell Reviewed by: allanjude, markj, jhb, emaste Differential Revision: https://reviews.freebsd.org/D43870 (cherry picked from commit 72ee91fed4cfdcfbfb767cc166370b40e50d446a) md5: Ignore files in string and passthrough mode. MFC after: 1 week Reviewed by: allanjude, markj Differential Revision: https://reviews.freebsd.org/D43871 (cherry picked from commit 5b44edb4058365ba8e4ccfdb5176c1cddd4394fe) md5: Clean up input stream rights. Keep it simple, caph_limit_stdio() and fileargs_fopen() already take care of everything for us. MFC after: 1 week Reviewed by: markj, jhb, emaste Differential Revision: https://reviews.freebsd.org/D43897 (cherry picked from commit 17d5b027c1921d0c6ba2de7993dd808dbf4df078) md5: Add test case for GNU input modes. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: allanjude, markj Differential Revision: https://reviews.freebsd.org/D43988 (cherry picked from commit e7308a60a5b77a1e4aff6e27eddef40fedabb98c) md5: Fix Perl mode long options. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: imp, allanjude, markj Differential Revision: https://reviews.freebsd.org/D43989 (cherry picked from commit 4db7ca24470576948e33f48033cfa5be2749950e) md5: Fix GNU check mode. Fixes: 9b20849bc5f1b500f2de7aeca77f0e6556069bbb MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: imp, allanjude, markj Differential Revision: https://reviews.freebsd.org/D43990 (cherry picked from commit c05533d97ac178f8e811407860d47d3c0ae61eed) md5: Untabify declarations. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: imp, allanjude, markj Differential Revision: https://reviews.freebsd.org/D43991 (cherry picked from commit 702f133fa18185a7e10e66316e8f158be935b696) --- sbin/md5/md5.1 | 9 +++- sbin/md5/md5.c | 101 +++++++++++++++++++++++---------------------- sbin/md5/tests/md5_test.sh | 35 ++++++++++++++++ 3 files changed, 95 insertions(+), 50 deletions(-) diff --git a/sbin/md5/md5.1 b/sbin/md5/md5.1 index 0cdfff928211..0a8dc46f3b1f 100644 --- a/sbin/md5/md5.1 +++ b/sbin/md5/md5.1 @@ -1,4 +1,4 @@ -.Dd May 10, 2023 +.Dd February 13, 2024 .Dt MD5 1 .Os .Sh NAME @@ -79,6 +79,11 @@ utility does the same, but with command-line options and an output format that match those of the similarly named utility that ships with Perl. .Pp +In all cases, each file listed on the command line is processed separately. +If no files are listed on the command line, or a file name is given as +.Pa - , +input is taken from stdin instead. +.Pp It is conjectured that it is computationally infeasible to produce two messages having the same message digest, or to produce any message having a given prespecified target message digest. @@ -124,6 +129,7 @@ option, the calculated digest is printed in addition to the exit status being se .Pq Note that this option is not yet useful if multiple files are specified. .It Fl p , -passthrough Echo stdin to stdout and append the checksum to stdout. +In this mode, any files specified on the command line are silently ignored. .It Fl q , -quiet Quiet mode \(em only the checksum is printed out. Overrides the @@ -141,6 +147,7 @@ options. .It Fl s Ar string , Fl -string= Ns Ar string Print a checksum of the given .Ar string . +In this mode, any files specified on the command line are silently ignored. .It Fl t , Fl -time-trial Run a built-in time trial. For the diff --git a/sbin/md5/md5.c b/sbin/md5/md5.c index eb9a2ffae1cc..1bf897d119c0 100644 --- a/sbin/md5/md5.c +++ b/sbin/md5/md5.c @@ -264,7 +264,8 @@ static const char *gnu_shortopts = "bctwz"; static const struct option perl_longopts[] = { { "algorithm", required_argument, 0, opt_algorithm }, - { "check", required_argument, 0, opt_check }, + { "binary", no_argument, 0, opt_binary }, + { "check", no_argument, 0, opt_check }, { "help", no_argument, 0, opt_help }, { "ignore-missing", no_argument, 0, opt_ignore_missing }, { "quiet", no_argument, 0, opt_quiet }, @@ -287,9 +288,10 @@ MD5_Update(MD5_CTX *c, const unsigned char *data, size_t len) } struct chksumrec { - char *filename; - char *chksum; - struct chksumrec *next; + char *filename; + enum input_mode input_mode; + char *chksum; + struct chksumrec *next; }; static struct chksumrec *head = NULL; @@ -302,17 +304,17 @@ static unsigned int numrecs; static void gnu_check(const char *checksumsfile) { - FILE *inp; - char *linebuf = NULL; - size_t linecap; - ssize_t linelen; - int lineno; - char *filename; - char *hashstr; - struct chksumrec *rec; - const char *digestname; - size_t digestnamelen; - size_t hashstrlen; + FILE *inp; + char *linebuf = NULL; + size_t linecap; + ssize_t linelen; + int lineno; + char *filename; + char *hashstr; + struct chksumrec *rec; + const char *digestname; + size_t digestnamelen; + size_t hashstrlen; struct stat st; if (strcmp(checksumsfile, "-") == 0) @@ -362,16 +364,18 @@ gnu_check(const char *checksumsfile) if (rec == NULL) errx(1, "malloc failed"); - if (*filename == '*' || - *filename == ' ' || - *filename == 'U' || - *filename == '^') { - if (lstat(filename, &st) != 0) - filename++; + if ((*filename == '*' || *filename == ' ' || + *filename == 'U' || *filename == '^') && + lstat(filename, &st) != 0 && + lstat(filename + 1, &st) == 0) { + rec->filename = strdup(filename + 1); + rec->input_mode = (enum input_mode)*filename; + } else { + rec->filename = strdup(filename); + rec->input_mode = input_mode; } rec->chksum = strdup(hashstr); - rec->filename = strdup(filename); if (rec->chksum == NULL || rec->filename == NULL) errx(1, "malloc failed"); rec->next = NULL; @@ -396,17 +400,17 @@ int main(int argc, char *argv[]) { #ifdef HAVE_CAPSICUM - cap_rights_t rights; - fileargs_t *fa = NULL; + cap_rights_t rights; + fileargs_t *fa = NULL; #endif const struct option *longopts; const char *shortopts; - FILE *f; - int i, opt; - char *p, *string = NULL; - char buf[HEX_DIGEST_LENGTH]; - size_t len; - struct chksumrec *rec; + FILE *f; + int i, opt; + char *p, *string = NULL; + char buf[HEX_DIGEST_LENGTH]; + size_t len; + struct chksumrec *rec; if ((progname = strrchr(argv[0], '/')) == NULL) progname = argv[0]; @@ -575,7 +579,7 @@ main(int argc, char *argv[]) argv += optind; #ifdef HAVE_CAPSICUM - if (caph_limit_stdout() < 0 || caph_limit_stderr() < 0) + if (caph_limit_stdio() < 0) err(1, "unable to limit rights for stdio"); #endif @@ -607,41 +611,40 @@ main(int argc, char *argv[]) err(1, "Unable to enter capability mode"); #endif - if (*argv) { + if (*argv && !pflag && string == NULL) { do { const char *filename = *argv; const char *filemode = "rb"; + if (cflag && mode != mode_bsd) { + input_mode = rec->input_mode; + checkAgainst = rec->chksum; + rec = rec->next; + } + if (input_mode == input_text) + filemode = "r"; + if (strcmp(filename, "-") == 0) { + f = stdin; + } else { #ifdef HAVE_CAPSICUM - if ((f = fileargs_fopen(fa, filename, filemode)) == NULL) { + f = fileargs_fopen(fa, filename, filemode); #else - if ((f = fopen(filename, filemode)) == NULL) { + f = fopen(filename, filemode); #endif + } + if (f == NULL) { if (errno != ENOENT || !(cflag && ignoreMissing)) { warn("%s", filename); failed = true; } - if (cflag && mode != mode_bsd) - rec = rec->next; continue; } -#ifdef HAVE_CAPSICUM - if (caph_rights_limit(fileno(f), &rights) < 0) - err(1, "capsicum"); -#endif - if (cflag && mode != mode_bsd) { - checkAgainst = rec->chksum; - rec = rec->next; - } p = MDInput(&Algorithm[digest], f, buf, false); - (void)fclose(f); + if (f != stdin) + (void)fclose(f); MDOutput(&Algorithm[digest], p, filename); } while (*++argv); } else if (!cflag && string == NULL && !skip) { -#ifdef HAVE_CAPSICUM - if (caph_limit_stdin() < 0) - err(1, "capsicum"); -#endif if (mode == mode_bsd) output_mode = output_bare; p = MDInput(&Algorithm[digest], stdin, buf, pflag); diff --git a/sbin/md5/tests/md5_test.sh b/sbin/md5/tests/md5_test.sh index c6bc1dfd7be0..34bdf43f13ea 100644 --- a/sbin/md5/tests/md5_test.sh +++ b/sbin/md5/tests/md5_test.sh @@ -197,11 +197,15 @@ bsd_${alg}_vec${i}_body() { printf '%s' \"\$inp_${i}\" >in atf_check -o inline:\"\$out_${i}_${alg}\n\" ${alg} input + # The first line is malformed per GNU coreutils but matches + # what we produce when mode == mode_bsd && output_mode == + # output_reverse (i.e. `sha1 -r`) so we want to support it. + cat >digests < To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 181e9683778e - stable/14 - sdiff: Misc cleanup. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 181e9683778ee4169d8e54e7330d4ca5281701f6 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=181e9683778ee4169d8e54e7330d4ca5281701f6 commit 181e9683778ee4169d8e54e7330d4ca5281701f6 Author: Dag-Erling Smørgrav AuthorDate: 2024-02-18 17:39:23 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-02-24 12:12:49 +0000 sdiff: Misc cleanup. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D43943 (cherry picked from commit 3cc86989bfbe27c91b5db592c2af33fef153e230) sdiff: Fix --expand-tabs and --tabsize. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D43941 (cherry picked from commit a834edfccd14a8c0f152a3b0078469af8e05f3fd) sdiff: Fix binary case. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D43942 (cherry picked from commit ad7bef8b890768e68a48bbfa6b92ebf635068504) --- usr.bin/sdiff/sdiff.1 | 4 +- usr.bin/sdiff/sdiff.c | 232 +++++++++++++++++++++----------------- usr.bin/sdiff/tests/sdiff_test.sh | 36 ++++++ 3 files changed, 164 insertions(+), 108 deletions(-) diff --git a/usr.bin/sdiff/sdiff.1 b/usr.bin/sdiff/sdiff.1 index ef9bb95a0990..ca6594c6479a 100644 --- a/usr.bin/sdiff/sdiff.1 +++ b/usr.bin/sdiff/sdiff.1 @@ -3,7 +3,7 @@ .\" Written by Raymond Lai . .\" Public domain. .\" -.Dd April 8, 2017 +.Dd February 16, 2024 .Dt SDIFF 1 .Os .Sh NAME @@ -117,8 +117,6 @@ Ignore all spaces. Ignore blank lines. .It Fl E -ignore-tab-expansion Treat tabs and eight spaces as the same. -.It Fl t -ignore-tabs -Ignore tabs. .It Fl H -speed-large-files Assume scattered small changes in a large file. .It Fl -ignore-file-name-case diff --git a/usr.bin/sdiff/sdiff.c b/usr.bin/sdiff/sdiff.c index b863d5875db6..6402b85017a7 100644 --- a/usr.bin/sdiff/sdiff.c +++ b/usr.bin/sdiff/sdiff.c @@ -9,7 +9,6 @@ #include #include #include -#include #include #include @@ -19,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -51,7 +51,7 @@ static void astrcat(char **, const char *); static void enqueue(char *, char, char *); static char *mktmpcpy(const char *); static int istextfile(FILE *); -static void binexec(char *, char *, char *) __dead2; +static int bindiff(FILE *, char *, FILE *, char *); static void freediff(struct diffline *); static void int_usage(void); static int parsecmd(FILE *, FILE *, FILE *); @@ -69,11 +69,13 @@ static STAILQ_HEAD(, diffline) diffhead = STAILQ_HEAD_INITIALIZER(diffhead); static size_t line_width; /* width of a line (two columns and divider) */ static size_t width; /* width of each column */ static size_t file1ln, file2ln; /* line number of file1 and file2 */ -static int Iflag = 0; /* ignore sets matching regexp */ -static int lflag; /* print only left column for identical lines */ -static int sflag; /* skip identical lines */ -FILE *outfp; /* file to save changes to */ -const char *tmpdir; /* TMPDIR or /tmp */ +static bool Iflag; /* ignore sets matching regexp */ +static bool lflag; /* print only left column for identical lines */ +static bool sflag; /* skip identical lines */ +static bool tflag; /* expand tabs */ +static int tabsize = 8; /* tab size */ +FILE *outfp; /* file to save changes to */ +const char *tmpdir; /* TMPDIR or /tmp */ enum { HELP_OPT = CHAR_MAX + 1, @@ -127,7 +129,7 @@ static const char *help_msg[] = { "\t-d, --minimal: minimize diff size.", "\t-I RE, --ignore-matching-lines=RE: ignore changes whose line matches RE.", "\t-i, --ignore-case: do a case-insensitive comparison.", - "\t-t, --expand-tabs: sxpand tabs to spaces.", + "\t-t, --expand-tabs: expand tabs to spaces.", "\t-W, --ignore-all-spaces: ignore all spaces.", "\t--speed-large-files: assume large file with scattered changes.", "\t--strip-trailing-cr: strip trailing carriage return.", @@ -206,14 +208,13 @@ FAIL: int main(int argc, char **argv) { - FILE *diffpipe=NULL, *file1, *file2; - size_t diffargc = 0, wflag = WIDTH; - int ch, fd[2] = {-1}, status; - pid_t pid=0; - const char *outfile = NULL; - char **diffargv, *diffprog = diff_path, *filename1, *filename2, - *tmp1, *tmp2, *s1, *s2; - int i; + FILE *diffpipe, *file1, *file2; + size_t diffargc = 0, flagc = 0, wval = WIDTH; + int ch, fd[2], i, ret, status; + pid_t pid; + const char *errstr, *outfile = NULL; + char **diffargv, *diffprog = diff_path, *flagv; + char *filename1, *filename2, *tmp1, *tmp2, *s1, *s2; char I_arg[] = "-I"; char speed_lf[] = "--speed-large-files"; @@ -228,26 +229,26 @@ main(int argc, char **argv) * waste some memory; however we need an extra space for the * NULL at the end, so it sort of works out. */ - if (!(diffargv = calloc(argc, sizeof(char **) * 2))) - err(2, "main"); + if ((diffargv = calloc(argc, sizeof(char *) * 2)) == NULL) + err(2, NULL); /* Add first argument, the program name. */ diffargv[diffargc++] = diffprog; - /* create a dynamic string for merging single-switch options */ - if ( asprintf(&diffargv[diffargc++], "-") < 0 ) - err(2, "main"); + /* create a dynamic string for merging single-character options */ + if ((flagv = malloc(flagc + 2)) == NULL) + err(2, NULL); + flagv[flagc] = '-'; + flagv[flagc + 1] = '\0'; + diffargv[diffargc++] = flagv; while ((ch = getopt_long(argc, argv, "aBbdEHI:ilo:stWw:", longopts, NULL)) != -1) { - const char *errstr; - switch (ch) { /* only compatible --long-name-form with diff */ case FCASE_IGNORE_OPT: case FCASE_SENSITIVE_OPT: case STRIPCR_OPT: - case TSIZE_OPT: case 'S': break; /* combine no-arg single switches */ @@ -257,16 +258,14 @@ main(int argc, char **argv) case 'd': case 'E': case 'i': - case 't': case 'W': - diffargv[1] = realloc(diffargv[1], sizeof(char) * strlen(diffargv[1]) + 2); + flagc++; + flagv = realloc(flagv, flagc + 2); /* * In diff, the 'W' option is 'w' and the 'w' is 'W'. */ - if (ch == 'W') - sprintf(diffargv[1], "%sw", diffargv[1]); - else - sprintf(diffargv[1], "%s%c", diffargv[1], ch); + flagv[flagc] = ch == 'W' ? 'w' : ch; + flagv[flagc + 1] = '\0'; break; case 'H': diffargv[diffargc++] = speed_lf; @@ -275,21 +274,24 @@ main(int argc, char **argv) diffargv[0] = diffprog = optarg; break; case 'I': - Iflag = 1; + Iflag = true; diffargv[diffargc++] = I_arg; diffargv[diffargc++] = optarg; break; case 'l': - lflag = 1; + lflag = true; break; case 'o': outfile = optarg; break; case 's': - sflag = 1; + sflag = true; + break; + case 't': + tflag = true; break; case 'w': - wflag = strtonum(optarg, WIDTH_MIN, + wval = strtonum(optarg, WIDTH_MIN, INT_MAX, &errstr); if (errstr) errx(2, "width is %s: %s", errstr, optarg); @@ -299,19 +301,23 @@ main(int argc, char **argv) printf("%s\n", help_msg[i]); exit(0); break; + case TSIZE_OPT: + tabsize = strtonum(optarg, 1, INT_MAX, &errstr); + if (errstr) + errx(2, "tabsize is %s: %s", errstr, optarg); + break; default: usage(); break; } } - /* no single switches were used */ - if (strcmp(diffargv[1], "-") == 0 ) { - for ( i = 1; i < argc-1; i++) { - diffargv[i] = diffargv[i+1]; - } - diffargv[diffargc-1] = NULL; + /* no single-character options were used */ + if (flagc == 0) { + memmove(diffargv + 1, diffargv + 2, + sizeof(char *) * (diffargc - 2)); diffargc--; + free(flagv); } argc -= optind; @@ -350,13 +356,22 @@ main(int argc, char **argv) filename2 = tmp2; } + if ((file1 = fopen(filename1, "r")) == NULL) + err(2, "could not open %s", filename1); + if ((file2 = fopen(filename2, "r")) == NULL) + err(2, "could not open %s", filename2); + if (!istextfile(file1) || !istextfile(file2)) { + ret = bindiff(file1, filename1, file2, filename2); + goto done; + } + diffargv[diffargc++] = filename1; diffargv[diffargc++] = filename2; /* Add NULL to end of array to indicate end of array. */ diffargv[diffargc++] = NULL; /* Subtract column divider and divide by two. */ - width = (wflag - 3) / 2; + width = (wval - 3) / 2; /* Make sure line_width can fit in size_t. */ if (width > (SIZE_MAX - 3) / 2) errx(2, "width is too large: %zu", width); @@ -365,21 +380,18 @@ main(int argc, char **argv) if (pipe(fd)) err(2, "pipe"); - switch (pid = fork()) { - case 0: + if ((pid = fork()) < 0) + err(1, "fork()"); + if (pid == 0) { /* child */ /* We don't read from the pipe. */ close(fd[0]); - if (dup2(fd[1], STDOUT_FILENO) == -1) - err(2, "child could not duplicate descriptor"); + if (dup2(fd[1], STDOUT_FILENO) != STDOUT_FILENO) + _exit(2); /* Free unused descriptor. */ close(fd[1]); execvp(diffprog, diffargv); - err(2, "could not execute diff: %s", diffprog); - break; - case -1: - err(2, "could not fork"); - break; + _exit(2); } /* parent */ @@ -390,26 +402,6 @@ main(int argc, char **argv) if ((diffpipe = fdopen(fd[0], "r")) == NULL) err(2, "could not open diff pipe"); - if ((file1 = fopen(filename1, "r")) == NULL) - err(2, "could not open %s", filename1); - if ((file2 = fopen(filename2, "r")) == NULL) - err(2, "could not open %s", filename2); - if (!istextfile(file1) || !istextfile(file2)) { - /* Close open files and pipe, delete temps */ - fclose(file1); - fclose(file2); - if (diffpipe != NULL) - fclose(diffpipe); - if (tmp1) - if (unlink(tmp1)) - warn("Error deleting %s.", tmp1); - if (tmp2) - if (unlink(tmp2)) - warn("Error deleting %s.", tmp2); - free(tmp1); - free(tmp2); - binexec(diffprog, filename1, filename2); - } /* Line numbers start at one. */ file1ln = file2ln = 1; @@ -421,20 +413,10 @@ main(int argc, char **argv) /* Wait for diff to exit. */ if (waitpid(pid, &status, 0) == -1 || !WIFEXITED(status) || WEXITSTATUS(status) >= 2) - err(2, "diff exited abnormally."); + errx(2, "diff exited abnormally"); + ret = WEXITSTATUS(status); - /* Delete and free unneeded temporary files. */ - if (tmp1) - if (unlink(tmp1)) - warn("Error deleting %s.", tmp1); - if (tmp2) - if (unlink(tmp2)) - warn("Error deleting %s.", tmp2); - free(tmp1); - free(tmp2); - filename1 = filename2 = tmp1 = tmp2 = NULL; - - /* No more diffs, so print common lines. */ + /* No more diffs, so enqueue common lines. */ if (lflag) while ((s1 = xfgets(file1))) enqueue(s1, ' ', NULL); @@ -452,23 +434,55 @@ main(int argc, char **argv) /* Process unmodified lines. */ processq(); +done: + /* Delete and free unneeded temporary files. */ + if (tmp1 != NULL) { + if (unlink(tmp1) != 0) + warn("failed to delete %s", tmp1); + free(tmp1); + } + if (tmp2 != NULL) { + if (unlink(tmp2) != 0) + warn("failed to delete %s", tmp2); + free(tmp2); + } + /* Return diff exit status. */ - return (WEXITSTATUS(status)); + free(diffargv); + if (flagc > 0) + free(flagv); + return (ret); } /* - * When sdiff detects a binary file as input, executes them with - * diff to maintain the same behavior as GNU sdiff with binary input. + * When sdiff detects a binary file as input. */ -static void -binexec(char *diffprog, char *f1, char *f2) +static int +bindiff(FILE *f1, char *fn1, FILE *f2, char *fn2) { - - char *args[] = {diffprog, f1, f2, (char *) 0}; - execv(diffprog, args); - - /* If execv() fails, sdiff's execution will continue below. */ - errx(1, "could not execute diff process"); + int ch1, ch2; + + flockfile(f1); + flockfile(f2); + do { + ch1 = getc_unlocked(f1); + ch2 = getc_unlocked(f2); + } while (ch1 != EOF && ch2 != EOF && ch1 == ch2); + funlockfile(f2); + funlockfile(f1); + if (ferror(f1)) { + warn("%s", fn1); + return (2); + } + if (ferror(f2)) { + warn("%s", fn2); + return (2); + } + if (ch1 != EOF || ch2 != EOF) { + printf("Binary files %s and %s differ\n", fn1, fn2); + return (1); + } + return (0); } /* @@ -514,11 +528,11 @@ printcol(const char *s, size_t *col, const size_t col_max) * If rounding to next multiple of eight causes * an integer overflow, just return. */ - if (*col > SIZE_MAX - 8) + if (*col > SIZE_MAX - tabsize) return; /* Round to next multiple of eight. */ - new_col = (*col / 8 + 1) * 8; + new_col = (*col / tabsize + 1) * tabsize; /* * If printing the tab goes past the column @@ -526,12 +540,20 @@ printcol(const char *s, size_t *col, const size_t col_max) */ if (new_col > col_max) return; - *col = new_col; + + if (tflag) { + do { + putchar(' '); + } while (++*col < new_col); + } else { + putchar(*s); + *col = new_col; + } break; default: - ++(*col); + ++*col; + putchar(*s); } - putchar(*s); } } @@ -552,7 +574,7 @@ prompt(const char *s1, const char *s2) const char *p; /* Skip leading whitespace. */ - for (p = cmd; isspace(*p); ++p) + for (p = cmd; isspace((unsigned char)*p); ++p) ; switch (*p) { case 'e': @@ -578,10 +600,10 @@ prompt(const char *s1, const char *s2) /* End of command parsing. */ break; case 's': - sflag = 1; + sflag = true; goto PROMPT; case 'v': - sflag = 0; + sflag = false; /* FALLTHROUGH */ default: /* Interactive usage help. */ @@ -702,7 +724,7 @@ parsecmd(FILE *diffpipe, FILE *file1, FILE *file2) p = line; /* Go to character after line number. */ - while (isdigit(*p)) + while (isdigit((unsigned char)*p)) ++p; c = *p; *p++ = 0; @@ -714,7 +736,7 @@ parsecmd(FILE *diffpipe, FILE *file1, FILE *file2) if (c == ',') { q = p; /* Go to character after file2end. */ - while (isdigit(*p)) + while (isdigit((unsigned char)*p)) ++p; c = *p; *p++ = 0; @@ -733,7 +755,7 @@ parsecmd(FILE *diffpipe, FILE *file1, FILE *file2) q = p; /* Go to character after line number. */ - while (isdigit(*p)) + while (isdigit((unsigned char)*p)) ++p; c = *p; *p++ = 0; diff --git a/usr.bin/sdiff/tests/sdiff_test.sh b/usr.bin/sdiff/tests/sdiff_test.sh index 100fa1b123b0..83ed93503f18 100755 --- a/usr.bin/sdiff/tests/sdiff_test.sh +++ b/usr.bin/sdiff/tests/sdiff_test.sh @@ -191,6 +191,40 @@ short_body() $(atf_get_srcdir)/d_input2 >/dev/null ; cat merge.out" } +atf_test_case tflag +tflag_head() +{ + atf_set "descr" "Checks tab expansion" +} +tflag_body() +{ + printf "a\tb\n" >a + printf "b\ta\n" >b + atf_check -s exit:1 -o match:$'a\tb' \ + sdiff a b + atf_check -s exit:1 -o match:"a {7}b" \ + sdiff -t a b + atf_check -s exit:1 -o match:"a {3}b" \ + sdiff -t --tabsize 4 a b +} + +atf_test_case binary +binary_head() +{ + atf_set "descr" "Checks binary file handling" +} +binary_body() +{ + printf "a\0\n" >a + printf "b\0\n" >b + atf_check -o empty sdiff a a + atf_check -o empty sdiff a - To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: be2c6fba9d83 - stable/14 - pfsync: Fix offset calculation List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: be2c6fba9d8314f9f8f4d4acc1c35e7a6a84b080 Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=be2c6fba9d8314f9f8f4d4acc1c35e7a6a84b080 commit be2c6fba9d8314f9f8f4d4acc1c35e7a6a84b080 Author: Kajetan Staszkiewicz AuthorDate: 2024-02-13 19:41:14 +0000 Commit: Kristof Provost CommitDate: 2024-02-24 18:47:13 +0000 pfsync: Fix offset calculation Even though message version is automatically recognized and the top of the struct is identical for different versions, when iterating over multiple messages proper message length must be used. That's the length of an union member for given version, not of the union itself. Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D43862 (cherry picked from commit 50edc630719827b6c58dd515328997fd196b1d78) --- sys/netpfil/pf/if_pfsync.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c index 75c361b394e0..41eab7be515d 100644 --- a/sys/netpfil/pf/if_pfsync.c +++ b/sys/netpfil/pf/if_pfsync.c @@ -1002,15 +1002,17 @@ pfsync_in_ins(struct mbuf *m, int offset, int count, int flags, int action) { struct mbuf *mp; union pfsync_state_union *sa, *sp; - int i, offp, len, msg_version; + int i, offp, total_len, msg_version, msg_len; switch (action) { case PFSYNC_ACT_INS_1301: - len = sizeof(struct pfsync_state_1301) * count; + msg_len = sizeof(struct pfsync_state_1301); + total_len = msg_len * count; msg_version = PFSYNC_MSG_VERSION_1301; break; case PFSYNC_ACT_INS_1400: - len = sizeof(struct pfsync_state_1400) * count; + msg_len = sizeof(struct pfsync_state_1400); + total_len = msg_len * count; msg_version = PFSYNC_MSG_VERSION_1400; break; default: @@ -1018,7 +1020,7 @@ pfsync_in_ins(struct mbuf *m, int offset, int count, int flags, int action) return (-1); } - mp = m_pulldown(m, offset, len, &offp); + mp = m_pulldown(m, offset, total_len, &offp); if (mp == NULL) { V_pfsyncstats.pfsyncs_badlen++; return (-1); @@ -1026,7 +1028,7 @@ pfsync_in_ins(struct mbuf *m, int offset, int count, int flags, int action) sa = (union pfsync_state_union *)(mp->m_data + offp); for (i = 0; i < count; i++) { - sp = &sa[i]; + sp = (union pfsync_state_union *)((char *)sa + msg_len * i); /* Check for invalid values. */ if (sp->pfs_1301.timeout >= PFTM_MAX || @@ -1046,7 +1048,7 @@ pfsync_in_ins(struct mbuf *m, int offset, int count, int flags, int action) break; } - return (len); + return (total_len); } static int @@ -1127,15 +1129,17 @@ pfsync_in_upd(struct mbuf *m, int offset, int count, int flags, int action) union pfsync_state_union *sa, *sp; struct pf_kstate *st; struct mbuf *mp; - int sync, offp, i, len, msg_version; + int sync, offp, i, total_len, msg_len, msg_version; switch (action) { case PFSYNC_ACT_UPD_1301: - len = sizeof(struct pfsync_state_1301) * count; + msg_len = sizeof(struct pfsync_state_1301); + total_len = msg_len * count; msg_version = PFSYNC_MSG_VERSION_1301; break; case PFSYNC_ACT_UPD_1400: - len = sizeof(struct pfsync_state_1400) * count; + msg_len = sizeof(struct pfsync_state_1400); + total_len = msg_len * count; msg_version = PFSYNC_MSG_VERSION_1400; break; default: @@ -1143,7 +1147,7 @@ pfsync_in_upd(struct mbuf *m, int offset, int count, int flags, int action) return (-1); } - mp = m_pulldown(m, offset, len, &offp); + mp = m_pulldown(m, offset, total_len, &offp); if (mp == NULL) { V_pfsyncstats.pfsyncs_badlen++; return (-1); @@ -1151,7 +1155,7 @@ pfsync_in_upd(struct mbuf *m, int offset, int count, int flags, int action) sa = (union pfsync_state_union *)(mp->m_data + offp); for (i = 0; i < count; i++) { - sp = &sa[i]; + sp = (union pfsync_state_union *)((char *)sa + msg_len * i); /* check for invalid values */ if (sp->pfs_1301.timeout >= PFTM_MAX || @@ -1214,7 +1218,7 @@ pfsync_in_upd(struct mbuf *m, int offset, int count, int flags, int action) PF_STATE_UNLOCK(st); } - return (len); + return (total_len); } static int From nobody Sun Feb 25 07:44:05 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TjG3B2wvhz5Bv7T; Sun, 25 Feb 2024 07:44:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TjG3B1GbNz4MNy; Sun, 25 Feb 2024 07:44:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708847046; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VnwGEHlt/kyOoPKOO4QBN+j9ILlY+sBn/4/ota5ALNo=; b=GA8lIqScEhwppDYBXr9fNN8bUCBh8xTLJXl9MTOs+hgDhJ8Kd6s0i7/NFu/56+a6Luxbjq 4SkFfGnKr0NL0jpZsELmGCro3Whg1NW7kiSck1ObTr8fCVYH43/LKD4rPDstQubGJnNSJ3 usOx18XM/m7TtiO+vA1ZoOn3r6mms9Kl9XdNTxmERjoFFbMAHN4biTigSOU1zm+wT4Y+aI d+0uQzFegs0mPS5SofUDVFeR1boMZY2TXd86v5Io5G7inZ2ZoDg6yXW0G8XyxcWYHLUQ9B rUsJ2liQ+EdkxPppq5M0QQFtqyozu0/fWRTEoO74+YuqL8Jw3Rw2AhEbwd7ARQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708847046; a=rsa-sha256; cv=none; b=vxjMIEqAtT05uaM3Su2K42N7uKl2B3oAtTjTdvAS2IuuL+/eDPEcvpRzUtNZq/aYpgpilN ju3C1V2FL1Inp1kX097gnCN28RTB0HvjEmrwmywrUIOu3qh/1hazk0lXj+IsRvBUh2KHND M4lGT0J2tJddpqjWEhcWxWznOELSw4H0L5/oBMAUN899bm/+klN8NwoqTdyVDmeTGLSMzo kpMS8w75LShjPyCVFkihUjtCCbeD9RXFZDS3taROHCAx/64xTmC42t/Ots46pQmEyRsdlS fSkhp7eCOPmvhMNWtM1Z/+Mrcs98RF6boUmUx3jnQoEcKKq4yVvL6ezUiXYc1w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708847046; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VnwGEHlt/kyOoPKOO4QBN+j9ILlY+sBn/4/ota5ALNo=; b=pVS/kKjBzHfBiMHuX0VEbaX/glExibgE8qkNe0IWIOtpB+dmoTcREo4aetq0T6Bvwulx91 fqV4BGD1HMhzpD0nB5iX2sQLpCT8oyzwof+cHrdG9Z4o2JAQmqcPXGT9H6HtYN7QvzkDI5 6m1vc45gKNqLzvCyiYmcFT8IJdiydswgyqpVbh2CvMr2fxOyVTc9+xKpNbWSEgqggS48y+ r9Rd2ZfqhEz8hj5KOCaFqzXWvLw11aa6useHEwWSkJMsSvLIqISDvv8/cRLdxNLl9v6XkX +7yzd0/iiPws1BYTCJpmY3N4AI5dIy0lTvOe5ROOvAP+WKtYc1NtSSOWwkVZaA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TjG3B0Kt7zbTx; Sun, 25 Feb 2024 07:44:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41P7i5Iw073215; Sun, 25 Feb 2024 07:44:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41P7i5XR073212; Sun, 25 Feb 2024 07:44:05 GMT (envelope-from git) Date: Sun, 25 Feb 2024 07:44:05 GMT Message-Id: <202402250744.41P7i5XR073212@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: a3c51cfd5da1 - stable/14 - uath(4): Fix a typo in a source code comment List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a3c51cfd5da1f1675e07fe2e8cd21fcc56515ed4 Auto-Submitted: auto-generated The branch stable/14 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=a3c51cfd5da1f1675e07fe2e8cd21fcc56515ed4 commit a3c51cfd5da1f1675e07fe2e8cd21fcc56515ed4 Author: Gordon Bergling AuthorDate: 2024-02-22 15:55:51 +0000 Commit: Gordon Bergling CommitDate: 2024-02-25 07:42:24 +0000 uath(4): Fix a typo in a source code comment - s/parmeter/parameter/ (cherry picked from commit 5a476e64b543dc63fae7fcd243dc066dced31c3b) --- sys/dev/usb/wlan/if_uathreg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/usb/wlan/if_uathreg.h b/sys/dev/usb/wlan/if_uathreg.h index 47ec13267e17..91e5f04bc902 100644 --- a/sys/dev/usb/wlan/if_uathreg.h +++ b/sys/dev/usb/wlan/if_uathreg.h @@ -50,7 +50,7 @@ struct uath_fwblock { * parameter 2 * ... * - * A variable-length parameter, or a parmeter that is larger than + * A variable-length parameter, or a parameter that is larger than * 32 bits is passed as pair, where length is a * 32-bit quantity and data is padded to 32 bits. */ From nobody Sun Feb 25 07:44:07 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TjG3C2nLbz5Bv0h; Sun, 25 Feb 2024 07:44:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TjG3C2GYwz4MRS; Sun, 25 Feb 2024 07:44:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708847047; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jI/7fU/u4TJiIya+CIkTtHB+ZZBxVSrWAJo2e5qx6S4=; b=Cghk6w1uvWR5otr3KBhVmn8KOfEBRfZNrr5PeR9k2D0vyyPPOgG83y5uTls3nVOfKjtUnS 5EbqH6SpPyMNx+ndNDCC8PgonUppVVSnh+JP65nEgS7lynD8l7zUWaY3MKS1RhTdwoJZAG 2nyMZ/P6VW0OwHFc4CHLkZzH8MK1gTSJxGw47ziyD5dR9ZQ9UavkR35R0S//pTCqFQaFJM W6Oes2JqPKTcj4CmQ07K9zSh3DPJstX0/W022GAGv2RvETHA1rofOZUEZswxB4rRNP/JYF m1SVUtGqtEVE54RUc5xkRHKKqXy/ASsjRjBvqgmWUyR+onxQ7IaLOfd2f6FaAw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708847047; a=rsa-sha256; cv=none; b=iML3m8KIxfZCJcwUjdTE5mo5M6+JhU0c1HUPQQodWi88+j9mPt119Tqq08dBTlyLm/Mxi8 gvxsGVwCEhFjLvtvInY8gRmR8UHBsLwrGhVFExUTCAvTMBsQEC8JvvJbqnV45f6fQynkEr fKDNOcFO+SRibo380RiP3rohEC9wsayyXWlAujXCz2zPN48Y0nwSirDvemHxb7iMv2EEGC g4I89BsZI2jtPOw4MA6lKdSftqEGeuiAR1X67CNOs+263lXGQ6YF2scWNLUpMHhJN53ADZ ilgLTlpDaK92Lew9yAzQ0GRIJvylSGoGtC4RsN49i+h8tEmbOdBGXesjpjvi3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708847047; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jI/7fU/u4TJiIya+CIkTtHB+ZZBxVSrWAJo2e5qx6S4=; b=PUevoETSYinwzNxr0fYwDCNlOjP2MbUwVSBmx5SoyayPXGNquF5NI5aBUQsdS7lZZUkavk kMYlnv/lgmEms+jrTOOuOvf32FFcygxaGoCa9bmp7k0/wcZz6Z2PIRJi1lFQMzCpL7o4sC gaw59+Is7st2NJ8FRPKS/602pppd/XexcVza6DC/vAECEyWbzhSfXTg3HfHjU5TdMYm3j6 Hajt/iCVIMb1C98k63XrHAe7gB1FRB6tQALYIyL0TAdAviP8eNMVAVTOzahfmAWpRNRPtg uirUVCyjn/BBDZLcHGxHfsGlocvp33dj+GwwvjL8KMgPbA3Kbb4oFA7H/j/zyQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TjG3C1NkHzbkG; Sun, 25 Feb 2024 07:44:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41P7i7S8073270; Sun, 25 Feb 2024 07:44:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41P7i7FV073267; Sun, 25 Feb 2024 07:44:07 GMT (envelope-from git) Date: Sun, 25 Feb 2024 07:44:07 GMT Message-Id: <202402250744.41P7i7FV073267@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: efbeab503b2c - stable/14 - vge(4): Fix a typo in a source code comment List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: efbeab503b2c8bfa4488e54171f98f61f551195a Auto-Submitted: auto-generated The branch stable/14 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=efbeab503b2c8bfa4488e54171f98f61f551195a commit efbeab503b2c8bfa4488e54171f98f61f551195a Author: Gordon Bergling AuthorDate: 2024-02-22 16:33:35 +0000 Commit: Gordon Bergling CommitDate: 2024-02-25 07:42:41 +0000 vge(4): Fix a typo in a source code comment - s/embadded/embedded/ (cherry picked from commit 04440331b5700e124c42b570ae1dfd00ea9c26f7) --- sys/dev/vge/if_vgereg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/vge/if_vgereg.h b/sys/dev/vge/if_vgereg.h index e005526c95c1..c5cb53ef2ca7 100644 --- a/sys/dev/vge/if_vgereg.h +++ b/sys/dev/vge/if_vgereg.h @@ -444,7 +444,7 @@ #define VGE_MIICMD_MOUT 0x08 /* data out pin enable */ #define VGE_MIICMD_MDP 0x10 /* enable direct programming mode */ #define VGE_MIICMD_WCMD 0x20 /* embedded mode write */ -#define VGE_MIICMD_RCMD 0x40 /* embadded mode read */ +#define VGE_MIICMD_RCMD 0x40 /* embedded mode read */ #define VGE_MIICMD_MAUTO 0x80 /* enable autopolling */ /* MII address register */ From nobody Sun Feb 25 07:44:08 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TjG3F077wz5BtvQ; Sun, 25 Feb 2024 07:44:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TjG3D3bC5z4Mnq; Sun, 25 Feb 2024 07:44:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708847048; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SxnvS+ntOi2WYxSblhWY4/YUbK+5q9ctf3h1ih0pF1A=; b=sOEbHYWOHRlFAGrQkrkZEZt7eYcsqck+6sRQFvQPRZFZHO8IWfgFqKQWzJiB5xBWjgxlHB bXosII//ZlXDxkdw6csqnm9tvFgVgK0k77v78jef6cgGTXR2rFg8iGmnzzdEyR4JtBT5PD Otjcf/UQlrUFU6LjoD8rZc/Ph1Yneo+Qg9nXGVxtZ+YQUGTdjAdvIynqRMbT/E33ehEClg XqZGMyaYS/0Tvp1mtdCb9iIjIwAjJkviqQsLb7QtSF6E+tuWb+145hJnuakPJzrnk4qE/i pTnlrIw+ozNVrJoImavcFGEvpvqaBkLC91odb+lZAy4RXYoyQy8enZTEn0icXw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708847048; a=rsa-sha256; cv=none; b=KSJZrVb7EpuuZ4GZe0ohdivGS3Dr87eFakQxBLJEWD8zGR2XrR+0BdwfFm7N9HqZJzrkYB Z6z5w68ki5ifgOjDEW0DNHUTnZPaNkK94JmdRkoWVWKCsxdP4CRp7zyGBLfqUXGVEXl55g MIvZjf9xDd53TM8AerpKes4KzKUwHdB0+b3S0tP9wXvEiDPMWhgPFmdb2b5gdCwYMjulw/ muNQth2LV3bepJC26XuKy7EJ2+Y5RdcZ+rSp7MJNG8yke6mxArg5j5khe881a7n54JgOHd N10TO+h4IJ2KhCoThUqhAcEty45GJbaamvq4fmWHWPcJ1ZWArpcen4HhS1kWhA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708847048; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SxnvS+ntOi2WYxSblhWY4/YUbK+5q9ctf3h1ih0pF1A=; b=bniT3eDxTyhyvXMFLcQMtXKCpBj5Xq8+/Gc6kYBOM2hDRitZ3S2uAUuS+ZCMUFFvpBn7YX HdbL27EoLlhlqX15BJTqgguK2f8kgnuMkevXS+atT3M5E4VeCS5MDJG/yGtsYn7vJF3eQh EoEW91BG348P6qSIPZiN8UiyEtG0YnfEptmiCFnFh27bLf+woGrVuHLM/v1A0lSjf6TMsu +t66IU9dhAyooL43Tq/e5SRDvGuPmvsipeNDH8FZUdjcG/uFUbZTuMkOrpYhYD3R6XaEJj rnYLoowtG4G7Kw3Fnk+Og0kZZOkoPCAIeuqQM/haxKNrB3JWuBcbAL0P9+K6xg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TjG3D2SYYzbkH; Sun, 25 Feb 2024 07:44:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41P7i8WK073324; Sun, 25 Feb 2024 07:44:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41P7i8SG073321; Sun, 25 Feb 2024 07:44:08 GMT (envelope-from git) Date: Sun, 25 Feb 2024 07:44:08 GMT Message-Id: <202402250744.41P7i8SG073321@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: f7d2a1d2dc56 - stable/14 - random(4): Fix a typo in a source code comment List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f7d2a1d2dc56eca7d1e210f8ff9db29467903626 Auto-Submitted: auto-generated The branch stable/14 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=f7d2a1d2dc56eca7d1e210f8ff9db29467903626 commit f7d2a1d2dc56eca7d1e210f8ff9db29467903626 Author: Gordon Bergling AuthorDate: 2024-02-22 15:54:50 +0000 Commit: Gordon Bergling CommitDate: 2024-02-25 07:43:02 +0000 random(4): Fix a typo in a source code comment - s/parmeter/parameter/ (cherry picked from commit 5e89e34f846a233fb97302c05af5a47c694405a1) --- sys/dev/random/hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/random/hash.c b/sys/dev/random/hash.c index 8e63d0f638f3..90ac65f42241 100644 --- a/sys/dev/random/hash.c +++ b/sys/dev/random/hash.c @@ -124,7 +124,7 @@ randomdev_encrypt_init(union randomdev_key *context, const void *data) /* * Create a pseudorandom output stream of 'bytecount' bytes using a CTR-mode - * cipher or similar. The 128-bit counter is supplied in the in-out parmeter + * cipher or similar. The 128-bit counter is supplied in the in-out parameter * 'ctr.' The output stream goes to 'd_out.' * * If AES is used, 'bytecount' is guaranteed to be a multiple of From nobody Sun Feb 25 07:44:09 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TjG3F6b0tz5BvK6; Sun, 25 Feb 2024 07:44:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TjG3F4mkMz4MrM; Sun, 25 Feb 2024 07:44:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708847049; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uJUC7rETW5Fmh/xMNk0UmtI9odI5+ujc+DhCNsBvrmM=; b=LhlHe7Coplo+7HZnu0nlsglSUHTk4dNWzF2Py6+WVzOrLr9X0BlmWW7zH0jovCXP7FfIJ/ Pf5lKuK1vN6nMgeMApZMbU+dUktG4MbDLFEueFQS/e3+J+0pGI+Spyp55IDtzA88jIyhCm SxlkHce8ZjUDgaGHP1g8Yw8N8t1DZgxnqIZmqxHP6I0xblxKpoddwVPExp7RgvQ834V9c0 6ar8jakW4WK1+nrEYs825TwgZNrrHbEEOZR3gxN/RghWKOQdjl9q+N0KEhZ7t4F2dJowJw S9fY0HqOOfzVY0zxmNPAiUPptGwNFRL6f98ilCIxRjAgXoS0LLyNgpskFP+XHA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708847049; a=rsa-sha256; cv=none; b=WkocpOMkYrPSHf9rTey+3GVqEEO1ZJd2WZ0AlXkAUQ4Y9Hy0cgGhZ5avjl4GcL3GEuMK+y YH1HPL2tpoghvWsWwtsPxGwOntGonPdMx9RgfbjOgoYLZ8kYk+pXtqH8K9NGkXw9b9nc29 AW5blMGSFbwjgeWKTrRchVLlZbuna+dj0P+QDsRGp09pSXBRd/7kv1zfHXUNxqEKnXxKcP ZlIVzsPccTL6Uueb8HR6gtJh+4lw8x2Pp3LlEW7Wmsj0EBVMYgqXmniCBGFbz7+Ph6XRet oUm7D2r4eVxUV2vTDrpAYTcoUXZmT9lsGHJi6dGDe//R9CfCWk9DnqaAlVx/iQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708847049; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uJUC7rETW5Fmh/xMNk0UmtI9odI5+ujc+DhCNsBvrmM=; b=XKtYT7s1nlJCL8rsmmud6kNe/wCWDhRLr7TCFlh4fa3DKceJCCfQtjK5XIkGyqXO4rBiuN 5mSWlr9jCMsPXqsfbaVJO2gW1RYcgbyAnymm4ozgfVcObwnDHpR7+fDQ7kUBBx0k65ZhtB 6mebMU7z9yOD2w8GiWsY2Xk1oUdRh+4btP7qn3gUVGr/7cwRkWkNy76IfDB/MMVs1ULz8P 7eGo4YsTq4lX/jG8DSuyiyp5TpmLvVQ5R4Wbp8YWbdY+34Vd6uVmJR48ba3oJKO5IG28XU Lr6rHPCu6iAP9iU/zPIK2LwAm+u0e9UvUWvgced2G3DMYIoVFkJ5RKgJCYtkDQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TjG3F3YtTzb9f; Sun, 25 Feb 2024 07:44:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41P7i9oS073375; Sun, 25 Feb 2024 07:44:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41P7i9xT073372; Sun, 25 Feb 2024 07:44:09 GMT (envelope-from git) Date: Sun, 25 Feb 2024 07:44:09 GMT Message-Id: <202402250744.41P7i9xT073372@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: a7a0875d276b - stable/14 - bge(4): Fix some typos in source code comments List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a7a0875d276b127aecba837c5374e4071540ce1b Auto-Submitted: auto-generated The branch stable/14 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=a7a0875d276b127aecba837c5374e4071540ce1b commit a7a0875d276b127aecba837c5374e4071540ce1b Author: Gordon Bergling AuthorDate: 2024-02-22 19:38:50 +0000 Commit: Gordon Bergling CommitDate: 2024-02-25 07:43:21 +0000 bge(4): Fix some typos in source code comments - s/firwmare/firmware/ - s/recue/reduce/ - s/throughpout/throughput/ - s/hardwares/hardware/ Obtainted from: NetBSD (cherry picked from commit d646dca3bc1bbd3bfd38bc5ed375d7a346768dcf) --- sys/dev/bge/if_bge.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c index 77a4cb90d852..a646ed226d3c 100644 --- a/sys/dev/bge/if_bge.c +++ b/sys/dev/bge/if_bge.c @@ -701,7 +701,7 @@ bge_ape_read_fw_ver(struct bge_softc *sc) sc->bge_mfw_flags |= BGE_MFW_ON_APE; - /* Fetch the APE firwmare type and version. */ + /* Fetch the APE firmware type and version. */ apedata = APE_READ_4(sc, BGE_APE_FW_VERSION); features = APE_READ_4(sc, BGE_APE_FW_FEATURES); if ((features & BGE_APE_FW_FEATURE_NCSI) != 0) { @@ -2159,7 +2159,7 @@ bge_blockinit(struct bge_softc *sc) * The BD ring replenish thresholds control how often the * hardware fetches new BD's from the producer rings in host * memory. Setting the value too low on a busy system can - * starve the hardware and recue the throughpout. + * starve the hardware and reduce the throughput. * * Set the BD ring replentish thresholds. The recommended * values are 1/8th the number of descriptors allocated to @@ -2295,7 +2295,7 @@ bge_blockinit(struct bge_softc *sc) */ CSR_WRITE_4(sc, BGE_RXLP_CFG, 0x181); - /* Inialize RX list placement stats mask. */ + /* Initialize RX list placement stats mask. */ CSR_WRITE_4(sc, BGE_RXLP_STATS_ENABLE_MASK, 0x007FFFFF); CSR_WRITE_4(sc, BGE_RXLP_STATS_CTL, 0x1); @@ -3536,7 +3536,7 @@ bge_attach(device_t dev) * known bug which can't handle TSO if Ethernet header + IP/TCP * header is greater than 80 bytes. A workaround for the TSO * bug exist but it seems it's too expensive than not using - * TSO at all. Some hardwares also have the TSO bug so limit + * TSO at all. Some hardware also have the TSO bug so limit * the TSO to the controllers that are not affected TSO issues * (e.g. 5755 or higher). */ From nobody Sun Feb 25 07:44:10 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TjG3H0P8rz5BvK8; Sun, 25 Feb 2024 07:44:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TjG3G5w8nz4MxD; Sun, 25 Feb 2024 07:44:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708847050; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dVAVTI914KZYzH5Qu0v0fk/voZ5PzUa52nkm+DiNyrU=; b=giQg47NfOQlsy0gH/lz9MhyVW05PnPnwjUQmeLpY7w+Mne9xLwjAn731K29Cr36accONEm bn+2Bt41BULuW5JPI/ND6GjIZ8nf0WwIZ1gpFTLXg6+pb7PEI6RNVZ4PchEZH8uW2msD4m UgQtrx4u8upYYG8MSo2kelktq3jSlLdSFK0fr4J0rQuac2NwrDagX+ngR9FElPvt6o/5Vt VylE0YNsdDujpnU7hsg6HBKF6cvaG3Nb0HfHVQzzDpSLn3Emzv8z9kCr2jtmem0Ui4z7GK xB8d8p0VZQcTHteq5SynGdUqOaC8QgIHbUWHCrLXD8BUDfFaHGEAs7wjVr6FQg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708847050; a=rsa-sha256; cv=none; b=EduWkAIBZpg/2VeuK2T/u1/9aqufi9fDX8MIeAnY03tiM7CIyV4dryQuRiUsTIrqXR7RHK InGQRsiInbAc7BYCq31vVf5EdE11yN6onLtMi2L+kb+Q5knUeK95pwLaoDDtlVqiuQkU4N zLF8bEdZL3uoBtyqf5QSLcns8do8uMoABbWwrgjXQbk0CwllPuDrtmJv8XDRHPm/XVtUlT 9Ed57ep/dISrFspij2kVIC6Vc2CErP5yES7DntRRmJJLuYKt8RU1hGjqsm2gaUzggMrFxE Ao60vYTWdjfwrBlZ+Wjx91sIpWnTvfx3+0kDtfruCjAjSoe01pxr1qH2Ie8TwA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708847050; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dVAVTI914KZYzH5Qu0v0fk/voZ5PzUa52nkm+DiNyrU=; b=tfIAOBp1zbVX4z5rU746GHJzeCqwJlY+QUII+fiFNAFIu3pMN+HEAY3WcyowtKwj+UbGHi Aiwbquwag3UTxJnBBuVh9b5VAlhoTRU+24osIZS2m956lzmbuls0Trca0qKPDolJ07wQHw vUD0idkKaWTpfMV7Xq2v7iplvnmRoTtk7PyZfLBRAfA4hIua/QDrGQAqMESRzdU//LtvBF FtLPtQMisv/pN3sjzljvCuxTfcHjeCkqQyNW3brF+b7PFbeCmRuDoXUTYm3AUZw6P0aUHv cH2CZwFtF61xgYg3E+SZEjpTD3GAW222AYsJ9pvHLr4H4VwckqG421a9Xuyyog== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TjG3G4f9lzbmP; Sun, 25 Feb 2024 07:44:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41P7iA21073429; Sun, 25 Feb 2024 07:44:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41P7iA9D073426; Sun, 25 Feb 2024 07:44:10 GMT (envelope-from git) Date: Sun, 25 Feb 2024 07:44:10 GMT Message-Id: <202402250744.41P7iA9D073426@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 324f8ce49a16 - stable/14 - sk(4): Fix a typo in a source code comment List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 324f8ce49a1646cd64da618fd54c83b20468d217 Auto-Submitted: auto-generated The branch stable/14 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=324f8ce49a1646cd64da618fd54c83b20468d217 commit 324f8ce49a1646cd64da618fd54c83b20468d217 Author: Gordon Bergling AuthorDate: 2024-02-22 16:16:49 +0000 Commit: Gordon Bergling CommitDate: 2024-02-25 07:43:38 +0000 sk(4): Fix a typo in a source code comment - /integeated/integrated/ - s/extented/extended/ Obtained from: NetBSD (cherry picked from commit a53204c22790a94a15f0e3c153f7fa12f9d57d27) --- sys/dev/sk/if_skreg.h | 2 +- sys/dev/sk/xmaciireg.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/sk/if_skreg.h b/sys/dev/sk/if_skreg.h index 29284025463d..63452e30f575 100644 --- a/sys/dev/sk/if_skreg.h +++ b/sys/dev/sk/if_skreg.h @@ -405,7 +405,7 @@ * fiber-based cards or BCOM for 1000baseT cards with a Broadcom * PHY. */ -#define SK_PHYTYPE_XMAC 0 /* integeated XMAC II PHY */ +#define SK_PHYTYPE_XMAC 0 /* integrated XMAC II PHY */ #define SK_PHYTYPE_BCOM 1 /* Broadcom BCM5400 */ #define SK_PHYTYPE_LONE 2 /* Level One LXT1000 */ #define SK_PHYTYPE_NAT 3 /* National DP83891 */ diff --git a/sys/dev/sk/xmaciireg.h b/sys/dev/sk/xmaciireg.h index ff836dd48903..dcd91e1640ab 100644 --- a/sys/dev/sk/xmaciireg.h +++ b/sys/dev/sk/xmaciireg.h @@ -335,7 +335,7 @@ #define XM_PHY_ANEXP 0x0006 /* autoneg expansion */ #define XM_PHY_NEXTP 0x0007 /* nextpage */ #define XM_PHY_LPNEXTP 0x0008 /* link partner's nextpage */ -#define XM_PHY_EXTSTS 0x000F /* extented status */ +#define XM_PHY_EXTSTS 0x000F /* extended status */ #define XM_PHY_RESAB 0x0010 /* resolved ability */ #define XM_BMCR_DUPLEX 0x0100 From nobody Sun Feb 25 07:44:11 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TjG3J137Mz5Bv7f; Sun, 25 Feb 2024 07:44:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TjG3H6BLvz4Mh2; Sun, 25 Feb 2024 07:44:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708847051; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s3F+qKA8+9dAm6w+9eq1QLGL9WtzFtBuYpnC+QnpTCY=; b=NazYBzXQfG2ji75+k/2UofVADlIU2bQN9FPjAg5Jje331imd+5XftfLwDbm+j37ilv4R++ F116x3rlT+/bHdFdrAxx9ecd28P7oxaAiHlZc6C/8x0yJP9D/H/d4pRx0hS/b3Aj2cExZD cMocj7VzROz6odcj0kr8CByIqz4zzbRxMNnDsFU3OS7OH26t+amYA5wZjK/n0uY3EuLM4n PNkgXdvzUVMfD/bdKp4cnl05VpXguBJaXfpy0vrlZYzfJ7MRntUcfolVuysjJgBG56nfJh qeb0Z6lawd4Nd3Ta6q5i5D0uY8bUCn2LN7PQ0bM1GeP8HMd+QBN1DWb8ydrGeA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708847051; a=rsa-sha256; cv=none; b=pC0VDoy59EunWTPtDg3a6skLUUYbwHF1wQA4M8XFYgwApWABzxW8xTX4hwXIFKgWCeVuhu EWBwYGaVWZXZayWMTkDmRp3A3ARTw3KY5w422B12QTR/J+MQRlF4dEdvtD/JYPKCp6+CIX VKRGgEDhBYegj8hIR/PtrC+ogJOdp8MV0cq83kK0Sj3eUiSftBwTl/LLnKNzWocfksiboZ wkK+NHyi0tFkiYJd/PQpXNVAtLOO98e7rVT6lHb1v2DKG84YgNKUUcbsTizUwL8kv/Cu5c XaTxPl2EhMT96JS7QPJHapQkuvD+dxj2C4fpExG8BnrKcLUY+U5gx2KIYkbayw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708847051; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s3F+qKA8+9dAm6w+9eq1QLGL9WtzFtBuYpnC+QnpTCY=; b=MTKkMvJ5kXfMLthvA/UtK/mAupv0tte60CXM9FGK81o8ogavq3T+VTk9fu5Uhfsw3Nqvfo DXClqPMAcW2NjshmzwZykzT3mtdr+EVCGpGNVj/t3d9bj7w/tsh34t53cnsU8Hbv+Ob2jV EbjQwzqXRPzE3zy67qYDLDs+Tzjz+EAp/aGNeYm5B9srxe/p8j7/fYHANkjjPtzMGoDr0D Xtrggdp9vzRH9b7TM0z4pAXfgFKClBIZUvQKTUQbYsk3i+6EiI18g0e6NX3E5exrxaKsJT ko4AA6WIX8d4huC1GfPzRSFXiN6bGkc5uSyspO/od0Atz1UsZU/rbTQ9q1BIDw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TjG3H5Gd4zbkJ; Sun, 25 Feb 2024 07:44:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41P7iBiM073483; Sun, 25 Feb 2024 07:44:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41P7iBxN073480; Sun, 25 Feb 2024 07:44:11 GMT (envelope-from git) Date: Sun, 25 Feb 2024 07:44:11 GMT Message-Id: <202402250744.41P7iBxN073480@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: ff9794844f86 - stable/14 - umcs(4): Fix two typos in source code comments List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ff9794844f86d6c30b82cc29ec3f175f449b2e94 Auto-Submitted: auto-generated The branch stable/14 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=ff9794844f86d6c30b82cc29ec3f175f449b2e94 commit ff9794844f86d6c30b82cc29ec3f175f449b2e94 Author: Gordon Bergling AuthorDate: 2024-02-22 13:14:08 +0000 Commit: Gordon Bergling CommitDate: 2024-02-25 07:43:54 +0000 umcs(4): Fix two typos in source code comments - s/frequences/frequencies/ (cherry picked from commit 059fd69e749953c12b2cf099b34d3323d9c67d11) --- sys/dev/usb/serial/umcs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/usb/serial/umcs.c b/sys/dev/usb/serial/umcs.c index ec8c89ab1f8b..18135e3bf67d 100644 --- a/sys/dev/usb/serial/umcs.c +++ b/sys/dev/usb/serial/umcs.c @@ -1047,7 +1047,7 @@ umcs7840_set_baudrate(struct umcs7840_softc *sc, uint8_t portno, uint32_t rate) } DPRINTF("Port %d set speed: %d (%02x / %d)\n", portno, rate, clk, divisor); - /* Set clock source for standard BAUD frequences */ + /* Set clock source for standard BAUD frequencies */ err = umcs7840_get_reg_sync(sc, umcs7840_port_registers[portno].reg_sp, &data); if (err) return (err); @@ -1078,7 +1078,7 @@ umcs7840_set_baudrate(struct umcs7840_softc *sc, uint8_t portno, uint32_t rate) return (0); } -/* Maximum speeds for standard frequences, when PLL is not used */ +/* Maximum speeds for standard frequencies, when PLL is not used */ static const uint32_t umcs7840_baudrate_divisors[] = {0, 115200, 230400, 403200, 460800, 806400, 921600, 1572864, 3145728,}; static const uint8_t umcs7840_baudrate_divisors_len = nitems(umcs7840_baudrate_divisors); From nobody Sun Feb 25 07:45:39 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TjG4z3WRLz5Bv9C; Sun, 25 Feb 2024 07:45:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TjG4z301dz4P4S; Sun, 25 Feb 2024 07:45:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708847139; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2Wcr57E2ld8MDX3VlA0CXoABRCWmKmsLedoJgng8qts=; b=BiDvzBmqb/dIgEUtduyBvbKYsOtq7mG+pNoHASb0MN46zq9E/IG/i7G1EJg7kZjP+XQqlM nWdndGyYz/OYqVg/ftnuKBIEC+g2Xv2edIec2b/MAOWrM82Vhng3q3RmFZmnb1RX4mWk9f T/nVyRVaymW8FfPBcuuC6zciyKsYAsaF5kPPdIzJh36CeovoSO207GEV/QpPnz3TBDrVps u+2UyFy3ES5wDPJIKyiGw8QS8gekmBd51RU0M0NFSiOtw25eQq6PS4GmkvOcTvGmFbz+kL xdK1pm8r0QO8pyzCf2gT4318wGzPQcM9EdcYKIYtne/0Cd9afeeKRbWLpOBqAw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708847139; a=rsa-sha256; cv=none; b=vf4Ut7POquXM3Db9N5ngNVRBm5iRw4KlqE8JiRuvpx/1P/M5hJENu5x7RS/FP+W+R2nNm6 svS/Y6tR+3+prbv5aE6BDcocMoQDi+hiGzAqrjioN/l04Yatdo5Vzk0qrA2m3UjYZSw4sW iEdoaNfzPqyc+bu8qgH45exSSLSXE1xij7u2ocmEPIQ7uWuZKQtp50zKDL03SyMZGzj8nD jJ33Hrh4CP/3TXaVYTR5HUzQKVS3ZzFKrwQLbej6Ilcrqyt0Uui7UGymhgyxJOnwQgoF9q WWUb/Ce7nbeHQaEhFbky9dTikH5s8eXxB8nuOotdzrLlxWFMjdWNN3zrE+Tbzg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708847139; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2Wcr57E2ld8MDX3VlA0CXoABRCWmKmsLedoJgng8qts=; b=xVe2+FXSMniWsM/4NO+sUm5Rt1LXMYzRDXjYpT7uEcT7+J9SiELffESolqmim02WZa3rF0 2KtM0/t5Ky8yrXlsLy/fy/iqWIIh86yZjWBTXl9/XIMLH/5UDgWu33q1LMZsx3s3VHpozI ncUmvWJn0IiKaJa1Rm3t7dOqrQr2wxJ1YVCOhR0Mm/xvBtlD9PHLnoIDhPTL/Ccsv4gnG9 iKmaB/WN10XTTWRNIysJB9SFwRKXUc3YRdJ8DfNII2FWVyRfMbCctacH1YN4+1xsOKRAsg XLkn65UCQawlfWxRY0WWNLmpt7Z8za8y6/OI7W8LOVeMhMMuYuiTNI9ggs4Fzw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TjG4z1yPPzbpw; Sun, 25 Feb 2024 07:45:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41P7jdWh073911; Sun, 25 Feb 2024 07:45:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41P7jdRT073908; Sun, 25 Feb 2024 07:45:39 GMT (envelope-from git) Date: Sun, 25 Feb 2024 07:45:39 GMT Message-Id: <202402250745.41P7jdRT073908@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 91ebcc32be85 - stable/13 - uath(4): Fix a typo in a source code comment List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 91ebcc32be85f5ad93e048bc7040b21779109f30 Auto-Submitted: auto-generated The branch stable/13 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=91ebcc32be85f5ad93e048bc7040b21779109f30 commit 91ebcc32be85f5ad93e048bc7040b21779109f30 Author: Gordon Bergling AuthorDate: 2024-02-22 15:55:51 +0000 Commit: Gordon Bergling CommitDate: 2024-02-25 07:44:26 +0000 uath(4): Fix a typo in a source code comment - s/parmeter/parameter/ (cherry picked from commit 5a476e64b543dc63fae7fcd243dc066dced31c3b) --- sys/dev/usb/wlan/if_uathreg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/usb/wlan/if_uathreg.h b/sys/dev/usb/wlan/if_uathreg.h index 47ec13267e17..91e5f04bc902 100644 --- a/sys/dev/usb/wlan/if_uathreg.h +++ b/sys/dev/usb/wlan/if_uathreg.h @@ -50,7 +50,7 @@ struct uath_fwblock { * parameter 2 * ... * - * A variable-length parameter, or a parmeter that is larger than + * A variable-length parameter, or a parameter that is larger than * 32 bits is passed as pair, where length is a * 32-bit quantity and data is padded to 32 bits. */ From nobody Sun Feb 25 07:45:40 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TjG504T1jz5Bv4Y; Sun, 25 Feb 2024 07:45:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TjG50425rz4P2B; Sun, 25 Feb 2024 07:45:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708847140; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C74oucyO7SyOe26vi+7kqJNuA2ntLvWOfVEcQnSCdGw=; b=IPHVlMfsohkOwjkwgrK3zv53b5FVNm+7x6J3xou/yO5Jj+chvlgrSaMXfFxYTGqu9Ms3L3 yFF8xl6e9qXRez43Uy3vgbDI0660fCjOQDNzKz+/EBc7LZjqy9e3fR//IC7SbkOA3UJ/vl SrvvNYv1+VB+k0Muec6Pk56ymUENYpuM+0uqX77dhAxb2XsiWtw2JUZgULsG32teCoFMVM 8BAaxCEFFi1jKuTzyM4JuDlUP0XYm94kIO01an1DccPb3l3JFsj+PF4aDYHTiffVd8koGA 5sC/kjiQ9DPGEC6zWsAHQ+P70sMGHv9+4fFGk3gw+qjWTIuriZ1/Z2XsaPKbrQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708847140; a=rsa-sha256; cv=none; b=OIqpUj9lFXMEQF4dqlOGKNKIG3UYReFFcgQblXFY1yZlPxz6GW6IJj9BvBR+3ciLjhvTKZ pJFJ9FkoGyVvz907I01oOHIjrQkQgb8QFDbIWxX9aP2fzNoY5nknsX674rdDKL6mmXkeb2 ryzUQgb2uawCcTPapYUA+9f81NL1ENzPmcNy5VruxvmpYyLSyW7NwEZd4mOmlZ5pPfTE7q +G0XkdSWz35QB2K/CIb5o48KK82+tBbTRMroUiRz62+2FCMXHo7lyQh3uJCsdMqs1V6k0T 3sGPK+JqhmUKBBq9M43RT8xgBDCV/afUJe642HXuG3JWwQ74Ifw63/2CT+XRxg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708847140; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C74oucyO7SyOe26vi+7kqJNuA2ntLvWOfVEcQnSCdGw=; b=pSEHCgaryIl3MfKe0Xf2hDHiXhY1G7s/1alprBtbEZLXJrY1sGVFmPt0iM8n2VxijMV6Ap gnjqG+WZn4fB5lKfRw32iE0l1PeOoWf6Jq+gP+g1BbJJM+AUJNDMINdkColy8d3j81gClb d3XPZIHObAfRSsTiFGy9lURVA0ZV1nH3ruyCfAgbupvd2Tkits6H91xU4EvnJii1fnYDXZ DjOS4sklbYDKTfSxZmv9Ao22V9kjQhGhzXfqwdJ9DJ/TbeRTtfssHYSP1trvM9WxyAwxJx mlZJlq2W/yeCZDCKFoLR3+UFIIf3sjvarvUFA3ec8fHSdiiDD2wT2v7R/C2RYg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TjG503153zbkN; Sun, 25 Feb 2024 07:45:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41P7jeHw073965; Sun, 25 Feb 2024 07:45:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41P7jejc073962; Sun, 25 Feb 2024 07:45:40 GMT (envelope-from git) Date: Sun, 25 Feb 2024 07:45:40 GMT Message-Id: <202402250745.41P7jejc073962@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: d7670d898dee - stable/13 - vge(4): Fix a typo in a source code comment List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d7670d898deeef5b22ee1a2967ae541ce3a00e6f Auto-Submitted: auto-generated The branch stable/13 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=d7670d898deeef5b22ee1a2967ae541ce3a00e6f commit d7670d898deeef5b22ee1a2967ae541ce3a00e6f Author: Gordon Bergling AuthorDate: 2024-02-22 16:33:35 +0000 Commit: Gordon Bergling CommitDate: 2024-02-25 07:44:37 +0000 vge(4): Fix a typo in a source code comment - s/embadded/embedded/ (cherry picked from commit 04440331b5700e124c42b570ae1dfd00ea9c26f7) --- sys/dev/vge/if_vgereg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/vge/if_vgereg.h b/sys/dev/vge/if_vgereg.h index e005526c95c1..c5cb53ef2ca7 100644 --- a/sys/dev/vge/if_vgereg.h +++ b/sys/dev/vge/if_vgereg.h @@ -444,7 +444,7 @@ #define VGE_MIICMD_MOUT 0x08 /* data out pin enable */ #define VGE_MIICMD_MDP 0x10 /* enable direct programming mode */ #define VGE_MIICMD_WCMD 0x20 /* embedded mode write */ -#define VGE_MIICMD_RCMD 0x40 /* embadded mode read */ +#define VGE_MIICMD_RCMD 0x40 /* embedded mode read */ #define VGE_MIICMD_MAUTO 0x80 /* enable autopolling */ /* MII address register */ From nobody Sun Feb 25 07:45:41 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TjG522RSSz5BvWr; Sun, 25 Feb 2024 07:45:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TjG5157qNz4PN9; Sun, 25 Feb 2024 07:45:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708847141; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f/nH9kNlr4mSCuKs/DTasAlfXeXFnTFmgB0X3tqt6DU=; b=cgS1aE7nB1nH2kVECw/oz+xB/ooH9kY/CcI1aKS7NYK2Xxlz11u/h6+kggJkH7M7ZMgZZU hiOV3uhOe+4oZ8OP9WMT5OMSGAtJRDFD6XdUZdihfGmWtmb9oUEJrggthouQV3qhciWjWy OD1cTG6+JjyT081kXpMITPZk3sQ4vdk3T1EDbwDTccGQMjjjat47h+RXfjK/guL/Onel+I EGTaoK7PO9CathGvP1HVkwfhZ6SUz10vhfujv7WZGnqh7D+SIclLP/vTNVaSDSsRdo9OL5 GAPr/lQTPGSsM7ThcNPD/NlA+Q5hpDo5h4KJXGkCYGMKHQuzQETW0bXxu6b6Kg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708847141; a=rsa-sha256; cv=none; b=j79VdDjlkQvzj9Ix2welyJOIRIhRekinQKPir9mkQVcWcJKiFRq3tFGiUQ75DV+SKFOfEU 649u+N5qjxkvyrJyccvo159WOYM0MnvmCJQU+qyUWeMiBiDzbkCs0+ajoVPx5WnbN7OtMf KOngc398ULUIzFq9JQWw9GTm67mBKieD1FbToh4E+1nBGC50DGXADMl+Dv6jnncGxPi9ck Jj0R1SrLi6LjTcVxIDO08xSL6ccU+I+m4Nx0H/EGrTH6hhcA6lBATzeFKM7gRC20/yMBtA srJlOhHeBs3BE4LjGchfjKgUrByCDBarXtUHaf0d1q747KEDqJ7h+r9uVosb0w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708847141; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f/nH9kNlr4mSCuKs/DTasAlfXeXFnTFmgB0X3tqt6DU=; b=Sovr86E4n+XC3hHenOLd57fkXbd7HGJ9fEhMrs3TcQ/l/xkRGuYHND2CuaYV0mXU+6n/Jg iz1SNeDtrOrkbJmC5d68BRBbIy8tn7nKGCGgoXNaRdWiHpel87Gbzpy5mOsQeBJTYNiSst O1lsB2a2K7qwC6Fi9/0yALyAs4YH9I5OSsh0z+kBXISRuH0wdXhj7KkISf7OVZ92V61tfv 5yH3F7ZzyaTMUtlwuuzHn9OaeWyD6j4B9Is5CUfyzetnGQTZDSlrIXi7aYK72dsm2+fVH+ 8SM/gug6t+3I9QQ/0o/77leywml3EUG2JZanaXaPcleSi7ug7a3Mv3f3ZLXA0Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TjG5144vBzbmQ; Sun, 25 Feb 2024 07:45:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41P7jfF8074019; Sun, 25 Feb 2024 07:45:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41P7jf6c074016; Sun, 25 Feb 2024 07:45:41 GMT (envelope-from git) Date: Sun, 25 Feb 2024 07:45:41 GMT Message-Id: <202402250745.41P7jf6c074016@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 8c3b4af727a0 - stable/13 - random(4): Fix a typo in a source code comment List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8c3b4af727a03d08ffe126bee8e74ace0deccfb0 Auto-Submitted: auto-generated The branch stable/13 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=8c3b4af727a03d08ffe126bee8e74ace0deccfb0 commit 8c3b4af727a03d08ffe126bee8e74ace0deccfb0 Author: Gordon Bergling AuthorDate: 2024-02-22 15:54:50 +0000 Commit: Gordon Bergling CommitDate: 2024-02-25 07:44:50 +0000 random(4): Fix a typo in a source code comment - s/parmeter/parameter/ (cherry picked from commit 5e89e34f846a233fb97302c05af5a47c694405a1) --- sys/dev/random/hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/random/hash.c b/sys/dev/random/hash.c index 8e63d0f638f3..90ac65f42241 100644 --- a/sys/dev/random/hash.c +++ b/sys/dev/random/hash.c @@ -124,7 +124,7 @@ randomdev_encrypt_init(union randomdev_key *context, const void *data) /* * Create a pseudorandom output stream of 'bytecount' bytes using a CTR-mode - * cipher or similar. The 128-bit counter is supplied in the in-out parmeter + * cipher or similar. The 128-bit counter is supplied in the in-out parameter * 'ctr.' The output stream goes to 'd_out.' * * If AES is used, 'bytecount' is guaranteed to be a multiple of From nobody Sun Feb 25 07:45:42 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TjG533nWZz5BvTk; Sun, 25 Feb 2024 07:45:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TjG526HrHz4PQP; Sun, 25 Feb 2024 07:45:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708847142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QucGKE54OeUXmNUKlzul754WV7ndn6to/NYe9zE73kY=; b=yMgqZaGciwM4DewEOOvura9z7KQ0PCyHsetaWfbxkXu2Lpgd8cK2xvHvXC3GecM/t+Uort iZAQMa8lBc+fI8DsWbCjVbxE2Bz4ssv6HmKgjqbkDf++mg6xj9U2YceYPNiBvJjaOad5sk T+pcbsTonrWUEmMZibLEpDNyVuO4Yun7vL5Jf9K2ayb0kE/iJeB92Q6FI0XDDMjATb2ktT Ssjpi9magDC1kLLWmWsU3FfFY9ZtdFDpSJ7a+ajC3A4IAV7N5Ud9WV/ZIP1o7aKiBsxC2X WeaVPC5gmqnON8WWdFzVbrQZeu5XMLiOw9d4fgmYbNqNCU2JryYNY9FePwQJtg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708847142; a=rsa-sha256; cv=none; b=WTIwc1GYSj9VWJ6kbymgK8Uq2vfYMLCpj0eM5s8GAj+AhJ6m4JXp0Btqqb6EM6W35Mnj5D SaOBDHoW3zf2YpJkuE+R/S7hfQi+K4z8o6TakYnPP5hwWKpLFz6AxMFqqE+ZBKBRentJFQ zewXAtxMy4uaK58hrxB5ohQ3LIM+w7fnXdeMgFA6ZJfn21mR3WY5XGcLC7H3frs7SkbLUK JJmszvUbwcpn7qLJG2rNtrb4niEkFIiC34k36OuP4TzGXqhStvwxoDwvp1Fog7fip4BZkv Rq3QEVueubP7uOZ+Ad0QM1TLXr+B2LaT9+BHjojakjCxklVObnTobbn7vVslDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708847142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QucGKE54OeUXmNUKlzul754WV7ndn6to/NYe9zE73kY=; b=Y+2gFmCHcmqLTONEZDzmB63QdeJmg2ahDmPrpB7bC/mNHcS+gGcHkZBA1mM5W8f7a8a9VB YLGt2U2P6viPrte+WmDMlLoLnU+Ra29GFR0WwXLb65enb/otawvHmdEo9Hlqjpq/X0xcvU ivRubWp0vvG8600qI48u3mRPq+heEGBEcgSIQbYse9Uj+d9pE0VGpuPTHy3TIuTyJPO7fY en3pGEDaDVfAuPyxcY85XiwiaDTQGwHe3vC03vzx7dbuhOZEdINo1lgTAHlZhIgD92fVL1 u6KZg5QYg8EZNnCE0Wv7rN3If5xkGsFhoRO9KXgIjYd4cWwGHaRUWTPQlO+plQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TjG524v3NzbmR; Sun, 25 Feb 2024 07:45:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41P7jg3U074077; Sun, 25 Feb 2024 07:45:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41P7jgnb074074; Sun, 25 Feb 2024 07:45:42 GMT (envelope-from git) Date: Sun, 25 Feb 2024 07:45:42 GMT Message-Id: <202402250745.41P7jgnb074074@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: dd4d5219070a - stable/13 - bge(4): Fix some typos in source code comments List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: dd4d5219070a2b663c8d7a752c6140268b9a1111 Auto-Submitted: auto-generated The branch stable/13 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=dd4d5219070a2b663c8d7a752c6140268b9a1111 commit dd4d5219070a2b663c8d7a752c6140268b9a1111 Author: Gordon Bergling AuthorDate: 2024-02-22 19:38:50 +0000 Commit: Gordon Bergling CommitDate: 2024-02-25 07:45:02 +0000 bge(4): Fix some typos in source code comments - s/firwmare/firmware/ - s/recue/reduce/ - s/throughpout/throughput/ - s/hardwares/hardware/ Obtainted from: NetBSD (cherry picked from commit d646dca3bc1bbd3bfd38bc5ed375d7a346768dcf) --- sys/dev/bge/if_bge.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c index 7a35aa518b8c..dcd65f9348d6 100644 --- a/sys/dev/bge/if_bge.c +++ b/sys/dev/bge/if_bge.c @@ -703,7 +703,7 @@ bge_ape_read_fw_ver(struct bge_softc *sc) sc->bge_mfw_flags |= BGE_MFW_ON_APE; - /* Fetch the APE firwmare type and version. */ + /* Fetch the APE firmware type and version. */ apedata = APE_READ_4(sc, BGE_APE_FW_VERSION); features = APE_READ_4(sc, BGE_APE_FW_FEATURES); if ((features & BGE_APE_FW_FEATURE_NCSI) != 0) { @@ -2160,7 +2160,7 @@ bge_blockinit(struct bge_softc *sc) * The BD ring replenish thresholds control how often the * hardware fetches new BD's from the producer rings in host * memory. Setting the value too low on a busy system can - * starve the hardware and recue the throughpout. + * starve the hardware and reduce the throughput. * * Set the BD ring replentish thresholds. The recommended * values are 1/8th the number of descriptors allocated to @@ -2295,7 +2295,7 @@ bge_blockinit(struct bge_softc *sc) */ CSR_WRITE_4(sc, BGE_RXLP_CFG, 0x181); - /* Inialize RX list placement stats mask. */ + /* Initialize RX list placement stats mask. */ CSR_WRITE_4(sc, BGE_RXLP_STATS_ENABLE_MASK, 0x007FFFFF); CSR_WRITE_4(sc, BGE_RXLP_STATS_CTL, 0x1); @@ -3536,7 +3536,7 @@ bge_attach(device_t dev) * known bug which can't handle TSO if Ethernet header + IP/TCP * header is greater than 80 bytes. A workaround for the TSO * bug exist but it seems it's too expensive than not using - * TSO at all. Some hardwares also have the TSO bug so limit + * TSO at all. Some hardware also have the TSO bug so limit * the TSO to the controllers that are not affected TSO issues * (e.g. 5755 or higher). */ From nobody Sun Feb 25 07:45:43 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TjG540s91z5BvP0; Sun, 25 Feb 2024 07:45:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TjG536l0cz4PD2; Sun, 25 Feb 2024 07:45:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708847143; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/jXTEg2dO/BDQD9kZlcF+NDrLzfCKDi816YBdUOIAHo=; b=NcZuHaTTSumeIC6vGcEN+sqP75LXCHVh+z8jwQwHJO9V8xCwjQ5FdIE0Y+QpxQb7Qo/1HB qpXLI1uMJ7WKy08uq3n9wW46xBN+7UxZDl2y8680nuJzL+c9fw23FdltTq6l7WpNfvwuJw blLKPOCgV+u/YclojtJt9Pvu633Ul8pminBNjn3bV1FdBoN87Bjn/z5dRroR3dWutRWpfV VXBhmgCegQp86iIRhaWDrt0Me3e3BIyRL1gjq3BQeKruwCra9LBxEJwGwGlkTzwyTaV8Y4 DC+vDI/yNwjy8Xq0Pa4WqsK5uterICwlS/vBmky4v4nSRRhYH76gb7acfO+AyA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708847143; a=rsa-sha256; cv=none; b=Sx0/fDBNy1X3v1kYhwyWh5Rxgs6OYhR1LFztsp1OIafs4GJl9Qo7h8G3SR77Pom3WLFl2S 8xYK7TcvCduEan3ssTVddcIF9BxiNo4HM+yJHDMnz47eozuSl1mOg/Nl1fHpFGtnKMvalU 7PqQFbqObm2CJvFRvU+Y8nQSPeHDph5qtSWV/1rQXlfrpX5N027CjGXvYiL4BUpjtVvJBR k7fagWYCew/3sjR6MxlAyCzT6249inYCUNJlY+DP8TaN3TLyxgKInGI0Jhx3ZmW+rhLO+e LKcGlOeH3+uSYfykvBaGVPdGl4ccy8Ci/bBWO2UOLNFPmWXadJ9uaVL2zp91Zw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708847143; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/jXTEg2dO/BDQD9kZlcF+NDrLzfCKDi816YBdUOIAHo=; b=wyUZPJeyPTTm3SnrMuaICl86DTK3KWJMzBMkkUvZA0y5MQ4Ib9bsGqc06ef72nLWAg72Qk iN0QbDuKjsfaTxMmrPYH7ciRy72/4YSMMG9/lxohbRHRBqdC4mQCgBI1J46o4mqjaBby4r cbPNvUoOrt1wfsEU642oCQrQLMlyG68a9kFZRlF5Acp8+Vg9XCxLQc5kcKqz72Y3ZuzvDs k9U184CrSwamZ8qUYwliTfYi5tzstw32OugQiSjTUM0waM9JAfeqRWVA/jGt53xSoqvo6t EUfKVijjHMM+51WMTUMVGb/sE6ZwbkNTo+LhnSM14juIoTOYQL2EsVnMZRnYXA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TjG535Vyvzb1v; Sun, 25 Feb 2024 07:45:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41P7jhX0074132; Sun, 25 Feb 2024 07:45:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41P7jhQ4074129; Sun, 25 Feb 2024 07:45:43 GMT (envelope-from git) Date: Sun, 25 Feb 2024 07:45:43 GMT Message-Id: <202402250745.41P7jhQ4074129@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: bbefc61cacc8 - stable/13 - sk(4): Fix a typo in a source code comment List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: bbefc61cacc83af56165c901e92f46d60d19832e Auto-Submitted: auto-generated The branch stable/13 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=bbefc61cacc83af56165c901e92f46d60d19832e commit bbefc61cacc83af56165c901e92f46d60d19832e Author: Gordon Bergling AuthorDate: 2024-02-22 16:16:49 +0000 Commit: Gordon Bergling CommitDate: 2024-02-25 07:45:16 +0000 sk(4): Fix a typo in a source code comment - /integeated/integrated/ - s/extented/extended/ Obtained from: NetBSD (cherry picked from commit a53204c22790a94a15f0e3c153f7fa12f9d57d27) --- sys/dev/sk/if_skreg.h | 2 +- sys/dev/sk/xmaciireg.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/sk/if_skreg.h b/sys/dev/sk/if_skreg.h index 541fed4096b2..044b0be2e1a9 100644 --- a/sys/dev/sk/if_skreg.h +++ b/sys/dev/sk/if_skreg.h @@ -405,7 +405,7 @@ * fiber-based cards or BCOM for 1000baseT cards with a Broadcom * PHY. */ -#define SK_PHYTYPE_XMAC 0 /* integeated XMAC II PHY */ +#define SK_PHYTYPE_XMAC 0 /* integrated XMAC II PHY */ #define SK_PHYTYPE_BCOM 1 /* Broadcom BCM5400 */ #define SK_PHYTYPE_LONE 2 /* Level One LXT1000 */ #define SK_PHYTYPE_NAT 3 /* National DP83891 */ diff --git a/sys/dev/sk/xmaciireg.h b/sys/dev/sk/xmaciireg.h index ff836dd48903..dcd91e1640ab 100644 --- a/sys/dev/sk/xmaciireg.h +++ b/sys/dev/sk/xmaciireg.h @@ -335,7 +335,7 @@ #define XM_PHY_ANEXP 0x0006 /* autoneg expansion */ #define XM_PHY_NEXTP 0x0007 /* nextpage */ #define XM_PHY_LPNEXTP 0x0008 /* link partner's nextpage */ -#define XM_PHY_EXTSTS 0x000F /* extented status */ +#define XM_PHY_EXTSTS 0x000F /* extended status */ #define XM_PHY_RESAB 0x0010 /* resolved ability */ #define XM_BMCR_DUPLEX 0x0100 From nobody Sun Feb 25 07:45:44 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TjG5569Jdz5BvLv; Sun, 25 Feb 2024 07:45:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TjG550dxNz4PNl; Sun, 25 Feb 2024 07:45:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708847145; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=F7eoW2HixoAGVWiGmjbXY4B5YNfa0v/BFXrywHrcRko=; b=uC+F2+f+xCmtg/mDI8Pnau68he9rD7Yn2cgMYbDDiGjz4+X772N7iffwc6MqUQyqwATNPt AIfwbf5d3I0fxQvm2zTp0qw03yyYUMAFd8bcmJwVOq134tn7s4fiMBWsKPmCogsd7k088w oYlNRGQAbr1nfATpb0YzhmQbOTWvSGEzLTKPJ1qL3eKb+1VeFQjVelmIYZaA26wmbSexd+ lRp0DObwJbFUe8GqGydo2x7ShndbBvCAAEGF1uuhc11e0dpnrRVmy1h4V3ISMYKX6q07Ne sAd1QXaDwG6p81ihnmZu0pxbLTanEbt8j9o9kys7ZdWVPInDYk6suw+uviKD2Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708847145; a=rsa-sha256; cv=none; b=XF9CNSmwyIZgIuzFmU67lp4gS1BJr6iirAmSYwkNj2KRVgI+HDw3BawF9v6nn/7rBQYS0j FM3ZAlY6ql0kXXd832LzWYJ2YEfw4+HGybzhXyDh4hG8Tzkh/G4DsVgD1WXi3fRoHUs7Vc JHxqx3RytYyTGPnQKAyBcNhcbIsbK2jG7YOA0qvvqYe+QYAuvRdsWJdaMgPENJQcDa7ciy OTeuZFh6znS3poJ5RDKd2kLP3gEwPWtbo07QcQ6XzYkWDkfSEps2IVgqzrhCQu6LTELd2a W5OXfU+BQjHjQJuKNWI6v0K4Zw2VqZi+vqVDGliT2iHZvs5PllM6sG+q1jihVQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708847145; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=F7eoW2HixoAGVWiGmjbXY4B5YNfa0v/BFXrywHrcRko=; b=XKqQ+NLVDP+ibTFJijC+iv/nfGkwGjOBjCQL4DZ/HCgS6AtZTe94gqx/WRFKbLE+CLwqWJ bRWJBZatfIXdxvRgCpUiFIX4xOQ2FVJHHAHri3ad+pBwCuReUFkEvf0M8xkC1yTT8HEMAi DzTpHxPVlNHYdZeHvMkGNCEDvpMlWEDb0N/KHIjZ/SAiD7VzDcsal8dnC3TbRCIrFyZj7j Ow4QCYcIlJwJgb+M0KfjxcOStY+2vqA+EF5Yx0yMCaV/9MNg1qpd3HrQtcJqRJZt26xTgn oqP6zY8wPZipDqsI/I5Z8o06MTg3lSWM7RBP1UEbNvJX+qJLR7cwc9PF+jgA7A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TjG546lrXzbKD; Sun, 25 Feb 2024 07:45:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41P7jisE074183; Sun, 25 Feb 2024 07:45:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41P7jiiN074180; Sun, 25 Feb 2024 07:45:44 GMT (envelope-from git) Date: Sun, 25 Feb 2024 07:45:44 GMT Message-Id: <202402250745.41P7jiiN074180@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: f3d93603bc29 - stable/13 - umcs(4): Fix two typos in source code comments List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f3d93603bc2960a98cfa11906335e9d86f97b668 Auto-Submitted: auto-generated The branch stable/13 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=f3d93603bc2960a98cfa11906335e9d86f97b668 commit f3d93603bc2960a98cfa11906335e9d86f97b668 Author: Gordon Bergling AuthorDate: 2024-02-22 13:14:08 +0000 Commit: Gordon Bergling CommitDate: 2024-02-25 07:45:29 +0000 umcs(4): Fix two typos in source code comments - s/frequences/frequencies/ (cherry picked from commit 059fd69e749953c12b2cf099b34d3323d9c67d11) --- sys/dev/usb/serial/umcs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/usb/serial/umcs.c b/sys/dev/usb/serial/umcs.c index 8138d09594f7..a413101cb03a 100644 --- a/sys/dev/usb/serial/umcs.c +++ b/sys/dev/usb/serial/umcs.c @@ -1049,7 +1049,7 @@ umcs7840_set_baudrate(struct umcs7840_softc *sc, uint8_t portno, uint32_t rate) } DPRINTF("Port %d set speed: %d (%02x / %d)\n", portno, rate, clk, divisor); - /* Set clock source for standard BAUD frequences */ + /* Set clock source for standard BAUD frequencies */ err = umcs7840_get_reg_sync(sc, umcs7840_port_registers[portno].reg_sp, &data); if (err) return (err); @@ -1080,7 +1080,7 @@ umcs7840_set_baudrate(struct umcs7840_softc *sc, uint8_t portno, uint32_t rate) return (0); } -/* Maximum speeds for standard frequences, when PLL is not used */ +/* Maximum speeds for standard frequencies, when PLL is not used */ static const uint32_t umcs7840_baudrate_divisors[] = {0, 115200, 230400, 403200, 460800, 806400, 921600, 1572864, 3145728,}; static const uint8_t umcs7840_baudrate_divisors_len = nitems(umcs7840_baudrate_divisors); From nobody Sun Feb 25 07:47:19 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TjG6w2lHqz5BvXF; Sun, 25 Feb 2024 07:47:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TjG6w1p1Yz4QlS; Sun, 25 Feb 2024 07:47:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708847240; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S1EopAyzoErulnC8LLS8k6AwwRooFD2y9YIrO7smr3s=; b=Bsx8iXgAr1fWEABHT1vPpCszVo8XDYhXknH3TrEmS/jm5ltvX2uTCHDKnq1oxNRNfXHZfg Tj74QLEaM5lX6ts+zQ2u0amnZBNn2pW7irQc+U/ttuRvvRsn6Cw+3J8TfLqgY1ZMe7TDJB wf4tyP++XYaFzZ/PJetNRbHH4zCgIXLlLeKHQp6akyWyG7ej96skG2hpuIlw//MCwhc1PY imHNijZWj5pGZQ5gpLVZmG7b0YGgOcZ/WyRul2uwgOc1h0CPXqydTNBgeFDK541CqOrhj1 MKeNl0jqGRG5Qivq7qBNhbzMy59aovaQLr+Azg74dJTAL9yo1OYCRTKhzEvwpw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708847240; a=rsa-sha256; cv=none; b=PYsDETpvlNjoLpun3EB4p0hCOpwMRpX5sACxUn38RnHY+mos2O0O/wxW+K4xLKDnTGLMe2 rQsePnLV64y8rLdNBhmwJ4ZaLMx0lIkZxuUvfx8TQB3vTx0tmAMFJYdiZpuDHx28ErJaDG ptb/lzuSVNFEDZpAHAtdtNtUb+NqrQeEks1shX6vpmoVFfT0MBDzm08RUopFdBydZbb9rG t1CYPRg1l+SfYy/c9D/Feu3gfQEfU+wc3OKJxJQJ72eEHKumBIfb29KSPahbS+7Sti1Lj0 O/m7eHYsDLqEsOvkM2qLkKuNJ3J9Jw4e90ruUcm7E+7dhkthtCkTVdP74NKjuw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708847240; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S1EopAyzoErulnC8LLS8k6AwwRooFD2y9YIrO7smr3s=; b=jAc25Rks2GHBIcbPAEeDOrug1rICr6qnMPRI2KysHCTrlK8rpFCszP9vt165lZtRa2HxOW KN2PR65+z3lijPq+deYeQZvFHweG5zyz3DKJODFJ4y28WWT+PP6lcykcTCgvtO1D7l2CkV qJgmM03ngDcMgMd6MxHUXJZRm6oye3y8+rCKYpnVcDQGh5BLNfuo/PE87XQMCf3gvN4IXf pHdGVI1Sn6A/Mg4g026oj2PMjvLftc5nMexyDJVf4hh1kpNSWMOqToL72hC//Edwgt8GwV DuySJ6yyJ/bwYVC5vbkVkJgalyqPQ1klhiju8r3nyVa/lrQLTdH5hk2eknDxmQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TjG6w0SLKzbKH; Sun, 25 Feb 2024 07:47:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41P7lJ2S074567; Sun, 25 Feb 2024 07:47:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41P7lJwG074564; Sun, 25 Feb 2024 07:47:19 GMT (envelope-from git) Date: Sun, 25 Feb 2024 07:47:19 GMT Message-Id: <202402250747.41P7lJwG074564@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 442d1ee07efc - stable/12 - uath(4): Fix a typo in a source code comment List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 442d1ee07efc4f5a1995429abec242439ac2d035 Auto-Submitted: auto-generated The branch stable/12 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=442d1ee07efc4f5a1995429abec242439ac2d035 commit 442d1ee07efc4f5a1995429abec242439ac2d035 Author: Gordon Bergling AuthorDate: 2024-02-22 15:55:51 +0000 Commit: Gordon Bergling CommitDate: 2024-02-25 07:46:00 +0000 uath(4): Fix a typo in a source code comment - s/parmeter/parameter/ (cherry picked from commit 5a476e64b543dc63fae7fcd243dc066dced31c3b) --- sys/dev/usb/wlan/if_uathreg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/usb/wlan/if_uathreg.h b/sys/dev/usb/wlan/if_uathreg.h index 1e7929bc7e8f..71abdcf5b91f 100644 --- a/sys/dev/usb/wlan/if_uathreg.h +++ b/sys/dev/usb/wlan/if_uathreg.h @@ -51,7 +51,7 @@ struct uath_fwblock { * parameter 2 * ... * - * A variable-length parameter, or a parmeter that is larger than + * A variable-length parameter, or a parameter that is larger than * 32 bits is passed as pair, where length is a * 32-bit quantity and data is padded to 32 bits. */ From nobody Sun Feb 25 07:47:21 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TjG6x3nwdz5BvcS; Sun, 25 Feb 2024 07:47:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TjG6x3Df9z4QZd; Sun, 25 Feb 2024 07:47:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708847241; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/CIV3zuhrbDy4UrMTngn5JCqUuVrORPiR89ildb35+Y=; b=NEbTZNezvbU9SQ/zlhD+R8yklYWpR2s/11zBKPb1U5HoGpf4MJRpXjzKp2ANOMwvGaGHdK ALU60qUZ5fTRypokHKA5zEOoCwQQRSFt4msNpxOo0Tqs9He9pSxEHaHmMgG7s43H3qmDQr YNLhPJ9dONc3CcHbRBpFU6y4b5+bmOZ7QSiPw/0+Uaw1ViMusZv76W2nxQPTbPy5V8/sNE +I42POB3OEOCNS+/vTnCkV0/prlPEGJQMYS5fOFHeHTSx8SpUruz38LRdjz36nVODBaIyG tuolo9ZZzArqA3Q8+bWGG1saLFh0x04DK5DtcfMQxA76MESBEV6YwiwbpuQ/yQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708847241; a=rsa-sha256; cv=none; b=a9nWktYPgz9jVshYcTVl2oMJtMDIGRZVRdqHW6Pn6fwkLL2CggmhPLajjJP2uTbcxYcUS6 rG+Y+APUI+AgY1D7hqJpZ/zaU4R+E//8Ocj+0KBZNY9FSO473Fairr746EuO1LJnEsp9OH GgBHlISEmCA/uj3ijzC9X4M5LB6VBK73LLTwSH0OFQL8T4EPRUvzElp9M54l/V92NTCb9G SiC163s6sQC+DtOifhfVlZgc8Y5ZEh+v0CkIK5melfMVnJxdq4cdCoDs2Dy/lQFFzEhdKy 4Q6B56bq1liswc3rQjFV3f+UY2q+qH+FPAtomslR0g9LJ+bTX0Fi5O1YNLE9JA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708847241; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/CIV3zuhrbDy4UrMTngn5JCqUuVrORPiR89ildb35+Y=; b=KGiXJEaL/219wtuUBqD4+Xo1HHtwvoaJ0/jovWau4+wZIPoHMLBC/dPD43AZm0PQUFacP1 oWMmuhbns12dlCt3pS5TGCC5hUezzVdjxPPfVjUtlS6xflADwVG/LCl5njZNx2ky91rs8H +M3IcCdOKMJXRwZZ9371B5zOs3TPQmNDIOPk+nPaNwFyF5jUqGHuxLcvOsqsa4HTPFLxzj yTXON4EtSpMIJ71wFea4NJd4Uvybh46EF9htKdlMS9TmO+SAdga6g7kckX8S7rjfBgrggT JNjceaS52qjxtWqSymQ90h5HiEoaQO8AMUkPhcroVC3EdWnP41Q6R381EsQKAA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TjG6x1hdkzbgg; Sun, 25 Feb 2024 07:47:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41P7lL6Y074621; Sun, 25 Feb 2024 07:47:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41P7lLAs074618; Sun, 25 Feb 2024 07:47:21 GMT (envelope-from git) Date: Sun, 25 Feb 2024 07:47:21 GMT Message-Id: <202402250747.41P7lLAs074618@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: c513a1b09b40 - stable/12 - vge(4): Fix a typo in a source code comment List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: c513a1b09b4032b44176f4d81b0c59f8a2f3d650 Auto-Submitted: auto-generated The branch stable/12 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=c513a1b09b4032b44176f4d81b0c59f8a2f3d650 commit c513a1b09b4032b44176f4d81b0c59f8a2f3d650 Author: Gordon Bergling AuthorDate: 2024-02-22 16:33:35 +0000 Commit: Gordon Bergling CommitDate: 2024-02-25 07:46:11 +0000 vge(4): Fix a typo in a source code comment - s/embadded/embedded/ (cherry picked from commit 04440331b5700e124c42b570ae1dfd00ea9c26f7) --- sys/dev/vge/if_vgereg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/vge/if_vgereg.h b/sys/dev/vge/if_vgereg.h index 88e6f22f3124..1ce8797d1a6b 100644 --- a/sys/dev/vge/if_vgereg.h +++ b/sys/dev/vge/if_vgereg.h @@ -447,7 +447,7 @@ #define VGE_MIICMD_MOUT 0x08 /* data out pin enable */ #define VGE_MIICMD_MDP 0x10 /* enable direct programming mode */ #define VGE_MIICMD_WCMD 0x20 /* embedded mode write */ -#define VGE_MIICMD_RCMD 0x40 /* embadded mode read */ +#define VGE_MIICMD_RCMD 0x40 /* embedded mode read */ #define VGE_MIICMD_MAUTO 0x80 /* enable autopolling */ /* MII address register */ From nobody Sun Feb 25 07:47:22 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TjG6y4YtPz5BvSK; Sun, 25 Feb 2024 07:47:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TjG6y3hnhz4Qjf; Sun, 25 Feb 2024 07:47:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708847242; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kZvyUX9z50+foUnLBfFS4qflyRAjhSBdjO/PM3cAY98=; b=TWIPXfQsd1/q315CXFY/X3fPzJPHa/JelE75QJ8T5jkw0Q6sVZdWveYXIr0fJDIYh1vPGB Qk2mAMrOi+4w44ah6k2PWKkKKEZEYSBnxJYkS1TlBj3JmCpLpdGg+zZdxaa9l9HYh6hfJE mNbD69EIsWJsvFaCoVr4YNh2NM5Vn4B048L2OnkMSpho1skQi3ru45CmbVCQBAQTKm+0s9 84DONRsEhV0QHGvLmXHi0xC3NR2rsusVKnB+DLNGrNMsg2QUxZwbV6GUeHrmC38BAFP3Uy Q5+r9m88z9XFEuJPUz0pfS8/Vmj2njgKj0z18goT7iztz/Z0ERgbbwYRqjkLWw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708847242; a=rsa-sha256; cv=none; b=eZT32RaQlctEWME0HGfs8F58lqGJON4f0c70eQgkEQXAXUWxUiil1NrtwJ1WaS2OxLFTl6 zckWmrumDj6dQYrwNq31ifzkShwnXFcFNOlsfO7ios4acyFSOd5lMJdC0joGiG6XrjOMr8 GfwmOjO9D3NwDThYnX9TA+eqvO7J9EJZWE0MwrYPQj7lGRCFVTRvo7MbwXjuC5ZQi50rZE 8DrkcZY5K5iKcEMo2ExShHGsBfJcC8tK3mzNCCowwdafnW7jMFUG4/ArcgoBZHw8dvFrNI Q+d1Fs02c7ispwbB01SG80oBqao1PkYr8o3yVhtsIjZ/hBt1ae6EQCsdoZrqoA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708847242; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kZvyUX9z50+foUnLBfFS4qflyRAjhSBdjO/PM3cAY98=; b=WihkDzu0RVHBFNzp4gKtSAolPmHTn/mvIRb11yZGsQ0ya9bPDQWUdIWeMSNeb2MZ+CJbe1 dShcU9hAlgJpxFQVVvq/MsqsgpA+7XscWJuC0DiYjAYXjjLKG2LBd/67bNmPrX/xDk/Put RS0bBjNgg63gJ4wxpl/I+XM2ZNE8LWquiPCcdXKO7+q/q5Oe4fuycBL5k8aSC327OVypZG xEefK+hKgDrODhF7wG0Le7rNl0rcs0cW5juj08X0OJ/lTVGK96ZYJCbdFADbLZpw+z+xp9 XmlJkDcbtRmIaAEshSN598A/OqLOK4EsNYZ7nWCL43V60LSdBDvS0yLUF/K9Gg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TjG6y2LvWzbgh; Sun, 25 Feb 2024 07:47:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41P7lM16074675; Sun, 25 Feb 2024 07:47:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41P7lMcV074672; Sun, 25 Feb 2024 07:47:22 GMT (envelope-from git) Date: Sun, 25 Feb 2024 07:47:22 GMT Message-Id: <202402250747.41P7lMcV074672@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 8dbf4f6c232d - stable/12 - random(4): Fix a typo in a source code comment List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 8dbf4f6c232d99486ae9ced375d8b44a42775d3c Auto-Submitted: auto-generated The branch stable/12 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=8dbf4f6c232d99486ae9ced375d8b44a42775d3c commit 8dbf4f6c232d99486ae9ced375d8b44a42775d3c Author: Gordon Bergling AuthorDate: 2024-02-22 15:54:50 +0000 Commit: Gordon Bergling CommitDate: 2024-02-25 07:46:29 +0000 random(4): Fix a typo in a source code comment - s/parmeter/parameter/ (cherry picked from commit 5e89e34f846a233fb97302c05af5a47c694405a1) --- sys/dev/random/hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/random/hash.c b/sys/dev/random/hash.c index 6fead915254b..59e2203d0c82 100644 --- a/sys/dev/random/hash.c +++ b/sys/dev/random/hash.c @@ -126,7 +126,7 @@ randomdev_encrypt_init(union randomdev_key *context, const void *data) /* * Create a pseudorandom output stream of 'bytecount' bytes using a CTR-mode - * cipher or similar. The 128-bit counter is supplied in the in-out parmeter + * cipher or similar. The 128-bit counter is supplied in the in-out parameter * 'ctr.' The output stream goes to 'd_out.' * * If AES is used, 'bytecount' is guaranteed to be a multiple of From nobody Sun Feb 25 07:47:23 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TjG6z6W2cz5BvXL; Sun, 25 Feb 2024 07:47:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TjG6z4RLPz4Qk0; Sun, 25 Feb 2024 07:47:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708847243; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JtU4tbo4+jKm0ox1gtn1Rq4MGpKvPHForsln3/zbQPM=; b=nUp4Xb2yIIZutprszDIJ0MHpABVmR/Ug8kS5hfyAaFYtstBv2Tvce5i5C/De4hKNxST6VG YLZxH0BM8DSHKAHVTyYWfG3XzGegzvqVn2Cf3IL0lMs+7Y0Qp2oAXUrUDufCD96iWsUzwB qrL3Bd1zMJV19m+3T9eEzyRaj+lwV8l19eC9xSM+WtmAcnWQnSLF2kQh3SpOcEVcoiqVB4 bKcJ4hE9/wGUf7nk9OWuxu3VdqL4bzz5PU+WoY1KvFGr8cEGtL+263g2nvLvC0hMdmGPXw CHYCW39AByrEgafkGfccAdGAcofBm87dWhfDJVS5k7Wwxh/eqPEWY7RrzhhbSA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708847243; a=rsa-sha256; cv=none; b=Zjmy78xQGb/hG+eT390ATeMMOiWSOwzGKFV+pvVeD0htH2lFT0CxM/pjur9Ne7Y124okij rQUDGSn3tVLEJAVHXPZTJXqZNaDjnUWHgjrwFYHYisSjQo8Ufyx7VcPh8V8aHOCK4+WWG+ jp+Z12zTG7dNPmAZGUmRXt3n3AZWOERICcW4gp3PQWqOP1or2fTHKVuHjZoQyANTZiIsT6 RaSVejK92NiKCwjeVQhUBDuAijgj560X7OX9jc/cRkJyeKSqycjcV1lXR4gk4hUBjcPLhY 75dueeZeNdTt1k5fP2TjdlO6NsxvpbYDO6QcysH9en/sqzIhjI14GjLxmotM0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708847243; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JtU4tbo4+jKm0ox1gtn1Rq4MGpKvPHForsln3/zbQPM=; b=XBdqNmLBZV4QtL9bYvA70yWWNQdoLDS1w2TUhMnw78Igu0rZZHMrTY0UsOAAGSOMcw49Nb FJSFlNQq5Mv/JVarIrwvGojwxtGlZ2e5w8IHtqns802z2lUXV6CqiWljq776T+WjXdM/IM ymh/MscHaus09WBm5jRkA6g+YqLTZIQChLZwgzwEH+fVlXvf7knjtMsS+3GBexZBLdlZwy MIFCwgW2/Irb/Tv3xcrrOKjMqTob3zCjdugNBzR7iwvuULtmWJY0VNeERZiV/eeW2g0/IR bSxuVYNWv2vcEFd+A0hXuNTFP2lAx8Pc1sJBpjHopX3GyKY5wnT5zs0lslu//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 4TjG6z3QxJzbkP; Sun, 25 Feb 2024 07:47:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41P7lNv2074726; Sun, 25 Feb 2024 07:47:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41P7lNVB074723; Sun, 25 Feb 2024 07:47:23 GMT (envelope-from git) Date: Sun, 25 Feb 2024 07:47:23 GMT Message-Id: <202402250747.41P7lNVB074723@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: eeee62ac1eb7 - stable/12 - bge(4): Fix some typos in source code comments List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: eeee62ac1eb756993cd6be72d6dbf2337048f3df Auto-Submitted: auto-generated The branch stable/12 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=eeee62ac1eb756993cd6be72d6dbf2337048f3df commit eeee62ac1eb756993cd6be72d6dbf2337048f3df Author: Gordon Bergling AuthorDate: 2024-02-22 19:38:50 +0000 Commit: Gordon Bergling CommitDate: 2024-02-25 07:46:43 +0000 bge(4): Fix some typos in source code comments - s/firwmare/firmware/ - s/recue/reduce/ - s/throughpout/throughput/ - s/hardwares/hardware/ Obtainted from: NetBSD (cherry picked from commit d646dca3bc1bbd3bfd38bc5ed375d7a346768dcf) --- sys/dev/bge/if_bge.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c index be52518fa6c7..c4d88486dff7 100644 --- a/sys/dev/bge/if_bge.c +++ b/sys/dev/bge/if_bge.c @@ -754,7 +754,7 @@ bge_ape_read_fw_ver(struct bge_softc *sc) sc->bge_mfw_flags |= BGE_MFW_ON_APE; - /* Fetch the APE firwmare type and version. */ + /* Fetch the APE firmware type and version. */ apedata = APE_READ_4(sc, BGE_APE_FW_VERSION); features = APE_READ_4(sc, BGE_APE_FW_FEATURES); if ((features & BGE_APE_FW_FEATURE_NCSI) != 0) { @@ -2219,7 +2219,7 @@ bge_blockinit(struct bge_softc *sc) * The BD ring replenish thresholds control how often the * hardware fetches new BD's from the producer rings in host * memory. Setting the value too low on a busy system can - * starve the hardware and recue the throughpout. + * starve the hardware and reduce the throughput. * * Set the BD ring replentish thresholds. The recommended * values are 1/8th the number of descriptors allocated to @@ -2354,7 +2354,7 @@ bge_blockinit(struct bge_softc *sc) */ CSR_WRITE_4(sc, BGE_RXLP_CFG, 0x181); - /* Inialize RX list placement stats mask. */ + /* Initialize RX list placement stats mask. */ CSR_WRITE_4(sc, BGE_RXLP_STATS_ENABLE_MASK, 0x007FFFFF); CSR_WRITE_4(sc, BGE_RXLP_STATS_CTL, 0x1); @@ -3595,7 +3595,7 @@ bge_attach(device_t dev) * known bug which can't handle TSO if Ethernet header + IP/TCP * header is greater than 80 bytes. A workaround for the TSO * bug exist but it seems it's too expensive than not using - * TSO at all. Some hardwares also have the TSO bug so limit + * TSO at all. Some hardware also have the TSO bug so limit * the TSO to the controllers that are not affected TSO issues * (e.g. 5755 or higher). */ From nobody Sun Feb 25 07:47:24 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TjG711nVbz5Bv9T; Sun, 25 Feb 2024 07:47:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TjG706v0Yz4Qm3; Sun, 25 Feb 2024 07:47:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708847245; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=95EX91qZc63GMleWNb642+x2aB1iP7ut+Ckznxq491A=; b=eGtiJ2oJqpL4DPgZCa9qKFme+vtt/muhcHQe+y3la49a/oPjOS/6CW3ViGTCsA2Tbeu180 CI4GeR/12j6WjenfGMyxzz2GDzs8eJlsRtQy8yzyLVdDLtL+Gig3pGzK9GGlrQjaua++Vd +789KaFP9yYOQtD++cdgOyJ6ONx8ocsKT/phAzr+uvXH4DYs2ullhnybEBaa/GRNZTB+dZ ijHxmNs/XZidD63rNJK2Z646aT5Edh8x5icRe1FN9SBzu8qmyqpel8CL634HSPmyYfa9DG duzRkSXlxiCEUENjobgYp7HoDHU5taqHkSq1ed8VGw0bljFeOwyiJuFxB2SRIQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708847245; a=rsa-sha256; cv=none; b=yFxJGeF/Dz5fd8x2HwlXsaq/EHM56OlApft4aNH4ACyxgtLdn8hIUag05pP2qr2bINyVX7 a0TbFPfTcxinpgvp+q1gW0qfNYfgJgTXJSB3EE/mI4eQ/BKex+REMv1ZkssIzk26yzFWfW M1pOTe7pfw7SOeHJ1GQVuTo9sxy0jiOOGhYkh24uZqxqt1Q/5SwU4/DBi1fGSL2V37Ec7E 4v2p81g0Ds6787k/npLVxzA5RbJh5G/mIRlQ4k/EsO6sVVdheW4TJo65Pkt2U/u6ZWKVMP L6DxXUcEmURLF1mWmB2X15oMI9dUFtK50bPbj1e4b2gu3Ic5Afrnc0JgkFs23w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708847245; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=95EX91qZc63GMleWNb642+x2aB1iP7ut+Ckznxq491A=; b=wDj7kPTWkz0D8Vsrg6AreV6JD9Sfs++LzUiojwrbHNvlWzKsMIKpnEEOfJr1MEjEzwDmsY XT0cJ2K8kqGHKS21G9+yYwcxtk6QJ8UQw5x4MuKsNDcLHZHltbW6Yjp/9O7Q4KgGXPQw2e Hnt4lPFmcvFfzrMxcEHfpODFzJdCi56aKjmvNkBocUGdb0+LnaU/MSUcxwEnUVjOxR1vz4 Y77FGW1teCYEozQ8U5H/h3urweKUrhtLZQSwbZsns5I2dO+yG2jca08Ll/qvVn6+8AZT3n f2dDXUhpdPyml+PBK9BFLateR7SDIQPMLKk+I0sSGNrC7Yy0qvGGPxDG6gHRpA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TjG704TMmzbgj; Sun, 25 Feb 2024 07:47:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41P7lOVQ074786; Sun, 25 Feb 2024 07:47:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41P7lOAD074783; Sun, 25 Feb 2024 07:47:24 GMT (envelope-from git) Date: Sun, 25 Feb 2024 07:47:24 GMT Message-Id: <202402250747.41P7lOAD074783@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 64d52e1605ae - stable/12 - sk(4): Fix a typo in a source code comment List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 64d52e1605aeb8cf4c93e5663e8c3f61d79b695a Auto-Submitted: auto-generated The branch stable/12 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=64d52e1605aeb8cf4c93e5663e8c3f61d79b695a commit 64d52e1605aeb8cf4c93e5663e8c3f61d79b695a Author: Gordon Bergling AuthorDate: 2024-02-22 16:16:49 +0000 Commit: Gordon Bergling CommitDate: 2024-02-25 07:46:57 +0000 sk(4): Fix a typo in a source code comment - /integeated/integrated/ - s/extented/extended/ Obtained from: NetBSD (cherry picked from commit a53204c22790a94a15f0e3c153f7fa12f9d57d27) --- sys/dev/sk/if_skreg.h | 2 +- sys/dev/sk/xmaciireg.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/sk/if_skreg.h b/sys/dev/sk/if_skreg.h index 85d3f14ea625..2dc2c9658a49 100644 --- a/sys/dev/sk/if_skreg.h +++ b/sys/dev/sk/if_skreg.h @@ -408,7 +408,7 @@ * fiber-based cards or BCOM for 1000baseT cards with a Broadcom * PHY. */ -#define SK_PHYTYPE_XMAC 0 /* integeated XMAC II PHY */ +#define SK_PHYTYPE_XMAC 0 /* integrated XMAC II PHY */ #define SK_PHYTYPE_BCOM 1 /* Broadcom BCM5400 */ #define SK_PHYTYPE_LONE 2 /* Level One LXT1000 */ #define SK_PHYTYPE_NAT 3 /* National DP83891 */ diff --git a/sys/dev/sk/xmaciireg.h b/sys/dev/sk/xmaciireg.h index 30bd16c9a749..3c5598a692b8 100644 --- a/sys/dev/sk/xmaciireg.h +++ b/sys/dev/sk/xmaciireg.h @@ -337,7 +337,7 @@ #define XM_PHY_ANEXP 0x0006 /* autoneg expansion */ #define XM_PHY_NEXTP 0x0007 /* nextpage */ #define XM_PHY_LPNEXTP 0x0008 /* link partner's nextpage */ -#define XM_PHY_EXTSTS 0x000F /* extented status */ +#define XM_PHY_EXTSTS 0x000F /* extended status */ #define XM_PHY_RESAB 0x0010 /* resolved ability */ #define XM_BMCR_DUPLEX 0x0100 From nobody Sun Feb 25 07:47:25 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TjG720F8Pz5Bv9X; Sun, 25 Feb 2024 07:47:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TjG7163bNz4QVV; Sun, 25 Feb 2024 07:47:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708847245; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=URx0wcXju/m4B45SHpBOkvS4aXuaxJqRm5y+NrC/XjM=; b=FbFdWu8en4StDXmNfu5Nct5br3I2bx6LDuR/Vwbk1coYiYxmrMXJCus0KDSlQrvuESOeYO Aqjaj189oKDvUzLixJ/u/WDLkQEqOmcq66K6TUUQk5GYpdcQEJ7RzNcrdFbEnNfCmRUPQI DYwA8XaM9ptKVKKjoxyDSunb/Stpn4//kp67Nm83xUhsWn9tatlxjNIrtMvoQCfnstAKMR oShJ1ulyzEPWvFTH8X/3m02dv3pDzi/MmDka4PE2qUZHBuMGeeyBIu1myV5/UHpo6kgx/7 AvefYPpfydpCwEefRzpGdYwvKx3j/UBGuTHQIxQ6sdPsbAPo5C73fYCiRzI6lQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708847245; a=rsa-sha256; cv=none; b=pi439HEq4VTX3PWWOgDQHfEAJ7DTkddlM7TvFAXp3+hI6rUAAelzfYvSkpunZD7RR8a3nD pz0UX2DGbctqVvd7pme/jA3cRZzgns5/zDOdB0vft66JyUnkAIfqVb4kY5aBDL2hfZ63Xm x6swn65O2jeyRx6fpPc4kJS9Ne/Cux/nws3JaC8HVeyEnfptfif0MdmR7Wdo++naRr1DD6 7N1G0uqA8GHhImY0Jf3suQ7oAUj9ZkmrTkVSXvmlqX7xomzUohOmHVQMEkUXuYb+ooGJMn zQlkOPInnRuypnCF4j84W8mYmRJ6tgM2r7MA/TWjvRP8jy3gxhfITfzRw1jRjA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708847245; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=URx0wcXju/m4B45SHpBOkvS4aXuaxJqRm5y+NrC/XjM=; b=czRzhJDP37YAmLkdWQmVvZxIMjp2YocXFYGkhVS7Da1xQ+2X6Dvi2Ih83rVMMpQ7E3twDq Gnf1qF87Jn6kzGzdJKGk/aH+O7afTXC1yTdaZdrNT8/92YSB0CZCDwhe4uFssrOJe+m1Nq /ucBIoKddlbGEBTauXf4Ans5GxRrHfai6QzBjqpCPzb+FBO79e9Z/PAhY837wU/Gt+4zEO zgrllC54bsmpTojUcoO6AjZlEeJ0qj42AvBQN9zHw7xEhS7pIOiP/jK2Wh4BWcApI4u3AI uGdAfzNQdMvV6DL+262QR064mk9c7HRyNEuxg1okUTTUY/P7u1hyovHH7uuUjw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TjG7156CRzbmV; Sun, 25 Feb 2024 07:47:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41P7lPQv074838; Sun, 25 Feb 2024 07:47:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41P7lPu6074835; Sun, 25 Feb 2024 07:47:25 GMT (envelope-from git) Date: Sun, 25 Feb 2024 07:47:25 GMT Message-Id: <202402250747.41P7lPu6074835@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: ef2b2b0bf3e3 - stable/12 - umcs(4): Fix two typos in source code comments List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: ef2b2b0bf3e3240b27dabd5a6c15503b5c03e031 Auto-Submitted: auto-generated The branch stable/12 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=ef2b2b0bf3e3240b27dabd5a6c15503b5c03e031 commit ef2b2b0bf3e3240b27dabd5a6c15503b5c03e031 Author: Gordon Bergling AuthorDate: 2024-02-22 13:14:08 +0000 Commit: Gordon Bergling CommitDate: 2024-02-25 07:47:09 +0000 umcs(4): Fix two typos in source code comments - s/frequences/frequencies/ (cherry picked from commit 059fd69e749953c12b2cf099b34d3323d9c67d11) --- sys/dev/usb/serial/umcs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/usb/serial/umcs.c b/sys/dev/usb/serial/umcs.c index 5b1add0f55fe..3473143c0bd1 100644 --- a/sys/dev/usb/serial/umcs.c +++ b/sys/dev/usb/serial/umcs.c @@ -1052,7 +1052,7 @@ umcs7840_set_baudrate(struct umcs7840_softc *sc, uint8_t portno, uint32_t rate) } DPRINTF("Port %d set speed: %d (%02x / %d)\n", portno, rate, clk, divisor); - /* Set clock source for standard BAUD frequences */ + /* Set clock source for standard BAUD frequencies */ err = umcs7840_get_reg_sync(sc, umcs7840_port_registers[portno].reg_sp, &data); if (err) return (err); @@ -1083,7 +1083,7 @@ umcs7840_set_baudrate(struct umcs7840_softc *sc, uint8_t portno, uint32_t rate) return (0); } -/* Maximum speeds for standard frequences, when PLL is not used */ +/* Maximum speeds for standard frequencies, when PLL is not used */ static const uint32_t umcs7840_baudrate_divisors[] = {0, 115200, 230400, 403200, 460800, 806400, 921600, 1572864, 3145728,}; static const uint8_t umcs7840_baudrate_divisors_len = nitems(umcs7840_baudrate_divisors); From nobody Sun Feb 25 07:50:26 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TjGBW0kCQz5BvfF; Sun, 25 Feb 2024 07:50:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TjGBV6zs4z4S6R; Sun, 25 Feb 2024 07:50:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708847427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PRWCsC7XjPWGuFvgtsz85Wrr3z3KPqWtieuL73DN5lE=; b=ltMeHzdnlM+XDPdk4GYy+QCREfOaAsGThNCW+8uZ8TJ+xj+JotO8oT8NWd6Hq1JWfm41dY gDdmfoy+KEu+ImU94dxVkYAr2jvsn9gZzItwTI58nFNOKLwcUWppRl/NPVwJmsK2zviPMr LSld1Zj88v/Ot983zhR9LRWMqhq/SeTlLkXnPtieOUCOnccsKAmLamjEvEPSlNFL0IElrj nyO7nbeNSJb9FrQRBOTIqdalAbERbGkIgRw50EJiXTh0eYDkBUAp8JQj3G484KI/8ZEHD1 ScPoKp6LaDAx0lpGHvRihkKpYfdzCFaoA9OL3eCkXVLqWcom/60q5UaHxWt2NA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708847427; a=rsa-sha256; cv=none; b=Veof8FoVN095YRgwjfUCXNynkCJuYOdNrzbaRYIy02xRUxncxp/bmiwRZwLLsSfAKyTWLU pp8Y8J8hQfcL1PRSOAGBgKkgTs8w/NvMeNlgmQ2goPHA7+Q0A4lc5akX+lLptugKG9Vjqs 9iyD46Iwmhm5tqV4im3MF96Wv+mWmxOWRqKn61MgeaQUTdG08byTbwyMpQjaIXbebfn3Cc JgnWteLnzzNk2s8wKSVCcHyoLEx78qBKtkaP5HdQfK57U2u+gwAo6ocML0WTTDPs8aZrEQ aEBqwf595z5M6vjaklGiAWpg+4xYr0ObkK7pf6CDx87vUnCZNZGcgw1NqGfsAA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708847427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PRWCsC7XjPWGuFvgtsz85Wrr3z3KPqWtieuL73DN5lE=; b=vl7sia27l8G/SJ+SxNllotGwOfXEMjefT7Pl6q3rPi236JtyXQKAfL5z9QOsd++vXKuzMI oPbYlAvhIxgV1P3WG44LRdnUPjqgJg2NYxAJceNMvCZLLJczXm1yuamoCZWYFCuIGlJqG2 qZhGVcAJsasWVWdVJ46tH/mEK3oX043hcHVk01bHi8htxqwZqOxM5NHdWiPPDJFUjgg9MG F4n6xYiu6J3csF6JWIgxhE6MkTSXIUkkvYElTyPRM0xz9TId39y/Ed2Pdp/jDnw2DP+K2s OAANVR75GIDMptk7z/svymCIv7ESe4buF24Fm1DerOVe4U+Rctj7dP+Lg7mJwA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TjGBV61LczbKM; Sun, 25 Feb 2024 07:50:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41P7oQsF083918; Sun, 25 Feb 2024 07:50:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41P7oQXm083915; Sun, 25 Feb 2024 07:50:26 GMT (envelope-from git) Date: Sun, 25 Feb 2024 07:50:26 GMT Message-Id: <202402250750.41P7oQXm083915@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: 8997b0270dae - releng/13.3 - 13.3: update to RC1 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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.3 X-Git-Reftype: branch X-Git-Commit: 8997b0270dae7ace32e87b3059c64834283c63fb Auto-Submitted: auto-generated The branch releng/13.3 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=8997b0270dae7ace32e87b3059c64834283c63fb commit 8997b0270dae7ace32e87b3059c64834283c63fb Author: Colin Percival AuthorDate: 2024-02-25 07:49:41 +0000 Commit: Colin Percival CommitDate: 2024-02-25 07:49:41 +0000 13.3: update to RC1 Now that we're at RC1, switch from "quarterly" packages to the release package set. Approved by: re (implicit) Sponsored by: https://www.patreon.com/cperciva --- release/pkg_repos/release-dvd.conf | 2 +- sys/conf/newvers.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/release/pkg_repos/release-dvd.conf b/release/pkg_repos/release-dvd.conf index 600c309d5979..72c369da39b1 100644 --- a/release/pkg_repos/release-dvd.conf +++ b/release/pkg_repos/release-dvd.conf @@ -1,5 +1,5 @@ release: { - url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly", + url: "pkg+http://pkg.FreeBSD.org/${ABI}/release_3", mirror_type: "srv", signature_type: "fingerprints", fingerprints: "/usr/share/keys/pkg", diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index a71331c3bb6f..8bc10ea021bf 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="13.3" -BRANCH="BETA3" +BRANCH="RC1" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From nobody Sun Feb 25 18:03:36 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TjWp11PQZz5Bj2B; Sun, 25 Feb 2024 18:03:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TjWp10rpXz464Z; Sun, 25 Feb 2024 18:03:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708884217; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U5empYguDYoQyMlqk26YnrnFfqCGjFkaamViCxaDtF8=; b=h9uGoViLO+cbUJQK+PmIxT+oVbUcquviKv2taOUWohhbtBAuARsK5brFuoa4CKtU+3BgG6 yeytPuKlwigajWw6tezW9zMt6h4yLLyzf/7EW0Dh3HZMXtngz9Ibb++45PquluY/E+Dlpf XCK7touO0nDs7QymK+xSKPxLip90Ke2I1JyLFkoRs76OInGOj77C0XI4Rx7Zq3F/mbvPaV DfTk4u1dqjth+0R+G7zWJcj976ruLXdIflbQlJSOLjOUMWBdET+wnEf9Ap3usmVS3mAXHj VjEPqktyRfUK7+tiTMumN7XRbGHRxMzpRiAcxorFQByVOtMRjXRfs1mLsrX0Rw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708884217; a=rsa-sha256; cv=none; b=nKkvWQ2pM0j2iVIeLjK4fZeJI0WHogQZOVGkKwo9SX3pMXWW6Uonh0wb3Gtlm+VZhwhAtA 1xcPxQQPKioDGdgtlCEuL5EoUnBqQFor41/UMcbUV3nqRbOSCiUb3YmaI/BOOL+2pya1eL dbRMPX/ksNGqjDKr2B4uX0rrmdpI+QOsqb7EP9Q5UvUZzr6//fQAWigI1VgY1QpFLCHeZY atY+Fa1VVLpBOgDpk0/5H325dKhLkwzH4kkI/KlKw679TiyVtY+dsWWJHnHxoEiynxorbZ aFPbQ1UK17VTNINzAO63hfIIIVmUEaDuHG2IGhFY4EF9Lme+PhOUKNmf73BrYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708884217; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U5empYguDYoQyMlqk26YnrnFfqCGjFkaamViCxaDtF8=; b=naOdhxiDEqWoGZupdg3xFVSEcGmRcRbGQzGkNQb6Rk7VUrwHAUnU4r9x1SNxhpQQhiznkY m9XUQ4pl7uwin/1NokbXIBp090cz0+0SvoxG7lRTzwU3MXej96+hYS+4wrmhlmHRa0OLV2 XapnX6e1ZHWi8GK+bCAEOkQWBSz0rl8E1rNTnpQI4bKR0P9e91AhBHnoM2TRAQ6DhrjISN AtFLfePgJwQxeg8Iqu/e5CrB4+84gb5wFWCMUMhzWvk1TuM2WOOHppB3YlUgGnsSqo24vs WLPVO+IR5Z0cIriD7P7JqlVUU3+L2fTP6SVDLVBxehshaEJEObAY01b8/wWoYg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TjWp071NdztX4; Sun, 25 Feb 2024 18:03:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41PI3aFZ034640; Sun, 25 Feb 2024 18:03:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41PI3aAq034637; Sun, 25 Feb 2024 18:03:36 GMT (envelope-from git) Date: Sun, 25 Feb 2024 18:03:36 GMT Message-Id: <202402251803.41PI3aAq034637@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gleb Smirnoff Subject: git: 1e74fc950419 - stable/14 - arp: fix arp -s/-S List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1e74fc950419f2b2482d313fc664cc03aa46f13c Auto-Submitted: auto-generated The branch stable/14 has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=1e74fc950419f2b2482d313fc664cc03aa46f13c commit 1e74fc950419f2b2482d313fc664cc03aa46f13c Author: Gleb Smirnoff AuthorDate: 2024-02-20 18:31:05 +0000 Commit: Gleb Smirnoff CommitDate: 2024-02-25 18:03:17 +0000 arp: fix arp -s/-S When setting a permanent ARP entry, the route(4) would use rtm->rtm_rmx.rmx_expire == 0 as a flag for installing a static entry, but netlink(4) is looking for explicit NTF_STICKY flag in the request. The arp(8) utility was adopted to use netlink(4) by default, but it has lots of route-era guts internally. Specifically there is global variable 'opts' that shares configuration for both protocols, and it is still initialized with route(4) specific RTF_xxx flags. In set_nl() these flags are translated to netlink(4) parameters. However, RTF_STATIC is a flag that is never set by default, so attempt to use it as a proxy flag manifesting -s/-S results in losing it. Use zero opts.expire_time as a manifest of -s/-S operation. This is a minimal fix. A better one would be to fully get rid of route(4) legacy. The change also corrects the logic to set NUD_PERMANENT flag for consistency. This flag is ignored by our kernel (now). Reviewed by: melifaro, tuexen, emaste PR: 277063 Fixes: 6ad73dbf65048b0950a1ba6ff25607f6708c8954 Differential Revision: https://reviews.freebsd.org/D43983 (cherry picked from commit 6a3e87e1306d5058d63f7552a25ed6376422f658) --- usr.sbin/arp/arp_netlink.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/usr.sbin/arp/arp_netlink.c b/usr.sbin/arp/arp_netlink.c index d78f380af04b..8644f3722aed 100644 --- a/usr.sbin/arp/arp_netlink.c +++ b/usr.sbin/arp/arp_netlink.c @@ -390,9 +390,6 @@ set_nl(uint32_t ifindex, struct sockaddr_in *dst, struct sockaddr_dl *sdl, char return (0); } - if (opts.expire_time != 0) - opts.flags &= ~RTF_STATIC; - snl_init_writer(&ss, &nw); struct nlmsghdr *hdr = snl_create_msg_request(&nw, RTM_NEWNEIGH); hdr->nlmsg_flags |= NLM_F_CREATE | NLM_F_REPLACE; @@ -402,11 +399,12 @@ set_nl(uint32_t ifindex, struct sockaddr_in *dst, struct sockaddr_dl *sdl, char ndmsg->ndm_family = AF_INET; ndmsg->ndm_ifindex = ifindex; - ndmsg->ndm_state = (opts.flags & RTF_STATIC) ? NUD_PERMANENT : NUD_NONE; + ndmsg->ndm_state = (opts.expire_time == 0) ? \ + NUD_PERMANENT : NUD_NONE; if (opts.flags & RTF_ANNOUNCE) nl_flags |= NTF_PROXY; - if (opts.flags & RTF_STATIC) + if (opts.expire_time == 0) nl_flags |= NTF_STICKY; ndmsg->ndm_flags = nl_flags; } From nobody Sun Feb 25 22:34:02 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TjdpM40Xxz5CDFB for ; Sun, 25 Feb 2024 22:34:19 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic305-21.consmr.mail.gq1.yahoo.com (sonic305-21.consmr.mail.gq1.yahoo.com [98.137.64.84]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4TjdpL06sQz4fq9 for ; Sun, 25 Feb 2024 22:34:17 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=O7+CE43Y; dmarc=pass (policy=reject) header.from=yahoo.com; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.64.84 as permitted sender) smtp.mailfrom=marklmi@yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1708900456; bh=EelGS48wTgiT6bOCKfTKvLRp3bESuTtasNHlRJ+XFhM=; h=From:Subject:Date:To:References:From:Subject:Reply-To; b=O7+CE43Y9UXQ4G6rrAt12X1XI+zOAQOuF1LDfOkdLtyXXGGEt4aBfI0eiliFDKwcDJU0REs6p3Ia3ORSWgMSZqNVk/3foW2uk7A/3FIKeRDJSCR7yiQUHgIvAqGvBdYT8UU3czKC7MdIGmESSJ2WlVNzBOAeSgx9j9na01MltNaya+6hdybxk844yxz7VpLknRzl0CBvZnkygsXF1uSXbzuGHC3guAWvyJ5bqVpqwY4URxtcDUDh/muEGalD8sFNEYK4o5sLG9rsRG9QIHvWBzFr0K7VLpRZVmYnVa23Hd9x4KR3uxpjeaNbSl8B5xumnob8Zqb+tMHJCzMIr0SRng== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1708900456; bh=BXwRa2dcbAFuBU+9UWSVXzUfbADJh+7a0fGZ7hWNR9b=; h=X-Sonic-MF:From:Subject:Date:To:From:Subject; b=gZJaeghpT/UQA8dHa7lZZetLx0d1h29pqVMme8rl5D34zs+mh+/i+uGZlfceIzABfIrQvCGzliOhf6nCFRjILXGA0ckVfMNGoxAZYSHBSnZxe75lj6OfoxKkFTlJ0QLRREqhJswCHQVE5kPMGhf/7fkRyf0TlGXG5rcrMQqjAzR2DrKwvW+BdHzJiWG/nBmtaMF4oxpfmcG6MBQOik1CK2rfqP96PTq+m0Vw4YgB3qKkB3V1WaTZXMvEB39ZWypYWAv21ZnQuJXX43OnDOHR3/WHtkwQH8asVhLiddxhXIN9m7DJpJ+V+G/q2dK46GD+LuyADgZW7DHEpER+2817wA== X-YMail-OSG: aFJmB64VM1nLlRJ3zLuc2WEhyeL0ipOOZ7XS_8Y51_cVcHraobLLR.sydm.dLI0 Zoy3cT.DCXGXmPNqkAYYqOmxLLnECmklDBEJUE_hlKs5mLj5SML7ipWPIZWlS1ub5hS2E.Bt7M6A KgLQtPaQp7VMpqTGivbzLk9Me.Ez0vfNClE1KwwH7ap62nT8MTrTK0AUHMs6M5bk5mdMLR9E9TAQ BTfW_ZQugCDxWvhxJ5_TSNeyYHGe6VqggZQGLM7luo7e9PrS82NlIyDmpanCpIMaflpgAR1me_UB AWK.RJbVoW3_8820z7oCXFEki95qx7vzZ3N3nvPS8L_8i6hwV.K8Qtr3dVOkJyKxAIenGNfgK3cH 5t5MLXhX5OzX8RmeD90N4KQ4J7zTKCUOam2I_tw279mQVh0MXEjcqSD.8q2kuwnDMCPqd2fNmb15 .H9BUCnCDJUJpAZuNvBgAaUpJLjTzBh3WQHeEGNksqFQmNCl_toPPWRbYeI1R7CLQMFaCKVOsFC8 uZtgQfxzMtevQYa1A4VsPK3ErCsNwW.CwxGb_BiYiVmYXOulbVn_biZPYe0FCNfz8MyNyR8u7njM C0oH2J_.d32rzXxS4YUXchhehc0bYUZ3A5uHOJjb1uHtTKLDQJ3YZBA8KRyKZWFsdwReWBIXsY5w 67FfDOZd.NUhedtm3.ylS3jrfqmnF1LlDVJgQzpQVxJAlfZidi7v6.9D8Ii3U4SCYMkntVdDVEzo _HzTudvs.4RoowFDy4kiWE9eCk2Jm7T5MUpumEYl2323TbgLVOAKY.KrEfbWHFQkhKpOJ6NADZKY 48BMWx9p9zI5YEJE7OkbuP66YDmdkFLtSwfvBfehaN_ex8_1iHnvCRs1sz80UnP71ZKd1faHw06i 7KrdEG7gCS5nLRMQ4869rd0OpE67en0I2yj3t8PVv8OeNv2jct_P66DvwbKXO9mAcsUEK7GDZT4P oIg4cVJYVguDCKUnGEx.5e7ErinSHU8.Fi1U9.gADSXjvRUtOhhZfhu1HZdILUYEZM5adk2bmE7P yvCifwhp7Pvz6vCelbX6ggCm3lgkGUgVghJ9EgO34dZcKW6OrWJm7b2BUDyoMs1LLu35zn87Ndsk N3XYlTVq64Uob7bNdzkraWCdltYTUe03.I9LxUNSGWLlCxMYbrnfh5v0DCUi5KyYDdH5dmrjDBdR iN3CzWsgbY_EDW5pNI_wLuS4l_nM86yIex59WOrbqzP86IvwY1EI.4Bx.1jll8MroDeRtsbSkhbs JnP9AFfbKQDZIPGpjtmymqRdbin7VIhvp2iGhURzqJy42hlKczd..p3D03S0HoC6zzAwsFNTGpC3 ay840p82EnNAzQvMho8YvQDdvnY9WK3BgrR_mK.5t.26YDV6soqNMGenDrJddyv3jUqfmbWUz85P .Ja_Zo1PBf35e36LMD47zwlaUv9l370JDqmFTVKlt2_0rkmRR9Vh0YJiSBUnFzmIV2.rpSrs2ht5 m3_XXHaZHM6FqTOrbxw8iuSS9T8j.QMhs6Kh14R5gGPzsJoXY9Y4UYmdy9DEOuov81z96O.UrsGV YH3anOkCh5KjeKQyFbhP0VWJ3Mg2dfJwtOGnKJ797abS_gsuIXPC6cU1RdI5.fcE.PwdkI5XkC5Y dTumbhIJA7Ps4JzbRrGpNKado5l7UdKxyWi.bpDvpdWwrSFZB9TtzFNWv.xu6_g8tDBebCRRC.9S npN_nRtVuJLWCRhMQENIl0S1U9qdfCsVvQ.oJydk7Yj4NxeZJzI40RjUsBs10BpU20KPOyhR.Onu DVogKj.wl6ENNZTwATtr18eGsFxMfodFFUxngA5uHgGEAr6oXHb5lkuejk6Jf8lfz0tn6ehtcr_l 49hu_pNHPOHJVlhgqfYRsa0Frrll00KWaX7UTtSnFS42EHb5QOmWDrz5EvQxDltwyLjD1.TgmgqD 8EIKS9nZFsIUBhS_uoVRY.uUoyoztLJAs3cULIo3KoZrD4AyersOceXZ6KFIwtl1KJSf5Ntcyfua kil94zKS62Ey4kjJT1lR_nSgqwV2DhjSSuYOKXqBCegolW_hp41w_Z47KtPzOjXpJe02ggpzA6uh 5d55B1fn7rfXQ2e6YlGtijIBaQ.80MatYpXY0Kma4UMPkrHT8S0vOiYP88SIQ0QM594VZ3aHv0mN JnqAN4G1F85A2f4An9qG2OWFxjSBUTnN6xbFmXLuCpAU1EFlAZbB4RrLF3hXbhDT7cuoQOpq6LYY wYJGEWPPprzE8m0VvgBHnB4SZ55zJNCR3qhnwV38PyAQKcRXNa45eLTfjHi9QJD9YhtGYNLnDsSG _gqIfEVjQGp5UR7_7Q7Ol5g-- X-Sonic-MF: X-Sonic-ID: 167b9042-af65-4bbd-88bc-5986b4d80cf7 Received: from sonic.gate.mail.ne1.yahoo.com by sonic305.consmr.mail.gq1.yahoo.com with HTTP; Sun, 25 Feb 2024 22:34:16 +0000 Received: by hermes--production-gq1-5c57879fdf-p26ct (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 0da896d6a22f15ef56dcbd10e84daa58; Sun, 25 Feb 2024 22:34:12 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.400.31\)) Subject: Re: git: 8997b0270dae - releng/13.3 - 13.3: update to RC1 [lang/rust broken for aarch64&powerpc in pkg.FreeBSD.org/${ABI}/release_3] Message-Id: <264F21EC-45A5-48A4-8EC5-F76E89CA586B@yahoo.com> Date: Sun, 25 Feb 2024 14:34:02 -0800 To: Colin Percival , dev-commits-src-branches@freebsd.org X-Mailer: Apple Mail (2.3774.400.31) References: <264F21EC-45A5-48A4-8EC5-F76E89CA586B.ref@yahoo.com> X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.73 / 15.00]; SUBJECT_HAS_CURRENCY(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.73)[-0.729]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; TO_DN_SOME(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; ARC_NA(0.00)[]; FREEMAIL_FROM(0.00)[yahoo.com]; MIME_TRACE(0.00)[0:+]; DKIM_TRACE(0.00)[yahoo.com:+]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; MLMMJ_DEST(0.00)[dev-commits-src-branches@freebsd.org]; APPLE_MAILER_COMMON(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.64.84:from]; RCVD_IN_DNSWL_NONE(0.00)[98.137.64.84:from] X-Rspamd-Queue-Id: 4TjdpL06sQz4fq9 Colin Percival wroteon Date: Sun, 25 Feb 2024 07:50:26 UTC : > The branch releng/13.3 has been updated by cperciva: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D8997b0270dae7ace32e87b3059c64834= 283c63fb >=20 > commit 8997b0270dae7ace32e87b3059c64834283c63fb > Author: Colin Percival > AuthorDate: 2024-02-25 07:49:41 +0000 > Commit: Colin Percival > CommitDate: 2024-02-25 07:49:41 +0000 >=20 > 13.3: update to RC1 >=20 > Now that we're at RC1, switch from "quarterly" packages to the release > package set. >=20 > Approved by: re (implicit) > Sponsored by: https://www.patreon.com/cperciva > --- > release/pkg_repos/release-dvd.conf | 2 +- > sys/conf/newvers.sh | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/release/pkg_repos/release-dvd.conf = b/release/pkg_repos/release-dvd.conf > index 600c309d5979..72c369da39b1 100644 > --- a/release/pkg_repos/release-dvd.conf > +++ b/release/pkg_repos/release-dvd.conf > @@ -1,5 +1,5 @@ > release: { > - url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly", > + url: "pkg+http://pkg.FreeBSD.org/${ABI}/release_3", > mirror_type: "srv", > signature_type: "fingerprints", > fingerprints: "/usr/share/keys/pkg", > diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh > index a71331c3bb6f..8bc10ea021bf 100644 > --- a/sys/conf/newvers.sh > +++ b/sys/conf/newvers.sh > @@ -53,7 +53,7 @@ >=20 > TYPE=3D"FreeBSD" > REVISION=3D"13.3" > -BRANCH=3D"BETA3" > +BRANCH=3D"RC1" > if [ -n "${BRANCH_OVERRIDE}" ]; then > BRANCH=3D${BRANCH_OVERRIDE} > fi Missing in pkg.FreeBSD.org/${ABI}/release_3 are: (aarch64 rust operability:) uthor Mikael Urankar 2024-02-24 13:07:29 +0000 committer Mikael Urankar 2024-02-24 13:07:29 +0000 commit 5f41aae86ef01a9fa542984d589ff07a2807ecde (patch) . . . lang/rust: Update bootstrap for aarch64 The previous one did not work. PR: 277220 (and the later one for powerpc rust operability:) author Mikael Urankar 2024-02-25 16:58:39 +0000 committer Mikael Urankar 2024-02-25 18:57:19 +0000 commit 06fa1fe2177b801f8467186b3e75050e70019c89 (patch) . . . lang/rust: Update bootstrap for powerpc The previous one did not work. Reported by: pkubaj =3D=3D=3D Mark Millard marklmi at yahoo.com From nobody Sun Feb 25 22:38:18 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TjdvK47jKz5CDhX for ; Sun, 25 Feb 2024 22:38:37 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic314-20.consmr.mail.gq1.yahoo.com (sonic314-20.consmr.mail.gq1.yahoo.com [98.137.69.83]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4TjdvJ55PRz4g1c for ; Sun, 25 Feb 2024 22:38:36 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=azVNTwS4; dmarc=pass (policy=reject) header.from=yahoo.com; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.69.83 as permitted sender) smtp.mailfrom=marklmi@yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1708900714; bh=66pur3L19LjsWgqBcl3uBAIOe45whnGITc4i1ot3j1o=; h=From:Subject:Date:References:To:In-Reply-To:From:Subject:Reply-To; b=azVNTwS4qzEPVJ8LGXUHhX7kO0yrTKgjjvsibY/J6NEUXwgOVVgueLDChzTp/pufqlpIOjS20kWvWrNwMGbcqZBTWDHb7QlittJ98FMGyfkwhcAOTDFE5cuSn2ETL4m/88fm8qOCeqC009lbP+LogwJ9BgKwPRBuVaD7JC/qVAQSTYlpZjOamVU3lchcPVjL1pl6Gn7fUmsnCaWS3PZ4d1CFZcWE3XumgC0v1oOdIo2eX817lKm9eIludIxJz7YA5mD4zAT2QsaIpZ8Q0wbTwX3pgmnd2XzfaLchQKOviFCkEqpdgkrIV1K8UVSJ+qZcmfzcRuhoK1miQ0kKBE1mRA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1708900714; bh=8h+2mXjaEb1sZuE91cPd2W9n/qc04v1j7xwLOi+82FC=; h=X-Sonic-MF:From:Subject:Date:To:From:Subject; b=a3PIlDn9tN6PTX9U3CgLN4GSiiuNrT7F9+HxKfmFwhL7QqekZqp+O5GBGS0+/ypNTmah/R3tVEPvlbmMXXNm2KskqXcC12BxJW/utlA5V8XE+0G7VgSouHrHdARX2GgVYokjIHoJwXraIEIsBjgo0PP7nq5zyV9k+w72iH95fa3KBHMESdbbKdZNAUAQtcpfjs+x/dDb9b91ce2tC2nPtVGDtrvAFDc4sF0D1Q9eH1TionbQCQn5xaOpOWak6NTPMbNLvW/tb2Y5fjLAeYP48+rbJfIhl+GaE0472u7DM4Dt56Ukq2P1SDFD2z5YRZo6BOGbiHSkXsyiP30+vKngog== X-YMail-OSG: .3Zx1BYVM1liPWM4oKQ_8H6xxWvD.FCqJci9bx3gYeGWM8FLMr8JZjaTMGJ3Exb mwzjF7C0VgzTbFk31YR1LVphw5bca7FTt3jRJdEB.qxbhq6.BvDcWyZmI7cNI3.9eppSXT4YYOZw i4cdoV2Ez98bACuVLWINrsEcXW17WE.IrevNAXixRHFLpELxkryvJbhJRGggBKkvHlSPh_KSZbZA 1gLbx1Vq.xV7VJ3du9kuJnIhP_yatD4bS1y8J3Lqk3z.yXgXoRR7nGwsFyhtP8hqDfN2MrFneTil z6J5UQLYLfvopeahOGefbUK9H._mAPtoTLDKlWdID0cybOvSQmM5nOjexe478r16a8_JjaDfRTQY JtJbba_Td3uYLLW.j2r9W5D9Am0IBPBHAQvViKlqbvRDpIFYHImrkZ2Rw8GgSRVe3Vnndud3Mhx4 Wwcr2To9vPjZhZYaA9TKKQHKvvu17qCLVIa6dMJvIxbda1ZX5NqnuCh2O6zqggNeo9G2XDGx2xap 9nnxUBvGU9PyUwo8uc1z2CYRIbEGJ8PFt86hMXe9HuNgjWlQRcpo246jCbaUhAiirwCZKhcVJK0H mc..pCBBLvCIEmslyGgxwJWYh.Vks01Bi_1clzxMc1ECjNdBCW8dkyZitJhXIm40NO0pJ3Ngg9Mo uqO8F3zt7CKOqL8uJBrfm35Q4kUVInnsUmNRTnTfN5v4L4THFm4YdFUHTnIsICeoTBvuV7a28CFE D0a.QeStIxciiyBfxxxIAFXXEaLF123rMMgUpa8XV.LDSKJt_y_oaVY.edBxwd_ZBr2qVVNJRmPb zwTAbMXY.S2WiOqkDUjVyMHELPakeA2WAexuJET3VduZvL180QzcwZ2O7APLnmx_cGAU89VCbGh3 yIgsAU6N3_MsW9dNdgaIrs_TIGZlmD0Hu0U4GiTAn.FrWNP9R.UamusfZmlOyltYEvXJMAbSizw1 O2C2MrlrdnigwqN1Y4OopQvacPvvE.bogc20RI3Uqr4wQPogAmee9oHlNvNWyVlnZJg157YIXZ2L KiALGxJw9OgrmBqtpF3aG8mXqblTlTqSPJCkzNKGII8N6x31kQCfecJeSoied1lokDU.pANK_j7t KsWm404OViVDc3GNlVC88K1aR.YU161kd.WEvnvionmEqyCJhTPF5uWlni.IafdjVRzqkL06s0go 60wJhQ8cVIMNoDhdezuOQJ2Oe37j2TM6ctlC7TgW7qyOdBOl2vuz9fV.O8cvAHjQQcv.XkpFG85b JzWoiFBe8VwetvgPdTfBgUURffCKP1yt0YtR5wqsdc4sW.Gi.YQHrxfBkMDCvxKoyiME9mbOrb6h bhS4IfJvj8LXZl.THnN5lxLbYggRTP.fkTVeAMctf3xGVR.XVAXv79T_dS4qt2a.SFIH5WZoN_kH 6ydTYSKPSPjvZ7i.rYQl1bG5BClbmj8ZwmBjREyogwWR1pS0Jir2aqS62uMddtvbciCu.ZA9cHur VI.11qThHc277XBX94fDJ51p1b98jX5xmDEhN740QJ.nhx0d0HK.4.TWjl9T.w9rDaQB6NxwqEa_ l8lXENwWqVOhw.pj8qIvaO1RrOjS.hu2uyh8at17CCeZ6UvUnAka2KePRFFSntuefdGF6EvWSb2i hLV01rOMlEv3Bescxq8Ss9F3XX7gnadV7a8_ulFAtsSer50Rw124edvmmJRaPWkQjuuvsLhnHTaA 7z_fZcBkcO_kLTXTpI5Go_Gpyw_8MHY349cYXCtR2xbem2pNtU.DDmEKYxbbYRZhVK3jEzkBgN4N 4uuIndxFqDMLg8f2ebj8cfKPBGtwpgMK8uxWVsafzDNgtnaPPpaQ7acYOhgHdx.NbKKTbkS_oBeP lL2J6D4pu6f8xApdtlHc3OIL9WuR.tPzsd3Xa3sRA9puXawX_HPiSeWabwe7U88uFLI_gCEzRjr5 Va8VxBa3yy9s.sUxaLJ1nHbBMp0EYJLf.futP_M9DF2PrlNYKxH2KTkn2eMh0h9ni0EbYAQNHP4P xahYm5qWs_vjkH6ROX9Gl5CRAMDV25CXHfn4ktixLyYO7pZlvFUYLS_9ko_3_1BOv15Gu6sjghnz LrGcKNOpFKKBVBjUWcBFm01FKmiCc4sIP85AOygqn84VyuYDElq.Pxc3AdPb7Dd1oCOlY1dDp2sR 35SCxylp643hWdYUOUtbXXr4.2WohNNNcAIO3wGsqexzTZ8jqi8rpxP7Xn_cAtiBfpOGyJAqXLKE Sk2khkUf_W9XZ_FpeNypL9wUIjRl99HEOEVYrRd3kE7eVpcyslgi.NI0tCsd2_jcJ5ZUToDu28ph tBZgDmayadfcCZxGfn7nz X-Sonic-MF: X-Sonic-ID: cfc389e6-8e94-4e6c-a5ea-e87d88fe9bd9 Received: from sonic.gate.mail.ne1.yahoo.com by sonic314.consmr.mail.gq1.yahoo.com with HTTP; Sun, 25 Feb 2024 22:38:34 +0000 Received: by hermes--production-gq1-5c57879fdf-hrd4s (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID ba3e23081dde1a00f7ac98505a12791f; Sun, 25 Feb 2024 22:38:29 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.400.31\)) Subject: Re: git: 8997b0270dae - releng/13.3 - 13.3: update to RC1 [lang/rust . . . NEVER MIND] Date: Sun, 25 Feb 2024 14:38:18 -0800 References: <264F21EC-45A5-48A4-8EC5-F76E89CA586B@yahoo.com> To: Colin Percival , dev-commits-src-branches@freebsd.org In-Reply-To: <264F21EC-45A5-48A4-8EC5-F76E89CA586B@yahoo.com> Message-Id: <202E8FD6-FF44-4C08-AD7D-D08329492873@yahoo.com> X-Mailer: Apple Mail (2.3774.400.31) X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.73 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.73)[-0.729]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; RCPT_COUNT_TWO(0.00)[2]; FREEMAIL_FROM(0.00)[yahoo.com]; TO_DN_SOME(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; MLMMJ_DEST(0.00)[dev-commits-src-branches@freebsd.org]; APPLE_MAILER_COMMON(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.69.83:from]; RCVD_IN_DNSWL_NONE(0.00)[98.137.69.83:from] X-Rspamd-Queue-Id: 4TjdvJ55PRz4g1c On Feb 25, 2024, at 14:34, Mark Millard wrote: > Colin Percival wroteon > Date: Sun, 25 Feb 2024 07:50:26 UTC : >=20 >> The branch releng/13.3 has been updated by cperciva: >>=20 >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D8997b0270dae7ace32e87b3059c64834= 283c63fb >>=20 >> commit 8997b0270dae7ace32e87b3059c64834283c63fb >> Author: Colin Percival >> AuthorDate: 2024-02-25 07:49:41 +0000 >> Commit: Colin Percival >> CommitDate: 2024-02-25 07:49:41 +0000 >>=20 >> 13.3: update to RC1 >>=20 >> Now that we're at RC1, switch from "quarterly" packages to the = release >> package set. >>=20 >> Approved by: re (implicit) >> Sponsored by: https://www.patreon.com/cperciva >> --- >> release/pkg_repos/release-dvd.conf | 2 +- >> sys/conf/newvers.sh | 2 +- >> 2 files changed, 2 insertions(+), 2 deletions(-) >>=20 >> diff --git a/release/pkg_repos/release-dvd.conf = b/release/pkg_repos/release-dvd.conf >> index 600c309d5979..72c369da39b1 100644 >> --- a/release/pkg_repos/release-dvd.conf >> +++ b/release/pkg_repos/release-dvd.conf >> @@ -1,5 +1,5 @@ >> release: { >> - url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly", >> + url: "pkg+http://pkg.FreeBSD.org/${ABI}/release_3", >> mirror_type: "srv", >> signature_type: "fingerprints", >> fingerprints: "/usr/share/keys/pkg", >> diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh >> index a71331c3bb6f..8bc10ea021bf 100644 >> --- a/sys/conf/newvers.sh >> +++ b/sys/conf/newvers.sh >> @@ -53,7 +53,7 @@ >>=20 >> TYPE=3D"FreeBSD" >> REVISION=3D"13.3" >> -BRANCH=3D"BETA3" >> +BRANCH=3D"RC1" >> if [ -n "${BRANCH_OVERRIDE}" ]; then >> BRANCH=3D${BRANCH_OVERRIDE} >> fi >=20 > Missing in pkg.FreeBSD.org/${ABI}/release_3 are: >=20 > (aarch64 rust operability:) >=20 > uthor Mikael Urankar 2024-02-24 13:07:29 +0000 > committer Mikael Urankar 2024-02-24 13:07:29 = +0000 > commit 5f41aae86ef01a9fa542984d589ff07a2807ecde (patch) > . . . > lang/rust: Update bootstrap for aarch64 > The previous one did not work. PR: 277220 >=20 > (and the later one for powerpc rust operability:) >=20 > author Mikael Urankar 2024-02-25 16:58:39 +0000 > committer Mikael Urankar 2024-02-25 18:57:19 = +0000 > commit 06fa1fe2177b801f8467186b3e75050e70019c89 (patch) > . . . > lang/rust: Update bootstrap for powerpc > The previous one did not work. Reported by: pkubaj Never mind. I messed up the comparison for what = pkg.FreeBSD.org/${ABI}/release_3 references: it actually goes back to lang/rust/1.74.1 (not 1.76.0). Sorry for the noise. =3D=3D=3D Mark Millard marklmi at yahoo.com