From nobody Mon Jun 9 10:53:19 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bG80c14yqz5xxBB; Mon, 09 Jun 2025 10:53:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bG80c0R27z4DJb; Mon, 09 Jun 2025 10:53:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749466400; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wK5dYBrN7DsS9VESGsFHfJjz+lsmH06cVWLSFYSCeko=; b=NhYOuv9wIYIFV6d0s1SKNk1ndhpwvRmdW+ceTofh4w8YjAkU7/CBPEu9MM/i0HnPi4O9Wm DPRpfpCA9PWBdcni12MnUpif1IYP23k/jFzDPLv0OSXn/7sorYY1AIEJeIduhztqgpo/Ce 7TMG+Wt/5rCoQ7RYK3GUpA5Csp5NmwPrIImpDJXJIdEBeEIIdoIIq5CznXvw1IEDTPya/P iCQg8d5c8kbAws+dtfiILVtgOMi92QcWZOvra28p4DLbZWICixL0dXXZI+LpGzZ1uHbPuk xkPyz2WkEy2/+tjnxBLA6Li1aRu27TAqwUCCq4KMRUKqaYYdqSrbTsJPlCaYZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749466400; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wK5dYBrN7DsS9VESGsFHfJjz+lsmH06cVWLSFYSCeko=; b=E72+XjLtUgDk3MPcl7C4S8n+wxAszt4nRqrKahtjxbiPo7RmwgdKuGedBiIU4nrlqdtOg/ qI5jCAkVsuCQul3GyPC2THbhEpsWWrSdQ/GDIdqFXBHMCyNaxpLnmkEjuKIZrwyA/Mhg0O oNqht2EqPFignGZB+wukZYgIws526onmlVS3rDgNmfA9QglvL6J0zQ+vuJFEee37yukle6 cVykrtMb85Uj9rdC0d64K5DhYBWnJ5B0aM70xMDYqbnCOnGQO6ADc3zqO8vcVNoA9XtUba MQhwIKdN6h41TCP9ocCzfvTMsTi8+D+IsSMzzFslF8Cc70/EsVQTdUJ4Sa+Uyg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749466400; a=rsa-sha256; cv=none; b=gCBXOqk3kuqNiJwQHz4suPkboYTa4uPiIdE0pyWuudlp7g1nlB6qLTz5UckV2K+1ZhSJlm 15aoRfWHfp//RDw6UAU+D/XYlZ43rqC6ZoEJ34wq+urhC1GXUdwOGid0uotPjfD0PddxSY KdcKCphxmn/kWbFZ+KVVy7piR6JahHl9hUxvP1KOC6koPIaOunB6atIAvaND+ZTjVKFM5n dfTsto+pAgvSV/WmTEJHQk5pv7zFqnu5bEvZiBqTJm7NMe+U8qRkQSw6RMIseFwXDM13ZP RsEBnhXma6yqvZ/lV3rhwDy5QC1weUXOIhWgAJjB8USPXx5vBJU+7OTjNwKQSw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bG80b75Kwzsj8; Mon, 09 Jun 2025 10:53:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559ArJIi043107; Mon, 9 Jun 2025 10:53:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559ArJ8k043104; Mon, 9 Jun 2025 10:53:19 GMT (envelope-from git) Date: Mon, 9 Jun 2025 10:53:19 GMT Message-Id: <202506091053.559ArJ8k043104@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 79d0f4474653 - main - rpcbind: Ensure krpc is present. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 79d0f447465394fee8afa833dbdeb1a5f3ed52c3 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=79d0f447465394fee8afa833dbdeb1a5f3ed52c3 commit 79d0f447465394fee8afa833dbdeb1a5f3ed52c3 Author: Dag-Erling Smørgrav AuthorDate: 2025-06-09 10:52:21 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-06-09 10:52:21 +0000 rpcbind: Ensure krpc is present. MFC after: 1 week Reviewed by: rmacklem, glebius Differential Revision: https://reviews.freebsd.org/D50627 --- usr.sbin/rpcbind/rpcbind.c | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/usr.sbin/rpcbind/rpcbind.c b/usr.sbin/rpcbind/rpcbind.c index 1397a0222396..622e954f903b 100644 --- a/usr.sbin/rpcbind/rpcbind.c +++ b/usr.sbin/rpcbind/rpcbind.c @@ -39,34 +39,38 @@ * */ -#include -#include -#include -#include +#include +#include +#include #include -#include #include #include +#include +#include #include +#include + #include #include #ifdef PORTMAP #include #endif #include + #include +#include +#include #include +#include #include +#include #include #include -#include #include -#include -#include -#include -#include #include -#include +#include +#include + #include "rpcbind.h" /* Global variables */ @@ -148,12 +152,15 @@ main(int argc, char *argv[]) update_bound_sa(); + /* Ensure krpc is loaded */ + if (modfind("krpc") < 0 && kldload("krpc") < 0) + err(1, "krpc"); + /* Check that another rpcbind isn't already running. */ - if ((rpcbindlockfd = (open(RPCBINDDLOCK, - O_RDONLY|O_CREAT, 0444))) == -1) + if ((rpcbindlockfd = open(RPCBINDDLOCK, O_RDONLY|O_CREAT, 0444)) < 0) err(1, "%s", RPCBINDDLOCK); - if(flock(rpcbindlockfd, LOCK_EX|LOCK_NB) == -1 && errno == EWOULDBLOCK) + if (flock(rpcbindlockfd, LOCK_EX|LOCK_NB) != 0 && errno == EWOULDBLOCK) errx(1, "another rpcbind is already running. Aborting"); getrlimit(RLIMIT_NOFILE, &rl); From nobody Mon Jun 9 11:49:02 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bG9F90F4gz5y1QQ; Mon, 09 Jun 2025 11:49:17 +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 4bG9F841Mjz3VK0; Mon, 09 Jun 2025 11:49:16 +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 559Bn3HT087169; Mon, 9 Jun 2025 14:49:06 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 559Bn3HT087169 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 559Bn22P087168; Mon, 9 Jun 2025 14:49:02 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 9 Jun 2025 14:49:02 +0300 From: Konstantin Belousov To: Dag-Erling =?utf-8?B?U23DuHJncmF2?= Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 79d0f4474653 - main - rpcbind: Ensure krpc is present. Message-ID: References: <202506091053.559ArJ8k043104@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <202506091053.559ArJ8k043104@gitrepo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Rspamd-Queue-Id: 4bG9F841Mjz3VK0 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] On Mon, Jun 09, 2025 at 10:53:19AM +0000, Dag-Erling Smørgrav wrote: > The branch main has been updated by des: > > URL: https://cgit.FreeBSD.org/src/commit/?id=79d0f447465394fee8afa833dbdeb1a5f3ed52c3 > > commit 79d0f447465394fee8afa833dbdeb1a5f3ed52c3 > Author: Dag-Erling Smørgrav > AuthorDate: 2025-06-09 10:52:21 +0000 > Commit: Dag-Erling Smørgrav > CommitDate: 2025-06-09 10:52:21 +0000 > > rpcbind: Ensure krpc is present. > > MFC after: 1 week > Reviewed by: rmacklem, glebius > Differential Revision: https://reviews.freebsd.org/D50627 > --- > usr.sbin/rpcbind/rpcbind.c | 35 +++++++++++++++++++++-------------- > 1 file changed, 21 insertions(+), 14 deletions(-) > > diff --git a/usr.sbin/rpcbind/rpcbind.c b/usr.sbin/rpcbind/rpcbind.c > index 1397a0222396..622e954f903b 100644 > --- a/usr.sbin/rpcbind/rpcbind.c > +++ b/usr.sbin/rpcbind/rpcbind.c > @@ -39,34 +39,38 @@ > * > */ > > -#include > -#include > -#include > -#include > +#include > +#include > +#include > #include > -#include > #include > #include > +#include > +#include > #include > +#include > + > #include > #include > #ifdef PORTMAP > #include > #endif > #include > + > #include > +#include > +#include > #include > +#include > #include > +#include > #include > #include > -#include > #include > -#include > -#include > -#include > -#include > #include > -#include > +#include > +#include > + > #include "rpcbind.h" > > /* Global variables */ > @@ -148,12 +152,15 @@ main(int argc, char *argv[]) > > update_bound_sa(); > > + /* Ensure krpc is loaded */ > + if (modfind("krpc") < 0 && kldload("krpc") < 0) > + err(1, "krpc"); Why does rpcbind need krpc mod? I understand that today most uses of Sun RPC are coming from nfs stuff. But it is still not the only application. E.g., NIS is still there. From nobody Mon Jun 9 11:59:15 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bG9Sy5p7Mz5y26h; Mon, 09 Jun 2025 11:59:30 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bG9Sy3SSmz3Z9R; Mon, 09 Jun 2025 11:59:30 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-ade58ef47c0so182853466b.1; Mon, 09 Jun 2025 04:59:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1749470368; x=1750075168; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=14tBxsff4ZoNnteaBwj9wq67HY4bvKrZaaeOa2UtVEE=; b=FaWQWiP0QFRRgQd/yCnH6z853c5IjVCU5YHWlMKAonhsWjpaj18uLLsZMG+mjyrgTW aJVEA90qUU8ImqHWopQCpZiym9KKler0s7v4Ms3R+9GmHPHfLfKDdIRcd9t2XBix4uNi qYxIrz8IhxzxkGrd+zdWfcVht/BSIUcB/9f8OMIe4qWSMfXwB9a6QxuHjXGDNJkdyBOU diNO6q6aW3/SrxI13QdT8XX36n6B/sufAiBj/2WUYCGVk99Q26t1Kl60Q0K/5XzyksEz XMp/8uE7q9XTSVpoJ7IjlbSSVfL0rZiNHZ4G9ycGsxsbypdgft7ygrRey0r2h3IGXgPZ Q1MQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749470368; x=1750075168; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=14tBxsff4ZoNnteaBwj9wq67HY4bvKrZaaeOa2UtVEE=; b=XJEYZ4OuhnwoIifwQaQaG1y2bam0h+tBuw4u2PvVeJn8l0ntEIJ1rf/T9KjqYsHXQ1 lHy5iK0urOeF2Yqfbu51uKgp6X1JiuCKQ6ip9OB5j1ydfRr5SrOpBMy2IcsnRIHxiEKg NRFbxmhdUzKm04ktkCHX4CvLtzyPSshSTaIdqzawq36Xy+G5BcicY4IQLhfFkqrkVeTy Ar1GLZB398B3+krftc90xplAXa5VRhR0LFfuqa+xQTGSQ4TDaAMK7PQ3KytXC1xAqPXX KK3om+km2myhJyt11S26qusbssAtFqCmMiVr2Csv2x7G7secTThG43bTHyyE9rTKEDrR syyA== X-Forwarded-Encrypted: i=1; AJvYcCV0JUNfvbHFnvSbD2BnU+CI3iqLLnImaEUJJp/fqEmj3MrNVtEwTYNPkZIbZD4Fksy8tbSFJKxyJSLmLxyOjODNhLFF@freebsd.org, AJvYcCVRVqpmMoNosAPMpMCa8lKp+azStbdoyg/+mp4w8Wio76SXmWK+WLgkBt7/1okDP7RiEQfPMv3V0tl9gv66V1X480GL57k=@freebsd.org, AJvYcCVgbHHZ7rWIdas5mYk/+DP6sldPffIBb9n1P1L14Jaykq6ZVWEQr+rDUyKr3U0MRt3EcrahBPbPUrUClwejyKA=@freebsd.org X-Gm-Message-State: AOJu0Yw27QpyizShT5nvFN1U5AQptWrMlAfDGav4fXLRyZqU0bmXxu9P UHIiNOSX4+/L/86LCFyZiekprVR/qhfttEiJ082Ut60/uPggjFo4GLynl6HmYbAtnGLRRXlfDIk hjWw22Wj+MS7nQnbrE/9Mm7EmR2icFg== X-Gm-Gg: ASbGnctVnV8KRArGs9vLnbMY9YB0CGBlIkcVdI3axpPdR3ZqVIjODz+XjURqGH2X9Pg atwhmJA7ZPtvVbx0GLjzkGBJovJrFAXivg0T9AaG3zZjXUJPcOuC193zk96snS1h+HR/cParNaI NXDrb6+7tm7rCuVoCQnxE92Fijpe3ae6hd1i6q9EfvfAZn4D1fXDnk5fwHv5Y4VUb6 X-Google-Smtp-Source: AGHT+IFd+rw2Ez+h8cUFkCrLNVk5TpguTSlw/jhp0L/yafEnN/+L6X84hsdwiXTRCcfpDNoxQ4j8HoliQjVc+whrkpY= X-Received: by 2002:a17:906:ef0e:b0:ad8:908d:20f3 with SMTP id a640c23a62f3a-ade07894142mr1536979666b.28.1749470367490; Mon, 09 Jun 2025 04:59:27 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202506091053.559ArJ8k043104@gitrepo.freebsd.org> In-Reply-To: From: Rick Macklem Date: Mon, 9 Jun 2025 04:59:15 -0700 X-Gm-Features: AX0GCFtfYgjMcwSIsL0jiYGG5sN3SRmG8cP5EvC52vQ_5-BGQiEGT3gLZPH2NdQ Message-ID: Subject: Re: git: 79d0f4474653 - main - rpcbind: Ensure krpc is present. To: Konstantin Belousov Cc: =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4bG9Sy3SSmz3Z9R X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] On Mon, Jun 9, 2025 at 4:49=E2=80=AFAM Konstantin Belousov wrote: > > CAUTION: This email originated from outside of the University of Guelph. = Do not click links or open attachments unless you recognize the sender and = know the content is safe. If in doubt, forward suspicious emails to IThelp@= uoguelph.ca. > > On Mon, Jun 09, 2025 at 10:53:19AM +0000, Dag-Erling Sm=C3=B8rgrav wrote: > > The branch main has been updated by des: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D79d0f447465394fee8afa833= dbdeb1a5f3ed52c3 > > > > commit 79d0f447465394fee8afa833dbdeb1a5f3ed52c3 > > Author: Dag-Erling Sm=C3=B8rgrav > > AuthorDate: 2025-06-09 10:52:21 +0000 > > Commit: Dag-Erling Sm=C3=B8rgrav > > CommitDate: 2025-06-09 10:52:21 +0000 > > > > rpcbind: Ensure krpc is present. > > > > MFC after: 1 week > > Reviewed by: rmacklem, glebius > > Differential Revision: https://reviews.freebsd.org/D50627 > > --- > > usr.sbin/rpcbind/rpcbind.c | 35 +++++++++++++++++++++-------------- > > 1 file changed, 21 insertions(+), 14 deletions(-) > > > > diff --git a/usr.sbin/rpcbind/rpcbind.c b/usr.sbin/rpcbind/rpcbind.c > > index 1397a0222396..622e954f903b 100644 > > --- a/usr.sbin/rpcbind/rpcbind.c > > +++ b/usr.sbin/rpcbind/rpcbind.c > > @@ -39,34 +39,38 @@ > > * > > */ > > > > -#include > > -#include > > -#include > > -#include > > +#include > > +#include > > +#include > > #include > > -#include > > #include > > #include > > +#include > > +#include > > #include > > +#include > > + > > #include > > #include > > #ifdef PORTMAP > > #include > > #endif > > #include > > + > > #include > > +#include > > +#include > > #include > > +#include > > #include > > +#include > > #include > > #include > > -#include > > #include > > -#include > > -#include > > -#include > > -#include > > #include > > -#include > > +#include > > +#include > > + > > #include "rpcbind.h" > > > > /* Global variables */ > > @@ -148,12 +152,15 @@ main(int argc, char *argv[]) > > > > update_bound_sa(); > > > > + /* Ensure krpc is loaded */ > > + if (modfind("krpc") < 0 && kldload("krpc") < 0) > > + err(1, "krpc"); > Why does rpcbind need krpc mod? > I understand that today most uses of Sun RPC are coming from nfs stuff. > But it is still not the only application. E.g., NIS is still there. I asked the same thig during review. It appears that the requirement is based on the recent change to using RPC over netlink instead of a unix domain socket, done by glebius@. rick From nobody Mon Jun 9 12:09:55 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bG9jG4FVsz5y2fT; Mon, 09 Jun 2025 12:10:10 +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 4bG9jF6YgPz3hPK; Mon, 09 Jun 2025 12:10:09 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=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 559C9tLb089335; Mon, 9 Jun 2025 15:09:58 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 559C9tLb089335 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 559C9t1G089334; Mon, 9 Jun 2025 15:09:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 9 Jun 2025 15:09:55 +0300 From: Konstantin Belousov To: Rick Macklem Cc: Dag-Erling =?utf-8?B?U23DuHJncmF2?= , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 79d0f4474653 - main - rpcbind: Ensure krpc is present. Message-ID: References: <202506091053.559ArJ8k043104@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Spamd-Result: default: False [1.65 / 15.00]; NEURAL_SPAM_LONG(1.00)[1.000]; NEURAL_SPAM_MEDIUM(1.00)[0.997]; NEURAL_HAM_SHORT(-0.35)[-0.350]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; MISSING_XM_UA(0.00)[]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; FREEMAIL_FROM(0.00)[gmail.com]; TAGGED_RCPT(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; RCVD_COUNT_TWO(0.00)[2]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; HAS_XAW(0.00)[] X-Rspamd-Queue-Id: 4bG9jF6YgPz3hPK X-Spamd-Bar: + On Mon, Jun 09, 2025 at 04:59:15AM -0700, Rick Macklem wrote: > On Mon, Jun 9, 2025 at 4:49 AM Konstantin Belousov wrote: > > > > CAUTION: This email originated from outside of the University of Guelph. Do not click links or open attachments unless you recognize the sender and know the content is safe. If in doubt, forward suspicious emails to IThelp@uoguelph.ca. > > > > On Mon, Jun 09, 2025 at 10:53:19AM +0000, Dag-Erling Smørgrav wrote: > > > The branch main has been updated by des: > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=79d0f447465394fee8afa833dbdeb1a5f3ed52c3 > > > > > > commit 79d0f447465394fee8afa833dbdeb1a5f3ed52c3 > > > Author: Dag-Erling Smørgrav > > > AuthorDate: 2025-06-09 10:52:21 +0000 > > > Commit: Dag-Erling Smørgrav > > > CommitDate: 2025-06-09 10:52:21 +0000 > > > > > > rpcbind: Ensure krpc is present. > > > > > > MFC after: 1 week > > > Reviewed by: rmacklem, glebius > > > Differential Revision: https://reviews.freebsd.org/D50627 > > > --- > > > usr.sbin/rpcbind/rpcbind.c | 35 +++++++++++++++++++++-------------- > > > 1 file changed, 21 insertions(+), 14 deletions(-) > > > > > > diff --git a/usr.sbin/rpcbind/rpcbind.c b/usr.sbin/rpcbind/rpcbind.c > > > index 1397a0222396..622e954f903b 100644 > > > --- a/usr.sbin/rpcbind/rpcbind.c > > > +++ b/usr.sbin/rpcbind/rpcbind.c > > > @@ -39,34 +39,38 @@ > > > * > > > */ > > > > > > -#include > > > -#include > > > -#include > > > -#include > > > +#include > > > +#include > > > +#include > > > #include > > > -#include > > > #include > > > #include > > > +#include > > > +#include > > > #include > > > +#include > > > + > > > #include > > > #include > > > #ifdef PORTMAP > > > #include > > > #endif > > > #include > > > + > > > #include > > > +#include > > > +#include > > > #include > > > +#include > > > #include > > > +#include > > > #include > > > #include > > > -#include > > > #include > > > -#include > > > -#include > > > -#include > > > -#include > > > #include > > > -#include > > > +#include > > > +#include > > > + > > > #include "rpcbind.h" > > > > > > /* Global variables */ > > > @@ -148,12 +152,15 @@ main(int argc, char *argv[]) > > > > > > update_bound_sa(); > > > > > > + /* Ensure krpc is loaded */ > > > + if (modfind("krpc") < 0 && kldload("krpc") < 0) > > > + err(1, "krpc"); > > Why does rpcbind need krpc mod? > > I understand that today most uses of Sun RPC are coming from nfs stuff. > > But it is still not the only application. E.g., NIS is still there. > > I asked the same thig during review. It appears that the requirement > is based on the recent change to using RPC over netlink instead > of a unix domain socket, done by glebius@. For what? Take for instance a machine participating in NIS domain but not doing NFS. From nobody Mon Jun 9 14:47:10 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGFBQ3YcVz5yDpL; Mon, 09 Jun 2025 14:47:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGFBQ2yWLz3PvJ; Mon, 09 Jun 2025 14:47:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749480430; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O8mh9DdeinQoDGaqO+bl9g1bh03Wmb0W61yik+6o7wY=; b=H88TPLMYiqoifCQBByso4IAGRfcH9qIqarUIo/EsOnNKNWpSoROfWaLMS/w7V47zLR+Ur2 ebKewM5uNOOyAAlwKxhL8899bkjRhe2r8qnfS+j3YD8FNKuiWC/kLMcQVRBUvRvYzoPrvW wCPHS24Ts6otU7ogC6iHV9tynkCrPjkMYqZY3tjGto9Imj0IFHkXDdpTx92aXSAqjvg/IX O6+D9entB5ulI/Hbi4e6Dr0Yjv/WnCIG3q4dPFccyOX97O+kzj+VCGF78QkwqJ7BB/AZCC HWiHjb9I6VuFfYIOjaxN0QCk1pLCpzkRmjfq3TzP3O1xi76ZKaijPVSU6wvuEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749480430; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O8mh9DdeinQoDGaqO+bl9g1bh03Wmb0W61yik+6o7wY=; b=c2knAChN/GeqKYeudXfkqL8eZGMYcIje2TTuAFy7tg5sEdzPi+2sZsAPa06bFW8MQvUZfl Uv0zyd/uxn8u41ZW14qL0VFYeabt20gHx29hMYTAEIjMTyphjo6LR6zT+r0IZDWLV93vGV LW/fc8hdE1dKFpw8NoxWrRGwceACpCj7aLSyGIDWuTgAr/TqbqLt+Q8j26iN3fbCaDMDLC or6c7hwE51TrmPUzApXDFVP0HHlKzIuCzIHmK3HHiRGDv/XCn6kB4uAnGU8iNBJp2lrAlC y3XHKlaBzkEBRYgjkKYBHLcRDY4TmjtwH/8m1SAExdQbXtw0NSpxTFqJu1kFZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749480430; a=rsa-sha256; cv=none; b=mpbUasTBlYMBishVuogC42HhdRBM4UQ7D10773qai6FTwgEM7A1ioMRqNbFMP70dQwEgnE JDOnjApbMBeR5tu7LjKgk4tQhFKl1rzJUYcmflEpQjpbWBg8bH4ICeeDp4inonzO93JUcz CcyOpX48tYClQdYMFLpEVySpdliEPRsG2UhXp4tkIqE34vLVysVzADpYWisjF9eCexBCTe kySsYM9QC1QN/X8d4MbtjZJ2mez+zPka57e/kiqrNflrSrNgwNQA4bjQ0jNvg4uaMNYVgB x9tmkZZzqAavflHoEITXzf/m6PNDstTCUruP8SybXAZMCkgikoErH2DVi/Kb1Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGFBQ2Dhqz1045; Mon, 09 Jun 2025 14:47:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559ElA9J076022; Mon, 9 Jun 2025 14:47:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559ElAi9076019; Mon, 9 Jun 2025 14:47:10 GMT (envelope-from git) Date: Mon, 9 Jun 2025 14:47:10 GMT Message-Id: <202506091447.559ElAi9076019@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: ebbe4bb15fc7 - main - wlan.4: Add 802.11ac to the list of supported standards List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ebbe4bb15fc7e74a72c54f5cc664c7a64cc1c8c2 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=ebbe4bb15fc7e74a72c54f5cc664c7a64cc1c8c2 commit ebbe4bb15fc7e74a72c54f5cc664c7a64cc1c8c2 Author: Ed Maste AuthorDate: 2025-06-09 14:43:56 +0000 Commit: Ed Maste CommitDate: 2025-06-09 14:44:40 +0000 wlan.4: Add 802.11ac to the list of supported standards Our Wi-Fi documentation will benefit from more holistic improvement, but we should at least include a reference to 802.11ac (Wi-Fi 5) after all of the recent work. Sponsored by: The FreeBSD Foundation --- share/man/man4/wlan.4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man4/wlan.4 b/share/man/man4/wlan.4 index 4cd1bfbdc9d5..62095fb81ede 100644 --- a/share/man/man4/wlan.4 +++ b/share/man/man4/wlan.4 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 5, 2023 +.Dd June 9, 2025 .Dt WLAN 4 .Os .Sh NAME @@ -44,7 +44,7 @@ module is required by all native 802.11 drivers. .Nm supports multi-mode devices capable of operating in both 2.4GHz and 5GHz bands and supports numerous -802.11 standards: 802.11a, 802.11b, 802.11g, 802.11n, and 802.11s (Draft 3.0). +802.11 standards: 802.11a, 802.11b, 802.11g, 802.11n, 802.11ac, and 802.11s (Draft 3.0). The WPA, 802.11i, and 802.1x security protocols are supported through a combination of in-kernel code and user-mode applications. The WME/WMM multi-media protocols are supported entirely within From nobody Mon Jun 9 15:41:11 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGGNl2WLHz5y3wZ; Mon, 09 Jun 2025 15:41:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGGNl1Trkz449H; Mon, 09 Jun 2025 15:41:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749483671; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=63CBRU7FsMGDO9uHRvKqkW+phfChwUjDsCWJ4xtH7VA=; b=YkU/Ydfr4nrDN6mxa+tQ93ShXCq9N4/Z33OkRifVHv+hyhsNSQWghyApFXUJhmSXcNaRSm xPEbs/DZWhgvYKYNZnmH1XjkH/mE+grkKcq/q2aT55LFbQ1OKX0/BtOBDCPdTrCYhAF6Lf 5O5/83Hfekg8QZCsSEk3vOsnW9JMDXSHboUskoWCCzFXrFkb03RlRgsDoabap2RBD6urF0 z8nhpB+QGQu2oVOppCAyQ7FdZEJ5BIghWSt61dPpMk7shvUznFS8dKbGF7+FSWOr/BI/yc 5zdPnzu9AomhUN+9KnBSYb/0DYoXdW7NUp+bZ1AI0ewYNan3ZeMGGiRML5C2Ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749483671; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=63CBRU7FsMGDO9uHRvKqkW+phfChwUjDsCWJ4xtH7VA=; b=bhKxtqvlmq7Dp8AIG2mVKwoj+lBg7U/n/p+tHUKM+3xO6vsXpZGqUphSBy5RYPsI98PFEG 9NgSsWNoK8xWwEkWVbS1tcFjMjV56dRIebYmwXsVVX9IiFX+yE+6FWWbnkvPZL5t3aVlGo MYTci5FUe4vA+4dzuvxezLXKhmfCvgX6ugpx37oWH1JuRm90g9wnWYPf58T82i9hG8VWcU LyjWwJbfADEixhdByRrtSjdoHVEQDZ7PHvwwIUbr7aIcioAm8J/tgwVJ3e0GkhkmRZ7axZ P5Y3H3FI69m17IPWfjRhQUGi+l8Pjonm+1h8/Ab6sEnXuLtbvGM8dY98aNI12Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749483671; a=rsa-sha256; cv=none; b=yLhiQREOYaseixYUheNUaAo8/dwnTQM0uIrcgbqlGfTw8IlkVe/U228T+j8GG6vJBaPA+I gWcN0jcwAQcXfVIKM3SKpv9rErLNsFJrvVsNx0yp/Z3STnf/ZPGS1u3jmkiQMFgERsKTz5 /4A8l1ynCmkoTPiFJ1UWo/oijEOG9m3/DInFpjCAp4aLh38o7MBMVPHrQZdgURDZ/nSye8 XV4sc/lcrJ08u81coBYEqnyO881Q5mG9uVBfw465gmWOVcZB9NdKLaFwgMLYcIPMbllIcQ WyJIi1+nYXDZqzrHSNm84ojmdcwSS04yefoc4f+y/m1yPPNsF6nR3nrKceil+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 4bGGNl14xsz121t; Mon, 09 Jun 2025 15:41:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559FfBTo084628; Mon, 9 Jun 2025 15:41:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559FfBcD084625; Mon, 9 Jun 2025 15:41:11 GMT (envelope-from git) Date: Mon, 9 Jun 2025 15:41:11 GMT Message-Id: <202506091541.559FfBcD084625@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ka Ho Ng Subject: git: 42905aa17b7e - main - nfsd, rpcbind: add -P option to support pidfile path List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 42905aa17b7e90a1f6881d84903e58330488f4ea Auto-Submitted: auto-generated The branch main has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=42905aa17b7e90a1f6881d84903e58330488f4ea commit 42905aa17b7e90a1f6881d84903e58330488f4ea Author: Ka Ho Ng AuthorDate: 2025-06-09 03:30:46 +0000 Commit: Ka Ho Ng CommitDate: 2025-06-09 15:24:07 +0000 nfsd, rpcbind: add -P option to support pidfile path The -P option, when specified opens a pidfile to a given path. Both daemons also install a default pid file to the corresponding locations, that is, /var/run/nfsd.pid and /var/run/rpcbind.pid. Sponsored by: Juniper Networks, Inc. MFC after: 7 days Reviewed by: rmacklem Differential Revision: https://reviews.freebsd.org/D50624 --- usr.sbin/nfsd/Makefile | 2 ++ usr.sbin/nfsd/Makefile.depend | 1 + usr.sbin/nfsd/nfsd.8 | 7 ++++++- usr.sbin/nfsd/nfsd.c | 29 ++++++++++++++++++++++++--- usr.sbin/rpcbind/Makefile | 2 ++ usr.sbin/rpcbind/Makefile.depend | 1 + usr.sbin/rpcbind/rpcbind.8 | 8 ++++++-- usr.sbin/rpcbind/rpcbind.c | 43 +++++++++++++++++++++++++++++++++++++--- 8 files changed, 84 insertions(+), 9 deletions(-) diff --git a/usr.sbin/nfsd/Makefile b/usr.sbin/nfsd/Makefile index d7ca8c380c48..b6bd9a28e651 100644 --- a/usr.sbin/nfsd/Makefile +++ b/usr.sbin/nfsd/Makefile @@ -3,4 +3,6 @@ PACKAGE= nfs PROG= nfsd MAN= nfsd.8 nfsv4.4 stablerestart.5 pnfs.4 pnfsserver.4 +LIBADD= util + .include diff --git a/usr.sbin/nfsd/Makefile.depend b/usr.sbin/nfsd/Makefile.depend index 732a025c9552..7e5c47e39608 100644 --- a/usr.sbin/nfsd/Makefile.depend +++ b/usr.sbin/nfsd/Makefile.depend @@ -9,6 +9,7 @@ DIRDEPS = \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ + lib/libutil \ .include diff --git a/usr.sbin/nfsd/nfsd.8 b/usr.sbin/nfsd/nfsd.8 index 992228fba752..2e5724dbce33 100644 --- a/usr.sbin/nfsd/nfsd.8 +++ b/usr.sbin/nfsd/nfsd.8 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd February 21, 2025 +.Dd May 30, 2025 .Dt NFSD 8 .Os .Sh NAME @@ -39,6 +39,7 @@ NFS server .Op Fl h Ar bindip .Op Fl p Ar pnfs_setup .Op Fl m Ar mirror_level +.Op Fl P Ar pidfile .Op Fl V Ar virtual_hostname .Op Fl Fl maxthreads Ar max_threads .Op Fl Fl minthreads Ar min_threads @@ -84,6 +85,10 @@ options to re-register NFS if the rpcbind server is restarted. Unregister the NFS service with .Xr rpcbind 8 without creating any servers. +.It Fl P Ar pidfile +Specify alternative location of a file where main process PID will be stored. +The default location is +.Pa /var/run/nfsd.pid . .It Fl V Ar virtual_hostname Specifies a hostname to be used as a principal name, instead of the default hostname. diff --git a/usr.sbin/nfsd/nfsd.c b/usr.sbin/nfsd/nfsd.c index f1f04af192da..94c30ae6dee1 100644 --- a/usr.sbin/nfsd/nfsd.c +++ b/usr.sbin/nfsd/nfsd.c @@ -58,6 +58,7 @@ #include #include +#include #include #include #include @@ -70,6 +71,7 @@ static int debug = 0; static int nofork = 0; +#define DEFAULT_PIDFILE "/var/run/nfsd.pid" #define NFSD_STABLERESTART "/var/db/nfs-stablerestart" #define NFSD_STABLEBACKUP "/var/db/nfs-stablerestart.bak" #define MAXNFSDCNT 256 @@ -79,6 +81,7 @@ static int nofork = 0; #define NFS_VER4 4 static pid_t children[MAXNFSDCNT]; /* PIDs of children */ static pid_t masterpid; /* PID of master/parent */ +static struct pidfh *masterpidfh = NULL; /* pidfh of master/parent */ static int nfsdcnt; /* number of children */ static int nfsdcnt_set; static int minthreads; @@ -161,7 +164,8 @@ main(int argc, char **argv) size_t jailed_size, nfs_minvers_size; const char *lopt; char **bindhost = NULL; - pid_t pid; + const char *pidfile_path = DEFAULT_PIDFILE; + pid_t pid, otherpid; struct nfsd_nfsd_args nfsdargs; const char *vhostname = NULL; @@ -171,14 +175,14 @@ main(int argc, char **argv) nfsdcnt = DEFNFSDCNT; unregister = reregister = tcpflag = maxsock = 0; bindanyflag = udpflag = connect_type_cnt = bindhostc = 0; - getopt_shortopts = "ah:n:rdtuep:m:V:N"; + getopt_shortopts = "ah:n:rdtuep:m:V:NP:"; getopt_usage = "usage:\n" " nfsd [-ardtueN] [-h bindip]\n" " [-n numservers] [--minthreads #] [--maxthreads #]\n" " [-p/--pnfs dsserver0:/dsserver0-mounted-on-dir,...," "dsserverN:/dsserverN-mounted-on-dir] [-m mirrorlevel]\n" - " [-V virtual_hostname]\n"; + " [-P pidfile ] [-V virtual_hostname]\n"; while ((ch = getopt_long(argc, argv, getopt_shortopts, longopts, &longindex)) != -1) switch (ch) { @@ -234,6 +238,9 @@ main(int argc, char **argv) case 'N': nofork = 1; break; + case 'P': + pidfile_path = optarg; + break; case 0: lopt = longopts[longindex].name; if (!strcmp(lopt, "minthreads")) { @@ -415,6 +422,16 @@ main(int argc, char **argv) } exit (0); } + + if (pidfile_path != NULL) { + masterpidfh = pidfile_open(pidfile_path, 0600, &otherpid); + if (masterpidfh == NULL) { + if (errno == EEXIST) + errx(1, "daemon already running, pid: %jd.", + (intmax_t)otherpid); + warn("cannot open pid file"); + } + } if (debug == 0 && nofork == 0) { daemon(0, 0); (void)signal(SIGHUP, SIG_IGN); @@ -434,6 +451,9 @@ main(int argc, char **argv) openlog("nfsd", LOG_PID | (debug ? LOG_PERROR : 0), LOG_DAEMON); + if (masterpidfh != NULL && pidfile_write(masterpidfh) != 0) + syslog(LOG_ERR, "pidfile_write(): %m"); + /* * For V4, we open the stablerestart file and call nfssvc() * to get it loaded. This is done before the daemons do the @@ -490,6 +510,7 @@ main(int argc, char **argv) if (pid) { children[0] = pid; } else { + pidfile_close(masterpidfh); (void)signal(SIGUSR1, child_cleanup); setproctitle("server"); start_server(0, &nfsdargs, vhostname); @@ -1008,6 +1029,8 @@ nfsd_exit(int status) { killchildren(); unregistration(); + if (masterpidfh != NULL) + pidfile_remove(masterpidfh); exit(status); } diff --git a/usr.sbin/rpcbind/Makefile b/usr.sbin/rpcbind/Makefile index 1bb2d7584ed2..eadadc71310e 100644 --- a/usr.sbin/rpcbind/Makefile +++ b/usr.sbin/rpcbind/Makefile @@ -9,6 +9,8 @@ SRCS= check_bound.c rpcb_stat.c rpcb_svc_4.c rpcbind.c pmap_svc.c \ CFLAGS+= -DPORTMAP +LIBADD= util + .if ${MK_INET6_SUPPORT} != "no" CFLAGS+= -DINET6 .endif diff --git a/usr.sbin/rpcbind/Makefile.depend b/usr.sbin/rpcbind/Makefile.depend index 732a025c9552..7e5c47e39608 100644 --- a/usr.sbin/rpcbind/Makefile.depend +++ b/usr.sbin/rpcbind/Makefile.depend @@ -9,6 +9,7 @@ DIRDEPS = \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ + lib/libutil \ .include diff --git a/usr.sbin/rpcbind/rpcbind.8 b/usr.sbin/rpcbind/rpcbind.8 index 36c7a8da9984..0132c8f6a5d0 100644 --- a/usr.sbin/rpcbind/rpcbind.8 +++ b/usr.sbin/rpcbind/rpcbind.8 @@ -1,6 +1,6 @@ .\" Copyright 1989 AT&T .\" Copyright 1991 Sun Microsystems, Inc. -.Dd July 11, 2024 +.Dd May 30, 2025 .Dt RPCBIND 8 .Os .Sh NAME @@ -8,7 +8,7 @@ .Nd universal addresses to RPC program number mapper .Sh SYNOPSIS .Nm -.Op Fl 6adIiLlNswW +.Op Fl 6adIiLlNPswW .Op Fl h Ar bindip .Sh DESCRIPTION The @@ -135,6 +135,10 @@ Run in foreground mode. In this mode, .Nm will not fork when it starts. +.It Fl P +Specify alternative location of a file where main process PID will be stored. +The default location is +.Pa /var/run/rpcbind.pid . .It Fl s Cause .Nm diff --git a/usr.sbin/rpcbind/rpcbind.c b/usr.sbin/rpcbind/rpcbind.c index 622e954f903b..d165bcd9fbfc 100644 --- a/usr.sbin/rpcbind/rpcbind.c +++ b/usr.sbin/rpcbind/rpcbind.c @@ -61,6 +61,7 @@ #include #include #include +#include #include #include #include @@ -86,6 +87,11 @@ int rpcbindlockfd; #define RPCBINDDLOCK "/var/run/rpcbind.lock" +#define DEFAULT_PIDFILE "/var/run/rpcbind.pid" + +char *pidfile_path = DEFAULT_PIDFILE; +struct pidfh *pidfh = NULL; + static int runasdaemon = 0; int insecure = 0; int oldstyle_local = 0; @@ -135,6 +141,7 @@ static struct t_bind netlink_taddr = { static int init_transport(struct netconfig *); static void rbllist_add(rpcprog_t, rpcvers_t, struct netconfig *, struct netbuf *); +static void cleanup_pidfile(void); static void terminate(int); static void parseargs(int, char *[]); static void update_bound_sa(void); @@ -163,6 +170,13 @@ main(int argc, char *argv[]) if (flock(rpcbindlockfd, LOCK_EX|LOCK_NB) != 0 && errno == EWOULDBLOCK) errx(1, "another rpcbind is already running. Aborting"); + if (pidfile_path != NULL) { + pidfh = pidfile_open(pidfile_path, 0600, NULL); + if (pidfh == NULL) + warn("cannot open pid file"); + atexit(cleanup_pidfile); + } + getrlimit(RLIMIT_NOFILE, &rl); if (rl.rlim_cur < 128) { if (rl.rlim_max <= 128) @@ -248,6 +262,9 @@ main(int argc, char *argv[]) err(1, "fork failed"); } + if (pidfh != NULL && pidfile_write(pidfh) != 0) + syslog(LOG_ERR, "pidfile_write(): %m"); + if (runasdaemon) { struct passwd *p; @@ -781,6 +798,16 @@ rbllist_add(rpcprog_t prog, rpcvers_t vers, struct netconfig *nconf, list_rbl = rbl; } +/* + * atexit callback for pidfh cleanup + */ +static void +cleanup_pidfile(void) +{ + if (pidfh != NULL) + pidfile_remove(pidfh); +} + /* * Catch the signal and die */ @@ -792,8 +819,15 @@ terminate(int signum) doterminate = signum; wr = write(terminate_wfd, &c, 1); - if (wr < 1) + if (wr < 1) { + /* + * The call to cleanup_pidfile should be async-signal safe. + * pidfile_remove calls fstat and funlinkat system calls, and + * we are exiting immediately. + */ + cleanup_pidfile(); _exit(2); + } } void @@ -821,7 +855,7 @@ parseargs(int argc, char *argv[]) #else #define WRAPOP "" #endif - while ((c = getopt(argc, argv, "6adh:IiLlNs" WRAPOP WSOP)) != -1) { + while ((c = getopt(argc, argv, "6adh:IiLlNP:s" WRAPOP WSOP)) != -1) { switch (c) { case '6': ipv6_only = 1; @@ -860,6 +894,9 @@ parseargs(int argc, char *argv[]) case 's': runasdaemon = 1; break; + case 'P': + pidfile_path = strdup(optarg); + break; #ifdef LIBWRAP case 'W': libwrap = 1; @@ -872,7 +909,7 @@ parseargs(int argc, char *argv[]) #endif default: /* error */ fprintf(stderr, - "usage: rpcbind [-6adIiLls%s%s] [-h bindip]\n", + "usage: rpcbind [-6adIiLlNPs%s%s] [-h bindip]\n", WRAPOP, WSOP); exit (1); } From nobody Mon Jun 9 15:45:49 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGGV54DLhz5y481; Mon, 09 Jun 2025 15:45:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGGV53K89z45Jh; Mon, 09 Jun 2025 15:45:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749483949; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I9QBDoGSc82gTYgkfCHIfPeSGoORY0hsZ5lPVG2lKxw=; b=RgsFJUfv2ujAqfjUeHbQg1UJ0rfJykmHjPNYMUdfvI9uOhZRTzO+jE/MQfqtAZRpoYB2Vt yLCE8q/cZfRjHkE6XYlfWjHEPDf/kL0PD07A2pafSkOkkPSLe1b7JtZ9ZMZmprC6dLWR1r JMFfXo2Z1VP4Byi2IvlM2DKloyqcKJShNK2A2g8u1Z/Xaq8xVZGAl+cmJgrFP5wzvUTuGE vPlGSDv83bh/twYWaMmUIr/fqrrHcUvyDZLagr3UX1vhvlKRD0Dv+udlXeHLZJ8G4BUt1K Pjzan4Jgetes+ttmSl0wFkc0uZv8Kk1X6LaqQnt4Lsuh/kYstCgCp62fmnnMng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749483949; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I9QBDoGSc82gTYgkfCHIfPeSGoORY0hsZ5lPVG2lKxw=; b=Y2UGPMRrZtB5tPQw01faqDfSYI1RG6hlwm7XDPhbqDg3a1LDLjDio9QUM48NjR686FBZKL SD8PR61s895Xh3zU78PAI3q3ltd6r0JkvDKjqkU7fbzvThtHBfUmLNaGEL0VCXxy2eEj/2 UJ0+LWap9g81yaD9Z2KP5EyDAGjpWtCpp9vDAOuwcAvdwAt9vfUYZ/T6XXuXAtZHRuAtOr r4PzQDNZ3Vh8Wut8ULikHr/zrc3DVh0krOIhq5s+0Vs0Ee0QO6WBFCWeke+29vynhoewKI c37nhqD7Ti+dZHbF/kyaa/Oh3RZnZs9B6LcamjqTeefbVvUv8hqUBdQ42rtLCQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749483949; a=rsa-sha256; cv=none; b=NpfQlxpw+F5zdGRwQTswT1/X20kzTS3gX4qvxIsuZvu0q/sfMZPaWU5N6zz0eSf7j4HB7U dR8GosFZoGC4gb/P+OpmkGft7SyLE7+iJO6AWDh4lC3VG3pDJiSfg2rF0ELE+fuNdSs0gL yLp5fOMGjig+zbb9tSvVc+3CTA0auY/qVZDjySbQrD/6bNavGqGjNxCsdTn9uEVumzZaMn V4qvS5XYISoEY8opuPKxDli+KMhWeBr/glPPYeP0kyi7gVpaYsQfI9t185VwhqW+heTdgN hrC6jz4+YxJRfkBVx6Wqjn6GcDXk7NsOXLrAUDoK8NZoy6Noh1B21CGtL4uv8Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGGV52x3vz12Dd; Mon, 09 Jun 2025 15:45:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559Fjnle088171; Mon, 9 Jun 2025 15:45:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559FjnUt088168; Mon, 9 Jun 2025 15:45:49 GMT (envelope-from git) Date: Mon, 9 Jun 2025 15:45:49 GMT Message-Id: <202506091545.559FjnUt088168@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: ea334b979422 - main - Revert "scmi: Add sysctl transport properties" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ea334b9794228c3afc641b7088d93b1e4049b519 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=ea334b9794228c3afc641b7088d93b1e4049b519 commit ea334b9794228c3afc641b7088d93b1e4049b519 Author: Andrew Turner AuthorDate: 2025-06-09 13:18:47 +0000 Commit: Andrew Turner CommitDate: 2025-06-04 01:32:38 +0000 Revert "scmi: Add sysctl transport properties" Revert to reapply series as some patches were incorrect versions This reverts commit e6d0edd2fe8c3c15faa7c9c66703efa007a5fbe1. --- sys/dev/firmware/arm/scmi.c | 13 ------------- sys/dev/firmware/arm/scmi.h | 3 --- 2 files changed, 16 deletions(-) diff --git a/sys/dev/firmware/arm/scmi.c b/sys/dev/firmware/arm/scmi.c index b27f7211201e..2d9f6fa89d4b 100644 --- a/sys/dev/firmware/arm/scmi.c +++ b/sys/dev/firmware/arm/scmi.c @@ -44,7 +44,6 @@ #include #include #include -#include #include #include @@ -190,7 +189,6 @@ static void scmi_process_response(struct scmi_softc *, uint32_t, int scmi_attach(device_t dev) { - struct sysctl_oid *sysctl_trans; struct scmi_softc *sc; phandle_t node; int error; @@ -211,17 +209,6 @@ scmi_attach(device_t dev) device_printf(dev, "Transport - max_msg:%d max_payld_sz:%lu reply_timo_ms:%d\n", SCMI_MAX_MSG(sc), SCMI_MAX_MSG_PAYLD_SIZE(sc), SCMI_MAX_MSG_TIMEOUT_MS(sc)); - sc->sysctl_root = SYSCTL_ADD_NODE(NULL, SYSCTL_STATIC_CHILDREN(_hw), - OID_AUTO, "scmi", CTLFLAG_RD, 0, "SCMI root"); - sysctl_trans = SYSCTL_ADD_NODE(NULL, SYSCTL_CHILDREN(sc->sysctl_root), - OID_AUTO, "transport", CTLFLAG_RD, 0, "SCMI Transport properties"); - SYSCTL_ADD_INT(NULL, SYSCTL_CHILDREN(sysctl_trans), OID_AUTO, "max_msg", - CTLFLAG_RD, &sc->trs_desc.max_msg, 0, "SCMI Max number of inflight messages"); - SYSCTL_ADD_INT(NULL, SYSCTL_CHILDREN(sysctl_trans), OID_AUTO, "max_msg_size", - CTLFLAG_RD, &sc->trs_desc.max_payld_sz, 0, "SCMI Max message payload size"); - SYSCTL_ADD_INT(NULL, SYSCTL_CHILDREN(sysctl_trans), OID_AUTO, "max_rx_timeout_ms", - CTLFLAG_RD, &sc->trs_desc.reply_timo_ms, 0, "SCMI Max message RX timeout ms"); - /* * Allow devices to identify. */ diff --git a/sys/dev/firmware/arm/scmi.h b/sys/dev/firmware/arm/scmi.h index fc52732bd503..990759237964 100644 --- a/sys/dev/firmware/arm/scmi.h +++ b/sys/dev/firmware/arm/scmi.h @@ -32,8 +32,6 @@ #ifndef _ARM64_SCMI_SCMI_H_ #define _ARM64_SCMI_SCMI_H_ -#include - #include "scmi_if.h" #define SCMI_DEF_MAX_MSG 32 @@ -66,7 +64,6 @@ struct scmi_softc { struct mtx mtx; struct scmi_transport_desc trs_desc; struct scmi_transport *trs; - struct sysctl_oid *sysctl_root; }; struct scmi_msg { From nobody Mon Jun 9 15:45:50 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGGV66HzMz5y4Yb; Mon, 09 Jun 2025 15:45:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGGV64xxYz45DC; Mon, 09 Jun 2025 15:45:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749483950; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EKSXI/tK5oddWMU5/SaCjI6CD/GucE2Yy5ZF4DQmXcQ=; b=otbIbtbyRNrHSuPKVw0Q4dqwKicnXeXtVPHlF7xQWO/wRWvsFtLxzPqS2+RRpkVTGopEK4 Y0BL2Kw/KxMeWSKaHDi90oEeKjObhNakn6n48hSqOmC+92BYJvudrHd9swiQGH9GWRaG/r WeZaPocVBOmq5qZ2FaqTJN8wddz/vY2wZ8UfmYyTapPviJM+QIJWFOXbCGoDaj4p8m6lHn kEWMcRfN4p9p0WpvTGEkYHjG1r0rskz0Dy11Wu9gIvMS1qx6V1/ev1GPvrhbAy+jeZ8tng evmAqPR3GhBXaePC93g5bZxkU5/XT0BIhPcj7mnxSk82+HIxrmNrLLdkw2u/Aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749483950; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EKSXI/tK5oddWMU5/SaCjI6CD/GucE2Yy5ZF4DQmXcQ=; b=ZfbtsJEdT6i5/MFYiFn+xlTRkH4lKfta6XsRYedYvMjdO7aniAlar1uF/kSVLZ+MRkOAJK PCZMYfn7CiAJhhoyeXBnGezCnXLUq5W5bQhf7VF979G3k0OYwcfMx0qKK/QKhSEjL/7JU0 8sPkyNGBX8qNJ7Ipfpfvc9uW3eWWm8OTl+Dnz2lQDz7DeRxeEI+aqejJXJK1vyu1dqFHzj tPvWX+8qYBJLBm4sshrlFWpkHrTXAyJ0Q23A9lieBQ0CEP6wQ1gzfoIQDnYWgw1kmbndqt r5eRCmP1zeJRk81kMuyNJ9cwNhV/WXco2b1eMHySttMuHbIfP3QuBG2YVq3TKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749483950; a=rsa-sha256; cv=none; b=nkvtcvd3Av9+cI3oyl8bTqIsNYvmX5lNyHMMD+KL3px//GfBx4gWALoKQp47G0AN40+4bD 3XJ5TWWtCZhR6EpujeKrLCgfJPlraDub5NB+KTLrh63K0Z/t4XGgoKLlYrmfyjdocgGJNv ewYXA7pU5f0xMR4axZlSuqPnnil50LeFmSmtISXhpTTl8GfAWZrDfZ+p54ZvqP/E3j+O3s dzIJ2mtKPT4BjGYIpKhzxmh0W2zK0dD4NLUiH+O4bFprwTL9cvpuF5FmgESizgH1VpmrAe S/k650yyVLMF0O38ZRa2nb99hSoPpjBE1Mipc2svrkazGUrepCw65/V87dXszg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGGV647x5z12BD; Mon, 09 Jun 2025 15:45:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559FjotK088206; Mon, 9 Jun 2025 15:45:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559Fjoi8088203; Mon, 9 Jun 2025 15:45:50 GMT (envelope-from git) Date: Mon, 9 Jun 2025 15:45:50 GMT Message-Id: <202506091545.559Fjoi8088203@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: c4629b0f2b45 - main - Revert "scmi: Add SDT traces to the core stack" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c4629b0f2b450d99ac99ff16d5dae11f1cdb23e2 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=c4629b0f2b450d99ac99ff16d5dae11f1cdb23e2 commit c4629b0f2b450d99ac99ff16d5dae11f1cdb23e2 Author: Andrew Turner AuthorDate: 2025-06-09 13:21:31 +0000 Commit: Andrew Turner CommitDate: 2025-06-04 01:32:38 +0000 Revert "scmi: Add SDT traces to the core stack" Revert to reapply series as some patches were incorrect versions This reverts commit 984f9fb81a9dfb9780c9bcc99607ad7cac3a72dd. --- sys/dev/firmware/arm/scmi.c | 59 +-------------------------------------------- 1 file changed, 1 insertion(+), 58 deletions(-) diff --git a/sys/dev/firmware/arm/scmi.c b/sys/dev/firmware/arm/scmi.c index 2d9f6fa89d4b..0b165e413674 100644 --- a/sys/dev/firmware/arm/scmi.c +++ b/sys/dev/firmware/arm/scmi.c @@ -43,7 +43,6 @@ #include #include #include -#include #include #include @@ -54,26 +53,6 @@ #include "scmi.h" #include "scmi_protocols.h" -SDT_PROVIDER_DEFINE(scmi); -SDT_PROBE_DEFINE3(scmi, func, scmi_req_alloc, req_alloc, - "int", "int", "int"); -SDT_PROBE_DEFINE3(scmi, func, scmi_req_free_unlocked, req_alloc, - "int", "int", "int"); -SDT_PROBE_DEFINE3(scmi, func, scmi_req_get, req_alloc, - "int", "int", "int"); -SDT_PROBE_DEFINE3(scmi, func, scmi_req_put, req_alloc, - "int", "int", "int"); -SDT_PROBE_DEFINE5(scmi, func, scmi_request_tx, xfer_track, - "int", "int", "int", "int", "int"); -SDT_PROBE_DEFINE5(scmi, entry, scmi_wait_for_response, xfer_track, - "int", "int", "int", "int", "int"); -SDT_PROBE_DEFINE5(scmi, exit, scmi_wait_for_response, xfer_track, - "int", "int", "int", "int", "int"); -SDT_PROBE_DEFINE2(scmi, func, scmi_rx_irq_callback, hdr_dump, - "int", "int"); -SDT_PROBE_DEFINE5(scmi, func, scmi_process_response, xfer_track, - "int", "int", "int", "int", "int"); - #define SCMI_MAX_TOKEN 1024 #define SCMI_HDR_TOKEN_S 18 @@ -109,12 +88,6 @@ SDT_PROBE_DEFINE5(scmi, func, scmi_process_response, xfer_track, #define SCMI_MSG_TOKEN(_hdr) \ (((_hdr) & SCMI_HDR_TOKEN_M) >> SCMI_HDR_TOKEN_S) -#define SCMI_MSG_PROTOCOL_ID(_hdr) \ - (((_hdr) & SCMI_HDR_PROTOCOL_ID_M) >> SCMI_HDR_PROTOCOL_ID_S) -#define SCMI_MSG_MESSAGE_ID(_hdr) \ - (((_hdr) & SCMI_HDR_MESSAGE_ID_M) >> SCMI_HDR_MESSAGE_ID_S) -#define SCMI_MSG_TYPE(_hdr) \ - (((_hdr) & SCMI_HDR_TYPE_ID_M) >> SCMI_HDR_TYPE_ID_S) struct scmi_req { int cnt; @@ -399,11 +372,8 @@ scmi_req_alloc(struct scmi_softc *sc, enum scmi_chan ch_idx) } mtx_unlock_spin(&rp->mtx); - if (req != NULL) { + if (req != NULL) refcount_init(&req->cnt, 1); - SDT_PROBE3(scmi, func, scmi_req_alloc, req_alloc, - req, refcount_load(&req->cnt), -1); - } return (req); } @@ -422,9 +392,6 @@ scmi_req_free_unlocked(struct scmi_softc *sc, enum scmi_chan ch_idx, refcount_init(&req->cnt, 0); LIST_INSERT_HEAD(&rp->head, req, next); mtx_unlock_spin(&rp->mtx); - - SDT_PROBE3(scmi, func, scmi_req_free_unlocked, req_alloc, - req, refcount_load(&req->cnt), -1); } static void @@ -439,9 +406,6 @@ scmi_req_get(struct scmi_softc *sc, struct scmi_req *req) if (!ok) device_printf(sc->dev, "%s() -- BAD REFCOUNT\n", __func__); - SDT_PROBE3(scmi, func, scmi_req_get, req_alloc, - req, refcount_load(&req->cnt), SCMI_MSG_TOKEN(req->msg.hdr)); - return; } @@ -456,9 +420,6 @@ scmi_req_put(struct scmi_softc *sc, struct scmi_req *req) req->header = 0; bzero(&req->msg, sizeof(req->msg) + SCMI_MAX_MSG_PAYLD_SIZE(sc)); scmi_req_free_unlocked(sc, SCMI_CHAN_A2P, req); - } else { - SDT_PROBE3(scmi, func, scmi_req_put, req_alloc, - req, refcount_load(&req->cnt), SCMI_MSG_TOKEN(req->msg.hdr)); } mtx_unlock_spin(&req->mtx); } @@ -610,10 +571,6 @@ scmi_process_response(struct scmi_softc *sc, uint32_t hdr, uint32_t rx_len) return; } - SDT_PROBE5(scmi, func, scmi_process_response, xfer_track, req, - SCMI_MSG_PROTOCOL_ID(req->msg.hdr), SCMI_MSG_MESSAGE_ID(req->msg.hdr), - SCMI_MSG_TOKEN(req->msg.hdr), req->timed_out); - mtx_lock_spin(&req->mtx); req->done = true; req->msg.rx_len = rx_len; @@ -651,8 +608,6 @@ scmi_rx_irq_callback(device_t dev, void *chan, uint32_t hdr, uint32_t rx_len) sc = device_get_softc(dev); - SDT_PROBE2(scmi, func, scmi_rx_irq_callback, hdr_dump, hdr, rx_len); - if (SCMI_IS_MSG_TYPE_NOTIF(hdr) || SCMI_IS_MSG_TYPE_DRESP(hdr)) { device_printf(dev, "DRESP/NOTIF unsupported. Drop.\n"); SCMI_CLEAR_CHANNEL(dev, chan); @@ -668,10 +623,6 @@ scmi_wait_for_response(struct scmi_softc *sc, struct scmi_req *req, void **out) unsigned int reply_timo_ms = SCMI_MAX_MSG_TIMEOUT_MS(sc); int ret; - SDT_PROBE5(scmi, entry, scmi_wait_for_response, xfer_track, req, - SCMI_MSG_PROTOCOL_ID(req->msg.hdr), SCMI_MSG_MESSAGE_ID(req->msg.hdr), - SCMI_MSG_TOKEN(req->msg.hdr), reply_timo_ms); - if (req->msg.polling) { bool needs_drop; @@ -716,10 +667,6 @@ scmi_wait_for_response(struct scmi_softc *sc, struct scmi_req *req, void **out) SCMI_TX_COMPLETE(sc->dev, NULL); - SDT_PROBE5(scmi, exit, scmi_wait_for_response, xfer_track, req, - SCMI_MSG_PROTOCOL_ID(req->msg.hdr), SCMI_MSG_MESSAGE_ID(req->msg.hdr), - SCMI_MSG_TOKEN(req->msg.hdr), req->timed_out); - return (ret); } @@ -822,10 +769,6 @@ scmi_request_tx(device_t dev, void *in) return (error); } - SDT_PROBE5(scmi, func, scmi_request_tx, xfer_track, req, - SCMI_MSG_PROTOCOL_ID(req->msg.hdr), SCMI_MSG_MESSAGE_ID(req->msg.hdr), - SCMI_MSG_TOKEN(req->msg.hdr), req->msg.polling); - return (0); } From nobody Mon Jun 9 15:45:51 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGGV80v3mz5y4Yg; Mon, 09 Jun 2025 15:45:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGGV762DKz45G6; Mon, 09 Jun 2025 15:45:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749483951; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0hjcAOnligDgeWj0ZH3ekxxMnDcVxTuEqu46NH9rxsM=; b=PPQKVf8rE/2Y2RVXrVNBQ2IjbjZesBcneP34+mCPUEwm/vuMkLQPH0URgitwEb97N2O/q5 PByOL3leD2REZsD33YhciqFX/rf2ZUcGdKO0YeeWUrDnuCia8XsvW7aZ1/iGKwcV8QY9wW j4Gxp5MVTBKKlfP/V3e3YmJNKEYj8XRBwUbX1Mmlmb02FOlY/10pOdmWbm07WminHh2C7t wc6UoJvElOAcLsJ2OFxeLS1ztIwUgA2mcQ48h+gD9WJ+ucmrm+bgJp7eHgW6MLzUFUHGE1 DgVd/AdyNTjMSVCAuXF0/dFd5LRHF8j+ZuVt+0kTZ6w91BGQBFZdvIL/uxDePA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749483951; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0hjcAOnligDgeWj0ZH3ekxxMnDcVxTuEqu46NH9rxsM=; b=eruvx4khCL0xodoTauTdvFbtab0yR2jfUQqVsDUQkByyU9doRRKZIlhVeCkCXaIfTcTQ33 sL8f+4S9vq7wxys1CKL2uFJV+2PGcAuSUr8UCIq8U6uh3fwAn6cofVxrTaBZq+ibBx+JmR QJy4FWvvl3xJMrpg2lJdfvkb2N5w06Q+TxbY9cJ4iaDxW14BxVXv/3uxpk9dNVSbE69/Or cZx5Bh6r2fjHiAjex1BTQoqO6wYSykP/PIh9pr9CRnN+YPfeFsiadcOIGk38ik4SV59P4E uWgaKrV03m3vGjQqsdog5X99qjnxHTf/4O+5VWBqxpT2d4wW8kCCHWdB+ZXBmw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749483951; a=rsa-sha256; cv=none; b=BJsxRF9A6AarOF8B6o01kvUBU5eAIrRjp25zQa2KCUdIf6rGMqqX3OoSOMb35mxB6JAggC OeBuyFkZDHmoWXwCt5ufjLH9GOBVjdh+4rK8d4UazpmzMQf45ZCWa19defwmbQEegeDUc3 WOCarYdfM8ErbxbLquTcYtPYfAJJhpPlyHsAMZSBf0qigOSndKwXn5JwH2I2c+RhoSHbr3 /4qtDEniQkhgr9UoFaOwa1XyZ4XBwU8XWknzjG1oKI5CCHlJreGbzraIE9ZWJmYAKgHDJN yaqBk+05rJLsAMNHCJyToSsSlR4n89gP68LozPEYI6GFM7eA7Wh1sal4/J9ogA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGGV756Hzz11yK; Mon, 09 Jun 2025 15:45:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559FjpS8088240; Mon, 9 Jun 2025 15:45:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559FjpBe088237; Mon, 9 Jun 2025 15:45:51 GMT (envelope-from git) Date: Mon, 9 Jun 2025 15:45:51 GMT Message-Id: <202506091545.559FjpBe088237@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 35fee38c77f1 - main - Revert "scmi: Add optional asynchronous handling of replies" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 35fee38c77f1bb1a30a2c62b8eca923463dbed7e Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=35fee38c77f1bb1a30a2c62b8eca923463dbed7e commit 35fee38c77f1bb1a30a2c62b8eca923463dbed7e Author: Andrew Turner AuthorDate: 2025-06-09 13:21:35 +0000 Commit: Andrew Turner CommitDate: 2025-06-04 01:32:39 +0000 Revert "scmi: Add optional asynchronous handling of replies" Revert to reapply series as some patches were incorrect versions This reverts commit b802926b7b145d7cfe2465ac4e19f062a9eb6e6d. --- sys/dev/firmware/arm/scmi.c | 46 +++++---------------------------------------- sys/dev/firmware/arm/scmi.h | 1 - 2 files changed, 5 insertions(+), 42 deletions(-) diff --git a/sys/dev/firmware/arm/scmi.c b/sys/dev/firmware/arm/scmi.c index 0b165e413674..950bbf94eeb6 100644 --- a/sys/dev/firmware/arm/scmi.c +++ b/sys/dev/firmware/arm/scmi.c @@ -43,7 +43,6 @@ #include #include #include -#include #include #include @@ -95,8 +94,6 @@ struct scmi_req { bool use_polling; bool done; bool is_raw; - device_t dev; - struct task tsk; struct mtx mtx; LIST_ENTRY(scmi_req) next; int protocol_id; @@ -106,7 +103,6 @@ struct scmi_req { struct scmi_msg msg; }; -#define tsk_to_req(t) __containerof((t), struct scmi_req, tsk) #define buf_to_msg(b) __containerof((b), struct scmi_msg, payld) #define msg_to_req(m) __containerof((m), struct scmi_req, msg) #define buf_to_req(b) msg_to_req(buf_to_msg(b)) @@ -135,9 +131,7 @@ struct scmi_transport { static void scmi_transport_configure(struct scmi_transport_desc *, phandle_t); static int scmi_transport_init(struct scmi_softc *, phandle_t); static void scmi_transport_cleanup(struct scmi_softc *); -static void scmi_req_async_waiter(void *, int); -static struct scmi_reqs_pool *scmi_reqs_pool_allocate(device_t, const int, - const int); +static struct scmi_reqs_pool *scmi_reqs_pool_allocate(const int, const int); static void scmi_reqs_pool_free(struct scmi_reqs_pool *); static struct scmi_req *scmi_req_alloc(struct scmi_softc *, enum scmi_chan); static struct scmi_req *scmi_req_initialized_alloc(device_t, int, int); @@ -223,7 +217,7 @@ DRIVER_MODULE(scmi, simplebus, scmi_driver, 0, 0); MODULE_VERSION(scmi, 1); static struct scmi_reqs_pool * -scmi_reqs_pool_allocate(device_t dev, const int max_msg, const int max_payld_sz) +scmi_reqs_pool_allocate(const int max_msg, const int max_payld_sz) { struct scmi_reqs_pool *rp; struct scmi_req *req; @@ -235,10 +229,6 @@ scmi_reqs_pool_allocate(device_t dev, const int max_msg, const int max_payld_sz) req = malloc(sizeof(*req) + max_payld_sz, M_DEVBUF, M_ZERO | M_WAITOK); - req->dev = dev; - req->tsk.ta_context = &req->tsk; - req->tsk.ta_func = scmi_req_async_waiter; - mtx_init(&req->mtx, "req", "SCMI", MTX_SPIN); LIST_INSERT_HEAD(&rp->head, req, next); } @@ -290,14 +280,14 @@ scmi_transport_init(struct scmi_softc *sc, phandle_t node) trs->inflight_ht = hashinit(td->max_msg, M_DEVBUF, &trs->inflight_mask); trs->chans[SCMI_CHAN_A2P] = - scmi_reqs_pool_allocate(sc->dev, td->max_msg, td->max_payld_sz); + scmi_reqs_pool_allocate(td->max_msg, td->max_payld_sz); if (trs->chans[SCMI_CHAN_A2P] == NULL) { free(trs, M_DEVBUF); return (ENOMEM); } trs->chans[SCMI_CHAN_P2A] = - scmi_reqs_pool_allocate(sc->dev, td->max_msg, td->max_payld_sz); + scmi_reqs_pool_allocate(td->max_msg, td->max_payld_sz); if (trs->chans[SCMI_CHAN_P2A] == NULL) { scmi_reqs_pool_free(trs->chans[SCMI_CHAN_A2P]); free(trs, M_DEVBUF); @@ -658,8 +648,7 @@ scmi_wait_for_response(struct scmi_softc *sc, struct scmi_req *req, void **out) SCMI_COLLECT_REPLY(sc->dev, &req->msg); if (req->msg.payld[0] != 0) ret = req->msg.payld[0]; - if (out != NULL) - *out = &req->msg.payld[SCMI_MSG_HDR_SIZE]; + *out = &req->msg.payld[SCMI_MSG_HDR_SIZE]; } else { device_printf(sc->dev, "Request for token 0x%X timed-out.\n", req->token); @@ -714,20 +703,6 @@ scmi_msg_get(device_t dev, int tx_payld_sz, int rx_payld_sz) return (&req->msg); } -static void -scmi_req_async_waiter(void *context, int pending) -{ - struct task *ta = context; - struct scmi_softc *sc; - struct scmi_req *req; - - req = tsk_to_req(ta); - sc = device_get_softc(req->dev); - scmi_wait_for_response(sc, req, NULL); - - scmi_msg_put(req->dev, &req->msg); -} - void scmi_msg_put(device_t dev, struct scmi_msg *msg) { @@ -788,14 +763,3 @@ scmi_request(device_t dev, void *in, void **out) return (scmi_wait_for_response(sc, req, out)); } - -int -scmi_msg_async_enqueue(struct scmi_msg *msg) -{ - struct scmi_req *req; - - req = msg_to_req(msg); - - return taskqueue_enqueue_flags(taskqueue_thread, &req->tsk, - TASKQUEUE_FAIL_IF_PENDING | TASKQUEUE_FAIL_IF_CANCELING); -} diff --git a/sys/dev/firmware/arm/scmi.h b/sys/dev/firmware/arm/scmi.h index 990759237964..f5b4173272bb 100644 --- a/sys/dev/firmware/arm/scmi.h +++ b/sys/dev/firmware/arm/scmi.h @@ -84,7 +84,6 @@ struct scmi_msg *scmi_msg_get(device_t dev, int tx_payld_sz, int rx_payld_sz); void scmi_msg_put(device_t dev, struct scmi_msg *msg); int scmi_request(device_t dev, void *in, void **); int scmi_request_tx(device_t dev, void *in); -int scmi_msg_async_enqueue(struct scmi_msg *msg); void scmi_rx_irq_callback(device_t dev, void *chan, uint32_t hdr, uint32_t rx_len); DECLARE_CLASS(scmi_driver); From nobody Mon Jun 9 15:45:52 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGGVB1xV9z5y4dV; Mon, 09 Jun 2025 15:45:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGGV931Dwz459W; Mon, 09 Jun 2025 15:45:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749483953; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OnV0kwLOSeYt7XxklmAk0j6nq1CruVLt87e+o6X7kv4=; b=dZr4kXU4t9S/qDdLOSYKPZRLxbbxG+capaw05rqzg6qRVhfTm03ksosStvF8oPrLPTZcve HF7JDC0o/sZ9hdbsjJ7ddPgcLky5kDKG/Qdw7ZiS34K1ilVB3Vq0lGzU3ihpZk2Jwvfsl2 wLpb0Fc/jrTQy25SD86nH1J+PqMhFoqv0vRL5EBCCp5BXFR7K2A19uHszywFMN9IvGi7+F tmQA35d6yx9j4exReMlkwYSUJMYS7FbCp+kVR4+99IzhZrB3Ze9NfsTVwjMx7EQ9ZZHmiO cLdWlgu1trrB62IkoaNRIy0s7zG73mNZWyeO8SwJkbk5VHLPfrHepKoxcgmHkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749483953; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OnV0kwLOSeYt7XxklmAk0j6nq1CruVLt87e+o6X7kv4=; b=rqHbjsc/QlXhg9/NrAdT+NAsNVKtt6BURw/DPbDAjyvjhxCJUyxXHzJrkyS1wJOsobPFv6 zih+pFpwSwN5zwbAe/c8zkajUcx7QeI4c3H5gGV/5CdeTVJsKFhtxNta5cgf7UL2H2vRHG yM1OfWU+1l4e6SsC+u2motgkM0YQzMY8c4Gy3A8R9KNdf5xzWZuTKjnOfNmLTuY37763hA BxFk+gz1iESwROgMugekXeHbtMFxb8c4wst5YcKolcFv/srRTSDMc14T8tILvoMTXy2Pr8 sYmZuvPhwhSGDJ1o+/2n+q/XCstbmP5AksntXTuyyZUFZ2Pks4BpRY4T2/l/GA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749483953; a=rsa-sha256; cv=none; b=Tno6smoVBXXBic3bz29heGS2oaO8ZdZtj2FJ5SmnFgAKpEPgSDDHB465Zy6yNAlyS7m5vB 6vvOdxUtIw3L2cYAR3t50LLYwNnGMw5+Elemi/csLhYFw2gB1LKIYNeZUC7Rfsg7Lp8iiA QbtAuAxSGlbBZBYAH8oTjPjck/nvoIfCK01Ep/v8FlMZcDKYu8HwmNgzgq+kwoWZubHmJV rM22o1r7ajrWDeqChc5USK5XmLxHTUjLvqfZ/odwQZwx8Y1uWU34Wcw5K27avy535YB2KE G3qtfEI8GytvktEsRyJrqeCPJHYiO0vNZW5oK/A3AlZuXHlqtzEOoRbNbfImRA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGGV862X8z12Df; Mon, 09 Jun 2025 15:45:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559FjqCO088277; Mon, 9 Jun 2025 15:45:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559Fjq7m088272; Mon, 9 Jun 2025 15:45:52 GMT (envelope-from git) Date: Mon, 9 Jun 2025 15:45:52 GMT Message-Id: <202506091545.559Fjq7m088272@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: b65172cb9ebd - main - Revert "scmi: Refactor scmi_request internal logic" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b65172cb9ebd704661dfa917e30af6658f8799f6 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=b65172cb9ebd704661dfa917e30af6658f8799f6 commit b65172cb9ebd704661dfa917e30af6658f8799f6 Author: Andrew Turner AuthorDate: 2025-06-09 13:21:37 +0000 Commit: Andrew Turner CommitDate: 2025-06-04 01:32:39 +0000 Revert "scmi: Refactor scmi_request internal logic" Revert to reapply series as some patches were incorrect versions This reverts commit 341d8fd90fa084d074059051478657cb45e53402. --- sys/dev/firmware/arm/scmi.c | 24 ++---------------------- sys/dev/firmware/arm/scmi.h | 1 - 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/sys/dev/firmware/arm/scmi.c b/sys/dev/firmware/arm/scmi.c index 950bbf94eeb6..c24768a5668a 100644 --- a/sys/dev/firmware/arm/scmi.c +++ b/sys/dev/firmware/arm/scmi.c @@ -717,7 +717,7 @@ scmi_msg_put(device_t dev, struct scmi_msg *msg) } int -scmi_request_tx(device_t dev, void *in) +scmi_request(device_t dev, void *in, void **out) { struct scmi_softc *sc; struct scmi_req *req; @@ -732,11 +732,8 @@ scmi_request_tx(device_t dev, void *in) /* Set inflight and send using transport specific method - refc-2 */ error = scmi_req_track_inflight(sc, req); - if (error != 0) { - device_printf(dev, "Failed to build req with HDR |%0X|\n", - req->msg.hdr); + if (error != 0) return (error); - } error = SCMI_XFER_MSG(sc->dev, &req->msg); if (error != 0) { @@ -744,22 +741,5 @@ scmi_request_tx(device_t dev, void *in) return (error); } - return (0); -} - -int -scmi_request(device_t dev, void *in, void **out) -{ - struct scmi_softc *sc; - struct scmi_req *req; - int error; - - error = scmi_request_tx(dev, in); - if (error != 0) - return (error); - - sc = device_get_softc(dev); - req = buf_to_req(in); - return (scmi_wait_for_response(sc, req, out)); } diff --git a/sys/dev/firmware/arm/scmi.h b/sys/dev/firmware/arm/scmi.h index f5b4173272bb..f6aa072caeca 100644 --- a/sys/dev/firmware/arm/scmi.h +++ b/sys/dev/firmware/arm/scmi.h @@ -83,7 +83,6 @@ void scmi_buf_put(device_t dev, void *buf); struct scmi_msg *scmi_msg_get(device_t dev, int tx_payld_sz, int rx_payld_sz); void scmi_msg_put(device_t dev, struct scmi_msg *msg); int scmi_request(device_t dev, void *in, void **); -int scmi_request_tx(device_t dev, void *in); void scmi_rx_irq_callback(device_t dev, void *chan, uint32_t hdr, uint32_t rx_len); DECLARE_CLASS(scmi_driver); From nobody Mon Jun 9 15:45:53 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGGVB4cmJz5y4T4; Mon, 09 Jun 2025 15:45:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGGV9705Nz45RG; Mon, 09 Jun 2025 15:45:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749483954; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LvblhsRz11pR1vr97oZUT+E8WFbtPF52qvtknkr95lw=; b=XDfrFBLb+5n9+2+o0NH8FWEuB7S/UEwjvvMYsFVYFrGl+CRWQhl9l1mX2Oy6qXX0ZpshHY PTftfsQQHrjc+au7gJ/DcXtYaIo1lfSk6x0I5CykrTbWDBxmhO5eGL0Si+4DQG+euDTA+U WwFvOwlA0dLtJEK53rewYC0vrvHfsizoNqDr+Q3QkBqCgaNByBQIr+McmMbH79FdI88Deq 8y6/35v9tIoZNEZJBCXvosK17i2Aqt4CmnFdLZs9uyuRMIZ4mB6BgfxZFkFuiGhFA/6BV6 TRnnaUUnBZxYurIlYejkkksTv24ClUZYhXH1EUUBcsV+CfTV7t5u2pz369jMGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749483954; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LvblhsRz11pR1vr97oZUT+E8WFbtPF52qvtknkr95lw=; b=ksRy9XNuTSg5CED1lVaLlP3+5IufFFVhFpvEOvhgy9KYnsORoX5Ju8y6HLikizLMj2H9De 8qGdlRBC5VD+iv2wZAsGff/+UlkU/MagKwJpi3zyOIz7DmInUQ3u6EU9OPWLgnCJZSzH8O 2hSy/XMvtVt2vj7XcvLSAvTHlG318lCDDGynT6omDYbnHI/gSKpsRyTwU8hiMkIjvcktiv QErM7+8jocEEnKf7u9Q9brDNcHWfKXb/ar5gvYdmgsSNnZ0JNlfd4vtEdMpnW4dJNjeb/s cjJIwQJmYpSrpMF80LwwDFFv1OgdurN6cUXyC6f8I4lYBMjLjUHHG4l4XyaoAA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749483954; a=rsa-sha256; cv=none; b=IGKXba8oqRvLQsScECLBd1Uv2+ZDMU3a3q4PfBqybxwBlCpvP1oIjR4RCTLwX1JHlvSV3B hB+O2lhWYs4fVAvh6Oo7uTicXgj+7NKqwtXVcDeVGrEujz0rqcqgQIU0dEuhMEzt/2yoKL 8Kym+qqVQOWQ6QlNRzW0oiS7RSVf65Z1/prBXeXHXYqbe1bbPZo8nw2uBrbinln3RJYqkA iqONVFOQD2cxV6BtrWhqfgbr4omSjpywlpvbNAW64h8gTt1gshOvEEHo/NDOhcUakeiNhg 1msdTA9LV2v250nXiuW2g5xI4xNGRHU2cLwckxviVJQhquMBEimHaT174tJYUw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGGV96Yzbz128n; Mon, 09 Jun 2025 15:45:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559FjrcH088315; Mon, 9 Jun 2025 15:45:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559FjrNS088312; Mon, 9 Jun 2025 15:45:53 GMT (envelope-from git) Date: Mon, 9 Jun 2025 15:45:53 GMT Message-Id: <202506091545.559FjrNS088312@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: b0be4172f557 - main - Revert "scmi: Add scmi_token_reserve helper" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b0be4172f55752bd5d868ac8fe3a5abf36fe91e7 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=b0be4172f55752bd5d868ac8fe3a5abf36fe91e7 commit b0be4172f55752bd5d868ac8fe3a5abf36fe91e7 Author: Andrew Turner AuthorDate: 2025-06-09 13:21:40 +0000 Commit: Andrew Turner CommitDate: 2025-06-04 01:32:39 +0000 Revert "scmi: Add scmi_token_reserve helper" Revert to reapply series as some patches were incorrect versions This reverts commit c508841dfc5923ef81ed8ea61da364fb20616bbf. --- sys/dev/firmware/arm/scmi.c | 48 +++++++++------------------------------------ 1 file changed, 9 insertions(+), 39 deletions(-) diff --git a/sys/dev/firmware/arm/scmi.c b/sys/dev/firmware/arm/scmi.c index c24768a5668a..8104f4e10429 100644 --- a/sys/dev/firmware/arm/scmi.c +++ b/sys/dev/firmware/arm/scmi.c @@ -93,7 +93,6 @@ struct scmi_req { bool timed_out; bool use_polling; bool done; - bool is_raw; struct mtx mtx; LIST_ENTRY(scmi_req) next; int protocol_id; @@ -140,7 +139,6 @@ static void scmi_req_free_unlocked(struct scmi_softc *, static void scmi_req_get(struct scmi_softc *, struct scmi_req *); static void scmi_req_put(struct scmi_softc *, struct scmi_req *); static int scmi_token_pick(struct scmi_softc *); -static int scmi_token_reserve(struct scmi_softc *, uint16_t); static void scmi_token_release_unlocked(struct scmi_softc *, int); static int scmi_req_track_inflight(struct scmi_softc *, struct scmi_req *); @@ -378,7 +376,6 @@ scmi_req_free_unlocked(struct scmi_softc *sc, enum scmi_chan ch_idx, mtx_lock_spin(&rp->mtx); req->timed_out = false; req->done = false; - req->is_raw = false; refcount_init(&req->cnt, 0); LIST_INSERT_HEAD(&rp->head, req, next); mtx_unlock_spin(&rp->mtx); @@ -427,6 +424,7 @@ scmi_token_pick(struct scmi_softc *sc) */ next_msg_id = sc->trs->next_id++ & SCMI_HDR_TOKEN_BF; token = BIT_FFS_AT(SCMI_MAX_TOKEN, &sc->trs->avail_tokens, next_msg_id); + /* TODO Account for wrap-arounds and holes */ if (token != 0) BIT_CLR(SCMI_MAX_TOKEN, token - 1, &sc->trs->avail_tokens); mtx_unlock_spin(&sc->trs->mtx); @@ -442,28 +440,6 @@ scmi_token_pick(struct scmi_softc *sc) return ((int)(token - 1)); } -static int -scmi_token_reserve(struct scmi_softc *sc, uint16_t candidate) -{ - int token = -EBUSY, retries = 3; - - do { - mtx_lock_spin(&sc->trs->mtx); - if (BIT_ISSET(SCMI_MAX_TOKEN, candidate, &sc->trs->avail_tokens)) { - BIT_CLR(SCMI_MAX_TOKEN, candidate, &sc->trs->avail_tokens); - token = candidate; - sc->trs->next_id++; - } - mtx_unlock_spin(&sc->trs->mtx); - if (token == candidate || retries-- == 0) - break; - - pause("scmi_tk_reserve", hz); - } while (1); - - return (token); -} - static void scmi_token_release_unlocked(struct scmi_softc *sc, int token) { @@ -474,23 +450,19 @@ scmi_token_release_unlocked(struct scmi_softc *sc, int token) static int scmi_finalize_req(struct scmi_softc *sc, struct scmi_req *req) { - if (!req->is_raw) - req->token = scmi_token_pick(sc); - else - req->token = scmi_token_reserve(sc, SCMI_MSG_TOKEN(req->msg.hdr)); + uint32_t header = 0; + req->token = scmi_token_pick(sc); if (req->token < 0) return (EBUSY); - if (!req->is_raw) { - req->msg.hdr = req->message_id; - req->msg.hdr |= SCMI_MSG_TYPE_CMD << SCMI_HDR_MESSAGE_TYPE_S; - req->msg.hdr |= req->protocol_id << SCMI_HDR_PROTOCOL_ID_S; - req->msg.hdr |= req->token << SCMI_HDR_TOKEN_S; - } + header = req->message_id; + header |= SCMI_MSG_TYPE_CMD << SCMI_HDR_MESSAGE_TYPE_S; + header |= req->protocol_id << SCMI_HDR_PROTOCOL_ID_S; + header |= req->token << SCMI_HDR_TOKEN_S; - /* Save requested header */ - req->header = req->msg.hdr; + req->header = htole32(header); + req->msg.hdr = htole32(header); return (0); } @@ -698,8 +670,6 @@ scmi_msg_get(device_t dev, int tx_payld_sz, int rx_payld_sz) if (req == NULL) return (NULL); - req->is_raw = true; - return (&req->msg); } From nobody Mon Jun 9 15:45:56 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGGVD3SfBz5y4bT; Mon, 09 Jun 2025 15: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGGVD1rQXz45Mq; Mon, 09 Jun 2025 15: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=1749483956; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pjx6OwGaUIPUG7W7XGsxYow+2018UWR160oPfrFjTqk=; b=PJsxzWywy1OBsGyfqqTYdnwiMimvoIFpJwvodGh/mvC6bg2ybTGFIfKnrwYDs0rDyRXxNk Za/ncWIdi1EV0p3G0DET64qNNedQDCoOukKpLfyxBJ5MmVBVUzDUW7Y8JYKt5jpKaKKGNb 6ypGN4nZCkZcm2Y0sGmAOI0CepcP/JSOnfppUKmyeQrp5iLaIxTohkRbABGniMuYZ+OYT7 q0DMNAUql2maqDI8DXnLWGvf5h23D2rDAtMDwdX36ZOVpu4J4CEAOCX09wTsoLThkm3k22 nLCH25kEcJVqWWrg71pDOSRbCdRYOSS9ZvHdnlDWz17TV2dpm74PKMd9N/UaPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749483956; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pjx6OwGaUIPUG7W7XGsxYow+2018UWR160oPfrFjTqk=; b=e2wEtlaertCW1tIzCYmkw6UdcgTSqjLzzNUY+OjwqM9iOnJMup3E7+xIE4u2ipVbuTiJq1 BUmcEyqM1B66HzN4xR7bFImh9BefxARk5Y+o/zWQUX4xWjT2oFHY6MT7mU1P9MB01r6jp4 jOgK6DoB34KNWjKiwhK6g37twk2+Ym7ghmXC2SgfCAp3C+dhpupBLe/GuAavhYPNERZ9Mv e6ZRF/sAQmjC7ugdl2q3y0mqP8MT6Kh8PLzzeg2fX5Z/5bW+/RPc4j0BiXUIkZQLe03jLw 3UgKOLo2IdVMxJ8qx+sSHFpjNbU8vea/czec1k4l6uLuHmSRlilCGPHG/Nu79A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749483956; a=rsa-sha256; cv=none; b=AUH1JvVyqagcFJZCIE1GcfFysJR469/jDPuPiGafZl3X75UH68yG/6O68YM7E5hZGBKCnZ LMcO5AzhitTijVAjLT7l5Vv/6JTgDe50UledcmMoLgphJ4QLOIYOtWdeQspMBv29midiTO ZCHcW9nBflZ7RA4Kkd+mPhCqNBSu16GDtSBksMohiHPybaOhOGyJzIiKtPpjlJ9OQRUHI/ nASbVzzCeaGT8Sfp3urncYdpCG45SM/Y0peLFuIbq7sHi61KcTzuABkxNveMDkfLnC8zdH jdrWhoURL0YW36b93NKhU2W2KKdxopq1i3k//sypzNVdJA6T/KRft/B/m7sqvA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGGVD1C35z12Dg; Mon, 09 Jun 2025 15:45:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559FjuOc088390; Mon, 9 Jun 2025 15:45:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559FjuVc088387; Mon, 9 Jun 2025 15:45:56 GMT (envelope-from git) Date: Mon, 9 Jun 2025 15:45:56 GMT Message-Id: <202506091545.559FjuVc088387@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 04a83b8b5e5b - main - Revert "scmi: Add devicetree transport properties" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 04a83b8b5e5b2d68649743739e07f7da5699d838 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=04a83b8b5e5b2d68649743739e07f7da5699d838 commit 04a83b8b5e5b2d68649743739e07f7da5699d838 Author: Andrew Turner AuthorDate: 2025-06-09 13:21:46 +0000 Commit: Andrew Turner CommitDate: 2025-06-04 01:32:39 +0000 Revert "scmi: Add devicetree transport properties" Revert to reapply series as some patches were incorrect versions This reverts commit 103ea03e6713a0f3bb874472fbd9fd81e2278805. --- sys/dev/firmware/arm/scmi.c | 52 +++++++++++++------------------------- sys/dev/firmware/arm/scmi.h | 14 +++------- sys/dev/firmware/arm/scmi_virtio.c | 12 ++++----- 3 files changed, 27 insertions(+), 51 deletions(-) diff --git a/sys/dev/firmware/arm/scmi.c b/sys/dev/firmware/arm/scmi.c index cf5a678370fd..00a229762414 100644 --- a/sys/dev/firmware/arm/scmi.c +++ b/sys/dev/firmware/arm/scmi.c @@ -127,8 +127,7 @@ struct scmi_transport { struct mtx mtx; }; -static void scmi_transport_configure(struct scmi_transport_desc *, phandle_t); -static int scmi_transport_init(struct scmi_softc *, phandle_t); +static int scmi_transport_init(struct scmi_softc *); static void scmi_transport_cleanup(struct scmi_softc *); static struct scmi_reqs_pool *scmi_reqs_pool_allocate(const int, const int); static void scmi_reqs_pool_free(struct scmi_reqs_pool *); @@ -166,12 +165,12 @@ scmi_attach(device_t dev) simplebus_init(dev, node); - error = scmi_transport_init(sc, node); + error = scmi_transport_init(sc); if (error != 0) return (error); - device_printf(dev, "Transport - max_msg:%d max_payld_sz:%lu reply_timo_ms:%d\n", - SCMI_MAX_MSG(sc), SCMI_MAX_MSG_PAYLD_SIZE(sc), SCMI_MAX_MSG_TIMEOUT_MS(sc)); + device_printf(dev, "Transport reply timeout initialized to %dms\n", + sc->trs_desc.reply_timo_ms); /* * Allow devices to identify. @@ -249,42 +248,29 @@ scmi_reqs_pool_free(struct scmi_reqs_pool *rp) free(rp, M_DEVBUF); } -static void -scmi_transport_configure(struct scmi_transport_desc *td, phandle_t node) -{ - if (OF_getencprop(node, "arm,max-msg", &td->max_msg, sizeof(td->max_msg)) == -1) - td->max_msg = SCMI_DEF_MAX_MSG; - - if (OF_getencprop(node, "arm,max-msg-size", &td->max_payld_sz, - sizeof(td->max_payld_sz)) == -1) - td->max_payld_sz = SCMI_DEF_MAX_MSG_PAYLD_SIZE; -} - static int -scmi_transport_init(struct scmi_softc *sc, phandle_t node) +scmi_transport_init(struct scmi_softc *sc) { - struct scmi_transport_desc *td = &sc->trs_desc; struct scmi_transport *trs; int ret; trs = malloc(sizeof(*trs), M_DEVBUF, M_ZERO | M_WAITOK); - scmi_transport_configure(td, node); - BIT_FILL(SCMI_MAX_TOKEN, &trs->avail_tokens); mtx_init(&trs->mtx, "tokens", "SCMI", MTX_SPIN); - trs->inflight_ht = hashinit(td->max_msg, M_DEVBUF, &trs->inflight_mask); + trs->inflight_ht = hashinit(SCMI_MAX_MSG, M_DEVBUF, + &trs->inflight_mask); trs->chans[SCMI_CHAN_A2P] = - scmi_reqs_pool_allocate(td->max_msg, td->max_payld_sz); + scmi_reqs_pool_allocate(SCMI_MAX_MSG, SCMI_MAX_MSG_PAYLD_SIZE); if (trs->chans[SCMI_CHAN_A2P] == NULL) { free(trs, M_DEVBUF); return (ENOMEM); } trs->chans[SCMI_CHAN_P2A] = - scmi_reqs_pool_allocate(td->max_msg, td->max_payld_sz); + scmi_reqs_pool_allocate(SCMI_MAX_MSG, SCMI_MAX_MSG_PAYLD_SIZE); if (trs->chans[SCMI_CHAN_P2A] == NULL) { scmi_reqs_pool_free(trs->chans[SCMI_CHAN_A2P]); free(trs, M_DEVBUF); @@ -300,13 +286,8 @@ scmi_transport_init(struct scmi_softc *sc, phandle_t node) return (ret); } - /* Use default transport timeout if not overridden by OF */ - OF_getencprop(node, "arm,max-rx-timeout-ms", &td->reply_timo_ms, - sizeof(td->reply_timo_ms)); - return (0); } - static void scmi_transport_cleanup(struct scmi_softc *sc) { @@ -374,7 +355,7 @@ scmi_req_put(struct scmi_softc *sc, struct scmi_req *req) { mtx_lock_spin(&req->mtx); if (!refcount_release_if_not_last(&req->cnt)) { - bzero(&req->msg, sizeof(req->msg) + SCMI_MAX_MSG_PAYLD_SIZE(sc)); + bzero(&req->msg, sizeof(req->msg) + SCMI_MAX_MSG_PAYLD_SIZE); scmi_req_free_unlocked(sc, SCMI_CHAN_A2P, req); } mtx_unlock_spin(&req->mtx); @@ -551,13 +532,13 @@ scmi_rx_irq_callback(device_t dev, void *chan, uint32_t hdr, uint32_t rx_len) static int scmi_wait_for_response(struct scmi_softc *sc, struct scmi_req *req, void **out) { - unsigned int reply_timo_ms = SCMI_MAX_MSG_TIMEOUT_MS(sc); int ret; if (req->msg.polling) { bool needs_drop; - ret = SCMI_POLL_MSG(sc->dev, &req->msg, reply_timo_ms); + ret = SCMI_POLL_MSG(sc->dev, &req->msg, + sc->trs_desc.reply_timo_ms); /* * Drop reference to successfully polled req unless it had * already also been processed on the IRQ path. @@ -576,7 +557,8 @@ scmi_wait_for_response(struct scmi_softc *sc, struct scmi_req *req, void **out) le32toh(req->msg.hdr), le32toh(req->header)); } } else { - ret = tsleep(req, 0, "scmi_wait4", (reply_timo_ms * hz) / 1000); + ret = tsleep(req, 0, "scmi_wait4", + (sc->trs_desc.reply_timo_ms * hz) / 1000); /* Check for lost wakeups since there is no associated lock */ mtx_lock_spin(&req->mtx); if (ret != 0 && req->done) @@ -609,8 +591,8 @@ scmi_buf_get(device_t dev, uint8_t protocol_id, uint8_t message_id, sc = device_get_softc(dev); - if (tx_payld_sz > SCMI_MAX_MSG_PAYLD_SIZE(sc) || - rx_payld_sz > SCMI_MAX_MSG_REPLY_SIZE(sc)) { + if (tx_payld_sz > SCMI_MAX_MSG_PAYLD_SIZE || + rx_payld_sz > SCMI_MAX_MSG_REPLY_SIZE) { device_printf(dev, "Unsupported payload size. Drop.\n"); return (NULL); } @@ -624,7 +606,7 @@ scmi_buf_get(device_t dev, uint8_t protocol_id, uint8_t message_id, req->message_id = message_id & SCMI_HDR_MESSAGE_ID_BF; req->msg.tx_len = sizeof(req->msg.hdr) + tx_payld_sz; req->msg.rx_len = rx_payld_sz ? - rx_payld_sz + 2 * sizeof(uint32_t) : SCMI_MAX_MSG_SIZE(sc); + rx_payld_sz + 2 * sizeof(uint32_t) : SCMI_MAX_MSG_SIZE; return (&req->msg.payld[0]); } diff --git a/sys/dev/firmware/arm/scmi.h b/sys/dev/firmware/arm/scmi.h index 135b49c3b05b..73b49f099ad8 100644 --- a/sys/dev/firmware/arm/scmi.h +++ b/sys/dev/firmware/arm/scmi.h @@ -34,14 +34,10 @@ #include "scmi_if.h" -#define SCMI_DEF_MAX_MSG 32 -#define SCMI_DEF_MAX_MSG_PAYLD_SIZE 128 - -#define SCMI_MAX_MSG_PAYLD_SIZE(sc) ((sc)->trs_desc.max_payld_sz + sizeof(uint32_t)) -#define SCMI_MAX_MSG_REPLY_SIZE(sc) (SCMI_MAX_MSG_PAYLD_SIZE((sc)) + sizeof(uint32_t)) -#define SCMI_MAX_MSG_SIZE(sc) (SCMI_MAX_MSG_REPLY_SIZE(sc) + sizeof(uint32_t)) -#define SCMI_MAX_MSG(sc) ((sc)->trs_desc.max_msg) -#define SCMI_MAX_MSG_TIMEOUT_MS(sc) ((sc)->trs_desc.reply_timo_ms) +#define SCMI_MAX_MSG 32 +#define SCMI_MAX_MSG_PAYLD_SIZE 128 +#define SCMI_MAX_MSG_REPLY_SIZE (SCMI_MAX_MSG_PAYLD_SIZE + sizeof(uint32_t)) +#define SCMI_MAX_MSG_SIZE (SCMI_MAX_MSG_REPLY_SIZE + sizeof(uint32_t)) enum scmi_chan { SCMI_CHAN_A2P, @@ -51,8 +47,6 @@ enum scmi_chan { struct scmi_transport_desc { bool no_completion_irq; - unsigned int max_msg; - unsigned int max_payld_sz; unsigned int reply_timo_ms; }; diff --git a/sys/dev/firmware/arm/scmi_virtio.c b/sys/dev/firmware/arm/scmi_virtio.c index 5252ad9cf9a4..8714fee2ec87 100644 --- a/sys/dev/firmware/arm/scmi_virtio.c +++ b/sys/dev/firmware/arm/scmi_virtio.c @@ -83,19 +83,19 @@ static void * scmi_virtio_p2a_pool_init(device_t dev, unsigned int max_msg) { struct scmi_virtio_softc *sc; - unsigned int max_msg_sz; void *pool; uint8_t *buf; int i; sc = device_get_softc(dev); - max_msg_sz = SCMI_MAX_MSG_SIZE(&sc->base); - pool = mallocarray(max_msg, max_msg_sz, M_DEVBUF, M_ZERO | M_WAITOK); - for (i = 0, buf = pool; i < max_msg; i++, buf += max_msg_sz) { + pool = mallocarray(max_msg, SCMI_MAX_MSG_SIZE, M_DEVBUF, + M_ZERO | M_WAITOK); + + for (i = 0, buf = pool; i < max_msg; i++, buf += SCMI_MAX_MSG_SIZE) { /* Feed platform with pre-allocated P2A buffers */ virtio_scmi_message_enqueue(sc->virtio_dev, - VIRTIO_SCMI_CHAN_P2A, buf, 0, max_msg_sz); + VIRTIO_SCMI_CHAN_P2A, buf, 0, SCMI_MAX_MSG_SIZE); } device_printf(dev, @@ -111,7 +111,7 @@ scmi_virtio_clear_channel(device_t dev, void *msg) sc = device_get_softc(dev); virtio_scmi_message_enqueue(sc->virtio_dev, VIRTIO_SCMI_CHAN_P2A, - msg, 0, SCMI_MAX_MSG_SIZE(&sc->base)); + msg, 0, SCMI_MAX_MSG_SIZE); } static int From nobody Mon Jun 9 15:45:54 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGGVC4XsQz5y4T5; Mon, 09 Jun 2025 15:45:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGGVC0rhBz45Tp; Mon, 09 Jun 2025 15:45:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749483955; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mY5XckQGdxKzl1SkymbUlXLJQWieYG0uHFQjJ2MFIv4=; b=rNSiX0AvQMoH8i9+RaxuyrHZwq9zz8Xyord//mKWbXC9Y05AQT4A0SBwxKqQcD31X7Mybt TwyNgxKKHWgR7PX2IKlYzezl9EROzv8SKBi3XB2g151ngZM42KihvyhfW4NHqTIeO3SmjS AhclsS4LWzjJzfRyV2WwMXpCMN+IjvyDIbGMNsh8IDFdTk0RslP/Y3HR635LzR/QwCHRQV qdkFFFj8Zi71+BK/W0llIh9X2f3E81DKvjc2a/r9GgOLbTiIhS1wBTxr8I8N4ZpDtfE8rf diqM/f9wxUfk7VwtUZdavBkAsHHrahB2BnAOost3or069HMZDi4Z3k8/3gvbCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749483955; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mY5XckQGdxKzl1SkymbUlXLJQWieYG0uHFQjJ2MFIv4=; b=X7D+IX6wtH9mVcBsxxNd8VrOAhnDxDXMt2g9Z6jz8e0gtrz0thrpwqjORkq//1XIr79TNp +EbaFMorWIScXW2SkBHRF63eit9/AEdVUoZ2nh9B2JQH27RcwflTVNJa6oOR4klkdiEP6H Jh2s3SrCuoRBSRvwuNgUGY2mIr0efpOOFbd2I5OD7MvTwEKI5v+MrI5t8/djUz7R2x76kX uuBroptuwYhTR+Q8woAVjaAgq2vp+RQdtfSYljY5KVmBg+BJ8V+YoWHqnk4vuJ/jgABA66 Uvl1wtk8mDXY6J+a5KeByI7I/GhD9yMknrO6+HNKdRTO/Y7ASr0tpSJVvhdoxA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749483955; a=rsa-sha256; cv=none; b=GPESveisnQgCXd2+ZaEam3WHh7xOM1owulT8OKlX+VxUw8CEp97b2OXjcRgdGYjYxJHmzs 5pMeraBiEViuzfqC7xzMWv6BMf/vIC+sk+KL77vRniuI0lclq+psidNeXiYG1zOJ+4cnmi OLJfUR8pEcuuq0lqdT+FhbGqCy4TXosTL1AGwlLnBgkeFYYoB/Cv8aP/qcWy7BDhNHa7jD 4v8m/Hlv8//xSnzbi2jbvLyS1Y6gbFdhNaqdUBZiU+cWMTAVUtKOY99xYgZOIx/3P91InX snowCeE9Ax48oIOARKDiCNYshkR1X3QyiOrpiBFoCSN0FM2rR7jpZPzXyezDxw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGGVC0CSRz11nk; Mon, 09 Jun 2025 15:45:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559FjsjV088350; Mon, 9 Jun 2025 15:45:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559FjsZf088347; Mon, 9 Jun 2025 15:45:54 GMT (envelope-from git) Date: Mon, 9 Jun 2025 15:45:54 GMT Message-Id: <202506091545.559FjsZf088347@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: ed57f6e6fd3c - main - Revert "scmi: Add helper to manipulate scmi_msg descriptors" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ed57f6e6fd3cab539c2aefb0c29d162b6923ce45 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=ed57f6e6fd3cab539c2aefb0c29d162b6923ce45 commit ed57f6e6fd3cab539c2aefb0c29d162b6923ce45 Author: Andrew Turner AuthorDate: 2025-06-09 13:21:42 +0000 Commit: Andrew Turner CommitDate: 2025-06-04 01:32:39 +0000 Revert "scmi: Add helper to manipulate scmi_msg descriptors" Revert to reapply series as some patches were incorrect versions This reverts commit e887179d4bc032e79d0334371d613c5841989a41. --- sys/dev/firmware/arm/scmi.c | 77 ++++++++++----------------------------------- sys/dev/firmware/arm/scmi.h | 2 -- 2 files changed, 16 insertions(+), 63 deletions(-) diff --git a/sys/dev/firmware/arm/scmi.c b/sys/dev/firmware/arm/scmi.c index 8104f4e10429..cf5a678370fd 100644 --- a/sys/dev/firmware/arm/scmi.c +++ b/sys/dev/firmware/arm/scmi.c @@ -132,10 +132,9 @@ static int scmi_transport_init(struct scmi_softc *, phandle_t); static void scmi_transport_cleanup(struct scmi_softc *); static struct scmi_reqs_pool *scmi_reqs_pool_allocate(const int, const int); static void scmi_reqs_pool_free(struct scmi_reqs_pool *); -static struct scmi_req *scmi_req_alloc(struct scmi_softc *, enum scmi_chan); -static struct scmi_req *scmi_req_initialized_alloc(device_t, int, int); +static struct scmi_req *scmi_req_alloc(struct scmi_softc *, enum scmi_chan); static void scmi_req_free_unlocked(struct scmi_softc *, - enum scmi_chan, struct scmi_req *); + enum scmi_chan, struct scmi_req *); static void scmi_req_get(struct scmi_softc *, struct scmi_req *); static void scmi_req_put(struct scmi_softc *, struct scmi_req *); static int scmi_token_pick(struct scmi_softc *); @@ -320,32 +319,6 @@ scmi_transport_cleanup(struct scmi_softc *sc) free(sc->trs, M_DEVBUF); } -static struct scmi_req * -scmi_req_initialized_alloc(device_t dev, int tx_payld_sz, int rx_payld_sz) -{ - struct scmi_softc *sc; - struct scmi_req *req; - - sc = device_get_softc(dev); - - if (tx_payld_sz > SCMI_MAX_MSG_PAYLD_SIZE(sc) || - rx_payld_sz > SCMI_MAX_MSG_REPLY_SIZE(sc)) { - device_printf(dev, "Unsupported payload size. Drop.\n"); - return (NULL); - } - - /* Pick one from free list */ - req = scmi_req_alloc(sc, SCMI_CHAN_A2P); - if (req == NULL) - return (NULL); - - req->msg.tx_len = sizeof(req->msg.hdr) + tx_payld_sz; - req->msg.rx_len = rx_payld_sz ? - rx_payld_sz + 2 * sizeof(uint32_t) : SCMI_MAX_MSG_SIZE(sc); - - return (req); -} - static struct scmi_req * scmi_req_alloc(struct scmi_softc *sc, enum scmi_chan ch_idx) { @@ -401,10 +374,6 @@ scmi_req_put(struct scmi_softc *sc, struct scmi_req *req) { mtx_lock_spin(&req->mtx); if (!refcount_release_if_not_last(&req->cnt)) { - req->protocol_id = 0; - req->message_id = 0; - req->token = 0; - req->header = 0; bzero(&req->msg, sizeof(req->msg) + SCMI_MAX_MSG_PAYLD_SIZE(sc)); scmi_req_free_unlocked(sc, SCMI_CHAN_A2P, req); } @@ -635,15 +604,27 @@ void * scmi_buf_get(device_t dev, uint8_t protocol_id, uint8_t message_id, int tx_payld_sz, int rx_payld_sz) { + struct scmi_softc *sc; struct scmi_req *req; - /* Pick a pre-built req */ - req = scmi_req_initialized_alloc(dev, tx_payld_sz, rx_payld_sz); + sc = device_get_softc(dev); + + if (tx_payld_sz > SCMI_MAX_MSG_PAYLD_SIZE(sc) || + rx_payld_sz > SCMI_MAX_MSG_REPLY_SIZE(sc)) { + device_printf(dev, "Unsupported payload size. Drop.\n"); + return (NULL); + } + + /* Pick one from free list */ + req = scmi_req_alloc(sc, SCMI_CHAN_A2P); if (req == NULL) return (NULL); req->protocol_id = protocol_id & SCMI_HDR_PROTOCOL_ID_BF; req->message_id = message_id & SCMI_HDR_MESSAGE_ID_BF; + req->msg.tx_len = sizeof(req->msg.hdr) + tx_payld_sz; + req->msg.rx_len = rx_payld_sz ? + rx_payld_sz + 2 * sizeof(uint32_t) : SCMI_MAX_MSG_SIZE(sc); return (&req->msg.payld[0]); } @@ -660,32 +641,6 @@ scmi_buf_put(device_t dev, void *buf) scmi_req_put(sc, req); } -struct scmi_msg * -scmi_msg_get(device_t dev, int tx_payld_sz, int rx_payld_sz) -{ - struct scmi_req *req; - - /* Pick a pre-built req */ - req = scmi_req_initialized_alloc(dev, tx_payld_sz, rx_payld_sz); - if (req == NULL) - return (NULL); - - return (&req->msg); -} - -void -scmi_msg_put(device_t dev, struct scmi_msg *msg) -{ - struct scmi_softc *sc; - struct scmi_req *req; - - sc = device_get_softc(dev); - - req = msg_to_req(msg); - - scmi_req_put(sc, req); -} - int scmi_request(device_t dev, void *in, void **out) { diff --git a/sys/dev/firmware/arm/scmi.h b/sys/dev/firmware/arm/scmi.h index f6aa072caeca..135b49c3b05b 100644 --- a/sys/dev/firmware/arm/scmi.h +++ b/sys/dev/firmware/arm/scmi.h @@ -80,8 +80,6 @@ struct scmi_msg { void *scmi_buf_get(device_t dev, uint8_t protocol_id, uint8_t message_id, int tx_payd_sz, int rx_payld_sz); void scmi_buf_put(device_t dev, void *buf); -struct scmi_msg *scmi_msg_get(device_t dev, int tx_payld_sz, int rx_payld_sz); -void scmi_msg_put(device_t dev, struct scmi_msg *msg); int scmi_request(device_t dev, void *in, void **); void scmi_rx_irq_callback(device_t dev, void *chan, uint32_t hdr, uint32_t rx_len); From nobody Mon Jun 9 15:45:57 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGGVF4sy1z5y4bZ; Mon, 09 Jun 2025 15:45:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGGVF2XgPz45cy; Mon, 09 Jun 2025 15:45:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749483957; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Zoq+wTmL6yaX7j3kUHNDGrYOubPZhoItMkew6fUkTgE=; b=rpKBOp1OklhTPzWiyEldBuHhxKXZc3ER4seuIYOeR/fVp2+RxCzgTdtplTOScouP3Q8K3i cRiVOEyEA1rfAViB1GAP7gfb+gex2M7zQ9ZsZc4bVjLww6wTQ7ECNSPYQTc+vdWnfbs2xx stxNN3KSRKyyGdQSlkOdCw8Y2w+2H468jCwntNqOI/RspFBiQucbJSMRFLGmwlJ9sL2YYJ IHFch91oADeItLZ2jqASvXOQo/HdfYqZ6mR5n7FjUbbxq0iN1aSWzvTuIUWqWTaNkMCuaX 6RAKay0VO4wZMSTx7qYlqGLTkfdn7xT9mweGP2L8CDINnmlI1WDnxrXtA4K73A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749483957; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Zoq+wTmL6yaX7j3kUHNDGrYOubPZhoItMkew6fUkTgE=; b=H1S3fv4ctKZeewmAknt4B+S7Ou5aYx2EnkNpHCG9fUOjzr/RimnaU4yjTJunDj9UG1cOiz AMoMWjjfdqtXRiSi+pCJj2Hatz2oxNRBu7PRJIHkNkKDNiWVe43ZM2yKeH6D6Qiex8NhvR Mw+WRLPbgZgPCE8uA+5dImc6ubQDfep+gRi7u5DXLsfcNAJmKZCIg8f8xIqRbPDuCyG963 enEssecygb6gTheV4Gww/iODRMp/5An2c2Z7OvwtcLL7vA59khJ+JulLE3gbQ8+ArefqXP IYlQUVliXgkSeUFBKc3JvPlK0SPHJZOA4tWUpiNoizl57P/a5tHg8dZkW2AFvw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749483957; a=rsa-sha256; cv=none; b=VjpyQSZyKQRaJ8t8/5l2IXUhtY8Um1lW8DbVB3KB1tkDBgK/LADEFxoFfIk3yRvRuTf5g/ f0MAdmrRdvy+YHFcUH3dJCrw688ploOfiPoM+jMWInqYzUv1BeDS7jKoHEZgkB2ajh6lc2 OZCxSfqDlbiPi3duegcpAa8NTDAkthIy7T6axHewQhRHZXTpho8VMOLMj/YTLfdXWbiyx7 6TCZCgB4rCv57B5aaiPDI2y6xeDAcHHJcfetQ6Yo56/MohnyPeMQh2BhEZ+8Npe7ldEQ8Y aa+FNS5+QogHZoMBDGKdH1TDYNSyPdyb9xo2wF2rNU1fByDLW9ypJDyeIUZpmg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGGVF28Mqz12Dh; Mon, 09 Jun 2025 15:45:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559FjvdL088425; Mon, 9 Jun 2025 15:45:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559FjvSS088422; Mon, 9 Jun 2025 15:45:57 GMT (envelope-from git) Date: Mon, 9 Jun 2025 15:45:57 GMT Message-Id: <202506091545.559FjvSS088422@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 3550c47a96b5 - main - Revert "scmi: Redefine max message payload size" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3550c47a96b5cc6ab07fca7fdfbd9043f12f58c2 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=3550c47a96b5cc6ab07fca7fdfbd9043f12f58c2 commit 3550c47a96b5cc6ab07fca7fdfbd9043f12f58c2 Author: Andrew Turner AuthorDate: 2025-06-09 13:21:49 +0000 Commit: Andrew Turner CommitDate: 2025-06-04 01:32:39 +0000 Revert "scmi: Redefine max message payload size" Revert to reapply series as some patches were incorrect versions This reverts commit f0216239492579022982d94e04090f1333fee5a5. --- sys/dev/firmware/arm/scmi.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/firmware/arm/scmi.h b/sys/dev/firmware/arm/scmi.h index 73b49f099ad8..5ad7b0db3f5f 100644 --- a/sys/dev/firmware/arm/scmi.h +++ b/sys/dev/firmware/arm/scmi.h @@ -36,8 +36,8 @@ #define SCMI_MAX_MSG 32 #define SCMI_MAX_MSG_PAYLD_SIZE 128 -#define SCMI_MAX_MSG_REPLY_SIZE (SCMI_MAX_MSG_PAYLD_SIZE + sizeof(uint32_t)) -#define SCMI_MAX_MSG_SIZE (SCMI_MAX_MSG_REPLY_SIZE + sizeof(uint32_t)) +#define SCMI_MAX_MSG_REPLY_SIZE (SCMI_MAX_MSG_PAYLD_SIZE - sizeof(uint32_t)) +#define SCMI_MAX_MSG_SIZE (SCMI_MAX_MSG_PAYLD_SIZE + sizeof(uint32_t)) enum scmi_chan { SCMI_CHAN_A2P, From nobody Mon Jun 9 15:45:58 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGGVG6lcCz5y4dm; Mon, 09 Jun 2025 15:45:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGGVG3KWrz45Py; Mon, 09 Jun 2025 15:45:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749483958; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xUGDPT53Bp7b+HEm1ih7/nB0FjPJ6uePgyczQkPTc4o=; b=SGlI4KCT9oIyWCqNmIzptzyo6fblWUop1xIeXKNFzmM49RX2OY+m5YVkDHyxKloOnQ6frl fjInEhMsQbFttNqCxyqpugMiCgpcPrThnmz79xdgXP6ff8XaTmbdty5w5WJta/AsfNnvDY ygpxEVqq0IF3wANCn4eBzwqK/rl456/dP/Cl3QU/9O4Rpf6Ar23h/qWdnUcp9xI/p5D+8x H+2A0vL/n/aQkinQXTPP9ab1QmXqcKf4BZ8a+UJzV+V5Ke1Zs3RSXFigf39LrLUa5SaOq/ 28QFkBdTnkDnKajYObVNZ4Yhyv14kK/m7HFh0hkAtdQe2aQgUK3fwdVNn9rNpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749483958; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xUGDPT53Bp7b+HEm1ih7/nB0FjPJ6uePgyczQkPTc4o=; b=LPLzYy5Jb/qNlm8DBGNv8ADYI2FIqqBdP40OpC8sFzUDKY39mKi7V1r2WfkAaQQOtflVTR D676b4XT5SReFMnzdo8M/wzTtp9KVYG2cBBo7qbXnBYuCDMnwvzp6xooImo7x4IaVxNKzc OfWTv7KhUcTX1FgBERHmybO+C3BTuxwhdgJeO/Y8zEs1Dyl2l0aOzwUNIOd8NAsGsS0pNr /I+WVMVdaBHFc8L3xaYtxdMOaTnFNfGwAMXflyfZRUdxEsVFVtUEBhdQmkfLvbDxPfZjSV L0B3NvqAYBX78Ud5me3r+HUTdSEWedhHHJ90s62z/nljn7Qs9TA7WA4YRcfo3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749483958; a=rsa-sha256; cv=none; b=KH50knFYC6VH3OrU8tOTn3INOj34jw2juxvBZEF+ohlNXWQJJGWmHJSM/OhcEy4yxr9N9z /PqwZOzuYuyjjYwem6sR91dWdPjTDMdGbVk4JQu9h23zYRx6b9S3lwgptoi443X+URi/k7 jnDuwCi6CzI4DteGSUi9AFxcTQYtJA0b9BAP7vtL41kSFjVyYRuy0jhwRCY/Ds4cWkMmUc ENGqeMDu/gILnAgb5P/WJM+xIObB0Jt6KOfHBK86mBt6VpotYMcHPTpnpLWCsZxa0c42Tb C1y4r6q4w9I5v7nDIyc6ZdsHqNH0Cqt3th34+LF4kiHjp9pe0k42FAiu1zuHvw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGGVG2qlkz11yL; Mon, 09 Jun 2025 15:45:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559FjwAA088463; Mon, 9 Jun 2025 15:45:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559Fjwe0088460; Mon, 9 Jun 2025 15:45:58 GMT (envelope-from git) Date: Mon, 9 Jun 2025 15:45:58 GMT Message-Id: <202506091545.559Fjwe0088460@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: d49ed3608010 - main - Revert "scmi: Make transports report the effective length of the received messages" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d49ed3608010681a5d1958b6499b336d48ec0dcc Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=d49ed3608010681a5d1958b6499b336d48ec0dcc commit d49ed3608010681a5d1958b6499b336d48ec0dcc Author: Andrew Turner AuthorDate: 2025-06-09 13:21:52 +0000 Commit: Andrew Turner CommitDate: 2025-06-04 01:32:39 +0000 Revert "scmi: Make transports report the effective length of the received messages" Revert to reapply series as some patches were incorrect versions This reverts commit 9342829d578e26f10a5cbc26e2b9e66cfd9864c4. --- sys/dev/firmware/arm/scmi.c | 10 ++++------ sys/dev/firmware/arm/scmi.h | 2 +- sys/dev/firmware/arm/scmi_mailbox.c | 10 +++++----- sys/dev/firmware/arm/scmi_shmem.c | 22 +++++++++++++--------- sys/dev/firmware/arm/scmi_shmem.h | 6 +++--- sys/dev/firmware/arm/scmi_smc.c | 4 ++-- sys/dev/firmware/arm/scmi_virtio.c | 5 +++-- 7 files changed, 31 insertions(+), 28 deletions(-) diff --git a/sys/dev/firmware/arm/scmi.c b/sys/dev/firmware/arm/scmi.c index 00a229762414..37496136c828 100644 --- a/sys/dev/firmware/arm/scmi.c +++ b/sys/dev/firmware/arm/scmi.c @@ -146,8 +146,7 @@ static struct scmi_req *scmi_req_lookup_inflight(struct scmi_softc *, uint32_t); static int scmi_wait_for_response(struct scmi_softc *, struct scmi_req *, void **); -static void scmi_process_response(struct scmi_softc *, uint32_t, - unsigned int); +static void scmi_process_response(struct scmi_softc *, uint32_t); int scmi_attach(device_t dev) @@ -470,7 +469,7 @@ scmi_req_lookup_inflight(struct scmi_softc *sc, uint32_t hdr) } static void -scmi_process_response(struct scmi_softc *sc, uint32_t hdr, uint32_t rx_len) +scmi_process_response(struct scmi_softc *sc, uint32_t hdr) { bool timed_out = false; struct scmi_req *req; @@ -485,7 +484,6 @@ scmi_process_response(struct scmi_softc *sc, uint32_t hdr, uint32_t rx_len) mtx_lock_spin(&req->mtx); req->done = true; - req->msg.rx_len = rx_len; if (!req->timed_out) { /* * Consider the case in which a polled message is picked @@ -514,7 +512,7 @@ scmi_process_response(struct scmi_softc *sc, uint32_t hdr, uint32_t rx_len) } void -scmi_rx_irq_callback(device_t dev, void *chan, uint32_t hdr, uint32_t rx_len) +scmi_rx_irq_callback(device_t dev, void *chan, uint32_t hdr) { struct scmi_softc *sc; @@ -526,7 +524,7 @@ scmi_rx_irq_callback(device_t dev, void *chan, uint32_t hdr, uint32_t rx_len) return; } - scmi_process_response(sc, hdr, rx_len); + scmi_process_response(sc, hdr); } static int diff --git a/sys/dev/firmware/arm/scmi.h b/sys/dev/firmware/arm/scmi.h index 5ad7b0db3f5f..345ae6eeb03a 100644 --- a/sys/dev/firmware/arm/scmi.h +++ b/sys/dev/firmware/arm/scmi.h @@ -75,7 +75,7 @@ void *scmi_buf_get(device_t dev, uint8_t protocol_id, uint8_t message_id, int tx_payd_sz, int rx_payld_sz); void scmi_buf_put(device_t dev, void *buf); int scmi_request(device_t dev, void *in, void **); -void scmi_rx_irq_callback(device_t dev, void *chan, uint32_t hdr, uint32_t rx_len); +void scmi_rx_irq_callback(device_t dev, void *chan, uint32_t hdr); DECLARE_CLASS(scmi_driver); diff --git a/sys/dev/firmware/arm/scmi_mailbox.c b/sys/dev/firmware/arm/scmi_mailbox.c index d7b642b69b85..858b81f68845 100644 --- a/sys/dev/firmware/arm/scmi_mailbox.c +++ b/sys/dev/firmware/arm/scmi_mailbox.c @@ -70,14 +70,14 @@ static void scmi_mailbox_a2p_callback(void *arg) { struct scmi_mailbox_softc *sc; - uint32_t msg_header, rx_len; + uint32_t msg_header; int ret; sc = arg; - ret = scmi_shmem_read_msg_header(sc->a2p_dev, &msg_header, &rx_len); + ret = scmi_shmem_read_msg_header(sc->a2p_dev, &msg_header); if (ret == 0) - scmi_rx_irq_callback(sc->base.dev, sc->a2p_dev, msg_header, rx_len); + scmi_rx_irq_callback(sc->base.dev, sc->a2p_dev, msg_header); } static int @@ -154,7 +154,7 @@ scmi_mailbox_poll_msg(device_t dev, struct scmi_msg *msg, unsigned int tmo_ms) sc = device_get_softc(dev); do { - if (scmi_shmem_poll_msg(sc->a2p_dev, &msg->hdr, &msg->rx_len)) + if (scmi_shmem_poll_msg(sc->a2p_dev, &msg->hdr)) break; DELAY(SCMI_MBOX_POLL_INTERVAL_MS * 1000); } while (tmo_loops--); @@ -171,7 +171,7 @@ scmi_mailbox_collect_reply(device_t dev, struct scmi_msg *msg) sc = device_get_softc(dev); ret = scmi_shmem_read_msg_payload(sc->a2p_dev, - msg->payld, msg->rx_len - SCMI_MSG_HDR_SIZE, msg->rx_len); + msg->payld, msg->rx_len - SCMI_MSG_HDR_SIZE); return (ret); } diff --git a/sys/dev/firmware/arm/scmi_shmem.c b/sys/dev/firmware/arm/scmi_shmem.c index a63d96b64cb5..9bab4bc4004e 100644 --- a/sys/dev/firmware/arm/scmi_shmem.c +++ b/sys/dev/firmware/arm/scmi_shmem.c @@ -247,7 +247,7 @@ scmi_shmem_clear_channel(device_t dev) } int -scmi_shmem_read_msg_header(device_t dev, uint32_t *msg_header, unsigned int *rx_len) +scmi_shmem_read_msg_header(device_t dev, uint32_t *msg_header) { uint32_t length, header; @@ -256,7 +256,6 @@ scmi_shmem_read_msg_header(device_t dev, uint32_t *msg_header, unsigned int *rx_ if (le32toh(length) < sizeof(header)) return (EINVAL); - *rx_len = le32toh(length); /* Read header. */ scmi_shmem_read(dev, SMT_OFFSET_MSG_HEADER, &header, SMT_SIZE_MSG_HEADER); @@ -267,11 +266,14 @@ scmi_shmem_read_msg_header(device_t dev, uint32_t *msg_header, unsigned int *rx_ } int -scmi_shmem_read_msg_payload(device_t dev, uint8_t *buf, uint32_t buf_len, uint32_t rx_len) +scmi_shmem_read_msg_payload(device_t dev, uint8_t *buf, uint32_t buf_len) { - uint32_t payld_len; + uint32_t length, payld_len; + + /* Read length. */ + scmi_shmem_read(dev, SMT_OFFSET_LENGTH, &length, SMT_SIZE_LENGTH); + payld_len = le32toh(length) - SCMI_MSG_HDR_SIZE; - payld_len = rx_len - SCMI_MSG_HDR_SIZE; if (payld_len > buf_len) { device_printf(dev, "RX payload %dbytes exceeds buflen %dbytes. Truncate.\n", @@ -294,7 +296,7 @@ scmi_shmem_tx_complete(device_t dev) scmi_shmem_release_channel(sc); } -bool scmi_shmem_poll_msg(device_t dev, uint32_t *msg_header, uint32_t *rx_len) +bool scmi_shmem_poll_msg(device_t dev, uint32_t *msg_header) { uint32_t status; bool ret; @@ -304,10 +306,12 @@ bool scmi_shmem_poll_msg(device_t dev, uint32_t *msg_header, uint32_t *rx_len) ret = (status & (SCMI_SHMEM_CHAN_STAT_CHANNEL_ERROR | SCMI_SHMEM_CHAN_STAT_CHANNEL_FREE)); - if (ret == 0) - return (ret); - return (scmi_shmem_read_msg_header(dev, msg_header, rx_len)); + if (ret) + scmi_shmem_read(dev, SMT_OFFSET_MSG_HEADER, msg_header, + SMT_SIZE_MSG_HEADER); + + return (ret); } static device_method_t shmem_methods[] = { diff --git a/sys/dev/firmware/arm/scmi_shmem.h b/sys/dev/firmware/arm/scmi_shmem.h index bc8284502129..ed8763d5c145 100644 --- a/sys/dev/firmware/arm/scmi_shmem.h +++ b/sys/dev/firmware/arm/scmi_shmem.h @@ -63,9 +63,9 @@ struct scmi_smt_header { device_t scmi_shmem_get(device_t sdev, phandle_t node, int index); int scmi_shmem_prepare_msg(device_t dev, uint8_t *msg, uint32_t tx_len, bool polling); -bool scmi_shmem_poll_msg(device_t dev, uint32_t *msg_header, uint32_t *rx_len); -int scmi_shmem_read_msg_header(device_t dev, uint32_t *msg_header, uint32_t *rx_len); -int scmi_shmem_read_msg_payload(device_t dev, uint8_t *buf, uint32_t buf_len, uint32_t rx_len); +bool scmi_shmem_poll_msg(device_t dev, uint32_t *msg_header); +int scmi_shmem_read_msg_header(device_t dev, uint32_t *msg_header); +int scmi_shmem_read_msg_payload(device_t dev, uint8_t *buf, uint32_t buf_len); void scmi_shmem_tx_complete(device_t); void scmi_shmem_clear_channel(device_t); diff --git a/sys/dev/firmware/arm/scmi_smc.c b/sys/dev/firmware/arm/scmi_smc.c index 81c66ad7bb46..9f0d899233fa 100644 --- a/sys/dev/firmware/arm/scmi_smc.c +++ b/sys/dev/firmware/arm/scmi_smc.c @@ -122,7 +122,7 @@ scmi_smc_poll_msg(device_t dev, struct scmi_msg *msg, unsigned int tmo) * Nothing to poll since commands are completed as soon as smc * returns ... but did we get back what we were poling for ? */ - scmi_shmem_read_msg_header(sc->a2p_dev, &msg->hdr, &msg->rx_len); + scmi_shmem_read_msg_header(sc->a2p_dev, &msg->hdr); return (0); } @@ -136,7 +136,7 @@ scmi_smc_collect_reply(device_t dev, struct scmi_msg *msg) sc = device_get_softc(dev); ret = scmi_shmem_read_msg_payload(sc->a2p_dev, - msg->payld, msg->rx_len - SCMI_MSG_HDR_SIZE, msg->rx_len); + msg->payld, msg->rx_len - SCMI_MSG_HDR_SIZE); return (ret); } diff --git a/sys/dev/firmware/arm/scmi_virtio.c b/sys/dev/firmware/arm/scmi_virtio.c index 8714fee2ec87..12cbb9ecefd5 100644 --- a/sys/dev/firmware/arm/scmi_virtio.c +++ b/sys/dev/firmware/arm/scmi_virtio.c @@ -76,7 +76,7 @@ scmi_virtio_callback(void *msg, unsigned int len, void *priv) } hdr = le32toh(*((uint32_t *)msg)); - scmi_rx_irq_callback(sc->base.dev, msg, hdr, len); + scmi_rx_irq_callback(sc->base.dev, msg, hdr); } static void * @@ -225,6 +225,7 @@ scmi_virtio_poll_msg(device_t dev, struct scmi_msg *msg, unsigned int tmo_ms) } rx_msg = hdr_to_msg(rx_buf); + rx_msg->rx_len = rx_len; /* Complete the polling on any poll path */ if (rx_msg->polling) atomic_store_rel_int(&rx_msg->poll_done, 1); @@ -241,7 +242,7 @@ scmi_virtio_poll_msg(device_t dev, struct scmi_msg *msg, unsigned int tmo_ms) rx_msg->hdr, rx_msg->polling); if (!rx_msg->polling) - scmi_rx_irq_callback(sc->base.dev, rx_msg, rx_msg->hdr, rx_len); + scmi_rx_irq_callback(sc->base.dev, rx_msg, rx_msg->hdr); } return (tmo_loops > 0 ? 0 : ETIMEDOUT); From nobody Mon Jun 9 15:45:59 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGGVJ2tcqz5y4dp; Mon, 09 Jun 2025 15:46:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGGVH4KN7z45kb; Mon, 09 Jun 2025 15:45:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749483959; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s9Y9P6cMU0tvz9XQ7kOVK5C5/xRuuqRD3DG2+HTd0kw=; b=c17yxwY3VQepOQruso1GzEi6IbOALot/uRh0JHFRCFnnvK9FxWgbcu/Zs2EkYgP3rZYTWe byU92gxTj11RhUBpRxTc1Tzy+pVgNksRqqDDm1q8cP/KkCdzlOfxxOYtInsNpfLQJG9Isc 7cVnPZgzwXTbHRf2qRxr+3WFqREm25ZFOA6/zONAUPTAT4M4gir2xHv7hoOgXutJxoBSf0 IzJVFmjA/ddAaItMfrGURfWx73qhBsmco/0JKN7OmXq0nj3mSp57R8llPWcS6I6CTypfPx /cx/A+4yRUWsPn1VX4nkOlS0YiQbwJ4xGvvksLd0V7zUqW4O40z8WTvaGCVbIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749483959; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s9Y9P6cMU0tvz9XQ7kOVK5C5/xRuuqRD3DG2+HTd0kw=; b=C6LjklkykRHLOJ+9I9rCFlRYPNCnzkxJNqzBMpv+tJ8NS2kUyYqr+BMuEsRRYv5hlT138o JIGNzK6dxFMvrpwv/XwOYhrnyFr3QlsZ7dpMIbPhcCrB0hY5CIR0JVREOtjdILMkoTMfBT 5LYdC6NrziOWcSNm4X1tSyxQDgleD+eIvf8/mLwW1klpVTdfLofyw06sz6yK397WateuaU 9gTTZDf+dMVTlvppK+7OpHQLfVUjXTFiCB7cj1VAu7IPBTLKKNLewImdguPl2Ze9d0+x9I VeDmDbyIBS2qq9oy90UihIRnbCGqXv0CvA1eTXhbkOtTSNdwvi1/sPrAvdysBw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749483959; a=rsa-sha256; cv=none; b=g58DH1T97B8UB+H7UAabIYot7mPPXGn+pJ44NAEDRDrLtQASuv2OyFjz3jvOs9Gk9AE/yT JrPQIMUtJT92hRoCK2PZOTd/d6w/ZoaoclT7idobsECNul+p6JiY6v2SNOSxjWIXrBM7ts b2nWhC15kMLgadA4K9HSfYev/uOL+MJHaAnaK45/HfAPx0lMRSdk2mX3TEg8FWwLiKaxVh Yj7ySa5eZwLUy5h7AOLkMlF+4TiR5FYF7CVzZC77ErMRW1qKKsPAjktJ9iS3RLVlSnYqOX cvRA30lEhC0TWlrZxePD36o2Shb9rq143px4dCVgW67ffH6FC/LfO/2kE0pJhQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGGVH3xSnz11mw; Mon, 09 Jun 2025 15:45:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559FjxQG088498; Mon, 9 Jun 2025 15:45:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559FjxrC088495; Mon, 9 Jun 2025 15:45:59 GMT (envelope-from git) Date: Mon, 9 Jun 2025 15:45:59 GMT Message-Id: <202506091545.559FjxrC088495@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: c758208373f3 - main - scmi: Make transports report the effective length of the received messages List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c758208373f36c21e0cb15b166e9a6d3d93edc99 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=c758208373f36c21e0cb15b166e9a6d3d93edc99 commit c758208373f36c21e0cb15b166e9a6d3d93edc99 Author: Cristian Marussi AuthorDate: 2025-06-09 13:22:14 +0000 Commit: Andrew Turner CommitDate: 2025-06-04 01:32:39 +0000 scmi: Make transports report the effective length of the received messages Once a message is received that fits into the RX buffer, update the msg.rx_len field with the effective length of the message received. Tested on: Arm Morello Board Reviewed by: andrew Sponsored by: Arm Ltd Signed-off-by: Cristian Marussi --- sys/dev/firmware/arm/scmi.c | 10 ++++++---- sys/dev/firmware/arm/scmi.h | 2 +- sys/dev/firmware/arm/scmi_mailbox.c | 12 ++++++------ sys/dev/firmware/arm/scmi_shmem.c | 18 +++++++----------- sys/dev/firmware/arm/scmi_shmem.h | 6 +++--- sys/dev/firmware/arm/scmi_smc.c | 4 ++-- sys/dev/firmware/arm/scmi_virtio.c | 5 ++--- 7 files changed, 27 insertions(+), 30 deletions(-) diff --git a/sys/dev/firmware/arm/scmi.c b/sys/dev/firmware/arm/scmi.c index 37496136c828..00a229762414 100644 --- a/sys/dev/firmware/arm/scmi.c +++ b/sys/dev/firmware/arm/scmi.c @@ -146,7 +146,8 @@ static struct scmi_req *scmi_req_lookup_inflight(struct scmi_softc *, uint32_t); static int scmi_wait_for_response(struct scmi_softc *, struct scmi_req *, void **); -static void scmi_process_response(struct scmi_softc *, uint32_t); +static void scmi_process_response(struct scmi_softc *, uint32_t, + unsigned int); int scmi_attach(device_t dev) @@ -469,7 +470,7 @@ scmi_req_lookup_inflight(struct scmi_softc *sc, uint32_t hdr) } static void -scmi_process_response(struct scmi_softc *sc, uint32_t hdr) +scmi_process_response(struct scmi_softc *sc, uint32_t hdr, uint32_t rx_len) { bool timed_out = false; struct scmi_req *req; @@ -484,6 +485,7 @@ scmi_process_response(struct scmi_softc *sc, uint32_t hdr) mtx_lock_spin(&req->mtx); req->done = true; + req->msg.rx_len = rx_len; if (!req->timed_out) { /* * Consider the case in which a polled message is picked @@ -512,7 +514,7 @@ scmi_process_response(struct scmi_softc *sc, uint32_t hdr) } void -scmi_rx_irq_callback(device_t dev, void *chan, uint32_t hdr) +scmi_rx_irq_callback(device_t dev, void *chan, uint32_t hdr, uint32_t rx_len) { struct scmi_softc *sc; @@ -524,7 +526,7 @@ scmi_rx_irq_callback(device_t dev, void *chan, uint32_t hdr) return; } - scmi_process_response(sc, hdr); + scmi_process_response(sc, hdr, rx_len); } static int diff --git a/sys/dev/firmware/arm/scmi.h b/sys/dev/firmware/arm/scmi.h index 345ae6eeb03a..5ad7b0db3f5f 100644 --- a/sys/dev/firmware/arm/scmi.h +++ b/sys/dev/firmware/arm/scmi.h @@ -75,7 +75,7 @@ void *scmi_buf_get(device_t dev, uint8_t protocol_id, uint8_t message_id, int tx_payd_sz, int rx_payld_sz); void scmi_buf_put(device_t dev, void *buf); int scmi_request(device_t dev, void *in, void **); -void scmi_rx_irq_callback(device_t dev, void *chan, uint32_t hdr); +void scmi_rx_irq_callback(device_t dev, void *chan, uint32_t hdr, uint32_t rx_len); DECLARE_CLASS(scmi_driver); diff --git a/sys/dev/firmware/arm/scmi_mailbox.c b/sys/dev/firmware/arm/scmi_mailbox.c index 858b81f68845..4ea0433377b2 100644 --- a/sys/dev/firmware/arm/scmi_mailbox.c +++ b/sys/dev/firmware/arm/scmi_mailbox.c @@ -70,14 +70,14 @@ static void scmi_mailbox_a2p_callback(void *arg) { struct scmi_mailbox_softc *sc; - uint32_t msg_header; + uint32_t msg_header, rx_len; int ret; sc = arg; - ret = scmi_shmem_read_msg_header(sc->a2p_dev, &msg_header); + ret = scmi_shmem_read_msg_header(sc->a2p_dev, &msg_header, &rx_len); if (ret == 0) - scmi_rx_irq_callback(sc->base.dev, sc->a2p_dev, msg_header); + scmi_rx_irq_callback(sc->base.dev, sc->a2p_dev, msg_header, rx_len); } static int @@ -154,12 +154,12 @@ scmi_mailbox_poll_msg(device_t dev, struct scmi_msg *msg, unsigned int tmo_ms) sc = device_get_softc(dev); do { - if (scmi_shmem_poll_msg(sc->a2p_dev, &msg->hdr)) + if (scmi_shmem_poll_msg(sc->a2p_dev, &msg->hdr, &msg->rx_len)) break; DELAY(SCMI_MBOX_POLL_INTERVAL_MS * 1000); } while (tmo_loops--); - return (tmo_loops ? 0 : 1); + return (tmo_loops > 0 ? 0 : ETIMEDOUT); } static int @@ -171,7 +171,7 @@ scmi_mailbox_collect_reply(device_t dev, struct scmi_msg *msg) sc = device_get_softc(dev); ret = scmi_shmem_read_msg_payload(sc->a2p_dev, - msg->payld, msg->rx_len - SCMI_MSG_HDR_SIZE); + msg->payld, msg->rx_len - SCMI_MSG_HDR_SIZE, msg->rx_len); return (ret); } diff --git a/sys/dev/firmware/arm/scmi_shmem.c b/sys/dev/firmware/arm/scmi_shmem.c index 9bab4bc4004e..32c260c8a9ad 100644 --- a/sys/dev/firmware/arm/scmi_shmem.c +++ b/sys/dev/firmware/arm/scmi_shmem.c @@ -247,7 +247,7 @@ scmi_shmem_clear_channel(device_t dev) } int -scmi_shmem_read_msg_header(device_t dev, uint32_t *msg_header) +scmi_shmem_read_msg_header(device_t dev, uint32_t *msg_header, unsigned int *rx_len) { uint32_t length, header; @@ -256,6 +256,7 @@ scmi_shmem_read_msg_header(device_t dev, uint32_t *msg_header) if (le32toh(length) < sizeof(header)) return (EINVAL); + *rx_len = le32toh(length); /* Read header. */ scmi_shmem_read(dev, SMT_OFFSET_MSG_HEADER, &header, SMT_SIZE_MSG_HEADER); @@ -266,14 +267,11 @@ scmi_shmem_read_msg_header(device_t dev, uint32_t *msg_header) } int -scmi_shmem_read_msg_payload(device_t dev, uint8_t *buf, uint32_t buf_len) +scmi_shmem_read_msg_payload(device_t dev, uint8_t *buf, uint32_t buf_len, uint32_t rx_len) { - uint32_t length, payld_len; - - /* Read length. */ - scmi_shmem_read(dev, SMT_OFFSET_LENGTH, &length, SMT_SIZE_LENGTH); - payld_len = le32toh(length) - SCMI_MSG_HDR_SIZE; + uint32_t payld_len; + payld_len = rx_len - SCMI_MSG_HDR_SIZE; if (payld_len > buf_len) { device_printf(dev, "RX payload %dbytes exceeds buflen %dbytes. Truncate.\n", @@ -296,7 +294,7 @@ scmi_shmem_tx_complete(device_t dev) scmi_shmem_release_channel(sc); } -bool scmi_shmem_poll_msg(device_t dev, uint32_t *msg_header) +bool scmi_shmem_poll_msg(device_t dev, uint32_t *msg_header, uint32_t *rx_len) { uint32_t status; bool ret; @@ -306,10 +304,8 @@ bool scmi_shmem_poll_msg(device_t dev, uint32_t *msg_header) ret = (status & (SCMI_SHMEM_CHAN_STAT_CHANNEL_ERROR | SCMI_SHMEM_CHAN_STAT_CHANNEL_FREE)); - if (ret) - scmi_shmem_read(dev, SMT_OFFSET_MSG_HEADER, msg_header, - SMT_SIZE_MSG_HEADER); + scmi_shmem_read_msg_header(dev, msg_header, rx_len); return (ret); } diff --git a/sys/dev/firmware/arm/scmi_shmem.h b/sys/dev/firmware/arm/scmi_shmem.h index ed8763d5c145..bc8284502129 100644 --- a/sys/dev/firmware/arm/scmi_shmem.h +++ b/sys/dev/firmware/arm/scmi_shmem.h @@ -63,9 +63,9 @@ struct scmi_smt_header { device_t scmi_shmem_get(device_t sdev, phandle_t node, int index); int scmi_shmem_prepare_msg(device_t dev, uint8_t *msg, uint32_t tx_len, bool polling); -bool scmi_shmem_poll_msg(device_t dev, uint32_t *msg_header); -int scmi_shmem_read_msg_header(device_t dev, uint32_t *msg_header); -int scmi_shmem_read_msg_payload(device_t dev, uint8_t *buf, uint32_t buf_len); +bool scmi_shmem_poll_msg(device_t dev, uint32_t *msg_header, uint32_t *rx_len); +int scmi_shmem_read_msg_header(device_t dev, uint32_t *msg_header, uint32_t *rx_len); +int scmi_shmem_read_msg_payload(device_t dev, uint8_t *buf, uint32_t buf_len, uint32_t rx_len); void scmi_shmem_tx_complete(device_t); void scmi_shmem_clear_channel(device_t); diff --git a/sys/dev/firmware/arm/scmi_smc.c b/sys/dev/firmware/arm/scmi_smc.c index 9f0d899233fa..81c66ad7bb46 100644 --- a/sys/dev/firmware/arm/scmi_smc.c +++ b/sys/dev/firmware/arm/scmi_smc.c @@ -122,7 +122,7 @@ scmi_smc_poll_msg(device_t dev, struct scmi_msg *msg, unsigned int tmo) * Nothing to poll since commands are completed as soon as smc * returns ... but did we get back what we were poling for ? */ - scmi_shmem_read_msg_header(sc->a2p_dev, &msg->hdr); + scmi_shmem_read_msg_header(sc->a2p_dev, &msg->hdr, &msg->rx_len); return (0); } @@ -136,7 +136,7 @@ scmi_smc_collect_reply(device_t dev, struct scmi_msg *msg) sc = device_get_softc(dev); ret = scmi_shmem_read_msg_payload(sc->a2p_dev, - msg->payld, msg->rx_len - SCMI_MSG_HDR_SIZE); + msg->payld, msg->rx_len - SCMI_MSG_HDR_SIZE, msg->rx_len); return (ret); } diff --git a/sys/dev/firmware/arm/scmi_virtio.c b/sys/dev/firmware/arm/scmi_virtio.c index 12cbb9ecefd5..8714fee2ec87 100644 --- a/sys/dev/firmware/arm/scmi_virtio.c +++ b/sys/dev/firmware/arm/scmi_virtio.c @@ -76,7 +76,7 @@ scmi_virtio_callback(void *msg, unsigned int len, void *priv) } hdr = le32toh(*((uint32_t *)msg)); - scmi_rx_irq_callback(sc->base.dev, msg, hdr); + scmi_rx_irq_callback(sc->base.dev, msg, hdr, len); } static void * @@ -225,7 +225,6 @@ scmi_virtio_poll_msg(device_t dev, struct scmi_msg *msg, unsigned int tmo_ms) } rx_msg = hdr_to_msg(rx_buf); - rx_msg->rx_len = rx_len; /* Complete the polling on any poll path */ if (rx_msg->polling) atomic_store_rel_int(&rx_msg->poll_done, 1); @@ -242,7 +241,7 @@ scmi_virtio_poll_msg(device_t dev, struct scmi_msg *msg, unsigned int tmo_ms) rx_msg->hdr, rx_msg->polling); if (!rx_msg->polling) - scmi_rx_irq_callback(sc->base.dev, rx_msg, rx_msg->hdr); + scmi_rx_irq_callback(sc->base.dev, rx_msg, rx_msg->hdr, rx_len); } return (tmo_loops > 0 ? 0 : ETIMEDOUT); From nobody Mon Jun 9 15:46:00 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGGVK2gdhz5y4HH; Mon, 09 Jun 2025 15:46:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGGVJ65gpz45Vx; Mon, 09 Jun 2025 15:46:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749483960; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L2iY9SY/EvGSDp74FIjKvYfC2mavVMR3rI+s33jiPrI=; b=syszc9Ob7g692UqDP9gFLXzNGx6KTi09okgVkV1X8zoomhPglEPWFoOrnpRDGyU9+eFDsz 0Uf23ZdrMI0/G/8i2TMCj97ocSSs25aEGi11cS+0o5ZM+T48L8sSt+Vj3zvEAh30Yua65L K3epUgwPVwXyeathoeVhl0rj3u8FZBJYKefI8iTxD9bxfy2Xg6MuV23RfxA2mBS91xqNCp D4ti63A3VTS24nTGZvuLz23eySbBWCQOh+ZQ6E36hI31FroarBk9A5qOOW9P+BuMIwubma 3Lfx0qdQ+YpYFhtMRtehcCglq4RGMWxntKvpxu+pE+I6gln+LLsAIhZ6j2+h9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749483960; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L2iY9SY/EvGSDp74FIjKvYfC2mavVMR3rI+s33jiPrI=; b=ukeQQIJPG4+m9C3FJVzbtsDwYAMuvYD4ZWhP7uYjTZnI5Rxrr1AuH8j0lBkBWl5Hj4IngU jE/yeACf9ApADR+HE8gjiUXFjZw6lU2ivqk61hzPPIdhosh6I55Iyv4Uk6ga1tnCX2DriR vs7U+b41AMuP95iOP95dOHqFEr733EKkJXL0FiqBWM+ZDHUJ4bV0+GL8xRYct7GyLuWlCL 5mLtgXnJVYnS78LLEq9Hggz+7DmaBFhr+Is8EM+CuRyj7H9rHTdAKRxdy/gtagjNWZsWnb j4K3d++fh/RG5EtKkd5z81fNAVX/9w3OxrrDdLezEZNdfpswYnK31YbN5Xwczw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749483960; a=rsa-sha256; cv=none; b=t83X7ZPkgvlvPPpKVArwoJTAlAYphMjEY4YSWthNw3ZTGN9Iwj8GsGdlXUh6MH45TQqn3B 5QoqqSgBhN92Tr2XHsEgEzkw3gTOHsVH4KjfB0yD5w/lLh19I7UyKau+HVw/c0/dGG5rMu paS2KEjO6W5NjF2X8jcZZruj4GUHMVQ+S4gfgsu/RZ4Wb6NMvqAMJh0huAD6Gf7DIdHY+g CTJU5PzN0j/OTFCxMOJe80To2gA+x8MWq3QF29JUOZdaJpJxVeGH4tPTP+d53uTtrFEEFQ bajKiZnzJQsPgHy1XIO7X8LZ7U5eL9p/wd9hRE1nqBgKOO4reyv5NM5GjdWUAg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGGVJ52JKz11mx; Mon, 09 Jun 2025 15:46:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559Fk0JF088538; Mon, 9 Jun 2025 15:46:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559Fk0TZ088535; Mon, 9 Jun 2025 15:46:00 GMT (envelope-from git) Date: Mon, 9 Jun 2025 15:46:00 GMT Message-Id: <202506091546.559Fk0TZ088535@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: a14428c69b84 - main - scmi: Redefine max message payload size List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a14428c69b84b65a0b3110fd3f4d1e4732271171 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=a14428c69b84b65a0b3110fd3f4d1e4732271171 commit a14428c69b84b65a0b3110fd3f4d1e4732271171 Author: Cristian Marussi AuthorDate: 2025-01-23 12:49:41 +0000 Commit: Andrew Turner CommitDate: 2025-06-04 01:32:40 +0000 scmi: Redefine max message payload size The defined maximum payload size should not include header and status field. Fix the definition accordingly, so that it matches the definitions as can be found in the Linux SCMI stack. The semantic of this define is important since it will then be possible to override such values from devicetree, like in Linux. Tested on: Arm Morello Board Reviewed by: andrew Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D47421 Signed-off-by: Cristian Marussi --- sys/dev/firmware/arm/scmi.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/firmware/arm/scmi.h b/sys/dev/firmware/arm/scmi.h index 5ad7b0db3f5f..73b49f099ad8 100644 --- a/sys/dev/firmware/arm/scmi.h +++ b/sys/dev/firmware/arm/scmi.h @@ -36,8 +36,8 @@ #define SCMI_MAX_MSG 32 #define SCMI_MAX_MSG_PAYLD_SIZE 128 -#define SCMI_MAX_MSG_REPLY_SIZE (SCMI_MAX_MSG_PAYLD_SIZE - sizeof(uint32_t)) -#define SCMI_MAX_MSG_SIZE (SCMI_MAX_MSG_PAYLD_SIZE + sizeof(uint32_t)) +#define SCMI_MAX_MSG_REPLY_SIZE (SCMI_MAX_MSG_PAYLD_SIZE + sizeof(uint32_t)) +#define SCMI_MAX_MSG_SIZE (SCMI_MAX_MSG_REPLY_SIZE + sizeof(uint32_t)) enum scmi_chan { SCMI_CHAN_A2P, From nobody Mon Jun 9 15:46:02 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGGVM2Pkwz5y4hK; Mon, 09 Jun 2025 15:46:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGGVL6wL0z45bb; Mon, 09 Jun 2025 15:46:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749483963; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yaj1hvNOHHwNl+RaWNfx4YaebDO5oIGTL8TFlck3lw8=; b=jrIdboNQvUBX/Kv5jme6aq9rE22XTKhpL2fEYwGU2s+8WohRii6TNlo0gIYFV36fcnOb5T tYDP9tDoZ0nbsqb+ZB6cvBEtVKO39O5SewqSUBAiDfJGApgiVhppn9r0X/iRGQcSovMxyd T7tkolo/fHpLTWx5blV2cM7/3h3h17Vxw1+ElCwZNBQsdAysL0DG3z5ef6iGPwQd0vJwz4 WkYPgClbX4uBt3LC0h6k5SzvHhAX2RNrG1VLcWkrqri7GGig5t4mQwSwozwtURTQcB6dyY rTyfgyEqx9To8UYOM8vnZ0rmKwUrDZNctRh5dIZQGYhvLYQpMgGFJmWhWBGnIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749483963; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yaj1hvNOHHwNl+RaWNfx4YaebDO5oIGTL8TFlck3lw8=; b=aquk/JOV9ItYNOFJ7q/MOaTaKQvRDHZ30okjuLNwEotsg+j69ip8bjoQARorabB2JkkwAm +SVEOGEl+oOI+ryGM8xl6/SQ2hL3CN5znuOh87+Ks909VmEZcjCb3JmO8qdQTHDZcWpl8J rCx8z5VvtGIUrk8e0Qb1xUnfDV6b1F7UcUpc9Vvr0lZHESMRK0UqcyLkUeBB3sFdWe+CZ8 yXtjwiwsg+CWpAlqrwRF0YqW6viCPgWsl2XzxTVyv7PogztV4vpKyvQZjMDi5A4WodnrV8 jWA0nhDZDbKchlkyyMdfKCWJ4noqieH+okAiqGOKE/B24BOhjxRDjl//TX7n8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749483963; a=rsa-sha256; cv=none; b=N5hRC0gxa//w8hitXxD6M9eIG3VAmbwYiWTezvveJp0hMB4y1+J5D2pERP1yjUx/oSNNkf EVtcWpf/7eM48oRwqAo/NbkmHUeHLNix6HguzMgwWDNsRyLvZh2vrHO3Ol0xDUduYfpb/a 4youBH0aF9FC2V2yA2iay898sgThMAB+pnFuTV89WLoEUWDs+4mneKXpBcrHPecm6z9Nrl 1SfYvEDZbg1OpVY54C8q8mXg8/V16nOJh5rYWgaBUpKhMU1x55oPfn0jC3PKs8YSyk9yaL HQb3PviYg/dyCiQ+7nA6hkbqqQLgoVfAZpchV3T37NCwvFs0jWkwYwHrNxF4PA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGGVL6WKQz11yN; Mon, 09 Jun 2025 15:46:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559Fk2Fr088612; Mon, 9 Jun 2025 15:46:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559Fk2fO088609; Mon, 9 Jun 2025 15:46:02 GMT (envelope-from git) Date: Mon, 9 Jun 2025 15:46:02 GMT Message-Id: <202506091546.559Fk2fO088609@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: f700da1c20f1 - main - scmi: Add helper to manipulate scmi_msg descriptors List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f700da1c20f1f103d2ab2899d7060d3e331f082e Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=f700da1c20f1f103d2ab2899d7060d3e331f082e commit f700da1c20f1f103d2ab2899d7060d3e331f082e Author: Cristian Marussi AuthorDate: 2025-01-23 13:23:28 +0000 Commit: Andrew Turner CommitDate: 2025-06-04 01:32:40 +0000 scmi: Add helper to manipulate scmi_msg descriptors Refactor allocation logic for scmi_req and introduce new helpers to be able to obtain an scmi_msg reference to a freshly allocated request. Tested on: Arm Morello Board Reviewed by: andrew Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D47423 Signed-off-by: Cristian Marussi --- sys/dev/firmware/arm/scmi.c | 77 +++++++++++++++++++++++++++++++++++---------- sys/dev/firmware/arm/scmi.h | 2 ++ 2 files changed, 63 insertions(+), 16 deletions(-) diff --git a/sys/dev/firmware/arm/scmi.c b/sys/dev/firmware/arm/scmi.c index cf5a678370fd..8104f4e10429 100644 --- a/sys/dev/firmware/arm/scmi.c +++ b/sys/dev/firmware/arm/scmi.c @@ -132,9 +132,10 @@ static int scmi_transport_init(struct scmi_softc *, phandle_t); static void scmi_transport_cleanup(struct scmi_softc *); static struct scmi_reqs_pool *scmi_reqs_pool_allocate(const int, const int); static void scmi_reqs_pool_free(struct scmi_reqs_pool *); -static struct scmi_req *scmi_req_alloc(struct scmi_softc *, enum scmi_chan); +static struct scmi_req *scmi_req_alloc(struct scmi_softc *, enum scmi_chan); +static struct scmi_req *scmi_req_initialized_alloc(device_t, int, int); static void scmi_req_free_unlocked(struct scmi_softc *, - enum scmi_chan, struct scmi_req *); + enum scmi_chan, struct scmi_req *); static void scmi_req_get(struct scmi_softc *, struct scmi_req *); static void scmi_req_put(struct scmi_softc *, struct scmi_req *); static int scmi_token_pick(struct scmi_softc *); @@ -319,6 +320,32 @@ scmi_transport_cleanup(struct scmi_softc *sc) free(sc->trs, M_DEVBUF); } +static struct scmi_req * +scmi_req_initialized_alloc(device_t dev, int tx_payld_sz, int rx_payld_sz) +{ + struct scmi_softc *sc; + struct scmi_req *req; + + sc = device_get_softc(dev); + + if (tx_payld_sz > SCMI_MAX_MSG_PAYLD_SIZE(sc) || + rx_payld_sz > SCMI_MAX_MSG_REPLY_SIZE(sc)) { + device_printf(dev, "Unsupported payload size. Drop.\n"); + return (NULL); + } + + /* Pick one from free list */ + req = scmi_req_alloc(sc, SCMI_CHAN_A2P); + if (req == NULL) + return (NULL); + + req->msg.tx_len = sizeof(req->msg.hdr) + tx_payld_sz; + req->msg.rx_len = rx_payld_sz ? + rx_payld_sz + 2 * sizeof(uint32_t) : SCMI_MAX_MSG_SIZE(sc); + + return (req); +} + static struct scmi_req * scmi_req_alloc(struct scmi_softc *sc, enum scmi_chan ch_idx) { @@ -374,6 +401,10 @@ scmi_req_put(struct scmi_softc *sc, struct scmi_req *req) { mtx_lock_spin(&req->mtx); if (!refcount_release_if_not_last(&req->cnt)) { + req->protocol_id = 0; + req->message_id = 0; + req->token = 0; + req->header = 0; bzero(&req->msg, sizeof(req->msg) + SCMI_MAX_MSG_PAYLD_SIZE(sc)); scmi_req_free_unlocked(sc, SCMI_CHAN_A2P, req); } @@ -604,27 +635,15 @@ void * scmi_buf_get(device_t dev, uint8_t protocol_id, uint8_t message_id, int tx_payld_sz, int rx_payld_sz) { - struct scmi_softc *sc; struct scmi_req *req; - sc = device_get_softc(dev); - - if (tx_payld_sz > SCMI_MAX_MSG_PAYLD_SIZE(sc) || - rx_payld_sz > SCMI_MAX_MSG_REPLY_SIZE(sc)) { - device_printf(dev, "Unsupported payload size. Drop.\n"); - return (NULL); - } - - /* Pick one from free list */ - req = scmi_req_alloc(sc, SCMI_CHAN_A2P); + /* Pick a pre-built req */ + req = scmi_req_initialized_alloc(dev, tx_payld_sz, rx_payld_sz); if (req == NULL) return (NULL); req->protocol_id = protocol_id & SCMI_HDR_PROTOCOL_ID_BF; req->message_id = message_id & SCMI_HDR_MESSAGE_ID_BF; - req->msg.tx_len = sizeof(req->msg.hdr) + tx_payld_sz; - req->msg.rx_len = rx_payld_sz ? - rx_payld_sz + 2 * sizeof(uint32_t) : SCMI_MAX_MSG_SIZE(sc); return (&req->msg.payld[0]); } @@ -641,6 +660,32 @@ scmi_buf_put(device_t dev, void *buf) scmi_req_put(sc, req); } +struct scmi_msg * +scmi_msg_get(device_t dev, int tx_payld_sz, int rx_payld_sz) +{ + struct scmi_req *req; + + /* Pick a pre-built req */ + req = scmi_req_initialized_alloc(dev, tx_payld_sz, rx_payld_sz); + if (req == NULL) + return (NULL); + + return (&req->msg); +} + +void +scmi_msg_put(device_t dev, struct scmi_msg *msg) +{ + struct scmi_softc *sc; + struct scmi_req *req; + + sc = device_get_softc(dev); + + req = msg_to_req(msg); + + scmi_req_put(sc, req); +} + int scmi_request(device_t dev, void *in, void **out) { diff --git a/sys/dev/firmware/arm/scmi.h b/sys/dev/firmware/arm/scmi.h index 135b49c3b05b..f6aa072caeca 100644 --- a/sys/dev/firmware/arm/scmi.h +++ b/sys/dev/firmware/arm/scmi.h @@ -80,6 +80,8 @@ struct scmi_msg { void *scmi_buf_get(device_t dev, uint8_t protocol_id, uint8_t message_id, int tx_payd_sz, int rx_payld_sz); void scmi_buf_put(device_t dev, void *buf); +struct scmi_msg *scmi_msg_get(device_t dev, int tx_payld_sz, int rx_payld_sz); +void scmi_msg_put(device_t dev, struct scmi_msg *msg); int scmi_request(device_t dev, void *in, void **); void scmi_rx_irq_callback(device_t dev, void *chan, uint32_t hdr, uint32_t rx_len); From nobody Mon Jun 9 15:46:01 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGGVL1tYKz5y4dx; Mon, 09 Jun 2025 15:46:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGGVK73K6z45bQ; Mon, 09 Jun 2025 15:46:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749483962; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l5YTQLUeo6/Sb85x237DxIIAil7rLptfefzxKrqlb3Q=; b=i+PYy/c7yyp/kzNBETwhWX+vusgZ3fUGhBngSKVVaTzxWvyyPcMgw65VEKsSMEXQiP9BpM Im9eAt/ygUATWtAC1erVKp1Z3/DRAQD1XC3BQqqejvW7tydfMvqi+xhx3wkP2l8mnnCA6X Rflg56q4ZjxEQ/tHeALTjvx/EXzEhB9N2LIrxqE1J5Sl8IlcqvoZESIfdVjh/W7qrr7mNE axU5y8wUQpABCzkRxYPvr+PR2lkhiU2S9+flsixrj23rKWw8ZtppNXY14E86SXKfs9WFpg vkjKUMv2DfZxa87fvRKFStK6KdaATSBO1+PbFkz8K28l71Sk32toCJqHmj8mrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749483962; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l5YTQLUeo6/Sb85x237DxIIAil7rLptfefzxKrqlb3Q=; b=IdEGaKsOlzwfX9jfhRN0lYGnxW21EjSMTREO+IkL9ljA7KAYgP6x7T8BJkIjuSP7P8C+mf 5N1lANB/OL7Zrd6Awa4QooE6I/sbJEIFVJgNHX3D9w/jZsQU5u0dW6sx7SKpbCWgXPg/D3 t3yFsoPERF0rgFP5m/BlFjLM3R/c/zeq3a8+FpuJUIXFdS9PxBUZ6IfAdqSvXQuXSUfj2i 8V0xkeP8FqG/tDF54ErUpcocf6k+fG4nPEXgC9FCz/GDG2TUh/4tEFsigligxj5C+ioPma qekXK2f5RKerOJ9AKAkceCjM+gc2REXQpethcoCwLMasJqkE9LZGhHhJdYnnvg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749483962; a=rsa-sha256; cv=none; b=oVUxh8GCgzqA/dzDKPOdIT2U9CFTN5DI4pzitg+DQ+A3tduQaw1ovZo0hA8xei0jQi80hx mvfy0lVA2vxL8tzetEKmvKgAYIpjXnNvQVH7JY4SLg4kcdlP1IlXELelSBNGm4oVduygJq h1ulDjQEiKY+ky8NlNh4IJ5ZcCO6dBO3MF37JJLX8J09qKUZQZGpaNdBT8y7YRestsZMqe ARlOMeNfwh1CHUtMahg6AdjwswMxXgI6dGH80J6z2czlMzK4LTh9mLNm+kre5JjdF/Trwl GMtrAnUIvRNpVxNW8vE6jqob1kwGvfjv64KO1O5PwM8cMko+3DxkHATWI3g9kQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGGVK5x9Zz12BF; Mon, 09 Jun 2025 15:46:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559Fk1gP088578; Mon, 9 Jun 2025 15:46:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559Fk1oS088575; Mon, 9 Jun 2025 15:46:01 GMT (envelope-from git) Date: Mon, 9 Jun 2025 15:46:01 GMT Message-Id: <202506091546.559Fk1oS088575@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: ba510513e83d - main - scmi: Add devicetree transport properties List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ba510513e83dc1db9d3e40c143c2d3d7d41bd798 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=ba510513e83dc1db9d3e40c143c2d3d7d41bd798 commit ba510513e83dc1db9d3e40c143c2d3d7d41bd798 Author: Cristian Marussi AuthorDate: 2025-01-23 13:01:26 +0000 Commit: Andrew Turner CommitDate: 2025-06-04 01:32:40 +0000 scmi: Add devicetree transport properties SCMI transport characteristics can be optionally described in the devicetree to override the default build-time values. Tested on: Arm Morello Board Reviewed by: andrew Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D47422 Signed-off-by: Cristian Marussi --- sys/dev/firmware/arm/scmi.c | 52 +++++++++++++++++++++++++------------- sys/dev/firmware/arm/scmi.h | 14 +++++++--- sys/dev/firmware/arm/scmi_virtio.c | 12 ++++----- 3 files changed, 51 insertions(+), 27 deletions(-) diff --git a/sys/dev/firmware/arm/scmi.c b/sys/dev/firmware/arm/scmi.c index 00a229762414..cf5a678370fd 100644 --- a/sys/dev/firmware/arm/scmi.c +++ b/sys/dev/firmware/arm/scmi.c @@ -127,7 +127,8 @@ struct scmi_transport { struct mtx mtx; }; -static int scmi_transport_init(struct scmi_softc *); +static void scmi_transport_configure(struct scmi_transport_desc *, phandle_t); +static int scmi_transport_init(struct scmi_softc *, phandle_t); static void scmi_transport_cleanup(struct scmi_softc *); static struct scmi_reqs_pool *scmi_reqs_pool_allocate(const int, const int); static void scmi_reqs_pool_free(struct scmi_reqs_pool *); @@ -165,12 +166,12 @@ scmi_attach(device_t dev) simplebus_init(dev, node); - error = scmi_transport_init(sc); + error = scmi_transport_init(sc, node); if (error != 0) return (error); - device_printf(dev, "Transport reply timeout initialized to %dms\n", - sc->trs_desc.reply_timo_ms); + device_printf(dev, "Transport - max_msg:%d max_payld_sz:%lu reply_timo_ms:%d\n", + SCMI_MAX_MSG(sc), SCMI_MAX_MSG_PAYLD_SIZE(sc), SCMI_MAX_MSG_TIMEOUT_MS(sc)); /* * Allow devices to identify. @@ -248,29 +249,42 @@ scmi_reqs_pool_free(struct scmi_reqs_pool *rp) free(rp, M_DEVBUF); } +static void +scmi_transport_configure(struct scmi_transport_desc *td, phandle_t node) +{ + if (OF_getencprop(node, "arm,max-msg", &td->max_msg, sizeof(td->max_msg)) == -1) + td->max_msg = SCMI_DEF_MAX_MSG; + + if (OF_getencprop(node, "arm,max-msg-size", &td->max_payld_sz, + sizeof(td->max_payld_sz)) == -1) + td->max_payld_sz = SCMI_DEF_MAX_MSG_PAYLD_SIZE; +} + static int -scmi_transport_init(struct scmi_softc *sc) +scmi_transport_init(struct scmi_softc *sc, phandle_t node) { + struct scmi_transport_desc *td = &sc->trs_desc; struct scmi_transport *trs; int ret; trs = malloc(sizeof(*trs), M_DEVBUF, M_ZERO | M_WAITOK); + scmi_transport_configure(td, node); + BIT_FILL(SCMI_MAX_TOKEN, &trs->avail_tokens); mtx_init(&trs->mtx, "tokens", "SCMI", MTX_SPIN); - trs->inflight_ht = hashinit(SCMI_MAX_MSG, M_DEVBUF, - &trs->inflight_mask); + trs->inflight_ht = hashinit(td->max_msg, M_DEVBUF, &trs->inflight_mask); trs->chans[SCMI_CHAN_A2P] = - scmi_reqs_pool_allocate(SCMI_MAX_MSG, SCMI_MAX_MSG_PAYLD_SIZE); + scmi_reqs_pool_allocate(td->max_msg, td->max_payld_sz); if (trs->chans[SCMI_CHAN_A2P] == NULL) { free(trs, M_DEVBUF); return (ENOMEM); } trs->chans[SCMI_CHAN_P2A] = - scmi_reqs_pool_allocate(SCMI_MAX_MSG, SCMI_MAX_MSG_PAYLD_SIZE); + scmi_reqs_pool_allocate(td->max_msg, td->max_payld_sz); if (trs->chans[SCMI_CHAN_P2A] == NULL) { scmi_reqs_pool_free(trs->chans[SCMI_CHAN_A2P]); free(trs, M_DEVBUF); @@ -286,8 +300,13 @@ scmi_transport_init(struct scmi_softc *sc) return (ret); } + /* Use default transport timeout if not overridden by OF */ + OF_getencprop(node, "arm,max-rx-timeout-ms", &td->reply_timo_ms, + sizeof(td->reply_timo_ms)); + return (0); } + static void scmi_transport_cleanup(struct scmi_softc *sc) { @@ -355,7 +374,7 @@ scmi_req_put(struct scmi_softc *sc, struct scmi_req *req) { mtx_lock_spin(&req->mtx); if (!refcount_release_if_not_last(&req->cnt)) { - bzero(&req->msg, sizeof(req->msg) + SCMI_MAX_MSG_PAYLD_SIZE); + bzero(&req->msg, sizeof(req->msg) + SCMI_MAX_MSG_PAYLD_SIZE(sc)); scmi_req_free_unlocked(sc, SCMI_CHAN_A2P, req); } mtx_unlock_spin(&req->mtx); @@ -532,13 +551,13 @@ scmi_rx_irq_callback(device_t dev, void *chan, uint32_t hdr, uint32_t rx_len) static int scmi_wait_for_response(struct scmi_softc *sc, struct scmi_req *req, void **out) { + unsigned int reply_timo_ms = SCMI_MAX_MSG_TIMEOUT_MS(sc); int ret; if (req->msg.polling) { bool needs_drop; - ret = SCMI_POLL_MSG(sc->dev, &req->msg, - sc->trs_desc.reply_timo_ms); + ret = SCMI_POLL_MSG(sc->dev, &req->msg, reply_timo_ms); /* * Drop reference to successfully polled req unless it had * already also been processed on the IRQ path. @@ -557,8 +576,7 @@ scmi_wait_for_response(struct scmi_softc *sc, struct scmi_req *req, void **out) le32toh(req->msg.hdr), le32toh(req->header)); } } else { - ret = tsleep(req, 0, "scmi_wait4", - (sc->trs_desc.reply_timo_ms * hz) / 1000); + ret = tsleep(req, 0, "scmi_wait4", (reply_timo_ms * hz) / 1000); /* Check for lost wakeups since there is no associated lock */ mtx_lock_spin(&req->mtx); if (ret != 0 && req->done) @@ -591,8 +609,8 @@ scmi_buf_get(device_t dev, uint8_t protocol_id, uint8_t message_id, sc = device_get_softc(dev); - if (tx_payld_sz > SCMI_MAX_MSG_PAYLD_SIZE || - rx_payld_sz > SCMI_MAX_MSG_REPLY_SIZE) { + if (tx_payld_sz > SCMI_MAX_MSG_PAYLD_SIZE(sc) || + rx_payld_sz > SCMI_MAX_MSG_REPLY_SIZE(sc)) { device_printf(dev, "Unsupported payload size. Drop.\n"); return (NULL); } @@ -606,7 +624,7 @@ scmi_buf_get(device_t dev, uint8_t protocol_id, uint8_t message_id, req->message_id = message_id & SCMI_HDR_MESSAGE_ID_BF; req->msg.tx_len = sizeof(req->msg.hdr) + tx_payld_sz; req->msg.rx_len = rx_payld_sz ? - rx_payld_sz + 2 * sizeof(uint32_t) : SCMI_MAX_MSG_SIZE; + rx_payld_sz + 2 * sizeof(uint32_t) : SCMI_MAX_MSG_SIZE(sc); return (&req->msg.payld[0]); } diff --git a/sys/dev/firmware/arm/scmi.h b/sys/dev/firmware/arm/scmi.h index 73b49f099ad8..135b49c3b05b 100644 --- a/sys/dev/firmware/arm/scmi.h +++ b/sys/dev/firmware/arm/scmi.h @@ -34,10 +34,14 @@ #include "scmi_if.h" -#define SCMI_MAX_MSG 32 -#define SCMI_MAX_MSG_PAYLD_SIZE 128 -#define SCMI_MAX_MSG_REPLY_SIZE (SCMI_MAX_MSG_PAYLD_SIZE + sizeof(uint32_t)) -#define SCMI_MAX_MSG_SIZE (SCMI_MAX_MSG_REPLY_SIZE + sizeof(uint32_t)) +#define SCMI_DEF_MAX_MSG 32 +#define SCMI_DEF_MAX_MSG_PAYLD_SIZE 128 + +#define SCMI_MAX_MSG_PAYLD_SIZE(sc) ((sc)->trs_desc.max_payld_sz + sizeof(uint32_t)) +#define SCMI_MAX_MSG_REPLY_SIZE(sc) (SCMI_MAX_MSG_PAYLD_SIZE((sc)) + sizeof(uint32_t)) +#define SCMI_MAX_MSG_SIZE(sc) (SCMI_MAX_MSG_REPLY_SIZE(sc) + sizeof(uint32_t)) +#define SCMI_MAX_MSG(sc) ((sc)->trs_desc.max_msg) +#define SCMI_MAX_MSG_TIMEOUT_MS(sc) ((sc)->trs_desc.reply_timo_ms) enum scmi_chan { SCMI_CHAN_A2P, @@ -47,6 +51,8 @@ enum scmi_chan { struct scmi_transport_desc { bool no_completion_irq; + unsigned int max_msg; + unsigned int max_payld_sz; unsigned int reply_timo_ms; }; diff --git a/sys/dev/firmware/arm/scmi_virtio.c b/sys/dev/firmware/arm/scmi_virtio.c index 8714fee2ec87..5252ad9cf9a4 100644 --- a/sys/dev/firmware/arm/scmi_virtio.c +++ b/sys/dev/firmware/arm/scmi_virtio.c @@ -83,19 +83,19 @@ static void * scmi_virtio_p2a_pool_init(device_t dev, unsigned int max_msg) { struct scmi_virtio_softc *sc; + unsigned int max_msg_sz; void *pool; uint8_t *buf; int i; sc = device_get_softc(dev); + max_msg_sz = SCMI_MAX_MSG_SIZE(&sc->base); + pool = mallocarray(max_msg, max_msg_sz, M_DEVBUF, M_ZERO | M_WAITOK); - pool = mallocarray(max_msg, SCMI_MAX_MSG_SIZE, M_DEVBUF, - M_ZERO | M_WAITOK); - - for (i = 0, buf = pool; i < max_msg; i++, buf += SCMI_MAX_MSG_SIZE) { + for (i = 0, buf = pool; i < max_msg; i++, buf += max_msg_sz) { /* Feed platform with pre-allocated P2A buffers */ virtio_scmi_message_enqueue(sc->virtio_dev, - VIRTIO_SCMI_CHAN_P2A, buf, 0, SCMI_MAX_MSG_SIZE); + VIRTIO_SCMI_CHAN_P2A, buf, 0, max_msg_sz); } device_printf(dev, @@ -111,7 +111,7 @@ scmi_virtio_clear_channel(device_t dev, void *msg) sc = device_get_softc(dev); virtio_scmi_message_enqueue(sc->virtio_dev, VIRTIO_SCMI_CHAN_P2A, - msg, 0, SCMI_MAX_MSG_SIZE); + msg, 0, SCMI_MAX_MSG_SIZE(&sc->base)); } static int From nobody Mon Jun 9 15:46:03 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGGVN5CLxz5y4f5; Mon, 09 Jun 2025 15:46:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGGVN0mf9z45lk; Mon, 09 Jun 2025 15:46:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749483964; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q9Ap0iwNqAW/yiCya6OsfjK/E/U/DjRvhdJXvtlrVhc=; b=qfBlsm04LVlNlSPttAHllzKQ9a+DVe3C1z8gnrlwIg7Gv6izcDFFtQSV/JswpdqLhcErpf VTE8jSgZEsn7L5ACaTtRWt889JsOz2sRWXCAoXxO8q8Sv/tvmwvtLh9uwlgQFp6nQHn/nG oOSYNKvsB5wC1dUBoulIzJPxt4qkl3sC0bw+0cxmMofOIeA0Zc+c99tfhgFV64bX0U6bEy j9av3FdrjO8NjdQ3r9x9KCIzqaX4m+eba1EuI23b1NWIWq8kR8hDdj+VqjzlMqTHCbvKDn VeUKAz6OqRfBE1PWXrN/NI7wwmXun8YQlRzMo25g3qJMypa44wA2IBaN8Yb46g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749483964; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q9Ap0iwNqAW/yiCya6OsfjK/E/U/DjRvhdJXvtlrVhc=; b=wjCxrCRNuykYMM93g+u86LF1yRDRXIERCvwCsNdOZQWrkD/LD1GbcHdef/b1KA/pBtjkfI 0H7Xw+w+ngbVT5RpVOv/kvTo7MlZGK1dV/1zadCroeCATZojYAZZHroTkYnBtE1FbCFADE zMqx9K5HMY+Eqj5ty8BpUnX+qTXG876JcoPIt8HO6Dsy/Qph0lXYLEhBXV0RnsmJ993Ru2 i2Dll983oHi6Zf7eyBFkc0BcMbSJFrwcoIy4r6zGX2xVv9NmrOn/bJGwIo5QhLudXNyp0J 5cN+2lfGwJ6agZBjIuk5Ppoam0NQAhdo58LsUHQ74dL+4NyA5AQ32MZ4pwv3cw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749483964; a=rsa-sha256; cv=none; b=b4mqDD/eQLLDniXGl564Xt0kyzVk9iHSg9rFH9H8m3S/GR6Hn9mlO95x3D+FCWC8d9Rw9S Hvfp7L0MnEk+dEQ7pnrenRG86dEpddyw5mL2bP4n6s8paB145pMUnncNTVfiwj8ZtfZ/xl gmVlPlxnYd6+ObatBKwAHUW0VpnkjVghuQvgsRyY+uwsp4FY+ELj2Zl1lShim8fPkBTCJr cpl5buG6AeCuhYkfvVSEraNK/Yc16KWy+qx8k3wKlQg+4m7IPdby/a5oPmxPW13hVKbxz2 KA79AzWV891bwizz2oNJ2rnc9YGFC34M/x0LZhSh+B96aX1s0ZU+4Yf9V6qt2A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGGVN0JrTz11sB; Mon, 09 Jun 2025 15:46:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559Fk336088647; Mon, 9 Jun 2025 15:46:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559Fk3bv088644; Mon, 9 Jun 2025 15:46:03 GMT (envelope-from git) Date: Mon, 9 Jun 2025 15:46:03 GMT Message-Id: <202506091546.559Fk3bv088644@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 35ec332f3471 - main - scmi: Add scmi_token_reserve helper List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 35ec332f3471375e4779542eea4ff1d30685d2a3 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=35ec332f3471375e4779542eea4ff1d30685d2a3 commit 35ec332f3471375e4779542eea4ff1d30685d2a3 Author: Cristian Marussi AuthorDate: 2025-06-09 13:23:43 +0000 Commit: Andrew Turner CommitDate: 2025-06-04 01:32:40 +0000 scmi: Add scmi_token_reserve helper During normal operation, the SCMI stack, upon each transmission attempt, takes care to automatically pick an appropriate, monotonically increasing, sequence number to fill-in the token field in the egressing message. This does not cope well with the alternative scenario in which, instead, a complete and fully formed message is provided upfront: in such a case the SCMI stack will have to use the already provided sequence number, embedded in the message, to track such transaction. Add a method to attempt to reserve a specific sequence number to be used when a fully firmed (raw) message is handled. Tested on: Arm Morello Board Reported by: andrew Sponsored by: Arm ltd Signed-off-by: Cristian Marussi --- sys/dev/firmware/arm/scmi.c | 48 ++++++++++++++++++++++++++++++++++++--------- 1 file changed, 39 insertions(+), 9 deletions(-) diff --git a/sys/dev/firmware/arm/scmi.c b/sys/dev/firmware/arm/scmi.c index 8104f4e10429..c24768a5668a 100644 --- a/sys/dev/firmware/arm/scmi.c +++ b/sys/dev/firmware/arm/scmi.c @@ -93,6 +93,7 @@ struct scmi_req { bool timed_out; bool use_polling; bool done; + bool is_raw; struct mtx mtx; LIST_ENTRY(scmi_req) next; int protocol_id; @@ -139,6 +140,7 @@ static void scmi_req_free_unlocked(struct scmi_softc *, static void scmi_req_get(struct scmi_softc *, struct scmi_req *); static void scmi_req_put(struct scmi_softc *, struct scmi_req *); static int scmi_token_pick(struct scmi_softc *); +static int scmi_token_reserve(struct scmi_softc *, uint16_t); static void scmi_token_release_unlocked(struct scmi_softc *, int); static int scmi_req_track_inflight(struct scmi_softc *, struct scmi_req *); @@ -376,6 +378,7 @@ scmi_req_free_unlocked(struct scmi_softc *sc, enum scmi_chan ch_idx, mtx_lock_spin(&rp->mtx); req->timed_out = false; req->done = false; + req->is_raw = false; refcount_init(&req->cnt, 0); LIST_INSERT_HEAD(&rp->head, req, next); mtx_unlock_spin(&rp->mtx); @@ -424,7 +427,6 @@ scmi_token_pick(struct scmi_softc *sc) */ next_msg_id = sc->trs->next_id++ & SCMI_HDR_TOKEN_BF; token = BIT_FFS_AT(SCMI_MAX_TOKEN, &sc->trs->avail_tokens, next_msg_id); - /* TODO Account for wrap-arounds and holes */ if (token != 0) BIT_CLR(SCMI_MAX_TOKEN, token - 1, &sc->trs->avail_tokens); mtx_unlock_spin(&sc->trs->mtx); @@ -440,6 +442,28 @@ scmi_token_pick(struct scmi_softc *sc) return ((int)(token - 1)); } +static int +scmi_token_reserve(struct scmi_softc *sc, uint16_t candidate) +{ + int token = -EBUSY, retries = 3; + + do { + mtx_lock_spin(&sc->trs->mtx); + if (BIT_ISSET(SCMI_MAX_TOKEN, candidate, &sc->trs->avail_tokens)) { + BIT_CLR(SCMI_MAX_TOKEN, candidate, &sc->trs->avail_tokens); + token = candidate; + sc->trs->next_id++; + } + mtx_unlock_spin(&sc->trs->mtx); + if (token == candidate || retries-- == 0) + break; + + pause("scmi_tk_reserve", hz); + } while (1); + + return (token); +} + static void scmi_token_release_unlocked(struct scmi_softc *sc, int token) { @@ -450,19 +474,23 @@ scmi_token_release_unlocked(struct scmi_softc *sc, int token) static int scmi_finalize_req(struct scmi_softc *sc, struct scmi_req *req) { - uint32_t header = 0; + if (!req->is_raw) + req->token = scmi_token_pick(sc); + else + req->token = scmi_token_reserve(sc, SCMI_MSG_TOKEN(req->msg.hdr)); - req->token = scmi_token_pick(sc); if (req->token < 0) return (EBUSY); - header = req->message_id; - header |= SCMI_MSG_TYPE_CMD << SCMI_HDR_MESSAGE_TYPE_S; - header |= req->protocol_id << SCMI_HDR_PROTOCOL_ID_S; - header |= req->token << SCMI_HDR_TOKEN_S; + if (!req->is_raw) { + req->msg.hdr = req->message_id; + req->msg.hdr |= SCMI_MSG_TYPE_CMD << SCMI_HDR_MESSAGE_TYPE_S; + req->msg.hdr |= req->protocol_id << SCMI_HDR_PROTOCOL_ID_S; + req->msg.hdr |= req->token << SCMI_HDR_TOKEN_S; + } - req->header = htole32(header); - req->msg.hdr = htole32(header); + /* Save requested header */ + req->header = req->msg.hdr; return (0); } @@ -670,6 +698,8 @@ scmi_msg_get(device_t dev, int tx_payld_sz, int rx_payld_sz) if (req == NULL) return (NULL); + req->is_raw = true; + return (&req->msg); } From nobody Mon Jun 9 15:46:05 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGGVP6vHdz5y4f6; Mon, 09 Jun 2025 15:46:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGGVP1tXjz45cB; Mon, 09 Jun 2025 15:46:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749483965; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IRqkNxb/XR4HSFOg4LaKYY6hIn67B0qiRQyup5bLRpY=; b=KyK/aHyC8Iis+Khk+whgLMeI3EaK5Vp6NmgG+lzE5vhptAJRzTvwRMIFMfUTGedh6vgqjx NkUdcg4lPh7ufCVJLlKdph+cgxAmAYLlQZOlCT9bX8/ftlmp9YDd9HM+c1qpsGlPZ0Ju3L 4VQENdVjM/8MVJDc2Wt6sMrKUL1QXXINN5SdwIydnGodNtrkaX20HVJlJ/4pM+YPfNAOVO X5qbQiJfljFjEk9TPq+haeeb3YVD6t7EnPFbHOrqkwdPzs0B1CRm3AU8eW/KCQrwVa2OFG MOPM+Q2de5Mh+0zMXlCSGe0P2h6XwgzoYIlmcS5gL159Jr7rZKQraoQ46KYyyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749483965; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IRqkNxb/XR4HSFOg4LaKYY6hIn67B0qiRQyup5bLRpY=; b=jETdhcv3OG62Q7ilxbuDVur9rLkYFUHQujfhjTfqHTiLgqDJfV8wrSOmxTg1SZTLaJWJ1+ G4aFdDSc3EWyiuZ1jl2uX8aOS/h46tPPUa8ywJqg4UyRv7zOYakEcgmEAXkY13t2xG1+zo k/D0qBPHTCK66PtKAEgaz9U++ZkiPSkp1hlOidIG9VDVik+9mymq+XfmoUMHjZwYloGl3S 5XnE2dKKePTMR4zdxfU3S9+5RuS5rjTSY4RL0VAt74PeLeFEYTAPTRbnWqjK3a/87QkPaS gIp/1SC+x8XG+LZac54WhzQW4ncyybTU6Sq2V8PR9Dl2PGE9mucqIsM4H73sFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749483965; a=rsa-sha256; cv=none; b=DRnnzpraMx3XiU5fe1yLd01hPsttXof6TQflwKEqIm4Ac0PDKtRmFSEvFD/8GP4geNGf8L 15XK2RP3kb1psOtSTzeBRNH6YYEB26O770u79u12t5uBM8BxrEM2LM4K32L2mRdWjkURUn ydHNQSLMutkcM1ytXuOKT/dAxCcq/rAVUUvtj/OdE5usNkWcYmen44EPFxwfBCAJLOAetY 8+JRPwRyT6wbIS2CDd93ejGVfUYGDbv8BGpaeXw/TdsDYsX0eObJAe1EcL+SjykxG7S5mF zKnIhUW4kxRqpvaXSQiurohOWoYZG3eZ2s14cCYmJEbvlgbRXweyO12YPFPM4w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGGVP19fKz11my; Mon, 09 Jun 2025 15:46:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559Fk5RL088680; Mon, 9 Jun 2025 15:46:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559Fk5qc088677; Mon, 9 Jun 2025 15:46:05 GMT (envelope-from git) Date: Mon, 9 Jun 2025 15:46:05 GMT Message-Id: <202506091546.559Fk5qc088677@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 8f706629284d - main - scmi: Refactor scmi_request internal logic List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8f706629284dea513bac3a59f3bfd745666062ad Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=8f706629284dea513bac3a59f3bfd745666062ad commit 8f706629284dea513bac3a59f3bfd745666062ad Author: Cristian Marussi AuthorDate: 2025-01-23 13:24:39 +0000 Commit: Andrew Turner CommitDate: 2025-06-04 01:32:40 +0000 scmi: Refactor scmi_request internal logic Split scmi_request internals into a TX and an RX phase, which will be called, anyway, in sequence as before when a normal transmission is requested. No functional change. Tested on: Arm Morello Board Reviewed by: andrew Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D47425 Signed-off-by: Cristian Marussi --- sys/dev/firmware/arm/scmi.c | 24 ++++++++++++++++++++++-- sys/dev/firmware/arm/scmi.h | 1 + 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/sys/dev/firmware/arm/scmi.c b/sys/dev/firmware/arm/scmi.c index c24768a5668a..950bbf94eeb6 100644 --- a/sys/dev/firmware/arm/scmi.c +++ b/sys/dev/firmware/arm/scmi.c @@ -717,7 +717,7 @@ scmi_msg_put(device_t dev, struct scmi_msg *msg) } int -scmi_request(device_t dev, void *in, void **out) +scmi_request_tx(device_t dev, void *in) { struct scmi_softc *sc; struct scmi_req *req; @@ -732,8 +732,11 @@ scmi_request(device_t dev, void *in, void **out) /* Set inflight and send using transport specific method - refc-2 */ error = scmi_req_track_inflight(sc, req); - if (error != 0) + if (error != 0) { + device_printf(dev, "Failed to build req with HDR |%0X|\n", + req->msg.hdr); return (error); + } error = SCMI_XFER_MSG(sc->dev, &req->msg); if (error != 0) { @@ -741,5 +744,22 @@ scmi_request(device_t dev, void *in, void **out) return (error); } + return (0); +} + +int +scmi_request(device_t dev, void *in, void **out) +{ + struct scmi_softc *sc; + struct scmi_req *req; + int error; + + error = scmi_request_tx(dev, in); + if (error != 0) + return (error); + + sc = device_get_softc(dev); + req = buf_to_req(in); + return (scmi_wait_for_response(sc, req, out)); } diff --git a/sys/dev/firmware/arm/scmi.h b/sys/dev/firmware/arm/scmi.h index f6aa072caeca..f5b4173272bb 100644 --- a/sys/dev/firmware/arm/scmi.h +++ b/sys/dev/firmware/arm/scmi.h @@ -83,6 +83,7 @@ void scmi_buf_put(device_t dev, void *buf); struct scmi_msg *scmi_msg_get(device_t dev, int tx_payld_sz, int rx_payld_sz); void scmi_msg_put(device_t dev, struct scmi_msg *msg); int scmi_request(device_t dev, void *in, void **); +int scmi_request_tx(device_t dev, void *in); void scmi_rx_irq_callback(device_t dev, void *chan, uint32_t hdr, uint32_t rx_len); DECLARE_CLASS(scmi_driver); From nobody Mon Jun 9 15:46:06 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGGVQ5CJPz5y4Z8; Mon, 09 Jun 2025 15:46:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGGVQ2FsXz45sW; Mon, 09 Jun 2025 15:46:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749483966; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I97S75L09Ke9g9ili7xbaJLCiX6Y6pyQ3SnHShBTfl4=; b=AJP5ttLviYaL5K2/oNtY9c8OOdaJTCQRiixPUpB9i+Y794oohqFwFn1d1kwsxg8cOYX4s/ CiaudKtE2yOY3V8OrTJiKCaX8QTHdH7/GF7M2LgXewNx8RePKDm/LhwYSxjDDdB1Nh7rkk 14FA3UpfSypZ5Zl9JDgsZ2GpG6Hou2pDSrC8Nv4LPiGZ+o96Rg6Wtee3qGGiBvgt+0F/ty gpuL+vdqxQfBqrFtVJoxtfkiXqEfCId9r/CoILbLxdy3zfgIaJ4S6FYp42arAellPcy6gV O+CW+UNEgF4QgTbJpeAIYZ8VVD/xrbI3xq6DrAkZFaozkh6n1ZCvdRrWIonHVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749483966; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I97S75L09Ke9g9ili7xbaJLCiX6Y6pyQ3SnHShBTfl4=; b=vPWfr/9r/bJIZ7i4Rz1L+GwwwE5zB7zTlHd73P8zlzwCbJPL1jIunvCXBxj3L3jZCx0fwY U+AnWQ9fAh/VsD5qstVcaREY+s31XxdnFEErgbQjEpFLECEh7BszEWYntmfYbEIC5ym/9F ZXZv/tCgvOWss6g8JKBJBzuBZUSyPQfP9Vw2tGBaLV3TTImXgMk06kBEx4hKyKGn85MAhD +kGbUJeVOxetpa9hCrPTtIbCnoLoq7YVkUi+wIQf39EPYJUVZZf8zETt7EcptETjDaSpb5 Jc44QQT9yXvZzd3P9+m1z7u7qH2Gqe3wNN9FggJDeu6zVR2TYeLFYSV29Es1zg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749483966; a=rsa-sha256; cv=none; b=MjuYO2vKRwcQsmJTB99r/+5NII1t4EhRXOp5NJjh5eNQ8pIlhoqxaltYD7JCIZHiFQlXQg aDt/XMlAyMWBC++RfrtXk58RHm5heUHf9XTU3teVoav7Lv+Rq+8jVjsfP4HaNMLr/NgxOa RacRXnlldfClRvxGTiNobei1rCy+KZaFmxk37HAmbEx0QN0m9Vn5G3Nx6R5hn9CI+2iETX t9qGfGCBv6uZ98RWuq7B1k9CQOv0g9zKfvKxfRheftssu7Wkml46IyQg3ZmXku1BV74SYe z5DQKKpEgFumc/VkHFXIYjMt1hkclFJe9vEbY8uWOGk2QBhi6/uGVepcpyhNBg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGGVQ1mqBz11sC; Mon, 09 Jun 2025 15:46:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559Fk6QB088713; Mon, 9 Jun 2025 15:46:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559Fk6RD088710; Mon, 9 Jun 2025 15:46:06 GMT (envelope-from git) Date: Mon, 9 Jun 2025 15:46:06 GMT Message-Id: <202506091546.559Fk6RD088710@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: e478b80556a1 - main - scmi: Add optional asynchronous handling of replies List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e478b80556a12820786fb7695eb044786931c2f3 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=e478b80556a12820786fb7695eb044786931c2f3 commit e478b80556a12820786fb7695eb044786931c2f3 Author: Cristian Marussi AuthorDate: 2025-01-23 13:26:12 +0000 Commit: Andrew Turner CommitDate: 2025-06-04 01:32:40 +0000 scmi: Add optional asynchronous handling of replies Add the core logic to handle the replies to pending command in an asynchronous manner. Tested on: Arm Morello Board Reviewed by: andrew Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D47426 Signed-off-by: Cristian Marussi --- sys/dev/firmware/arm/scmi.c | 46 ++++++++++++++++++++++++++++++++++++++++----- sys/dev/firmware/arm/scmi.h | 1 + 2 files changed, 42 insertions(+), 5 deletions(-) diff --git a/sys/dev/firmware/arm/scmi.c b/sys/dev/firmware/arm/scmi.c index 950bbf94eeb6..0b165e413674 100644 --- a/sys/dev/firmware/arm/scmi.c +++ b/sys/dev/firmware/arm/scmi.c @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -94,6 +95,8 @@ struct scmi_req { bool use_polling; bool done; bool is_raw; + device_t dev; + struct task tsk; struct mtx mtx; LIST_ENTRY(scmi_req) next; int protocol_id; @@ -103,6 +106,7 @@ struct scmi_req { struct scmi_msg msg; }; +#define tsk_to_req(t) __containerof((t), struct scmi_req, tsk) #define buf_to_msg(b) __containerof((b), struct scmi_msg, payld) #define msg_to_req(m) __containerof((m), struct scmi_req, msg) #define buf_to_req(b) msg_to_req(buf_to_msg(b)) @@ -131,7 +135,9 @@ struct scmi_transport { static void scmi_transport_configure(struct scmi_transport_desc *, phandle_t); static int scmi_transport_init(struct scmi_softc *, phandle_t); static void scmi_transport_cleanup(struct scmi_softc *); -static struct scmi_reqs_pool *scmi_reqs_pool_allocate(const int, const int); +static void scmi_req_async_waiter(void *, int); +static struct scmi_reqs_pool *scmi_reqs_pool_allocate(device_t, const int, + const int); static void scmi_reqs_pool_free(struct scmi_reqs_pool *); static struct scmi_req *scmi_req_alloc(struct scmi_softc *, enum scmi_chan); static struct scmi_req *scmi_req_initialized_alloc(device_t, int, int); @@ -217,7 +223,7 @@ DRIVER_MODULE(scmi, simplebus, scmi_driver, 0, 0); MODULE_VERSION(scmi, 1); static struct scmi_reqs_pool * -scmi_reqs_pool_allocate(const int max_msg, const int max_payld_sz) +scmi_reqs_pool_allocate(device_t dev, const int max_msg, const int max_payld_sz) { struct scmi_reqs_pool *rp; struct scmi_req *req; @@ -229,6 +235,10 @@ scmi_reqs_pool_allocate(const int max_msg, const int max_payld_sz) req = malloc(sizeof(*req) + max_payld_sz, M_DEVBUF, M_ZERO | M_WAITOK); + req->dev = dev; + req->tsk.ta_context = &req->tsk; + req->tsk.ta_func = scmi_req_async_waiter; + mtx_init(&req->mtx, "req", "SCMI", MTX_SPIN); LIST_INSERT_HEAD(&rp->head, req, next); } @@ -280,14 +290,14 @@ scmi_transport_init(struct scmi_softc *sc, phandle_t node) trs->inflight_ht = hashinit(td->max_msg, M_DEVBUF, &trs->inflight_mask); trs->chans[SCMI_CHAN_A2P] = - scmi_reqs_pool_allocate(td->max_msg, td->max_payld_sz); + scmi_reqs_pool_allocate(sc->dev, td->max_msg, td->max_payld_sz); if (trs->chans[SCMI_CHAN_A2P] == NULL) { free(trs, M_DEVBUF); return (ENOMEM); } trs->chans[SCMI_CHAN_P2A] = - scmi_reqs_pool_allocate(td->max_msg, td->max_payld_sz); + scmi_reqs_pool_allocate(sc->dev, td->max_msg, td->max_payld_sz); if (trs->chans[SCMI_CHAN_P2A] == NULL) { scmi_reqs_pool_free(trs->chans[SCMI_CHAN_A2P]); free(trs, M_DEVBUF); @@ -648,7 +658,8 @@ scmi_wait_for_response(struct scmi_softc *sc, struct scmi_req *req, void **out) SCMI_COLLECT_REPLY(sc->dev, &req->msg); if (req->msg.payld[0] != 0) ret = req->msg.payld[0]; - *out = &req->msg.payld[SCMI_MSG_HDR_SIZE]; + if (out != NULL) + *out = &req->msg.payld[SCMI_MSG_HDR_SIZE]; } else { device_printf(sc->dev, "Request for token 0x%X timed-out.\n", req->token); @@ -703,6 +714,20 @@ scmi_msg_get(device_t dev, int tx_payld_sz, int rx_payld_sz) return (&req->msg); } +static void +scmi_req_async_waiter(void *context, int pending) +{ + struct task *ta = context; + struct scmi_softc *sc; + struct scmi_req *req; + + req = tsk_to_req(ta); + sc = device_get_softc(req->dev); + scmi_wait_for_response(sc, req, NULL); + + scmi_msg_put(req->dev, &req->msg); +} + void scmi_msg_put(device_t dev, struct scmi_msg *msg) { @@ -763,3 +788,14 @@ scmi_request(device_t dev, void *in, void **out) return (scmi_wait_for_response(sc, req, out)); } + +int +scmi_msg_async_enqueue(struct scmi_msg *msg) +{ + struct scmi_req *req; + + req = msg_to_req(msg); + + return taskqueue_enqueue_flags(taskqueue_thread, &req->tsk, + TASKQUEUE_FAIL_IF_PENDING | TASKQUEUE_FAIL_IF_CANCELING); +} diff --git a/sys/dev/firmware/arm/scmi.h b/sys/dev/firmware/arm/scmi.h index f5b4173272bb..990759237964 100644 --- a/sys/dev/firmware/arm/scmi.h +++ b/sys/dev/firmware/arm/scmi.h @@ -84,6 +84,7 @@ struct scmi_msg *scmi_msg_get(device_t dev, int tx_payld_sz, int rx_payld_sz); void scmi_msg_put(device_t dev, struct scmi_msg *msg); int scmi_request(device_t dev, void *in, void **); int scmi_request_tx(device_t dev, void *in); +int scmi_msg_async_enqueue(struct scmi_msg *msg); void scmi_rx_irq_callback(device_t dev, void *chan, uint32_t hdr, uint32_t rx_len); DECLARE_CLASS(scmi_driver); From nobody Mon Jun 9 15:46:07 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGGVS0L6Sz5y4bq; Mon, 09 Jun 2025 15:46:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGGVR5NJmz461x; Mon, 09 Jun 2025 15:46:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749483967; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mEDxrdV1ti1faKiuBwnkM6yDt40kYcIJFKSQgL+HpAg=; b=vv9gLby1lZfNm2GO7PdQ4PQXpX2u0mxQSK3NUxUqjhsl1RPcUYl6d/mS2q0yZVzp5GfJR1 XjXkfBGhixXzS7WJemlOn/bJqDESxtO2NLTgcdGb6hd9b+/pVPwmvqFshv8geHdyIct1JO UETtqS8kHKP8fDySDXqkhzEfA8GkermKCbrX1Kx9d3jwLZU0MhG46vVrCjX0QXZthgZOCl 1JWygPF1Zatb+V9zTsrg1jleuFj6Hq4J495/qegJkO3iK83AqtcNfIE+gIOdAMnmgMdqRc 6PDel4HYX5EqOoCcw7L3SJSedHPBi2pa0Vpc+QXfhel6+O0eNoU0iizbxMq/ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749483967; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mEDxrdV1ti1faKiuBwnkM6yDt40kYcIJFKSQgL+HpAg=; b=Bggb4ABi07H+T3eUUC/EwEb4EksBk6B1BUlXpESFnNepx+92MDwqqyffbdXeXd5+WIeJfF MW866uHPcEqV8TxpKY8YE85DnCkZbyJWz18c/MO8sLLGnJS2+nlykQ4CzTs3KKhD+5hlp/ 9z5PtGDdBqM+tNtpCjEBnK3uXKc3sMGKjwClLQNJ3d24UM80jAFtkIVgC2Y88CBC5/CqWO dplXF2HGUCO4AaInrFo610hyZXZlyQ6aIos0OBXPgtlfdhca86CJ8d3jqVOskF0AfeRO9g ei9femQwG872dRM20m9EQzCKfZGtw9wWEhoyaJYkOekzqZnaQFH6lDC9ibRkGw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749483967; a=rsa-sha256; cv=none; b=qUWbtIOMvnGkhp/EStdODaZDg26TWYUeBaI3hCWg2awq85l4Keq5ybLL7NNcLQ0ypCp1Z9 vAfwTBcZQom6eirUrLZWBajjOKk+e97EhLSBIKDVXo2jNkmjYz9S83Hy36WGU/wYOoDB+T tvh24hcGId6eQWLOl/kcKi/GXeaBPpl1CqWZHUu7fDf9VbHgaqjywkrh/iALfTzmxBoNrD EL3B1HwYjBtYEwZHFaar7S4Gy0VU4WgvL9OVQF8FW+KyBUtpDwGork2Eit89KWHwtYdCUo q4CsGwCt8UD3ORrCfTKKwEizECsINMwMFN3F74NUuiNue3S+pKFbIaM1S88xBQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGGVR37tqz11sD; Mon, 09 Jun 2025 15:46:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559Fk7LO088752; Mon, 9 Jun 2025 15:46:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559Fk7uR088749; Mon, 9 Jun 2025 15:46:07 GMT (envelope-from git) Date: Mon, 9 Jun 2025 15:46:07 GMT Message-Id: <202506091546.559Fk7uR088749@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: d5778530d1d9 - main - scmi: Add SDT traces to the core stack List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d5778530d1d9130ac6ba03eaf54364403eb6706d Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=d5778530d1d9130ac6ba03eaf54364403eb6706d commit d5778530d1d9130ac6ba03eaf54364403eb6706d Author: Cristian Marussi AuthorDate: 2025-01-23 13:26:41 +0000 Commit: Andrew Turner CommitDate: 2025-06-04 01:32:40 +0000 scmi: Add SDT traces to the core stack Add a few basic traces to track SCMI messages lifecycle. Tested on: Arm Morello Board Reviewed by: Andrew Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D47427 Signed-off-by: Cristian Marussi --- sys/dev/firmware/arm/scmi.c | 59 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/sys/dev/firmware/arm/scmi.c b/sys/dev/firmware/arm/scmi.c index 0b165e413674..2d9f6fa89d4b 100644 --- a/sys/dev/firmware/arm/scmi.c +++ b/sys/dev/firmware/arm/scmi.c @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -53,6 +54,26 @@ #include "scmi.h" #include "scmi_protocols.h" +SDT_PROVIDER_DEFINE(scmi); +SDT_PROBE_DEFINE3(scmi, func, scmi_req_alloc, req_alloc, + "int", "int", "int"); +SDT_PROBE_DEFINE3(scmi, func, scmi_req_free_unlocked, req_alloc, + "int", "int", "int"); +SDT_PROBE_DEFINE3(scmi, func, scmi_req_get, req_alloc, + "int", "int", "int"); +SDT_PROBE_DEFINE3(scmi, func, scmi_req_put, req_alloc, + "int", "int", "int"); +SDT_PROBE_DEFINE5(scmi, func, scmi_request_tx, xfer_track, + "int", "int", "int", "int", "int"); +SDT_PROBE_DEFINE5(scmi, entry, scmi_wait_for_response, xfer_track, + "int", "int", "int", "int", "int"); +SDT_PROBE_DEFINE5(scmi, exit, scmi_wait_for_response, xfer_track, + "int", "int", "int", "int", "int"); +SDT_PROBE_DEFINE2(scmi, func, scmi_rx_irq_callback, hdr_dump, + "int", "int"); +SDT_PROBE_DEFINE5(scmi, func, scmi_process_response, xfer_track, + "int", "int", "int", "int", "int"); + #define SCMI_MAX_TOKEN 1024 #define SCMI_HDR_TOKEN_S 18 @@ -88,6 +109,12 @@ #define SCMI_MSG_TOKEN(_hdr) \ (((_hdr) & SCMI_HDR_TOKEN_M) >> SCMI_HDR_TOKEN_S) +#define SCMI_MSG_PROTOCOL_ID(_hdr) \ + (((_hdr) & SCMI_HDR_PROTOCOL_ID_M) >> SCMI_HDR_PROTOCOL_ID_S) +#define SCMI_MSG_MESSAGE_ID(_hdr) \ + (((_hdr) & SCMI_HDR_MESSAGE_ID_M) >> SCMI_HDR_MESSAGE_ID_S) +#define SCMI_MSG_TYPE(_hdr) \ + (((_hdr) & SCMI_HDR_TYPE_ID_M) >> SCMI_HDR_TYPE_ID_S) struct scmi_req { int cnt; @@ -372,8 +399,11 @@ scmi_req_alloc(struct scmi_softc *sc, enum scmi_chan ch_idx) } mtx_unlock_spin(&rp->mtx); - if (req != NULL) + if (req != NULL) { refcount_init(&req->cnt, 1); + SDT_PROBE3(scmi, func, scmi_req_alloc, req_alloc, + req, refcount_load(&req->cnt), -1); + } return (req); } @@ -392,6 +422,9 @@ scmi_req_free_unlocked(struct scmi_softc *sc, enum scmi_chan ch_idx, refcount_init(&req->cnt, 0); LIST_INSERT_HEAD(&rp->head, req, next); mtx_unlock_spin(&rp->mtx); + + SDT_PROBE3(scmi, func, scmi_req_free_unlocked, req_alloc, + req, refcount_load(&req->cnt), -1); } static void @@ -406,6 +439,9 @@ scmi_req_get(struct scmi_softc *sc, struct scmi_req *req) if (!ok) device_printf(sc->dev, "%s() -- BAD REFCOUNT\n", __func__); + SDT_PROBE3(scmi, func, scmi_req_get, req_alloc, + req, refcount_load(&req->cnt), SCMI_MSG_TOKEN(req->msg.hdr)); + return; } @@ -420,6 +456,9 @@ scmi_req_put(struct scmi_softc *sc, struct scmi_req *req) req->header = 0; bzero(&req->msg, sizeof(req->msg) + SCMI_MAX_MSG_PAYLD_SIZE(sc)); scmi_req_free_unlocked(sc, SCMI_CHAN_A2P, req); + } else { + SDT_PROBE3(scmi, func, scmi_req_put, req_alloc, + req, refcount_load(&req->cnt), SCMI_MSG_TOKEN(req->msg.hdr)); } mtx_unlock_spin(&req->mtx); } @@ -571,6 +610,10 @@ scmi_process_response(struct scmi_softc *sc, uint32_t hdr, uint32_t rx_len) return; } + SDT_PROBE5(scmi, func, scmi_process_response, xfer_track, req, + SCMI_MSG_PROTOCOL_ID(req->msg.hdr), SCMI_MSG_MESSAGE_ID(req->msg.hdr), + SCMI_MSG_TOKEN(req->msg.hdr), req->timed_out); + mtx_lock_spin(&req->mtx); req->done = true; req->msg.rx_len = rx_len; @@ -608,6 +651,8 @@ scmi_rx_irq_callback(device_t dev, void *chan, uint32_t hdr, uint32_t rx_len) sc = device_get_softc(dev); + SDT_PROBE2(scmi, func, scmi_rx_irq_callback, hdr_dump, hdr, rx_len); + if (SCMI_IS_MSG_TYPE_NOTIF(hdr) || SCMI_IS_MSG_TYPE_DRESP(hdr)) { device_printf(dev, "DRESP/NOTIF unsupported. Drop.\n"); SCMI_CLEAR_CHANNEL(dev, chan); @@ -623,6 +668,10 @@ scmi_wait_for_response(struct scmi_softc *sc, struct scmi_req *req, void **out) unsigned int reply_timo_ms = SCMI_MAX_MSG_TIMEOUT_MS(sc); int ret; + SDT_PROBE5(scmi, entry, scmi_wait_for_response, xfer_track, req, + SCMI_MSG_PROTOCOL_ID(req->msg.hdr), SCMI_MSG_MESSAGE_ID(req->msg.hdr), + SCMI_MSG_TOKEN(req->msg.hdr), reply_timo_ms); + if (req->msg.polling) { bool needs_drop; @@ -667,6 +716,10 @@ scmi_wait_for_response(struct scmi_softc *sc, struct scmi_req *req, void **out) SCMI_TX_COMPLETE(sc->dev, NULL); + SDT_PROBE5(scmi, exit, scmi_wait_for_response, xfer_track, req, + SCMI_MSG_PROTOCOL_ID(req->msg.hdr), SCMI_MSG_MESSAGE_ID(req->msg.hdr), + SCMI_MSG_TOKEN(req->msg.hdr), req->timed_out); + return (ret); } @@ -769,6 +822,10 @@ scmi_request_tx(device_t dev, void *in) return (error); } + SDT_PROBE5(scmi, func, scmi_request_tx, xfer_track, req, + SCMI_MSG_PROTOCOL_ID(req->msg.hdr), SCMI_MSG_MESSAGE_ID(req->msg.hdr), + SCMI_MSG_TOKEN(req->msg.hdr), req->msg.polling); + return (0); } From nobody Mon Jun 9 15:46:08 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGGVT3pnCz5y4km; Mon, 09 Jun 2025 15:46:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGGVS5YhMz464N; Mon, 09 Jun 2025 15:46:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749483968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0fwDLcFTE85pwQiUZugJFpfzDGTFvS9DB/r27QH0xwM=; b=WyJWorbFYUlBiYH8IYtcHdpGkXpsJVvJQX2ik5KHqaIrb8aL71tRy0TGATI01CHJbQWNj9 t18r4yRnnYvCi5bQDliuqvOp/sTOEbB8ivpJc7SBMok5QD8TrNMGMQkkb54phcRyRxp0W7 M+7/8xxPlM3xL3TVg12Do2bODE87GO1My/nhLQu3eJQsf8mSFmYdWhgTWAdK5IXInK6eAs G4NBZQc9Rsn/oCLDfbt48VX4eLuEHFNoxE0vzX0w5AVYJrNZFqI7ypxExaBtFFxx0d7PaK nA+OJqPOn5DAb6mO9BNXHGvMkJ5p9Z9OHL7dM1G3fwtMBpLZdj+AbbcUyGIqcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749483968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0fwDLcFTE85pwQiUZugJFpfzDGTFvS9DB/r27QH0xwM=; b=oDKmCeiHG9/A6yLfGhzDxa43cd972fDpDm7I55Kh/yZC7IQQ/Suo0VcZvtLRRbKpC+QqEq YQHrpEpCkTL4MS9Ux/N2v57J3G2l9Vi64hHb/WUenQyVtEBmKwmot0bYLt+1YlPKHS/xsf +lRGvpgfhsV+xxyFoI+QoGh7H3fO/SARcrLudwjWZpUsG5hwQTtpTEC55C5T0XzFzDX2+4 1VIjivYBY6+G+TK2lcNVJukzE6vMAXiTySrRVCv1O1rMMPYXb3zjtc2gczgtlTIf8hQU83 R2WqRz6s1rLzYULwXMfmDP+IAXB85u9tWP/5j6IGjEwelUEmtFwKNezczDNgmw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749483968; a=rsa-sha256; cv=none; b=YyBgQvMemiNG6Szzikbz/fepGae+YsgHsdelb4lZ1Ho09MrB1Wy2Ku9neZnLloVvRzIvUP Gls3RBuYNdD8WesDKvFg7xDvgLFgFOMeQYjuCOnys1AVYeP4EaT9KFf0qWuS0g0UzSXfUe 7dvx6wsTNq84nODocSAty4SIlCDO+EbS+Nxo/h0ECViZXF+UICf7yS3kVI3pdRzxE0M6rK Go23QiWTZZst8KxztGwNnqpoM4uOHsvuWdE13L43hPYOwDgPy8QhCT2jmN0Ddrmd61zFif hIaOpz9jRxran9T6Y/HsobCJqKEObPrmRedCmv1qi0Lo7+rlKcxX3sCKE/6saQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGGVS49gHz128p; Mon, 09 Jun 2025 15:46:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559Fk8LA088785; Mon, 9 Jun 2025 15:46:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559Fk8c3088782; Mon, 9 Jun 2025 15:46:08 GMT (envelope-from git) Date: Mon, 9 Jun 2025 15:46:08 GMT Message-Id: <202506091546.559Fk8c3088782@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 5a54d768e1f9 - main - scmi: Add sysctl transport properties List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5a54d768e1f90d5e382083c014495058418a6c53 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=5a54d768e1f90d5e382083c014495058418a6c53 commit 5a54d768e1f90d5e382083c014495058418a6c53 Author: Cristian Marussi AuthorDate: 2025-01-23 13:27:08 +0000 Commit: Andrew Turner CommitDate: 2025-06-04 01:32:40 +0000 scmi: Add sysctl transport properties Expose as read-only the configured transport properties. Tested on: Arm Morello Board Reviewed by: andrew Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D47428 Signed-off-by: Cristian Marussi --- sys/dev/firmware/arm/scmi.c | 13 +++++++++++++ sys/dev/firmware/arm/scmi.h | 3 +++ 2 files changed, 16 insertions(+) diff --git a/sys/dev/firmware/arm/scmi.c b/sys/dev/firmware/arm/scmi.c index 2d9f6fa89d4b..b27f7211201e 100644 --- a/sys/dev/firmware/arm/scmi.c +++ b/sys/dev/firmware/arm/scmi.c @@ -44,6 +44,7 @@ #include #include #include +#include #include #include @@ -189,6 +190,7 @@ static void scmi_process_response(struct scmi_softc *, uint32_t, int scmi_attach(device_t dev) { + struct sysctl_oid *sysctl_trans; struct scmi_softc *sc; phandle_t node; int error; @@ -209,6 +211,17 @@ scmi_attach(device_t dev) device_printf(dev, "Transport - max_msg:%d max_payld_sz:%lu reply_timo_ms:%d\n", SCMI_MAX_MSG(sc), SCMI_MAX_MSG_PAYLD_SIZE(sc), SCMI_MAX_MSG_TIMEOUT_MS(sc)); + sc->sysctl_root = SYSCTL_ADD_NODE(NULL, SYSCTL_STATIC_CHILDREN(_hw), + OID_AUTO, "scmi", CTLFLAG_RD, 0, "SCMI root"); + sysctl_trans = SYSCTL_ADD_NODE(NULL, SYSCTL_CHILDREN(sc->sysctl_root), + OID_AUTO, "transport", CTLFLAG_RD, 0, "SCMI Transport properties"); + SYSCTL_ADD_INT(NULL, SYSCTL_CHILDREN(sysctl_trans), OID_AUTO, "max_msg", + CTLFLAG_RD, &sc->trs_desc.max_msg, 0, "SCMI Max number of inflight messages"); + SYSCTL_ADD_INT(NULL, SYSCTL_CHILDREN(sysctl_trans), OID_AUTO, "max_msg_size", + CTLFLAG_RD, &sc->trs_desc.max_payld_sz, 0, "SCMI Max message payload size"); + SYSCTL_ADD_INT(NULL, SYSCTL_CHILDREN(sysctl_trans), OID_AUTO, "max_rx_timeout_ms", + CTLFLAG_RD, &sc->trs_desc.reply_timo_ms, 0, "SCMI Max message RX timeout ms"); + /* * Allow devices to identify. */ diff --git a/sys/dev/firmware/arm/scmi.h b/sys/dev/firmware/arm/scmi.h index 990759237964..fc52732bd503 100644 --- a/sys/dev/firmware/arm/scmi.h +++ b/sys/dev/firmware/arm/scmi.h @@ -32,6 +32,8 @@ #ifndef _ARM64_SCMI_SCMI_H_ #define _ARM64_SCMI_SCMI_H_ +#include + #include "scmi_if.h" #define SCMI_DEF_MAX_MSG 32 @@ -64,6 +66,7 @@ struct scmi_softc { struct mtx mtx; struct scmi_transport_desc trs_desc; struct scmi_transport *trs; + struct sysctl_oid *sysctl_root; }; struct scmi_msg { From nobody Mon Jun 9 19:32:50 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGMX601R1z5yNsC; Mon, 09 Jun 2025 19:32:54 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGMX548s6z3g52; Mon, 09 Jun 2025 19:32:53 +0000 (UTC) (envelope-from bz@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749497573; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=7K5HYQWLzLd0wDGd/xHtjB37eLSjVivKtHOV4k8uHjA=; b=b+QS8TY8RVRjpEvLe+ZRRg11/CSiZF78t2IAJuBkHfrOwJdW3u80hJNPRSv0fFf3eYtJbg AJ4iFXePjl4vrgRS+K9NV71QUg5R9qIBCiRwCFOEo0R0bEDTdokbTIwjEGHkK2lhsN5SV7 5lamJtLJ85UXf8/zHVQYosUDbfqb493dkfCBdXT0h5Hgm96iEbLTBJPLji8agpud3+pnOh gtvqOLydkWxOU3jri6ltVZi4ABqTM1cU1g6LyHAzhOSrtBTHlOafNBbFGfLUvb6nhlK493 hXT9dwLs2eMbzEIualgIYElfJFjunak/e+qE1+ZiBIHZmqqA9Y3limNMmDq1Lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749497573; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=7K5HYQWLzLd0wDGd/xHtjB37eLSjVivKtHOV4k8uHjA=; b=jBx8ZT3NmTCIjLmFiTkSbOVE4YVMCf7DiR1BuMDcQf0x5BmnthkgAx0hr3qcoyS/tWxVWK O05fzti7EuP59mQSwl28IqtzhB5/BKbxhmFq4B7wyL+C5zAuasvl3xX952hEcRFzlw9T4o xXDtjoRMU2TUhlf6VysoB6N4/1xilYoXhZaEQ6+VKijPp5qfyUDEiybVuokpnBLhL3rqwQ L+AwTfX5LF4QR2tFLW4gkVvnRFfR8nVYj+do/knzA/d+MClFnEIb5pQE7zq7hN6qTlL+m0 hZwy4nnYh5jy6DudD0+I7v2V1x/ovvguea5lqoOBKY+3jhgjp4QAeLuViDph4w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749497573; a=rsa-sha256; cv=none; b=uX8MoGGNsDShXmJZRUuO5mIaWDa6A6Gg6OvEZE9PT+RpPdKU1vTywWeSOAlIF0Y/wKe4I/ I7JEuxPOM/ig/CMgKHvlRkJlcx47HP6VwaCPTyLvl35nTlGwWALsbauUy2riU5DUSZUd/M seM4cLUeTs709DV+3qjnOsT6s1xKfUrQ5Ak1Q7SAB+/VlXajQKuh957W0Eh4IV4xLlzPB7 xr/z3fLZAA9AyfWkqKpGxkpNw5uJ0a8UglcG8FATv3r2uZMubHBlTG+8ElSBkYM12YRH/O FPiazQ4uZAGkvSn+rBfHcu133+mU9uPYh6ws2vy+F5mMK6HzCkaniNUIv4u+hw== Received: from mx-01.divo.sbone.de (mx-01.divo.sbone.de [IPv6:2003:a:140a:2200:6:594:fffe:19]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature ECDSA (prime256v1) client-digest SHA256) (Client CN "mx-01.divo.sbone.de", Issuer "E5" (verified OK)) (Authenticated sender: bz/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bGMX531xxz1Kx1; Mon, 09 Jun 2025 19:32:53 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mx-01.divo.sbone.de (Postfix) with ESMTPS id 4EDD5A64805; Mon, 09 Jun 2025 19:32:50 +0000 (UTC) Received: from content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 8E9BA2D029E0; Mon, 9 Jun 2025 19:32:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) by content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (amavisd-new, port 10024) with ESMTP id wgqxwm_351mR; Mon, 9 Jun 2025 19:32:50 +0000 (UTC) Received: from strong-rtwn0.sbone.de (strong-rtwn0.sbone.de [IPv6:fde9:577b:c1a9:4902:3e64:cfff:fe55:bc80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 4DB5B2D029D8; Mon, 9 Jun 2025 19:32:50 +0000 (UTC) Date: Mon, 9 Jun 2025 19:32:50 +0000 (UTC) From: "Bjoern A. Zeeb" To: Christos Margiolis cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: e1bbaa71d62c - main - sound: Implement AFMT_FLOAT support In-Reply-To: <202503301748.52UHmPRF060200@gitrepo.freebsd.org> Message-ID: References: <202503301748.52UHmPRF060200@gitrepo.freebsd.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed On Sun, 30 Mar 2025, Christos Margiolis wrote: > The branch main has been updated by christos: > > URL: https://cgit.FreeBSD.org/src/commit/?id=e1bbaa71d62c8681a576f9f5bedf475c7541bd35 > > commit e1bbaa71d62c8681a576f9f5bedf475c7541bd35 > Author: Christos Margiolis > AuthorDate: 2025-03-30 17:45:38 +0000 > Commit: Christos Margiolis > CommitDate: 2025-03-30 17:45:38 +0000 > > sound: Implement AFMT_FLOAT support > > Even though the OSS manual [1] advises against using AFMT_FLOAT, there > are applications that expect the sound driver to support it, and might > not work properly without it. > > This patch adds AFMT_F32_LE|BE (as well as AFMT_FLOAT for OSS > compatibility) in sys/soundcard.h and implements AFMT_F32_LE|BE <-> > AFMT_S32_LE|BE conversion functions. As a result, applications can > write/read floats to/from sound(4), but internally, because sound(4) > works with integers, we convert floating point samples to integer ones, > before doing any processing. > > The reason for encoding/decoding IEEE754s manually, instead of using > fpu_kern(9), is that fpu_kern(9) is not supported by all architectures, > and also introduces significant overhead. > > The IEEE754 encoding/decoding implementation has been written by Ariff > Abdullah [2]. > > [1] http://manuals.opensound.com/developer/AFMT_FLOAT.html > [2] https://people.freebsd.org/~ariff/utils/ieee754.c > > PR: 157050, 184380, 264973, 280612, 281390 > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > Reviewed by: emaste > Differential Revision: https://reviews.freebsd.org/D47638 > --- > sys/dev/sound/pcm/channel.c | 4 +++ > sys/dev/sound/pcm/feeder_chain.c | 2 ++ > sys/dev/sound/pcm/feeder_rate.c | 4 +++ > sys/dev/sound/pcm/feeder_volume.c | 2 ++ > sys/dev/sound/pcm/pcm.h | 67 +++++++++++++++++++++++++++++++++++++-- > sys/dev/sound/pcm/sound.h | 13 +++++--- > sys/sys/soundcard.h | 8 +++++ > tests/sys/sound/pcm_read_write.c | 6 ++++ > 8 files changed, 98 insertions(+), 8 deletions(-) > > diff --git a/sys/dev/sound/pcm/feeder_volume.c b/sys/dev/sound/pcm/feeder_volume.c > index f72c6aa7ef4f..2d35bb56ef8f 100644 > --- a/sys/dev/sound/pcm/feeder_volume.c > +++ b/sys/dev/sound/pcm/feeder_volume.c > @@ -93,6 +93,8 @@ FEEDVOLUME_DECLARE(U, 32, LE) > FEEDVOLUME_DECLARE(U, 16, BE) > FEEDVOLUME_DECLARE(U, 24, BE) > FEEDVOLUME_DECLARE(U, 32, BE) > +FEEDVOLUME_DECLARE(F, 32, LE) > +FEEDVOLUME_DECLARE(F, 32, BE) > #endif > > struct feed_volume_info { Could it be that they also need to be added to feed_volume_info_tab below? Kernel LINT builds complain that they are unused. /bz -- Bjoern A. Zeeb r15:7 From nobody Mon Jun 9 20:28:30 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGNmd235kz5yRmM; Mon, 09 Jun 2025 20:28:49 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGNmd07j3z3Jqr; Mon, 09 Jun 2025 20:28:49 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-6077dea37easo5259972a12.3; Mon, 09 Jun 2025 13:28:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1749500922; x=1750105722; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=lwFbWXmpS1ByIMXxbfNkjJd1DdVLKdwjM7QiRJ5AZNc=; b=TsyvzAXgTkGCbZyDeNoCeJ4EXtowcQZBqs3aAtPuXRxqEoEj2g5yfuev0//UKQRNmv qSiaTIjn7vFFwEleCF7cBxBwxU011BPXF6OVfEyVVy9htbF3gg1akae0zOI/g+0f98n0 wbCrqGhlJXAVlMRfGtC1QDh1pfg4lCOdZSN5xnazNTy659gq/8IGkyhYxvPbqN2XLrII mHJDCSp1YzZ5fgfN3ntrMF8lktwESCJHy0PBNZDVKJeHcAABRB3Tj14+7IkFETyFaVfC UXp7RAEAUe//wdP2YrveRZSyUK584fDs+8w8/dVwAQJslL3pvaBtuQuCEr33zP1kfj8e eihQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749500922; x=1750105722; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lwFbWXmpS1ByIMXxbfNkjJd1DdVLKdwjM7QiRJ5AZNc=; b=EBCqtWKPP85Ys6pfHSMHU2IeOMd+o2TRfZipvQM0I3xGksgPTtNPvLA6yBCRt3BG85 v5kS2jGfRMiq0Df8wanBYiX5Gw50pu1c8yIl/qT5xiHAJFlIk/EjW+sukFSjpTON1Zxv 1VzutrMp665G87SHdVJ5m9AAei1pUKBbNuNcYfp+kBiIuH+KYShOm6u6+N6c1IC1BALD lI2m1IaKmSCFkPSmu8clSVa8RlhwOyoOSnnB3mbhx0fT4iot/MOEkDIfai1V64p9lH5b bhRMyxbBL01MdML176tA0CdftIQfT0NiUkbG5LJ4a0QBtMxsFjT3euGZ7g9Nvy8TqO1M wizg== X-Forwarded-Encrypted: i=1; AJvYcCVtzrYWYmmcIQ3kOCNvvLiVzgCoYLuC1qWkAX6oDIbPSoKnUQcN1pan+DFjZHud5MC1EDg0wF49Q4Ujhkd9CTc=@freebsd.org, AJvYcCXTnC0bkA4xsF5c2EGfjEfpIplwch6EKCysKuRhozXFeDPDj9Dn+8Z1Mg1JlyOrYekW03tKwM3Srs2rxaUOBS4UInaq@freebsd.org, AJvYcCXhAaewS6WaB7OmGG/TnqcT/IPNpz/0F9WHZZdmrZZSKTMesxycMG2qkqLuwX7f4OFMARswQQ/P8GoYfSZ07UDgA3FQhYc=@freebsd.org X-Gm-Message-State: AOJu0YzFur1hUKRXhCuopkudSFb4nVF7VOnxFZ+YwYoiy+IN1tRGKbUS h3lsAQP8hLHk38bw1bmtKmQRWCRyX6HuP3LO7fGsBjOg961ge7e/AcVjdpGRQZ3AV35j7CaJntl eaBxfYdB+KJJSsG+fUI1QyfXR4XZACw9VU9orXw== X-Gm-Gg: ASbGncshMTK3NhJYJ9WO5Ox3JKE9O3oSYkpvAzR3pnYIT/cgk9ewkRkbuHfJTxP07oE +w2kUpbjSzDNRehxKR33JuIyRTgm/K4PAFFTexpwgUI/cMnyeb2ZuwPphORI66UUpeVuZVZqwIq xfVKqNlasTEa5e8lXZEQgU/EPmc77DOVqLRyK9RVI3llPTuZ4bXsvm3EeeMLHkC+tawxkPS38bl +Y= X-Google-Smtp-Source: AGHT+IGTdxVVos1hKz+5hfjcylVHUNoHJXizKXX6LWYIf4ziKnLfF8PA9+FwuVKGNCJUO6UC8OcXVxt0O/55cI2B1uY= X-Received: by 2002:a05:6402:2114:b0:607:d05f:7f14 with SMTP id 4fb4d7f45d1cf-607d05f86f2mr7326577a12.10.1749500921796; Mon, 09 Jun 2025 13:28:41 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202506091053.559ArJ8k043104@gitrepo.freebsd.org> In-Reply-To: From: Rick Macklem Date: Mon, 9 Jun 2025 13:28:30 -0700 X-Gm-Features: AX0GCFty8Fr9B2XKrnOpz57Ekuor3oAxNzYqz2bnP7_4WvB-Sw4L5-dXwk2wjIo Message-ID: Subject: Re: git: 79d0f4474653 - main - rpcbind: Ensure krpc is present. To: Konstantin Belousov Cc: =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4bGNmd07j3z3Jqr X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] On Mon, Jun 9, 2025 at 5:10=E2=80=AFAM Konstantin Belousov wrote: > > CAUTION: This email originated from outside of the University of Guelph. = Do not click links or open attachments unless you recognize the sender and = know the content is safe. If in doubt, forward suspicious emails to IThelp@= uoguelph.ca. > > On Mon, Jun 09, 2025 at 04:59:15AM -0700, Rick Macklem wrote: > > On Mon, Jun 9, 2025 at 4:49=E2=80=AFAM Konstantin Belousov wrote: > > > > > > CAUTION: This email originated from outside of the University of Guel= ph. Do not click links or open attachments unless you recognize the sender = and know the content is safe. If in doubt, forward suspicious emails to ITh= elp@uoguelph.ca. > > > > > > On Mon, Jun 09, 2025 at 10:53:19AM +0000, Dag-Erling Sm=C3=B8rgrav wr= ote: > > > > The branch main has been updated by des: > > > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D79d0f447465394fee8af= a833dbdeb1a5f3ed52c3 > > > > > > > > commit 79d0f447465394fee8afa833dbdeb1a5f3ed52c3 > > > > Author: Dag-Erling Sm=C3=B8rgrav > > > > AuthorDate: 2025-06-09 10:52:21 +0000 > > > > Commit: Dag-Erling Sm=C3=B8rgrav > > > > CommitDate: 2025-06-09 10:52:21 +0000 > > > > > > > > rpcbind: Ensure krpc is present. > > > > > > > > MFC after: 1 week > > > > Reviewed by: rmacklem, glebius > > > > Differential Revision: https://reviews.freebsd.org/D50627 > > > > --- > > > > usr.sbin/rpcbind/rpcbind.c | 35 +++++++++++++++++++++-------------= - > > > > 1 file changed, 21 insertions(+), 14 deletions(-) > > > > > > > > diff --git a/usr.sbin/rpcbind/rpcbind.c b/usr.sbin/rpcbind/rpcbind.= c > > > > index 1397a0222396..622e954f903b 100644 > > > > --- a/usr.sbin/rpcbind/rpcbind.c > > > > +++ b/usr.sbin/rpcbind/rpcbind.c > > > > @@ -39,34 +39,38 @@ > > > > * > > > > */ > > > > > > > > -#include > > > > -#include > > > > -#include > > > > -#include > > > > +#include > > > > +#include > > > > +#include > > > > #include > > > > -#include > > > > #include > > > > #include > > > > +#include > > > > +#include > > > > #include > > > > +#include > > > > + > > > > #include > > > > #include > > > > #ifdef PORTMAP > > > > #include > > > > #endif > > > > #include > > > > + > > > > #include > > > > +#include > > > > +#include > > > > #include > > > > +#include > > > > #include > > > > +#include > > > > #include > > > > #include > > > > -#include > > > > #include > > > > -#include > > > > -#include > > > > -#include > > > > -#include > > > > #include > > > > -#include > > > > +#include > > > > +#include > > > > + > > > > #include "rpcbind.h" > > > > > > > > /* Global variables */ > > > > @@ -148,12 +152,15 @@ main(int argc, char *argv[]) > > > > > > > > update_bound_sa(); > > > > > > > > + /* Ensure krpc is loaded */ > > > > + if (modfind("krpc") < 0 && kldload("krpc") < 0) > > > > + err(1, "krpc"); > > > Why does rpcbind need krpc mod? > > > I understand that today most uses of Sun RPC are coming from nfs stuf= f. > > > But it is still not the only application. E.g., NIS is still there. > > > > I asked the same thig during review. It appears that the requirement > > is based on the recent change to using RPC over netlink instead > > of a unix domain socket, done by glebius@. > > For what? > Take for instance a machine participating in NIS domain but not doing NFS= . My vague recollection (I'll admit I cannot be bothered looking at the older code) is that rpcbind would accept queries on a AF_LOCAL (unix domain) socket for local RPC processes. glebius@ does not want RPCs to be done over AF_LOCAL sockets (he would have to explain why), so he created an RPC layer in the krpc for netlink as= an alternative and converted all utilities that were doing RPCs over AF_LOCAL sockets to use it. --> Since some part of the netlink conversion is in the krpc, the krpc is n= eeded for any RPC program that wants to use netlink, as I understand it. (The other RPC utilities that used to do RPCs over AF_LOCAL are all N= FS related, so the krpc being loaded is a given.) For any more info than the above, glebius@ will have to explain it. rick From nobody Mon Jun 9 20:51:15 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGPGZ3SyWz5yTnb; Mon, 09 Jun 2025 20:51:18 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGPGZ1Hdxz3XH5; Mon, 09 Jun 2025 20:51:18 +0000 (UTC) (envelope-from glebius@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749502278; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=uKpyZk1AE7rEGWk1z6jYOcjsWbmdGjra0N/hfkloPwk=; b=qv4pW0NQero+qLhGW6YBXTGk2OOtBXzz1yA9X+ByDCwgYofQYN7EpmyRJ2Jh5SVITQOzem v89zBKuIVl6Lq31iGIH2TCRO6E7suX2wH6GEcnIGIAUOSUJirr3FwNUwms1khWqu53XEye ag5YwT4vz/Bqt4yhDPVIYTEvhCuweAYqphiL5MpXa+bsEFm/8qim6pjB+4ZCLL6ajo5kae AX/aQ+dHmRHRqgLRF/a+P7Oqx/Hkxq8AjWKPaUZlbwbuxAy9+lrJvPXWzVzXffNvg3x2VY R20WZw0p5Iu4aApLtcarqphP15aJBl6hgkW83AvtzbN4w5dJplpq821IpiuEZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749502278; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=uKpyZk1AE7rEGWk1z6jYOcjsWbmdGjra0N/hfkloPwk=; b=rp7Vm3RaXSdenYLLKTi20mw8VEhrUEIGah/S51iOGUK7CWSc4kU67yx9eYfzUD9X7gF5B7 CSsPezY6eX3fVCjqtseELZttL8y4f3eBkIpDFomAbuIKq5pyXbfxhT9cwhmbzUhAvtb+5E voE4JmYNgW8Am+XF6Ug2DZjGb1n5ceycyuncWWBOiuvyjssn2MM1mF0WLKHP+WPDzIKP+G +8zZ7ibY/mfAFz/pQrEpeX4L+NhxTh7k8owOBpsk0KNnS+D1wcpGM2YU/Vbg31LsZFREJn ba12zVJZaoH/2EQlKHKUqGlt6yVq+5z2Hn46bj1MExiuaX0HBms/xv36E/kSZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749502278; a=rsa-sha256; cv=none; b=QA8YMQUtcXFAFbuBIwuqLHcFZ12wPZNbAOovQuzGlheCIY2AL91OvlfySfzxqf20fxCjuJ +t547fvcKwtzh8KXVj/Fi9ipNc4RfDKUI2571+Ka1pt3Qf0yDaYnhHaFyiBAp4hBIGSmpw jFN30lY5wn4UvEYRg2qRHRvNfZwJ2/CAMvlj1xRdjssas736mBek0oNELtHj6gKS78+PCR XYvheMiR3ciSWoQr1KBc7oU9KONh+1LPwflYLWZKONHXwLfzu9i4wtBGzidIeyWf0KLoD2 3t2+UMLfgqXlzxKq6Yqzgfs+h4nrSvYra8CT8koQrxl41SUH9V1khfd5cGVraw== Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: glebius) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bGPGY2HbLz1MXN; Mon, 09 Jun 2025 20:51:17 +0000 (UTC) (envelope-from glebius@freebsd.org) Date: Mon, 9 Jun 2025 13:51:15 -0700 From: Gleb Smirnoff To: Rick Macklem Cc: Konstantin Belousov , Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 79d0f4474653 - main - rpcbind: Ensure krpc is present. Message-ID: References: <202506091053.559ArJ8k043104@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Mon, Jun 09, 2025 at 01:28:30PM -0700, Rick Macklem wrote: R> My vague recollection (I'll admit I cannot be bothered looking at the R> older code) R> is that rpcbind would accept queries on a AF_LOCAL (unix domain) socket for R> local RPC processes. R> R> glebius@ does not want RPCs to be done over AF_LOCAL sockets (he would R> have to explain why), so he created an RPC layer in the krpc for netlink as an R> alternative and converted all utilities that were doing RPCs over AF_LOCAL R> sockets to use it. Not exactly. I don't want kernel RPC to userland to use AF_LOCAL. A process to a process RPC of course continues to use AF_LOCAL. What would be better for rpcbind: to skip providing kernel RPC services if krpc(4) not detected at startup, or to autoload krpc? The latter makes it safe for a scenario when NFS is instantiated at a later runtime of a machine, when rpcbind already runs. The former scenario would require a restart of rpcbind. -- Gleb Smirnoff From nobody Mon Jun 9 21:06:52 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGPcY2rqYz5yVKG; Mon, 09 Jun 2025 21:06:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGPcX6n5Sz3gKc; Mon, 09 Jun 2025 21:06:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749503213; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U+6CEXMeghQwwbqJbk9VfK2Sl/244ElpqPmxDpLNdOA=; b=EO0ZKceSWqwPBYzVdyqZvgihhCjK6Qbvrzapreh8LCp4/DoTxjH9bW4LNLFM+CW+CSjb0D nDywGZUuAxAHb35BLzchKH2AoKFNlTc3D5xnHpaf67vqKusjAjOW3ig2s3t2Bi102On3Pz ri1m2mQYs0s0UCG2ThExv9RddSXpap85bdInumq/F0VYj9SyyuPBl7bqYX+bh+6wrpGtNd 3pryoPxnWW7CaK0ZJG9NEZRlOR3fTDGNAwt0xzFGUlVpm95OfQeXyS9mlshhHCbvYXbj+d jIYolgQgRJto42Dcm5pv5u/rzGY1H3Qvd8aNXFa8lX7bqOIqumeMFRJHQWI5Ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749503213; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U+6CEXMeghQwwbqJbk9VfK2Sl/244ElpqPmxDpLNdOA=; b=aV7Y7UE/q6s+or4DL9Di8qtupmzBD5fUuZsmGN3I9Q/zfEUtoyqwO5yvHJGeVFp0HNanc0 KvRvaKfyL1LdWJBF78gKPiCOtM0cdKk3QxjO2FwN8oCouJnbJAOEJMqq0X+YSOFxjHQ5tQ zmTufZdDSt6i+hwwLiXSQ4ui3cTZjJS2Gtgbt5ZwIz7DqczNl+j0OxYAXw+DnlZTZ/rA5W yPi+FTZ/lOxrdUqSgIqFOeaeHb/KyfXj7MW5nrrWYeIBKvUkcM69c/to7F8W2wUC04XHm7 Zg1pF5RuoBrnnCl0p7ZjkmUeOJd3La+VVSWi9vTKo4dbgOdryfmmIrBY3yQh4w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749503213; a=rsa-sha256; cv=none; b=TFJ+/45ID6t1QtemvIQO7axn9xM/TREDAsHMitaeIGUjTeQ5ZjO1uVC3Cs8fiwgyawWSZF woMkktBDrsS+t8Dm/9Vyl09KdGl9PnELx6JjrMb1f8ODX2jQOaM3j2aK3OcCYDF2mn17+P kP3xcDGUyAXPv62Wp2qzYaE1qk+9Lrh4OQJeV6ktA6A5ZCadGro3cnLLlFqhQf8bVN5eM4 hKtH1X7himL1ImzqWZNC7U2BDxRAC55XY4tEPWLUme8M+UGCZorhlZJBE9I7rM44Ae8arg 3pSGoZ2lx8LqLKIWCy7SEAsJGrj6SBcWr5zuMC3RMrFnQWcWZTL0SR/c5M/zmw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGPcX6Lx2z19Ff; Mon, 09 Jun 2025 21:06:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559L6qbl089727; Mon, 9 Jun 2025 21:06:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559L6qCG089724; Mon, 9 Jun 2025 21:06:52 GMT (envelope-from git) Date: Mon, 9 Jun 2025 21:06:52 GMT Message-Id: <202506092106.559L6qCG089724@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: defc181278cc - main - pf: reorganise fragment reassembly List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: defc181278cc8e04369cf439d18f1de184532a34 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=defc181278cc8e04369cf439d18f1de184532a34 commit defc181278cc8e04369cf439d18f1de184532a34 Author: Kristof Provost AuthorDate: 2025-05-29 11:27:17 +0000 Commit: Kristof Provost CommitDate: 2025-06-09 19:37:56 +0000 pf: reorganise fragment reassembly To avoid packet loss due to reuse of the 16 bit IPv4 fragment id, we need suitable data structures. Organize the pf fragments with two red-black trees. One is holding the address and protocol information and the other has only the fragment id. This will allow to drop fragemts for specific connections more aggressively. from markus@; OK sashan@ Obtained from: OpenBSD, bluhm , 09228e5ff0 Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D50723 --- sys/netpfil/pf/pf_norm.c | 169 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 114 insertions(+), 55 deletions(-) diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index ed9aed157993..45f4415d084b 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -76,21 +76,20 @@ struct pf_frent { uint16_t fe_mff; /* more fragment flag */ }; -struct pf_fragment_cmp { - struct pf_addr frc_src; - struct pf_addr frc_dst; - uint32_t frc_id; - sa_family_t frc_af; - uint8_t frc_proto; +RB_HEAD(pf_frag_tree, pf_fragment); +struct pf_frnode { + struct pf_addr fn_src; /* ip source address */ + struct pf_addr fn_dst; /* ip destination address */ + sa_family_t fn_af; /* address family */ + u_int8_t fn_proto; /* protocol for fragments in fn_tree */ + u_int32_t fn_fragments; /* number of entries in fn_tree */ + + RB_ENTRY(pf_frnode) fn_entry; + struct pf_frag_tree fn_tree; /* matching fragments, lookup by id */ }; struct pf_fragment { - struct pf_fragment_cmp fr_key; -#define fr_src fr_key.frc_src -#define fr_dst fr_key.frc_dst -#define fr_id fr_key.frc_id -#define fr_af fr_key.frc_af -#define fr_proto fr_key.frc_proto + uint32_t fr_id; /* fragment id for reassemble */ /* pointers to queue element */ struct pf_frent *fr_firstoff[PF_FRAG_ENTRY_POINTS]; @@ -102,6 +101,7 @@ struct pf_fragment { TAILQ_HEAD(pf_fragq, pf_frent) fr_queue; uint16_t fr_maxlen; /* maximum length of single fragment */ u_int16_t fr_holes; /* number of holes in the queue */ + struct pf_frnode *fr_node; /* ip src/dst/proto/af for fragments */ }; VNET_DEFINE_STATIC(struct mtx, pf_frag_mtx); @@ -114,16 +114,25 @@ VNET_DEFINE(uma_zone_t, pf_state_scrub_z); /* XXX: shared with pfsync */ VNET_DEFINE_STATIC(uma_zone_t, pf_frent_z); #define V_pf_frent_z VNET(pf_frent_z) +VNET_DEFINE_STATIC(uma_zone_t, pf_frnode_z); +#define V_pf_frnode_z VNET(pf_frnode_z) VNET_DEFINE_STATIC(uma_zone_t, pf_frag_z); #define V_pf_frag_z VNET(pf_frag_z) TAILQ_HEAD(pf_fragqueue, pf_fragment); TAILQ_HEAD(pf_cachequeue, pf_fragment); +RB_HEAD(pf_frnode_tree, pf_frnode); VNET_DEFINE_STATIC(struct pf_fragqueue, pf_fragqueue); #define V_pf_fragqueue VNET(pf_fragqueue) -RB_HEAD(pf_frag_tree, pf_fragment); VNET_DEFINE_STATIC(struct pf_frag_tree, pf_frag_tree); #define V_pf_frag_tree VNET(pf_frag_tree) +static __inline int pf_frnode_compare(struct pf_frnode *, + struct pf_frnode *); +VNET_DEFINE_STATIC(struct pf_frnode_tree, pf_frnode_tree); +#define V_pf_frnode_tree VNET(pf_frnode_tree) +RB_PROTOTYPE(pf_frnode_tree, pf_frnode, fn_entry, pf_frnode_compare); +RB_GENERATE(pf_frnode_tree, pf_frnode, fn_entry, pf_frnode_compare); + static int pf_frag_compare(struct pf_fragment *, struct pf_fragment *); static RB_PROTOTYPE(pf_frag_tree, pf_fragment, fr_entry, pf_frag_compare); @@ -134,8 +143,7 @@ static void pf_free_fragment(struct pf_fragment *); static struct pf_frent *pf_create_fragment(u_short *); static int pf_frent_holes(struct pf_frent *frent); -static struct pf_fragment *pf_find_fragment(struct pf_fragment_cmp *key, - struct pf_frag_tree *tree); +static struct pf_fragment *pf_find_fragment(struct pf_frnode *, u_int32_t); static inline int pf_frent_index(struct pf_frent *); static int pf_frent_insert(struct pf_fragment *, struct pf_frent *, struct pf_frent *); @@ -143,7 +151,7 @@ void pf_frent_remove(struct pf_fragment *, struct pf_frent *); struct pf_frent *pf_frent_previous(struct pf_fragment *, struct pf_frent *); -static struct pf_fragment *pf_fillup_fragment(struct pf_fragment_cmp *, +static struct pf_fragment *pf_fillup_fragment(struct pf_frnode *, u_int32_t, struct pf_frent *, u_short *); static struct mbuf *pf_join_fragment(struct pf_fragment *); #ifdef INET @@ -163,14 +171,13 @@ static int pf_reassemble6(struct mbuf **, #ifdef INET static void -pf_ip2key(struct ip *ip, struct pf_fragment_cmp *key) +pf_ip2key(struct ip *ip, struct pf_frnode *key) { - key->frc_src.v4 = ip->ip_src; - key->frc_dst.v4 = ip->ip_dst; - key->frc_af = AF_INET; - key->frc_proto = ip->ip_p; - key->frc_id = ip->ip_id; + key->fn_src.v4 = ip->ip_src; + key->fn_dst.v4 = ip->ip_dst; + key->fn_af = AF_INET; + key->fn_proto = ip->ip_p; } #endif /* INET */ @@ -180,6 +187,9 @@ pf_normalize_init(void) V_pf_frag_z = uma_zcreate("pf frags", sizeof(struct pf_fragment), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); + V_pf_frnode_z = uma_zcreate("pf fragment node", + sizeof(struct pf_frnode), NULL, NULL, NULL, NULL, + UMA_ALIGN_PTR, 0); V_pf_frent_z = uma_zcreate("pf frag entries", sizeof(struct pf_frent), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); V_pf_state_scrub_z = uma_zcreate("pf state scrubs", @@ -202,26 +212,36 @@ pf_normalize_cleanup(void) uma_zdestroy(V_pf_state_scrub_z); uma_zdestroy(V_pf_frent_z); + uma_zdestroy(V_pf_frnode_z); uma_zdestroy(V_pf_frag_z); mtx_destroy(&V_pf_frag_mtx); } static int -pf_frag_compare(struct pf_fragment *a, struct pf_fragment *b) +pf_frnode_compare(struct pf_frnode *a, struct pf_frnode *b) { int diff; - if ((diff = a->fr_id - b->fr_id) != 0) + if ((diff = a->fn_proto - b->fn_proto) != 0) return (diff); - if ((diff = a->fr_proto - b->fr_proto) != 0) + if ((diff = a->fn_af - b->fn_af) != 0) return (diff); - if ((diff = a->fr_af - b->fr_af) != 0) + if ((diff = pf_addr_cmp(&a->fn_src, &b->fn_src, a->fn_af)) != 0) return (diff); - if ((diff = pf_addr_cmp(&a->fr_src, &b->fr_src, a->fr_af)) != 0) + if ((diff = pf_addr_cmp(&a->fn_dst, &b->fn_dst, a->fn_af)) != 0) return (diff); - if ((diff = pf_addr_cmp(&a->fr_dst, &b->fr_dst, a->fr_af)) != 0) + return (0); +} + +static __inline int +pf_frag_compare(struct pf_fragment *a, struct pf_fragment *b) +{ + int diff; + + if ((diff = a->fr_id - b->fr_id) != 0) return (diff); + return (0); } @@ -281,10 +301,20 @@ static void pf_free_fragment(struct pf_fragment *frag) { struct pf_frent *frent; + struct pf_frnode *frnode; PF_FRAG_ASSERT(); - RB_REMOVE(pf_frag_tree, &V_pf_frag_tree, frag); + frnode = frag->fr_node; + RB_REMOVE(pf_frag_tree, &frnode->fn_tree, frag); + MPASS(frnode->fn_fragments >= 1); + frnode->fn_fragments--; + if (frnode->fn_fragments == 0) { + MPASS(RB_EMPTY(&frnode->fn_tree)); + RB_REMOVE(pf_frnode_tree, &V_pf_frnode_tree, frnode); + uma_zfree(V_pf_frnode_z, frnode); + } + TAILQ_REMOVE(&V_pf_fragqueue, frag, frag_next); /* Free all fragment entries */ @@ -299,17 +329,23 @@ pf_free_fragment(struct pf_fragment *frag) } static struct pf_fragment * -pf_find_fragment(struct pf_fragment_cmp *key, struct pf_frag_tree *tree) +pf_find_fragment(struct pf_frnode *key, uint32_t id) { - struct pf_fragment *frag; + struct pf_fragment *frag, idkey; + struct pf_frnode *frnode; PF_FRAG_ASSERT(); - frag = RB_FIND(pf_frag_tree, tree, (struct pf_fragment *)key); - if (frag != NULL) { - TAILQ_REMOVE(&V_pf_fragqueue, frag, frag_next); - TAILQ_INSERT_HEAD(&V_pf_fragqueue, frag, frag_next); - } + frnode = RB_FIND(pf_frnode_tree, &V_pf_frnode_tree, key); + if (frnode == NULL) + return (NULL); + MPASS(frnode->fn_fragments >= 1); + idkey.fr_id = id; + frag = RB_FIND(pf_frag_tree, &frnode->fn_tree, &idkey); + if (frag == NULL) + return (NULL); + TAILQ_REMOVE(&V_pf_fragqueue, frag, frag_next); + TAILQ_INSERT_HEAD(&V_pf_fragqueue, frag, frag_next); return (frag); } @@ -527,11 +563,12 @@ pf_frent_previous(struct pf_fragment *frag, struct pf_frent *frent) } static struct pf_fragment * -pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, - u_short *reason) +pf_fillup_fragment(struct pf_frnode *key, uint32_t id, + struct pf_frent *frent, u_short *reason) { struct pf_frent *after, *next, *prev; struct pf_fragment *frag; + struct pf_frnode *frnode; uint16_t total; PF_FRAG_ASSERT(); @@ -555,12 +592,12 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, goto bad_fragment; } - DPFPRINTF((key->frc_af == AF_INET ? + DPFPRINTF((key->fn_af == AF_INET ? "reass frag %d @ %d-%d\n" : "reass frag %#08x @ %d-%d\n", - key->frc_id, frent->fe_off, frent->fe_off + frent->fe_len)); + id, frent->fe_off, frent->fe_off + frent->fe_len)); /* Fully buffer all of the fragments in this fragment queue. */ - frag = pf_find_fragment(key, &V_pf_frag_tree); + frag = pf_find_fragment(key, id); /* Create a new reassembly queue for this packet. */ if (frag == NULL) { @@ -574,7 +611,22 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, } } - *(struct pf_fragment_cmp *)frag = *key; + frnode = RB_FIND(pf_frnode_tree, &V_pf_frnode_tree, key); + if (frnode == NULL) { + frnode = uma_zalloc(V_pf_frnode_z, M_NOWAIT); + if (frnode == NULL) { + pf_flush_fragments(); + frnode = uma_zalloc(V_pf_frnode_z, M_NOWAIT); + if (frnode == NULL) { + REASON_SET(reason, PFRES_MEMORY); + uma_zfree(V_pf_frag_z, frag); + goto drop_fragment; + } + } + *frnode = *key; + RB_INIT(&frnode->fn_tree); + frnode->fn_fragments = 0; + } memset(frag->fr_firstoff, 0, sizeof(frag->fr_firstoff)); memset(frag->fr_entries, 0, sizeof(frag->fr_entries)); frag->fr_timeout = time_uptime; @@ -582,7 +634,14 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, frag->fr_maxlen = frent->fe_len; frag->fr_holes = 1; - RB_INSERT(pf_frag_tree, &V_pf_frag_tree, frag); + frag->fr_id = id; + frag->fr_node = frnode; + /* RB_INSERT cannot fail as pf_find_fragment() found nothing */ + RB_INSERT(pf_frag_tree, &frnode->fn_tree, frag); + frnode->fn_fragments++; + if (frnode->fn_fragments == 1) + RB_INSERT(pf_frnode_tree, &V_pf_frnode_tree, frnode); + TAILQ_INSERT_HEAD(&V_pf_fragqueue, frag, frag_next); /* We do not have a previous fragment, cannot fail. */ @@ -592,6 +651,7 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, } KASSERT(!TAILQ_EMPTY(&frag->fr_queue), ("!TAILQ_EMPTY()->fr_queue")); + MPASS(frag->fr_node); /* Remember maximum fragment len for refragmentation. */ if (frent->fe_len > frag->fr_maxlen) @@ -627,7 +687,7 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, if (prev != NULL && prev->fe_off + prev->fe_len > frent->fe_off) { uint16_t precut; - if (frag->fr_af == AF_INET6) + if (frag->fr_node->fn_af == AF_INET6) goto free_fragment; precut = prev->fe_off + prev->fe_len - frent->fe_off; @@ -681,7 +741,7 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent, return (frag); free_ipv6_fragment: - if (frag->fr_af == AF_INET) + if (frag->fr_node->fn_af == AF_INET) goto bad_fragment; free_fragment: /* @@ -743,8 +803,8 @@ pf_reassemble(struct mbuf **m0, u_short *reason) struct pf_fragment *frag; struct m_tag *mtag; struct pf_fragment_tag *ftag; - struct pf_fragment_cmp key; - uint16_t total, hdrlen; + struct pf_frnode key; + uint16_t total, hdrlen; uint32_t frag_id; uint16_t maxlen; @@ -761,7 +821,7 @@ pf_reassemble(struct mbuf **m0, u_short *reason) pf_ip2key(ip, &key); - if ((frag = pf_fillup_fragment(&key, frent, reason)) == NULL) + if ((frag = pf_fillup_fragment(&key, ip->ip_id, frent, reason)) == NULL) return (PF_DROP); /* The mbuf is part of the fragment entry, no direct free or access */ @@ -835,7 +895,7 @@ pf_reassemble6(struct mbuf **m0, struct ip6_frag *fraghdr, struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); struct pf_frent *frent; struct pf_fragment *frag; - struct pf_fragment_cmp key; + struct pf_frnode key; struct m_tag *mtag; struct pf_fragment_tag *ftag; int off; @@ -858,14 +918,13 @@ pf_reassemble6(struct mbuf **m0, struct ip6_frag *fraghdr, frent->fe_off = ntohs(fraghdr->ip6f_offlg & IP6F_OFF_MASK); frent->fe_mff = fraghdr->ip6f_offlg & IP6F_MORE_FRAG; - key.frc_src.v6 = ip6->ip6_src; - key.frc_dst.v6 = ip6->ip6_dst; - key.frc_af = AF_INET6; + key.fn_src.v6 = ip6->ip6_src; + key.fn_dst.v6 = ip6->ip6_dst; + key.fn_af = AF_INET6; /* Only the first fragment's protocol is relevant. */ - key.frc_proto = 0; - key.frc_id = fraghdr->ip6f_ident; + key.fn_proto = 0; - if ((frag = pf_fillup_fragment(&key, frent, reason)) == NULL) { + if ((frag = pf_fillup_fragment(&key, fraghdr->ip6f_ident, frent, reason)) == NULL) { PF_FRAG_UNLOCK(); return (PF_DROP); } From nobody Mon Jun 9 21:06:53 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGPcZ1RPSz5yVH5; Mon, 09 Jun 2025 21:06:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGPcZ00xHz3gCT; Mon, 09 Jun 2025 21:06:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749503214; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=biC7GMtg9hjKDJHwWkqVy02x+YDDFV6lW1fAqIrJDTE=; b=Vmc4AakyBw56owZgOZrmmPw+jmrHpKWHjhpgEgp1nIh5MNSeMh0Z9wmZ+2ZUJbqhderfM4 MvNlop5gZlezBi0n1EWtRb4PHFQGa2vhMRTZMuIB979FTMUAR2O5e76wKTng99yMQOnmsF GGRflfxYSv9RZbFGhvgc0NtfUTxwJsyy75OZstx30WGbeEauU4cuIDpJkyO54vdw1n59z4 YwW4SlazEG4be2SFzS2g9Z++2Vw3cdOm6NS0x23rY2z4BOtqavAe9aenNV8xfs8OgHycHK 7zBztKPVikMy1VcTFft9jKS2xS3P5Y3mnsknnhU8s+wgOks1RHrFP+cX2xhu0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749503214; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=biC7GMtg9hjKDJHwWkqVy02x+YDDFV6lW1fAqIrJDTE=; b=DL43YI9GJtpB3le90mFhPbpWT5a9hZsP1d1t05Rw8+Y3n+pdEI9r0WCcsGBTSt7ZUIFDtJ fR/1BNApfQ9vfKwMIUdLEQvNuTGnzSY6rH7W3AFlmWjFsbXufLH+9HU1vQgGAGG9FKHs2K Rxqgy0mZSzmhGLRnmy0QS5fABZNRmO9z+EgHgm8elV7LYPThDWcnhRKXElFHPegrMri5bB OGf8btE0ukEnN8vpur9Nq0fJp+nVETiOiCmqWutoJ91hy8ZmtTx0scxHj4g4seKHYwXLar c1cpppzQ3kTai2QYeU/GTWS3gx2kwl40cXTpqgaI1Z/iskxmiLHDgmy6CPk4zw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749503214; a=rsa-sha256; cv=none; b=Q6Y1XHf9c3ctQ22R6FHmj0e+EbWba4IOkJg+lLCAnaTlxUTUCueoHaLJ7IRMufOZJp5Bgq N9coKs1UbahHksRHuzNaDyjg8O/FCXoR3/2V17lWDR+S5hI4n7RETRoWWx21xs+sxY3V+v j9uaFlFB9kTzAGFi/08FVNsStLiOpGV5z/04h+og7Z7bCYs3+SLk7clTUhGu+fT6TTXnFy VuOtzeiCHwnF1whv2zCmEDk5qx1uClhQ5tVL4DEx6OzDebwxhcB0IvYs1G12Nz9KOAzEn9 YRSeQ8E4Mwn2E5gj5/ZNQFMd+ENyFcoZUSRoBkN9+HmRdeC0QVijVmRTr+KTng== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGPcY6h6Qz1BLj; Mon, 09 Jun 2025 21:06:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559L6rWB089768; Mon, 9 Jun 2025 21:06:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559L6rLY089765; Mon, 9 Jun 2025 21:06:53 GMT (envelope-from git) Date: Mon, 9 Jun 2025 21:06:53 GMT Message-Id: <202506092106.559L6rLY089765@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 4ace4ea9ca6e - main - pfctl: add option -S (no domain resolution) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4ace4ea9ca6ee18d2c449ea7a8f909fe8836eb9e Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=4ace4ea9ca6ee18d2c449ea7a8f909fe8836eb9e commit 4ace4ea9ca6ee18d2c449ea7a8f909fe8836eb9e Author: Kristof Provost AuthorDate: 2025-05-29 14:13:10 +0000 Commit: Kristof Provost CommitDate: 2025-06-09 19:38:06 +0000 pfctl: add option -S (no domain resolution) manpage wording and reminder about usage() jmc@ ok florian@ henning@ Reviewed by: ziaee (manpages) Obtained from: OpenBSD, benno , 7c8726d43b Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D50724 --- sbin/pfctl/parse.y | 19 ++++++++++--------- sbin/pfctl/pfctl.8 | 5 ++++- sbin/pfctl/pfctl.c | 7 +++++-- sbin/pfctl/pfctl.h | 2 +- sbin/pfctl/pfctl_parser.c | 15 +++++++++------ sbin/pfctl/pfctl_parser.h | 37 +++++++++++++++++++------------------ sbin/pfctl/pfctl_radix.c | 4 ++-- sbin/pfctl/pfctl_table.c | 18 +++++++++--------- 8 files changed, 59 insertions(+), 48 deletions(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 3ddf391810c6..1b137eecfa47 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -364,7 +364,7 @@ int rule_consistent(struct pfctl_rule *, int); int filter_consistent(struct pfctl_rule *, int); int nat_consistent(struct pfctl_rule *); int rdr_consistent(struct pfctl_rule *); -int process_tabledef(char *, struct table_opts *); +int process_tabledef(char *, struct table_opts *, int); void expand_label_str(char *, size_t, const char *, const char *); void expand_label_if(const char *, char *, size_t, const char *); void expand_label_addr(const char *, char *, size_t, sa_family_t, @@ -1746,7 +1746,7 @@ tabledef : TABLE '<' STRING '>' table_opts { YYERROR; } if (pf->loadopt & PFCTL_FLAG_TABLE) - if (process_tabledef($3, &$5)) { + if (process_tabledef($3, &$5, pf->opts)) { free($3); YYERROR; } @@ -3007,7 +3007,7 @@ filter_opt : USER uids { } | DIVERTTO STRING PORT portplain { #ifndef __FreeBSD__ - if ((filter_opts.divert.addr = host($2)) == NULL) { + if ((filter_opts.divert.addr = host($2, pf->opts)) == NULL) { yyerror("could not parse divert address: %s", $2); free($2); @@ -3719,7 +3719,7 @@ xhost : not host { ; host : STRING { - if (($$ = host($1)) == NULL) { + if (($$ = host($1, pf->opts)) == NULL) { /* error. "any" is handled elsewhere */ free($1); yyerror("could not parse host specification"); @@ -3731,7 +3731,8 @@ host : STRING { | STRING '-' STRING { struct node_host *b, *e; - if ((b = host($1)) == NULL || (e = host($3)) == NULL) { + if ((b = host($1, pf->opts)) == NULL || + (e = host($3, pf->opts)) == NULL) { free($1); free($3); yyerror("could not parse host specification"); @@ -3767,7 +3768,7 @@ host : STRING { if (asprintf(&buf, "%s/%lld", $1, (long long)$3) == -1) err(1, "host: asprintf"); free($1); - if (($$ = host(buf)) == NULL) { + if (($$ = host(buf, pf->opts)) == NULL) { /* error. "any" is handled elsewhere */ free(buf); yyerror("could not parse host specification"); @@ -3785,7 +3786,7 @@ host : STRING { if (asprintf(&buf, "%lld/%lld", $1, $3) == -1) #endif err(1, "host: asprintf"); - if (($$ = host(buf)) == NULL) { + if (($$ = host(buf, pf->opts)) == NULL) { /* error. "any" is handled elsewhere */ free(buf); yyerror("could not parse host specification"); @@ -5494,7 +5495,7 @@ rdr_consistent(struct pfctl_rule *r) } int -process_tabledef(char *name, struct table_opts *opts) +process_tabledef(char *name, struct table_opts *opts, int popts) { struct pfr_buffer ab; struct node_tinit *ti; @@ -5505,7 +5506,7 @@ process_tabledef(char *name, struct table_opts *opts) ab.pfrb_type = PFRB_ADDRS; SIMPLEQ_FOREACH(ti, &opts->init_nodes, entries) { if (ti->file) - if (pfr_buf_load(&ab, ti->file, 0, append_addr)) { + if (pfr_buf_load(&ab, ti->file, 0, append_addr, popts)) { if (errno) yyerror("cannot load \"%s\": %s", ti->file, strerror(errno)); diff --git a/sbin/pfctl/pfctl.8 b/sbin/pfctl/pfctl.8 index acf1bacee08f..0a4b8952ef74 100644 --- a/sbin/pfctl/pfctl.8 +++ b/sbin/pfctl/pfctl.8 @@ -24,7 +24,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd May 9, 2025 +.Dd May 29, 2025 .Dt PFCTL 8 .Os .Sh NAME @@ -527,6 +527,9 @@ address mapping failed .It translate no free ports in translation port range .El +.It Fl S +Do not perform domain name resolution. +If a name cannot be resolved without DNS, an error will be reported. .It Fl T Ar command Op Ar address ... Specify the .Ar command diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index 32b957cbc889..cd4e2ae82aae 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -258,7 +258,7 @@ usage(void) extern char *__progname; fprintf(stderr, -"usage: %s [-AdeghMmNnOPqRrvz] [-a anchor] [-D macro=value] [-F modifier]\n" +"usage: %s [-AdeghMmNnOPqRSrvz] [-a anchor] [-D macro=value] [-F modifier]\n" "\t[-f file] [-i interface] [-K host | network]\n" "\t[-k host | network | gateway | label | id] [-o level] [-p device]\n" "\t[-s modifier] [-t table -T command [address ...]] [-x level]\n", @@ -3035,7 +3035,7 @@ main(int argc, char *argv[]) usage(); while ((ch = getopt(argc, argv, - "a:AdD:eqf:F:ghi:k:K:mMnNOo:Pp:rRs:t:T:vx:z")) != -1) { + "a:AdD:eqf:F:ghi:k:K:mMnNOo:Pp:rRs:St:T:vx:z")) != -1) { switch (ch) { case 'a': anchoropt = optarg; @@ -3137,6 +3137,9 @@ main(int argc, char *argv[]) usage(); } break; + case 'S': + opts |= PF_OPT_NODNS; + break; case 't': tableopt = optarg; break; diff --git a/sbin/pfctl/pfctl.h b/sbin/pfctl/pfctl.h index 7df56499ea16..f4a033971865 100644 --- a/sbin/pfctl/pfctl.h +++ b/sbin/pfctl/pfctl.h @@ -75,7 +75,7 @@ int pfr_buf_add(struct pfr_buffer *, const void *); void *pfr_buf_next(struct pfr_buffer *, const void *); int pfr_buf_grow(struct pfr_buffer *, int); int pfr_buf_load(struct pfr_buffer *, char *, int, - int (*)(struct pfr_buffer *, char *, int)); + int (*)(struct pfr_buffer *, char *, int, int), int); char *pfr_strerror(int); int pfi_get_ifaces(const char *, struct pfi_kif *, int *); int pfi_clr_istats(const char *, int *, int); diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index d814b5f200e1..2d88c6d00605 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -77,7 +77,7 @@ int ifa_skip_if(const char *filter, struct node_host *p); struct node_host *host_if(const char *, int, int *); struct node_host *host_v4(const char *, int); struct node_host *host_v6(const char *, int); -struct node_host *host_dns(const char *, int, int); +struct node_host *host_dns(const char *, int, int, int); const char * const tcpflags = "FSRPAUEWe"; @@ -1801,7 +1801,7 @@ ifa_skip_if(const char *filter, struct node_host *p) struct node_host * -host(const char *s) +host(const char *s, int opts) { struct node_host *h = NULL; int mask, v4mask, v6mask, cont = 1; @@ -1839,7 +1839,8 @@ host(const char *s) cont = 0; /* dns lookup */ - if (cont && (h = host_dns(ps, v4mask, v6mask)) != NULL) + if (cont && (h = host_dns(ps, v4mask, v6mask, + (opts & PF_OPT_NODNS))) != NULL) cont = 0; free(ps); @@ -1957,7 +1958,7 @@ host_v6(const char *s, int mask) } struct node_host * -host_dns(const char *s, int v4mask, int v6mask) +host_dns(const char *s, int v4mask, int v6mask, int numeric) { struct addrinfo hints, *res0, *res; struct node_host *n, *h = NULL; @@ -1974,6 +1975,8 @@ host_dns(const char *s, int v4mask, int v6mask) memset(&hints, 0, sizeof(hints)); hints.ai_family = PF_UNSPEC; hints.ai_socktype = SOCK_STREAM; /* DUMMY */ + if (numeric) + hints.ai_flags = AI_NUMERICHOST; error = getaddrinfo(ps, NULL, &hints, &res0); if (error) { free(ps); @@ -2037,7 +2040,7 @@ host_dns(const char *s, int v4mask, int v6mask) * if set to 1, only simple addresses are accepted (no netblock, no "!"). */ int -append_addr(struct pfr_buffer *b, char *s, int test) +append_addr(struct pfr_buffer *b, char *s, int test, int opts) { char *r; struct node_host *h, *n; @@ -2045,7 +2048,7 @@ append_addr(struct pfr_buffer *b, char *s, int test) for (r = s; *r == '!'; r++) not = !not; - if ((n = host(r)) == NULL) { + if ((n = host(r, opts)) == NULL) { errno = 0; return (-1); } diff --git a/sbin/pfctl/pfctl_parser.h b/sbin/pfctl/pfctl_parser.h index 7ab872c6ee41..718c05b306b2 100644 --- a/sbin/pfctl/pfctl_parser.h +++ b/sbin/pfctl/pfctl_parser.h @@ -38,22 +38,23 @@ #define PF_OSFP_FILE "/etc/pf.os" -#define PF_OPT_DISABLE 0x0001 -#define PF_OPT_ENABLE 0x0002 -#define PF_OPT_VERBOSE 0x0004 -#define PF_OPT_NOACTION 0x0008 -#define PF_OPT_QUIET 0x0010 -#define PF_OPT_CLRRULECTRS 0x0020 -#define PF_OPT_USEDNS 0x0040 -#define PF_OPT_VERBOSE2 0x0080 -#define PF_OPT_DUMMYACTION 0x0100 -#define PF_OPT_DEBUG 0x0200 -#define PF_OPT_SHOWALL 0x0400 -#define PF_OPT_OPTIMIZE 0x0800 -#define PF_OPT_NUMERIC 0x1000 -#define PF_OPT_MERGE 0x2000 -#define PF_OPT_RECURSE 0x4000 -#define PF_OPT_KILLMATCH 0x8000 +#define PF_OPT_DISABLE 0x00001 +#define PF_OPT_ENABLE 0x00002 +#define PF_OPT_VERBOSE 0x00004 +#define PF_OPT_NOACTION 0x00008 +#define PF_OPT_QUIET 0x00010 +#define PF_OPT_CLRRULECTRS 0x00020 +#define PF_OPT_USEDNS 0x00040 +#define PF_OPT_VERBOSE2 0x00080 +#define PF_OPT_DUMMYACTION 0x00100 +#define PF_OPT_DEBUG 0x00200 +#define PF_OPT_SHOWALL 0x00400 +#define PF_OPT_OPTIMIZE 0x00800 +#define PF_OPT_NUMERIC 0x01000 +#define PF_OPT_MERGE 0x02000 +#define PF_OPT_RECURSE 0x04000 +#define PF_OPT_KILLMATCH 0x08000 +#define PF_OPT_NODNS 0x10000 #define PF_NAT_PROXY_PORT_LOW 50001 #define PF_NAT_PROXY_PORT_HIGH 65535 @@ -370,9 +371,9 @@ int get_query_socket(void); struct node_host *ifa_exists(char *); struct node_host *ifa_grouplookup(char *ifa_name, int flags); struct node_host *ifa_lookup(char *, int); -struct node_host *host(const char *); +struct node_host *host(const char *, int); -int append_addr(struct pfr_buffer *, char *, int); +int append_addr(struct pfr_buffer *, char *, int, int); int append_addr_host(struct pfr_buffer *, struct node_host *, int, int); diff --git a/sbin/pfctl/pfctl_radix.c b/sbin/pfctl/pfctl_radix.c index 9739b0f238e1..21191259adff 100644 --- a/sbin/pfctl/pfctl_radix.c +++ b/sbin/pfctl/pfctl_radix.c @@ -400,7 +400,7 @@ pfr_buf_clear(struct pfr_buffer *b) int pfr_buf_load(struct pfr_buffer *b, char *file, int nonetwork, - int (*append_addr)(struct pfr_buffer *, char *, int)) + int (*append_addr)(struct pfr_buffer *, char *, int, int), int opts) { FILE *fp; char buf[BUF_SIZE]; @@ -416,7 +416,7 @@ pfr_buf_load(struct pfr_buffer *b, char *file, int nonetwork, return (-1); } while ((rv = pfr_next_token(buf, fp)) == 1) - if (append_addr(b, buf, nonetwork)) { + if (append_addr(b, buf, nonetwork, opts)) { rv = -1; break; } diff --git a/sbin/pfctl/pfctl_table.c b/sbin/pfctl/pfctl_table.c index f23a62f518e1..3fe87b53b7f9 100644 --- a/sbin/pfctl/pfctl_table.c +++ b/sbin/pfctl/pfctl_table.c @@ -59,7 +59,7 @@ static int pfctl_table(int, char *[], char *, const char *, char *, const char *, int); static void print_table(const struct pfr_table *, int, int); static int print_tstats(const struct pfr_tstats *, int); -static int load_addr(struct pfr_buffer *, int, char *[], char *, int); +static int load_addr(struct pfr_buffer *, int, char *[], char *, int, int); static void print_addrx(struct pfr_addr *, struct pfr_addr *, int); static int nonzero_astats(struct pfr_astats *); static void print_astats(struct pfr_astats *, int); @@ -204,7 +204,7 @@ pfctl_table(int argc, char *argv[], char *tname, const char *command, xprintf(opts, "%d addresses deleted", ndel); } else if (!strcmp(command, "add")) { b.pfrb_type = PFRB_ADDRS; - if (load_addr(&b, argc, argv, file, 0)) + if (load_addr(&b, argc, argv, file, 0, opts)) goto _error; CREATE_TABLE; if (opts & PF_OPT_VERBOSE) @@ -219,7 +219,7 @@ pfctl_table(int argc, char *argv[], char *tname, const char *command, opts & PF_OPT_USEDNS); } else if (!strcmp(command, "delete")) { b.pfrb_type = PFRB_ADDRS; - if (load_addr(&b, argc, argv, file, 0)) + if (load_addr(&b, argc, argv, file, 0, opts)) goto _error; if (opts & PF_OPT_VERBOSE) flags |= PFR_FLAG_FEEDBACK; @@ -233,7 +233,7 @@ pfctl_table(int argc, char *argv[], char *tname, const char *command, opts & PF_OPT_USEDNS); } else if (!strcmp(command, "replace")) { b.pfrb_type = PFRB_ADDRS; - if (load_addr(&b, argc, argv, file, 0)) + if (load_addr(&b, argc, argv, file, 0, opts)) goto _error; CREATE_TABLE; if (opts & PF_OPT_VERBOSE) @@ -356,7 +356,7 @@ pfctl_table(int argc, char *argv[], char *tname, const char *command, b.pfrb_type = PFRB_ADDRS; b2.pfrb_type = PFRB_ADDRS; - if (load_addr(&b, argc, argv, file, 1)) + if (load_addr(&b, argc, argv, file, 1, opts)) goto _error; if (opts & PF_OPT_VERBOSE2) { flags |= PFR_FLAG_REPLACE; @@ -383,7 +383,7 @@ pfctl_table(int argc, char *argv[], char *tname, const char *command, rv = 2; } else if (!strcmp(command, "zero") && (argc || file != NULL)) { b.pfrb_type = PFRB_ADDRS; - if (load_addr(&b, argc, argv, file, 0)) + if (load_addr(&b, argc, argv, file, 0, opts)) goto _error; if (opts & PF_OPT_VERBOSE) flags |= PFR_FLAG_FEEDBACK; @@ -463,15 +463,15 @@ print_tstats(const struct pfr_tstats *ts, int debug) int load_addr(struct pfr_buffer *b, int argc, char *argv[], char *file, - int nonetwork) + int nonetwork, int opts) { while (argc--) - if (append_addr(b, *argv++, nonetwork)) { + if (append_addr(b, *argv++, nonetwork, opts)) { if (errno) warn("cannot decode %s", argv[-1]); return (-1); } - if (pfr_buf_load(b, file, nonetwork, append_addr)) { + if (pfr_buf_load(b, file, nonetwork, append_addr, opts)) { warn("cannot load %s", file); return (-1); } From nobody Mon Jun 9 21:06:55 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGPcb3Pw6z5yVgK; Mon, 09 Jun 2025 21:06:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGPcb1gyQz3gHg; Mon, 09 Jun 2025 21:06:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749503215; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FrDkNESrXzvgGAwXChEMQylEaeHoWsrxXRaKlg3zYdQ=; b=AjQoG5aCS8SW9yLn9sT9ng7avKfSq6IbByhviWnAUjrMKYgSomR0j8UlIzOvQXcDVajqAE XhaE+WZxqKBpUBSMo1I1UPvq4CxnV3JmFtUNidk1cEdfykrtmOTHJEYBi2f03yY7b71LVT iYcbNoXC+V7Yafso77X8HXN8ivdUR2Y5T5INZDD1+OqNrbLgHTFffGbpxxbael8vajnGOh qtP/YRBoaHiuZPvXav+o8flXL/Ym1laAH04bECqxJkvJNt68pPwf6A+5V1Q7hMcT5Cnn/0 /VfxEyhnsnpm7jS7bTpSNDRMJy+S5LDlpRuz5M/04HsGYJrpDfR9Z4xV2CnJfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749503215; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FrDkNESrXzvgGAwXChEMQylEaeHoWsrxXRaKlg3zYdQ=; b=J22OC7w0uVS0sNVOq+mYEOGL27K99sbEZNbLhoQlDXIR0tRdT+2aX898wHYWVWR09BPgSn /b2aTyB4d3VwRMtd/5ls1lEoWEUwBEwuPhnvWxKVJYLbxfiLUQgBqBaVPDImmquV+LVcb2 M+YhFAuya44/M+2fW2TXSgeXQRAMioa0T7vCrqLfv2PDDyM1fU45YDX8K7JG7fw7XThJUO tooYg/HTHdvCgOkCbT9ruk9mPa6o2DlJ3L7Pp9T8y1FRAAkilQSkfmjiPzR0gXr6o147Eo yhBF+/dETSTPq1i6M1MYZNhCZ8uiHhjYLwSH2oXFrZ4GUiRW5p7a83Um6HrhRA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749503215; a=rsa-sha256; cv=none; b=aPmn/s9hrvNvpE7r/slYKXplLyrYu7Agf0u99plQIwjBf8mvMLl6f0hXAsStZc+h2g1lZV XRiqWUgLH8yL/cRTHlrmi+1Gpp685thNfDpqiM+W+cqlSAYUz0C65VXI07CsD8XiPbjwZ1 SaQBOpT9GqoaavQlnBaNpxHD8ZAJSAyHIMvBnaanewooBqq2euwprMyZiDCqTEPqIAixbw NrFtFM5VR04fx/FBk+Lc6/LY/EUGD+I7kWSCnsBwjwIle320teG5EtCuojJLbo+ZJyI0bT 2svhbDCs76oOLXyy9HGeRiLMT5jrSgeP78mzBEeBQe0BeRBrBJ2oPZv67KdFSw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGPcb0rdLz1BJH; Mon, 09 Jun 2025 21:06:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559L6tXi089803; Mon, 9 Jun 2025 21:06:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559L6tKd089800; Mon, 9 Jun 2025 21:06:55 GMT (envelope-from git) Date: Mon, 9 Jun 2025 21:06:55 GMT Message-Id: <202506092106.559L6tKd089800@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 54a547fcb47c - main - pf: split pf_find_or_create_ruleset() into smaller chunks List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 54a547fcb47c9fce54789a8b091e900b291fd1ba Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=54a547fcb47c9fce54789a8b091e900b291fd1ba commit 54a547fcb47c9fce54789a8b091e900b291fd1ba Author: Kristof Provost AuthorDate: 2025-05-30 13:02:50 +0000 Commit: Kristof Provost CommitDate: 2025-06-09 19:38:47 +0000 pf: split pf_find_or_create_ruleset() into smaller chunks tested by Hrvoje OK mpi@, OK bluhm@ Obtained from: OpenBSD, sashan , 0d5abfc5ba Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D50725 --- sys/net/pfvar.h | 2 + sys/netpfil/pf/pf.h | 1 + sys/netpfil/pf/pf_ruleset.c | 178 ++++++++++++++++++++++++++++---------------- 3 files changed, 117 insertions(+), 64 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 6209a93dd995..65debf53e5ff 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -2664,6 +2664,8 @@ int pf_kanchor_nvcopyout(const struct pf_kruleset *, void pf_kanchor_remove(struct pf_krule *); void pf_remove_if_empty_kruleset(struct pf_kruleset *); struct pf_kruleset *pf_find_kruleset(const char *); +struct pf_kruleset *pf_get_leaf_kruleset(char *, char **); +struct pf_kanchor *pf_create_kanchor(struct pf_kanchor *, const char *); struct pf_kruleset *pf_find_or_create_kruleset(const char *); void pf_rs_initialize(void); diff --git a/sys/netpfil/pf/pf.h b/sys/netpfil/pf/pf.h index b5c0eeaa8f01..2009d2907985 100644 --- a/sys/netpfil/pf/pf.h +++ b/sys/netpfil/pf/pf.h @@ -489,6 +489,7 @@ struct pf_osfp_ioctl { }; #define PF_ANCHOR_NAME_SIZE 64 +#define PF_ANCHOR_MAXPATH (MAXPATHLEN - PF_ANCHOR_NAME_SIZE - 1) struct pf_rule { struct pf_rule_addr src; diff --git a/sys/netpfil/pf/pf_ruleset.c b/sys/netpfil/pf/pf_ruleset.c index 6fd92201439d..865c5ecd72d9 100644 --- a/sys/netpfil/pf/pf_ruleset.c +++ b/sys/netpfil/pf/pf_ruleset.c @@ -189,13 +189,108 @@ pf_find_kruleset(const char *path) else return (&anchor->ruleset); } +struct pf_kruleset * +pf_get_leaf_kruleset(char *path, char **path_remainder) +{ + struct pf_kruleset *ruleset; + char *leaf, *p; + int i = 0; + + p = path; + while (*p == '/') + p++; + + ruleset = pf_find_kruleset(p); + leaf = p; + while (ruleset == NULL) { + leaf = strrchr(p, '/'); + if (leaf != NULL) { + *leaf = '\0'; + i++; + ruleset = pf_find_kruleset(p); + } else { + leaf = path; + /* + * if no path component exists, then main ruleset is + * our parent. + */ + ruleset = &pf_main_ruleset; + } + } + + if (path_remainder != NULL) + *path_remainder = leaf; + + /* restore slashes in path. */ + while (i != 0) { + while (*leaf != '\0') + leaf++; + *leaf = '/'; + i--; + } + + return (ruleset); +} + +struct pf_kanchor * +pf_create_kanchor(struct pf_kanchor *parent, const char *aname) +{ + struct pf_kanchor *anchor, *dup; + + if (!*aname || (strlen(aname) >= PF_ANCHOR_NAME_SIZE) || + ((parent != NULL) && (strlen(parent->path) >= PF_ANCHOR_MAXPATH))) + return (NULL); + + anchor = rs_malloc(sizeof(*anchor)); + if (anchor == NULL) + return (NULL); + + RB_INIT(&anchor->children); + strlcpy(anchor->name, aname, sizeof(anchor->name)); + if (parent != NULL) { + /* + * Make sure path for levels 2, 3, ... is terminated by '/': + * 1/2/3/... + */ + strlcpy(anchor->path, parent->path, sizeof(anchor->path)); + strlcat(anchor->path, "/", sizeof(anchor->path)); + } + strlcat(anchor->path, anchor->name, sizeof(anchor->path)); + + if ((dup = RB_INSERT(pf_kanchor_global, &V_pf_anchors, anchor)) != + NULL) { + printf("pf_find_or_create_ruleset: RB_INSERT1 " + "'%s' '%s' collides with '%s' '%s'\n", + anchor->path, anchor->name, dup->path, dup->name); + rs_free(anchor); + return (NULL); + } + + if (parent != NULL) { + anchor->parent = parent; + if ((dup = RB_INSERT(pf_kanchor_node, &parent->children, + anchor)) != NULL) { + printf("pf_find_or_create_ruleset: " + "RB_INSERT2 '%s' '%s' collides with " + "'%s' '%s'\n", anchor->path, anchor->name, + dup->path, dup->name); + RB_REMOVE(pf_kanchor_global, &V_pf_anchors, + anchor); + rs_free(anchor); + return (NULL); + } + } + pf_init_kruleset(&anchor->ruleset); + anchor->ruleset.anchor = anchor; + return (anchor); +} struct pf_kruleset * pf_find_or_create_kruleset(const char *path) { - char *p, *q, *r; + char *p, *aname, *r; struct pf_kruleset *ruleset; - struct pf_kanchor *anchor = NULL, *dup, *parent = NULL; + struct pf_kanchor *anchor = NULL; if (path[0] == 0) return (&pf_main_ruleset); @@ -208,76 +303,31 @@ pf_find_or_create_kruleset(const char *path) if (p == NULL) return (NULL); strlcpy(p, path, MAXPATHLEN); - while (parent == NULL && (q = strrchr(p, '/')) != NULL) { - *q = 0; - if ((ruleset = pf_find_kruleset(p)) != NULL) { - parent = ruleset->anchor; - break; - } - } - if (q == NULL) - q = p; - else - q++; - strlcpy(p, path, MAXPATHLEN); - if (!*q) { - rs_free(p); - return (NULL); - } - while ((r = strchr(q, '/')) != NULL || *q) { + + ruleset = pf_get_leaf_kruleset(p, &aname); + anchor = ruleset->anchor; + + while (*aname == '/') + aname++; + /* + * aname is a path remainder, which contains nodes we must create. We + * process the aname path from left to right, effectively descending + * from parents to children. + */ + while ((r = strchr(aname, '/')) != NULL || *aname) { if (r != NULL) *r = 0; - if (!*q || strlen(q) >= PF_ANCHOR_NAME_SIZE || - (parent != NULL && strlen(parent->path) >= - MAXPATHLEN - PF_ANCHOR_NAME_SIZE - 1)) { - rs_free(p); - return (NULL); - } - anchor = (struct pf_kanchor *)rs_malloc(sizeof(*anchor)); + anchor = pf_create_kanchor(anchor, aname); if (anchor == NULL) { rs_free(p); return (NULL); } - RB_INIT(&anchor->children); - strlcpy(anchor->name, q, sizeof(anchor->name)); - if (parent != NULL) { - strlcpy(anchor->path, parent->path, - sizeof(anchor->path)); - strlcat(anchor->path, "/", sizeof(anchor->path)); - } - strlcat(anchor->path, anchor->name, sizeof(anchor->path)); - if ((dup = RB_INSERT(pf_kanchor_global, &V_pf_anchors, anchor)) != - NULL) { - printf("pf_find_or_create_ruleset: RB_INSERT1 " - "'%s' '%s' collides with '%s' '%s'\n", - anchor->path, anchor->name, dup->path, dup->name); - rs_free(anchor); - rs_free(p); - return (NULL); - } - if (parent != NULL) { - anchor->parent = parent; - if ((dup = RB_INSERT(pf_kanchor_node, &parent->children, - anchor)) != NULL) { - printf("pf_find_or_create_ruleset: " - "RB_INSERT2 '%s' '%s' collides with " - "'%s' '%s'\n", anchor->path, anchor->name, - dup->path, dup->name); - RB_REMOVE(pf_kanchor_global, &V_pf_anchors, - anchor); - rs_free(anchor); - rs_free(p); - return (NULL); - } - } - pf_init_kruleset(&anchor->ruleset); - anchor->ruleset.anchor = anchor; - parent = anchor; - if (r != NULL) - q = r + 1; + if (r == NULL) + break; else - *q = 0; + aname = r + 1; } + rs_free(p); return (&anchor->ruleset); } From nobody Mon Jun 9 21:06:56 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGPcc68sdz5yVQ8; Mon, 09 Jun 2025 21:06:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGPcc47YMz3gQB; Mon, 09 Jun 2025 21:06:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749503216; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9W5QQTLWE5KfeNCJsygmd/p49ZyQqQIDeU1TeQleugk=; b=LgdZ/jx8QiqvydCmI2CjvJ316e/ciS0nr4+ymyRx6ocxlcA+unuBPgng8NLxRJHISXBdw0 LNYd9NMgpZcxoSZOWZMnjNgQMTlCy7unilewlHxOSFtcAriBiD4eB+C+F2mAFLdAvSAADm 1m9Rp4I4bzhMQod9xKFFs8XRUkkb1cUHjEluxQBnQaUAFlFIVz1dE/Tn+W6e2DGHjtpz11 /a8Bk8EImAq2kpoNSj0KZN5nbIOLBHl1qLkwaEgE1uUm/hQh6GyA3K8PNEo4ToaG2uofFA w9ZzC+FuiBC54ccIQwyDe36mBsJKk6tJ5elRbAzyKcOagLSSfoZF8XUGhorgdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749503216; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9W5QQTLWE5KfeNCJsygmd/p49ZyQqQIDeU1TeQleugk=; b=ystyLHxOYY+riqfH3FEqO0fWQVXrT0xtnc167Rzf1nUljJCOaTnySrhB5PqJn56UYfWNje WsthMM1zZoXCtPiiuxQfDtNFLUc5VwDSBlGa2YOFCCaN9GLBr0hiZM5VQnZUSsGqWDbIlZ cQ9ob9eSvDkmdGJmzzDYCsDbAM4o7u5F7C4In8ESECllXYRBKJl/sKdTeHqsH+iahVtnaC cacKoSMI/r8PfllSq5KuSA9SibM3cQhciqFJ3Ef1NWtx0SqX38+bARR0sGYKFo88LOInLS pYKCPwNCatPbX8+y3i+KRV7at2rku9G9X9NtXjy5Tt5pPXz23wzkwkMnY/oVBg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749503216; a=rsa-sha256; cv=none; b=tqp2++lDkx0/DWvqQD/F9SrO3Lbph/ydikRIa8ba35nKXf8UaWq5wPfl87AEYo868MGYGK YoiHQ09yBJVEAIQ86rjKdq8cRjMhyQiuejkhgxGpMBqa5F/t8sPm4gGffhbpa/GBHN57d7 AlqKqGHDKLqBw/tM+qSt2mYe1ViDvJvPfFyXq7gSFyXJoNg75WlU9Q4WwAbRG+v2Srgg+E Qfxo4SND5PNUzRFQAVxdluLFCzJ7R2piXhkp32n8EKA/FNjusoxiS55c6Z63h/2f052uw6 AdylK68F3Z4HCFGuSXxKiqm+iZn8N0nVHWpn1XbPDqBGQizT7qo6UcQBej91Tw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGPcc1X7cz19yc; Mon, 09 Jun 2025 21:06:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559L6ulQ089838; Mon, 9 Jun 2025 21:06:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559L6uNf089835; Mon, 9 Jun 2025 21:06:56 GMT (envelope-from git) Date: Mon, 9 Jun 2025 21:06:56 GMT Message-Id: <202506092106.559L6uNf089835@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: ecc175e984d9 - main - pf tests: killstate:key requires scapy List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ecc175e984d90599983b40993927e7b11d232711 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=ecc175e984d90599983b40993927e7b11d232711 commit ecc175e984d90599983b40993927e7b11d232711 Author: Kristof Provost AuthorDate: 2025-06-09 13:21:45 +0000 Commit: Kristof Provost CommitDate: 2025-06-09 19:38:54 +0000 pf tests: killstate:key requires scapy Mark it as such so we skip rather than fail if scapy is not installed. Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netpfil/pf/killstate.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/sys/netpfil/pf/killstate.sh b/tests/sys/netpfil/pf/killstate.sh index 59db93276d58..447a4e388f11 100644 --- a/tests/sys/netpfil/pf/killstate.sh +++ b/tests/sys/netpfil/pf/killstate.sh @@ -579,6 +579,7 @@ key_head() { atf_set descr 'Test killing states by their key' atf_set require.user root + atf_set require.progs python3 scapy } key_body() From nobody Mon Jun 9 21:06:57 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGPcf2zMLz5yVST; Mon, 09 Jun 2025 21:06:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGPcd48sRz3g8X; Mon, 09 Jun 2025 21:06:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749503217; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hhFHFMTz2HQeFNTLVOp3IfE+ViGb+kstiqVbFZ94tc4=; b=wTOFIFk5NZ8itEde3ioVy1Bc0lnkGGN4Fp1NGZGxFBJxqfrG0hC4+FKttD1IqIYEgRiCa9 APb/7oDfO9yMwG0NK/VLrFcJDwn6Tko2PibMn6CQ5Q0qoiVNBT93uNyDV7dUsg8aWt40Jf MXigCQQu/Bb3+nUJlInalfKqxiKDFEsvytyJAlLgo/KIQ+LDw6jHhuCwtOIu28vo3iEEpg 0aobOJ8z9ryB5E3sGI4xh7a61lTDlu6faC1G/tDp8fSj/E8HXDo4CbP3mRoVvK5UXOvLNL +ETZDyixD7FrlX6+ZkLKqy/JqJBVA4nU63Wfax2EM7yrMlOy8HpsUfo3fEdvJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749503217; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hhFHFMTz2HQeFNTLVOp3IfE+ViGb+kstiqVbFZ94tc4=; b=oTMQAJyYCalFGoi06yG8CyTMu5j4ws/QIrb4jgPjOzGmy8uMl2CzaxGPk7jR0q4AWjxXqt 9nn4A3JlsR/ykZMo5VslcVO9BORXAmRrZ1zFKrmzsQ6Ua1Ycnsyu14XLGrCP7D4pvzfkQt Hhe53BnBKZMo0q9gcjZljkVwbASNKcte2ASIidWHTp9+ZfaXEtbDlYQWN5haBbhuGG8Qpg pRe6aIsL0+lHmKaVYno/lL/kctQkOHHFqAHl8TqIHOK5XCLWNG35BxZjrl3OYeZQ5DuQHP q6d1dcjGH8k0onCyNS6UDr4o2z8rGq9g94SLEXNrBWTqNjHHUMMPCI5bokN2yw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749503217; a=rsa-sha256; cv=none; b=SKSMuMFzp1qstoZ3Aig681h1Nj2zIM7gwfHHWX9eRpedrg/TU/aVcKgk6QXTT5eOg5Gujn fEytq1r/4S6k5u3CpOG/MZ2PvLY+xgeG8dyvfYpEEjxWRS1fhtcfG4bR+/d+Gttqu8bsXa cqJ698Ttz3gpZ1boXnvXouF8hN+q00dJj7H1k87HjOawwnZj6qCW4qlEcWhVxB7S4oWhUU xLOmqtvJ+Ej6+cz/CwB10pBuZazF01EWOSl9UjSNXxruM4ZbDLJt/J9IFblGuNXXHDH6wo lLx4PY+ghJzEQvPzLVRG8cSvvUnWqddoLXSq5hN+VqnyUdWkADBlgRnhtQu8mQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGPcd2mPgz1BFy; Mon, 09 Jun 2025 21:06:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559L6vCu089873; Mon, 9 Jun 2025 21:06:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559L6vKZ089870; Mon, 9 Jun 2025 21:06:57 GMT (envelope-from git) Date: Mon, 9 Jun 2025 21:06:57 GMT Message-Id: <202506092106.559L6vKZ089870@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: f96f838114a2 - main - pf tests: frag6.py:TestFrag6_RouteTo::test_too_big requires scapy List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f96f838114a223c0399d23240555099586fbf97a Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=f96f838114a223c0399d23240555099586fbf97a commit f96f838114a223c0399d23240555099586fbf97a Author: Kristof Provost AuthorDate: 2025-06-09 13:23:11 +0000 Commit: Kristof Provost CommitDate: 2025-06-09 19:38:54 +0000 pf tests: frag6.py:TestFrag6_RouteTo::test_too_big requires scapy Mark it as such so we skip rather than fail if scapy is not installed. Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netpfil/pf/frag6.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/sys/netpfil/pf/frag6.py b/tests/sys/netpfil/pf/frag6.py index c8b756f8274b..26ae7af7c90c 100644 --- a/tests/sys/netpfil/pf/frag6.py +++ b/tests/sys/netpfil/pf/frag6.py @@ -244,6 +244,8 @@ class TestFrag6_RouteTo(VnetTestTemplate): def vnet3_handler(self, vnet): pass + @pytest.mark.require_user("root") + @pytest.mark.require_progs(["scapy"]) def test_too_big(self): ToolsHelper.print_output("/sbin/route add -6 default 2001:db8::2") From nobody Mon Jun 9 21:44:59 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGQSX1z4Zz5yXTs; Mon, 09 Jun 2025 21: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGQSW6c3mz4H3P; Mon, 09 Jun 2025 21: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=1749505499; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xsy0m75Lz5WqmRoUCvgq2GVZK604LHQMxYtpZy2/r+M=; b=w+v1tt7wtg3OPFK838KetRlFLtIcw2l3BQ/LJAd7PhDlvL5MiJIQni/N5ZRjEO2KKdTXBx Rwt/T2/B4xMbtzsJXFI7Z/fvCZhQ3qfcY77wpi1sd0K4iNLy7BdOQhieyJ/J5TAAomN5Cp RSU7wbrwDhjCSxk1GG7z41trIS9NZEsDyy8xuRLuj+LgWAJ6jYxP+TSQr5xuVjCumIxamf Frr0qbqBmMnPxF6Dfl762JIswgdLVYZYgbw7MViK5Ew4h4EJpuz/8kuS90b1e4RfZJXuD+ rjkfdBcR17qA1bQL6FfG2KhPl3iEfRP0/Y/xVTstkEEKY0MM1ghaRWOcXeOWFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749505499; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xsy0m75Lz5WqmRoUCvgq2GVZK604LHQMxYtpZy2/r+M=; b=Jf3dESsYW6/B+vCiHeDMp1F2tDvGbd/zKgVSYsYruWulFlrP3lTQSvij2IgGBBUC7zL7Hd Np3TeVtWue3yx+GwKtUQh4a3xy3RzP6qO7a3oUznoLI3Nue8g4kPQ6R7hy68QrpXMVaTyw wCJGDvav/fqaoULeQUF3ZDYLVh0xCoN0bvlLbC5UMA/pOsKF0Nh1vmSZJB8gCdoEtO9j+O 18tOOLQp9bZGck2mrYDFawRAHvadNGJrY69AVWN9a8RcmdBXMnNKdarhLvTho0b67bQi0f mA1kOnn6fLV9+IJTngSX/s1/TmGXyQthKSGOIYXpkBLSoj2Wki+xiKOFXv2z/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749505499; a=rsa-sha256; cv=none; b=SS3LWenf3APRU/DH5OoMS9edvEuha4A03O1uEUrL9ZFKqZX9AEs2pGRU+UsdE3xUM0CP0R bD4NbxQdg+cKqeqOte1VWiDz8q4vyLTQqrlSeJLAzp8XKSk/gzgGazmCvve0Wm9PEKNn3r Cz0khvvJDncgT3yzLorm0yEXt+5PJbjox+j4Utll7ijCJicIte3U5/6uP7pchElFFOZ8em Zqyhwvyn7csuUkgnrj2AhI++lTqIfe0X476LLsiilNf/RpTM3MESWBfSYKZlxHLtbabEsc FwgjtM9jr+GxbMTlX9N3u515PbZ9vL4vujJfVDkfCj+gQZI95VR4gfXZB1SSzg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGQSW6Bslz1BmX; Mon, 09 Jun 2025 21:44:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559LixNu062820; Mon, 9 Jun 2025 21:44:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559LixJ5062817; Mon, 9 Jun 2025 21:44:59 GMT (envelope-from git) Date: Mon, 9 Jun 2025 21:44:59 GMT Message-Id: <202506092144.559LixJ5062817@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 54ad06cad10c - main - ifconfig: 802.11: also print IEEE80211_CIPHER_AES_GCM_128 information List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 54ad06cad10c3822784389b0956f92a1c7041abd Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=54ad06cad10c3822784389b0956f92a1c7041abd commit 54ad06cad10c3822784389b0956f92a1c7041abd Author: Bjoern A. Zeeb AuthorDate: 2025-05-27 19:38:18 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-09 21:44:25 +0000 ifconfig: 802.11: also print IEEE80211_CIPHER_AES_GCM_128 information While we currently do not print the STA unicast key (PTK) we will not see this but it is for fullness and in preparations for follow-up hanges. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D50553 --- sbin/ifconfig/ifieee80211.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c index 1a9f0450a253..0236bb5802e7 100644 --- a/sbin/ifconfig/ifieee80211.c +++ b/sbin/ifconfig/ifieee80211.c @@ -4757,6 +4757,9 @@ printcipher(int s, struct ieee80211req *ireq, int keylenop) case IEEE80211_CIPHER_AES_CCM: printf("AES-CCM"); break; + case IEEE80211_CIPHER_AES_GCM_128: + printf("AES-GCM"); + break; case IEEE80211_CIPHER_CKIP: printf("CKIP"); break; @@ -4801,6 +4804,9 @@ printkey(if_ctx *ctx, const struct ieee80211req_key *ik) case IEEE80211_CIPHER_AES_CCM: LINE_CHECK("AES-CCM %u:%u-bit", ik->ik_keyix+1, 8*keylen); break; + case IEEE80211_CIPHER_AES_GCM_128: + LINE_CHECK("AES-GCM %u:%u-bit", ik->ik_keyix+1, 8*keylen); + break; case IEEE80211_CIPHER_CKIP: LINE_CHECK("CKIP %u:%u-bit", ik->ik_keyix+1, 8*keylen); break; From nobody Mon Jun 9 21:45:00 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGQSY3lDdz5yXZN; Mon, 09 Jun 2025 21: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGQSY11Ydz4H3T; Mon, 09 Jun 2025 21: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=1749505501; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HZ3JA08SPkdPl1yRLM9MaV3WLpW5G+RWt3IcG0LCo3A=; b=kJ46JcQBdjrd41Iieak4i7gW6EnnGafiz2ACksyIWWPTA9BtoV/4o6w5CTadRXo+MXvvWZ IjPPCxxzQ4pbIXJP1nAqEU1Vn6/0h5gCXyl7U9Z2M/6CFwawYhS/wabCHsFBa0PlNqmM9L ZvvDyGlPpU4WwHqteQ74bLjKpHbkGHZK0H0gIEOaDSD97gKHmIUz33L+0X5dQ86b2O0Pih W2Gym2GcZN2YyGe2ztTI2qeG+UXHpRSo0b2EDZdqIgRsOI+8Im+Rsp3dB6chGbKS7B2JU3 eYnfSt2egBFAYIlhLkH4R1k4RkQKZff7mCBnmvXHkpNTeSocI60payF6GNhC7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749505501; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HZ3JA08SPkdPl1yRLM9MaV3WLpW5G+RWt3IcG0LCo3A=; b=CaByobFMBB039OuhdChPiW9jwBfAsoUD5yfAzkwCiiJ0klm5ipDfJYeqCEWKpncrrwclbE tG98S6nYhNVSlTkLy39MljCR1WvJUpqBjQL3EwT7VTncjPRAI6UZWGcxKoSEa5iBzEpX4V +J3cp62aVmXDJU+YPo5qqx+Z3Cq0hZGLxaMNh/iYx0TP4HYjeCtKs6g6mQNd/FaJLWXvZ+ 16DQuGIpPRLwQYw0KoMHuvE8GvmJXErVoJXUCP8FFFlZM50rncemBF9VZtduHqVAfjMgeY JqBhZ1VvPKBZ6Iz5eC12rvOel9sd2f60yYRgULHq7f+D80HjPuUuDyoaFOLYEw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749505501; a=rsa-sha256; cv=none; b=FzQY207OCWs73UjPC0SWNwY813flX3SSPyarPxDG01h+TT8gTSdyrxs8IhCctosXeH2V27 VM9LfXgZ95hHFH0ceDctYxSKDFBRKirkVgC/kgDRbqMVZcXT34wFgJZs3lOJuQFl+v3kpY 3Q+khbdKyEUtZySVCL4hx4TjQGBZmA+SpUYEVgICyHsWScWRRw7Jz1tNtGqY+5M38iJqrd P2AvALe4S80LsMnI/VTlRJYYOHTG873XD1StGytdK7Z2OGHwJzH9PNtwZ0h0D1cqUsKAvs YMXycvCZyC8NEFHHsZDVjXE1li6apRS2O4KfFY61CyIMi+DgFeGf/DnBqIv+uw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGQSY01Gtz1Bq5; Mon, 09 Jun 2025 21:45:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559Lj0mD062877; Mon, 9 Jun 2025 21:45:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559Lj00K062874; Mon, 9 Jun 2025 21:45:00 GMT (envelope-from git) Date: Mon, 9 Jun 2025 21:45:00 GMT Message-Id: <202506092145.559Lj00K062874@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: e277735ce059 - main - ifconfig: 802.11: print node unicast key (PTK) if available in STA mode List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e277735ce05911aaee336cd61ec3a12435f46d8d Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=e277735ce05911aaee336cd61ec3a12435f46d8d commit e277735ce05911aaee336cd61ec3a12435f46d8d Author: Bjoern A. Zeeb AuthorDate: 2025-05-27 19:44:42 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-09 21:44:25 +0000 ifconfig: 802.11: print node unicast key (PTK) if available in STA mode Add a variable when querying the BSSID so we can later use it rather than losing the "data" buffer. When printing key information also query the node unicast key if in STA mode (the key for the BSSID). Do not error in case we fail. This is helpful for debugging mostly; was also useful when testing GCMP support. Sponsored by: The FreeBSD Foundation MFC after; 3 days Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D50554 --- sbin/ifconfig/ifieee80211.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c index 0236bb5802e7..9ece44960378 100644 --- a/sbin/ifconfig/ifieee80211.c +++ b/sbin/ifconfig/ifieee80211.c @@ -4898,6 +4898,7 @@ ieee80211_status(if_ctx *ctx) { int s = ctx->io_s; static const uint8_t zerobssid[IEEE80211_ADDR_LEN]; + uint8_t bssid[IEEE80211_ADDR_LEN]; enum ieee80211_opmode opmode = get80211opmode(ctx); int i, num, wpa, wme, bgscan, bgscaninterval, val, len, wepmode; uint8_t data[32]; @@ -4948,10 +4949,10 @@ ieee80211_status(if_ctx *ctx) } else if (verbose) printf(" channel UNDEF"); - if (get80211(ctx, IEEE80211_IOC_BSSID, data, IEEE80211_ADDR_LEN) >= 0 && - (memcmp(data, zerobssid, sizeof(zerobssid)) != 0 || verbose)) { - printf(" bssid %s", ether_ntoa((struct ether_addr *)data)); - printbssidname((struct ether_addr *)data); + if (get80211(ctx, IEEE80211_IOC_BSSID, bssid, IEEE80211_ADDR_LEN) >= 0 && + (memcmp(bssid, zerobssid, sizeof(zerobssid)) != 0 || verbose)) { + printf(" bssid %s", ether_ntoa((struct ether_addr *)bssid)); + printbssidname((struct ether_addr *)bssid); } if (get80211len(ctx, IEEE80211_IOC_STATIONNAME, data, sizeof(data), &len) != -1) { @@ -5107,6 +5108,21 @@ ieee80211_status(if_ctx *ctx) printkey(ctx, &ik); } } + if (opmode == IEEE80211_M_STA && wpa >= 2) { + struct ieee80211req_key ik; + int error; + + memset(&ik, 0, sizeof(ik)); + ik.ik_keyix = IEEE80211_KEYIX_NONE; + memcpy(ik.ik_macaddr, bssid, sizeof(ik.ik_macaddr)); + error = get80211(ctx, IEEE80211_IOC_WPAKEY, &ik, sizeof(ik)); + if (error == 0 && ik.ik_keylen != 0) { + if (verbose) + LINE_BREAK(); + printkey(ctx, &ik); + i++; + } + } if (i > 0 && verbose) LINE_BREAK(); end: From nobody Mon Jun 9 21:45:01 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGQSZ3fWrz5yXZP; Mon, 09 Jun 2025 21:45:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGQSZ17Kxz4H1D; Mon, 09 Jun 2025 21: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=1749505502; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U5/NdxzQWJ1BeAtMPmNx7JVDBBUgCwI8W5wfEqiFJag=; b=p/MWcJNmbjwTBcQGYL/9mMOx+ihVlqMm5G90HwIcGCnc8tSofe0EwpFlWs8Z+CleYLMd51 Hb0FF9sQ7EAQp9LKyro94pTvG4TdxvlwDTk87gZFE2HC4LYpogXH9+REDvz1C7+eKQrFL1 ECcaH+fyN3PhdTqft5jw7CqnKMUlMSGehMoBzNxjP27V49Y7IrDQryA/Gj9eFr8AHLPKEv 1qUfAQzDdvm/tn/BQdtLTMNetTa1s4undn7RYcKfP9qiby4ln612JVmXLOLCJmjfE/wRy8 nR8hVLvl0hiZQS4HTRV/wavEY34aAELsYinT4uiETDqMaq1Vn2dQOhTRWkOj3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749505502; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U5/NdxzQWJ1BeAtMPmNx7JVDBBUgCwI8W5wfEqiFJag=; b=wgUwZZqdlkEdds4Ps2PkqvkKgdYkE0TfU40BPjVl51s1CSpotWAV7lkZIAt9blGJzahE50 ycjGXCfEWTs4U5M+lK93kZZtTRCnBXFT1W0PaNMSmfM1GHAZf+NtR+A9jiLEc/G0Pl4OI5 9t3DiKk2Mzgzy20QWiXQzqAVDl459Xng2i2EyhCYztjw1esw06oDsD87gLJl3f6OlSQ777 H5Lrbrde2uJyhM2gaaXTLlzhRoTaE53tOhn/32srDEF7U7SoXdYd+g9prChvyXvQ0NrPPY cTvESS1p5uW2ivf4iKpuW6mnvh7DddRlXEonndEjBQN4VOlP43vKqs198ual3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749505502; a=rsa-sha256; cv=none; b=nVGHNVT/KG0WIo4yYjjaxuLn8A4n8lwB5oMhKy0cOV7A7dQ241lztBjrdliKWgBMIXNtDg YNV+/Ig1xBrGBZQ/isfapanV2Lrf3CTZ47VZgwhdfEXJ03Mx1am0hbTZ8/XsdIuS+qV6w8 bY47bP3lkYCygaiDPQ2IEDJNo3cofHBCgCik78b8PUbI35YlzfG1drsr2SkDmN/as4nXir xa9t8fvqvxJ0knpnZ3yeuLCjo8a4tnQ3H9otidZKAZdmVze4oZywhNV5bflfo79fka8131 3uNNUfeS9Vk8Hn++yguUq22yoNyFYtahmi1kk6scpgjVd1DSuZc3lGlNN9tskg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGQSZ0fXZz1C9N; Mon, 09 Jun 2025 21:45:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559Lj1rD062914; Mon, 9 Jun 2025 21:45:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559Lj1Jw062911; Mon, 9 Jun 2025 21:45:01 GMT (envelope-from git) Date: Mon, 9 Jun 2025 21:45:01 GMT Message-Id: <202506092145.559Lj1Jw062911@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 164bf9ffbe1a - main - ifconfig: 802.11: factor out keyix printing List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 164bf9ffbe1a9fc8768b2f597fd4b32b3e406ac1 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=164bf9ffbe1a9fc8768b2f597fd4b32b3e406ac1 commit 164bf9ffbe1a9fc8768b2f597fd4b32b3e406ac1 Author: Bjoern A. Zeeb AuthorDate: 2025-05-27 19:51:38 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-09 21:44:25 +0000 ifconfig: 802.11: factor out keyix printing The node unicast key (PTK) uses a key index of (-1) and printing a 64k number does not look great. Factor out printing the key number into a buffer and use 'ucast' for the node unicast key. Hope is that this will be useful for the future as well when we will have more/different keys possibly. Looks like (with -vk): AES-CCM 2:128-bit rsc 0 tsc 0 rx AES-CCM 3:128-bit rsc 0 tsc 0 rx AES-GCM ucast:128-bit rsc 0 tsc 0 tx+rx Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D50555 --- sbin/ifconfig/ifieee80211.c | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c index 9ece44960378..d08b5c861c76 100644 --- a/sbin/ifconfig/ifieee80211.c +++ b/sbin/ifconfig/ifieee80211.c @@ -4773,6 +4773,17 @@ printcipher(int s, struct ieee80211req *ireq, int keylenop) } #endif +static void +printkey_index(uint16_t keyix, char *buf, size_t buflen) +{ + buf[0] = '\0'; + if (keyix == IEEE80211_KEYIX_NONE) { + snprintf(buf, buflen, "ucast"); + } else { + snprintf(buf, buflen, "%u", keyix+1); + } +} + static void printkey(if_ctx *ctx, const struct ieee80211req_key *ik) { @@ -4781,41 +4792,43 @@ printkey(if_ctx *ctx, const struct ieee80211req_key *ik) int printcontents; const int verbose = ctx->args->verbose; const bool printkeys = ctx->args->printkeys; + char keyix[16]; printcontents = printkeys && (memcmp(ik->ik_keydata, zerodata, keylen) != 0 || verbose); if (printcontents) LINE_BREAK(); + printkey_index(ik->ik_keyix, keyix, sizeof(keyix)); switch (ik->ik_type) { case IEEE80211_CIPHER_WEP: /* compatibility */ - LINE_CHECK("wepkey %u:%s", ik->ik_keyix+1, + LINE_CHECK("wepkey %s:%s", keyix, keylen <= 5 ? "40-bit" : keylen <= 13 ? "104-bit" : "128-bit"); break; case IEEE80211_CIPHER_TKIP: if (keylen > 128/8) keylen -= 128/8; /* ignore MIC for now */ - LINE_CHECK("TKIP %u:%u-bit", ik->ik_keyix+1, 8*keylen); + LINE_CHECK("TKIP %s:%u-bit", keyix, 8*keylen); break; case IEEE80211_CIPHER_AES_OCB: - LINE_CHECK("AES-OCB %u:%u-bit", ik->ik_keyix+1, 8*keylen); + LINE_CHECK("AES-OCB %s:%u-bit", keyix, 8*keylen); break; case IEEE80211_CIPHER_AES_CCM: - LINE_CHECK("AES-CCM %u:%u-bit", ik->ik_keyix+1, 8*keylen); + LINE_CHECK("AES-CCM %s:%u-bit", keyix, 8*keylen); break; case IEEE80211_CIPHER_AES_GCM_128: - LINE_CHECK("AES-GCM %u:%u-bit", ik->ik_keyix+1, 8*keylen); + LINE_CHECK("AES-GCM %s:%u-bit", keyix, 8*keylen); break; case IEEE80211_CIPHER_CKIP: - LINE_CHECK("CKIP %u:%u-bit", ik->ik_keyix+1, 8*keylen); + LINE_CHECK("CKIP %s:%u-bit", keyix, 8*keylen); break; case IEEE80211_CIPHER_NONE: - LINE_CHECK("NULL %u:%u-bit", ik->ik_keyix+1, 8*keylen); + LINE_CHECK("NULL %s:%u-bit", keyix, 8*keylen); break; default: - LINE_CHECK("UNKNOWN (0x%x) %u:%u-bit", - ik->ik_type, ik->ik_keyix+1, 8*keylen); + LINE_CHECK("UNKNOWN (0x%x) %s:%u-bit", + ik->ik_type, keyix, 8*keylen); break; } if (printcontents) { From nobody Mon Jun 9 21:45:03 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGQSb4FHMz5yXP2; Mon, 09 Jun 2025 21: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGQSb2H7Yz4H9n; Mon, 09 Jun 2025 21: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=1749505503; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1eSsdTGw4CcyqQVHCC5S0g4UvqX/zzyiMbl+bewBFKg=; b=J3zGqe2xuONFJbL8+1jY/aR3Ddh3N3E7jrKvhEFqskk7hYKhNjBTrE85n7BGR5XQIpjAsL fQcnz4kE3duJlxeo7UBY8weF3l4ttDOQA77u3RxfK2XcG2Qsymxg4ivgZQUfYmCe0ENtk6 VxjlpbwRM5tXnN60tw5h+gXz63glON7fibKk4jjVBaltfrLb396kdQlypFtSK0odhcVgYV 2fV3NHN6D1YxVsWYCzkVQ4XtNYbp9LBBj/Oesnq6ktprP7guTXXAInYs62CIMoibpivNbr 0yv67XJO3mn4kCW7kzpPc9mNOAdwCdPeamFgh3twjsnkkz32TjT7ZUnI6pOVJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749505503; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1eSsdTGw4CcyqQVHCC5S0g4UvqX/zzyiMbl+bewBFKg=; b=UsXUUFldRwNAbX2Cpen+FiQcB7OT2a7snKY0w/zvcgsar2FnwsNt+3kmUAsWbAMK6umKIY DkMRjU0nZE408OS9Sxx4GG01IXwcibMcW8WE25nzZ/9sGIOY5an6HhTV8Rh1QFzjG3MAEG z9l3RzFH0EA08qdNgGqHtWt5euWz1p64DddjYSCej5SfdSYqi4z2n+aew+al33pASEY0r3 UGCJ/mViTnCInwORK1QeENkk0hG34p7zp89oiqeyrvdkdoR/F6Lru0f0sFl8FHnTG0exmO BlMhtNqbrsM5K5ZmWxzky0sPXXVmUyK6mFfsqHr9LkUwGpwTvcPw2fEPzJw3DA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749505503; a=rsa-sha256; cv=none; b=wOqdpHtvcgCkFCJhbNrM3dAQU6VEVXjVKyNAb0a5W2WHy5u1ujf7oRt+1xtpygUOGD+3ds k43DZoqPIJAytTRjLThqwtszI7xx7nvsJ5or19dvcznyVTmhKdlpQO1ka9nwcLpH51Pk8e TS/Ogmq9VvrbwJqtaJNi0orRALwk+obsrdehhfxofrYe8er74qc/gKRXHMXNT0M2BbLDFM gDHQYHwmqLAIkfo/efWv4bMVlXelGashuNoranuzBMBVYeyuljfX4fzzIXnxbRedJ886rM 4LrcMtO/haz9/4REXTOD/OKaqObJWvNpE91/lGCm1gr6MSZSoluAvmTqYiZs3Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGQSb1DLCz1BLG; Mon, 09 Jun 2025 21:45:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559Lj3F3062956; Mon, 9 Jun 2025 21:45:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559Lj3fF062953; Mon, 9 Jun 2025 21:45:03 GMT (envelope-from git) Date: Mon, 9 Jun 2025 21:45:03 GMT Message-Id: <202506092145.559Lj3fF062953@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 1313f1c2a35f - main - ifconfig: 802.11: decode RSNXE IE List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1313f1c2a35f7dbaba1b2948d2f0c4a1f4113f67 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=1313f1c2a35f7dbaba1b2948d2f0c4a1f4113f67 commit 1313f1c2a35f7dbaba1b2948d2f0c4a1f4113f67 Author: Bjoern A. Zeeb AuthorDate: 2025-04-22 20:08:20 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-09 21:44:25 +0000 ifconfig: 802.11: decode RSNXE IE Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D50675 --- sbin/ifconfig/ifieee80211.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c index d08b5c861c76..2f79f2e92e60 100644 --- a/sbin/ifconfig/ifieee80211.c +++ b/sbin/ifconfig/ifieee80211.c @@ -3212,6 +3212,33 @@ printrsnie(if_ctx *ctx, const char *tag, const u_int8_t *ie, size_t ielen) } } +static void +printrsnxe(if_ctx *ctx, const char *tag, const u_int8_t *ie, size_t ielen) +{ + size_t n; + + printf("%s", tag); + if (!ctx->args->verbose) + return; + + ie += 2, ielen -= 2; + + n = (*ie & 0x0f); + printf("<%zu", n + 1); + + /* We do not yet know about more than n=1 (0). */ + if (n != 0) + goto end; + + if (*ie & 0x10) + printf(" PTWTOPS"); + if (*ie & 0x20) + printf(" SAE h-t-e"); + +end: + printf(">"); +} + #define BE_READ_2(p) \ ((u_int16_t) \ ((((const u_int8_t *)(p))[1] ) | \ @@ -3620,6 +3647,7 @@ iename(int elemid) case IEEE80211_ELEMID_TPC: return " TPC"; case IEEE80211_ELEMID_CCKM: return " CCKM"; case IEEE80211_ELEMID_EXTCAP: return " EXTCAP"; + case IEEE80211_ELEMID_RSN_EXT: return " RSNXE"; } snprintf(iename_buf, sizeof(iename_buf), " UNKNOWN_ELEMID_%d", elemid); @@ -3703,6 +3731,9 @@ printies(if_ctx *ctx, const u_int8_t *vp, int ielen, unsigned int maxcols) case IEEE80211_ELEMID_APCHANREP: printapchanrep(ctx, " APCHANREP", vp, 2+vp[1]); break; + case IEEE80211_ELEMID_RSN_EXT: + printrsnxe(ctx, " RSNXE", vp, 2+vp[1]); + break; default: if (verbose) printie(ctx, iename(vp[0]), vp, 2+vp[1], maxcols); From nobody Mon Jun 9 21:45:04 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGQSc4jrKz5yXTv; Mon, 09 Jun 2025 21: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGQSc1sN3z4HB1; Mon, 09 Jun 2025 21: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=1749505504; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JGLoY3bghQLqAQicLGEXP6qNTRuTbKOCS8CkEFz3Emo=; b=dSd19IzPzWLBCcM8iRnxQy0ft2o4Oa4cpTpPW05u+DT9hAhCGVvXL9rchZlzJF6t0H08EJ 6DyfD/RQV0FbnR/TagTdAdfMPDWotUS2C8XwdCwY9nC0ozJusnP0lum6zHpZz0rUi72ykr TYuSlVVKmddyWsGs26BAgwaJM7jSQGPSYPIwF4jCa0nhzNkL+MKpOniskIhse1WUoo/Rgd naMVz1MawvEf5wFVTP7+EM+8eBefCHvxCi9mfnk3QFwQvykHptRb/1PgpPdsmq09kLyhzr mi+cio0iCi0jJ8pm1AB2zqtsFQkldjSa8JzNIAU/WZ4rJzZB4E4c3S372gSJFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749505504; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JGLoY3bghQLqAQicLGEXP6qNTRuTbKOCS8CkEFz3Emo=; b=KUzKjuoEdgXk6CNnoNehi0CNI88Eej/m5EIJMNqQBmhjoCYSrYyCTb7Yj3ts/oVkIVJHJQ Eq5FMywb+DFQHD6Omsj2QvMRIWIDmevMp6+nf3C7QenSxytO4ZuFJ4a4vhSyjLzxYkWwvR wFf/FUcVtJPH3IYggoDBcKFwR156QutWOINqTf8Q1yIW1Ec2KR2yv7gEly/krsY4Hhua0O Ruu5eS5HTuxXKx4MwzMkNQMs5NiMNxuoZVzvwCZhlZwnVeUfJO20V+pTFa24isXxhbMHOa S1Vdpx7poxZrZugWRY4V+QScjrFBL2YaQ8Vs01C6/zd1huokxi7Bl1jaXXLmmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749505504; a=rsa-sha256; cv=none; b=AtSZk+cn9mrNLDM1LUz/b+flw8bfsWk0+taZ2M0E0YnllQQ9hn5d6WmdVhEW/w863scUPh hGkJpVhMYrtCnP4toDqqOcJAlGiS9Guw6qnNxbAfg1gFREOfBj+EAaD8if+QcCHFuXn+S1 sU1xrpsPR7lZZ2GRvd77dLCPxpR/8jXp06K1pIUKJPom7gbdlZou1zmXn7+sxeJugn23C1 V8nj1kmap+Gd7xkjwApRdEjkGW2GLYlKJ7kplz7mJNXgjqQbi3z9016yav2ADPnAoV+D+u iUcJJ793M8UABnylyb9yFkhS+F4kYRvD6cwLwoHKH7q9ymxe7HJhsmTdMzK9Fw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGQSc1SmLz1C9P; Mon, 09 Jun 2025 21:45:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559Lj41w062996; Mon, 9 Jun 2025 21:45:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559Lj4Cw062993; Mon, 9 Jun 2025 21:45:04 GMT (envelope-from git) Date: Mon, 9 Jun 2025 21:45:04 GMT Message-Id: <202506092145.559Lj4Cw062993@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 8be200cf968f - main - net80211: LinuxKPI: migrate HE IE structs from LinuxKPI to net80211 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8be200cf968f0c7f72f75c8a73d7b2bee43f935d Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=8be200cf968f0c7f72f75c8a73d7b2bee43f935d commit 8be200cf968f0c7f72f75c8a73d7b2bee43f935d Author: Bjoern A. Zeeb AuthorDate: 2025-06-02 15:58:49 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-09 21:44:25 +0000 net80211: LinuxKPI: migrate HE IE structs from LinuxKPI to net80211 Take the HE IE structures as they are used by drivers and put them into net80211 rather than LinuxKPI. There is little need to re-invent the wheel on those. They settled for long enough. Do not export them by default to user space as some also overlap with wpa and we still do not have a clear distinction for what is available only in kernel and what to user space. In our case ifconfig(8) is a consumer of these structs which it can setting WANT_NET80211 like we have done for some VHT bits before. Add struct net80211_he_cap which holds the IE fields but also a bool and is meant to be put into ic/vap/ni. The bool will give us the same naming for all layers rather than having individual flags in each part which was highly confusing. In theory this struct should be in ieee80211_var.h but that would pull things apart. Extend struct ieee80211_mu_edca_param_set by a union as it will help ifconfig(8) parsing the bk/be/vi/vo parts. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D50676 --- sys/compat/linuxkpi/common/include/net/cfg80211.h | 24 +------- sys/compat/linuxkpi/common/include/net/mac80211.h | 5 -- sys/net80211/ieee80211.h | 70 +++++++++++++++++++++++ 3 files changed, 71 insertions(+), 28 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/cfg80211.h b/sys/compat/linuxkpi/common/include/net/cfg80211.h index e9af70f751d4..c806afb971e6 100644 --- a/sys/compat/linuxkpi/common/include/net/cfg80211.h +++ b/sys/compat/linuxkpi/common/include/net/cfg80211.h @@ -895,29 +895,7 @@ struct linuxkpi_ieee80211_regdomain { #define VENDOR_CMD_RAW_DATA (void *)(uintptr_t)(-ENOENT) -/* - * 802.11ax-2021, - * 9.4.2.248.2 HE MAC Capabilities Information field. - * 9.4.2.248.3 HE PHY Capabilities Information field. - */ -struct ieee80211_he_cap_elem { - u8 mac_cap_info[6]; - u8 phy_cap_info[11]; -} __packed; - -/* 802.11ax-2021, 9.4.2.248.4 Supported HE-MCS And NSS Set field. */ -struct ieee80211_he_mcs_nss_supp { - uint16_t rx_mcs_80; - uint16_t tx_mcs_80; - uint16_t rx_mcs_160; - uint16_t tx_mcs_160; - uint16_t rx_mcs_80p80; - uint16_t tx_mcs_80p80; -}; - -#define IEEE80211_HE_CAP_PPE_THRES_MAX 25 - -/* net80211::ic_ieee80211_he_cap */ +/* net80211::net80211_he_cap */ struct ieee80211_sta_he_cap { bool has_he; struct ieee80211_he_cap_elem he_cap_elem; diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index 6ce6a6384c12..af3199c38939 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -413,11 +413,6 @@ struct ieee80211_ftm_responder_params { int civicloc_len; }; -struct ieee80211_he_mu_edca_param_ac_rec { - /* TODO FIXME */ - int aifsn, ecw_min_max, mu_edca_timer; -}; - struct ieee80211_conf { int dynamic_ps_timeout; int power_level; diff --git a/sys/net80211/ieee80211.h b/sys/net80211/ieee80211.h index cca721e6b54e..c782e09a522d 100644 --- a/sys/net80211/ieee80211.h +++ b/sys/net80211/ieee80211.h @@ -28,6 +28,12 @@ #ifndef _NET80211_IEEE80211_H_ #define _NET80211_IEEE80211_H_ +#include + +#ifndef _KERNEL +#include +#endif + /* * 802.11 protocol definitions. */ @@ -1098,6 +1104,70 @@ struct ieee80211_ie_vht_txpwrenv { #define WLAN_ACTION_VHT_GROUPID_MGMT 1 #define WLAN_ACTION_VHT_OPMODE_NOTIF 2 +#if defined(_KERNEL) || defined(WANT_NET80211) +/* + * HE + */ + +/* + * 802.11ax-2021, + * 9.4.2.248.2 HE MAC Capabilities Information field. + * 9.4.2.248.3 HE PHY Capabilities Information field. + */ +struct ieee80211_he_cap_elem { + uint8_t mac_cap_info[6]; + uint8_t phy_cap_info[11]; +} __packed; + +/* 802.11ax-2021, 9.4.2.248.4 Supported HE-MCS And NSS Set field. */ +struct ieee80211_he_mcs_nss_supp { + uint16_t rx_mcs_80; + uint16_t tx_mcs_80; + uint16_t rx_mcs_160; + uint16_t tx_mcs_160; + uint16_t rx_mcs_80p80; + uint16_t tx_mcs_80p80; +} __packed; + +#define IEEE80211_HE_CAP_PPE_THRES_MAX 25 + +/* XXX this should only be internal. */ +struct net80211_he_cap { + bool has_he; + struct ieee80211_he_cap_elem he_cap_elem; + struct ieee80211_he_mcs_nss_supp he_mcs_nss_supp; + uint8_t ppe_thres[IEEE80211_HE_CAP_PPE_THRES_MAX]; +}; + +/* 802.11ax-2021, 9.4.2.249 HE Operation element. */ +struct ieee80211_he_operation { + uint32_t he_oper_params; + uint16_t he_mcs_nss_set; + uint8_t optional[0]; +} __packed; + +/* 802.11ax-2021, 9.4.2.251 MU EDCA Parameter Set element. */ +struct ieee80211_he_mu_edca_param_ac_rec { + uint8_t aifsn; + uint8_t ecw_min_max; + uint8_t mu_edca_timer; +} __packed; + +struct ieee80211_mu_edca_param_set { + uint8_t mu_qos_info; + union { + struct { + struct ieee80211_he_mu_edca_param_ac_rec ac_be; + struct ieee80211_he_mu_edca_param_ac_rec ac_bk; + struct ieee80211_he_mu_edca_param_ac_rec ac_vi; + struct ieee80211_he_mu_edca_param_ac_rec ac_vo; + }; + struct ieee80211_he_mu_edca_param_ac_rec param_ac_recs[4]; + }; +} __packed; +#endif /* _KERNEL || WANT_NET80211 */ + + /* * Management information element payloads. * From nobody Mon Jun 9 21:45:05 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGQSd5SM2z5yXP5; Mon, 09 Jun 2025 21: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGQSd2btgz4Gxv; Mon, 09 Jun 2025 21: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=1749505505; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lCsvpqWzkBNxPUdd0hi9X6CoMWYSw1dBHqQuM10Vefg=; b=iJLyuJEdsPRKqWJkNXxL7do1zzaegvG0XDEg6R3AdyBdBTR71fYFi8NE3RhsBcQL/dS9ON RCMR81NJ3rafnN186U2uLIvaKGJFJScUEWwru6EMtQ4P/SCXEMXPVm/oXHLN+jAxY2r/FP //sjAjNn0QKwncidJbZPBJuXqLE6mulLl1vdVui1WbcS1hDZGGvQjQCZBl+5R0hVkB3XII e9ilw0bxwkbhVb3A9eFrpvv67ltIZV3HjAG2kpoOKhZ4LJhbqZwqIimdOvZua4lI+JLuGE A7C41hpf+zkwjh55OCr7p40FBBx6rfWd6R+BsNSYP6MjNLlmYKST/wEPGr4KMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749505505; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lCsvpqWzkBNxPUdd0hi9X6CoMWYSw1dBHqQuM10Vefg=; b=CeG83XH3tSe/J6FuzNnBjTkKMN1NUPiS35MLjjEW9ZxPdfMC3Wa+YmuUeqqpdiQk/S15VQ i1mG4KrVnkLWuD1/OAVVAKG4+b3qySOkFnXWXN60G1EwEIx09LqtqBUqkUEnM6vdShjkjf 2M0XPwti5hpCfKbXIKfR14mr7kyNazb7hvluJGNPmsjCKbf5Azn3Zz8lyh7EHhgZcumbBD yTRWGnmIGQeOyUHk4TuqoKXi9XEG09/AUFpEc3yvaXIn2IhvebUrgk7bEwu5sxSz1Rpxc/ M/2Y21TEh6OIPE7qhfcpmNuNz/Fe3HKEliNwYAHe8Vv1vbOYqhP861xWxBgwpg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749505505; a=rsa-sha256; cv=none; b=Iex+qq4G6Q+yWLRBYbFzC1yO11LVhES2GBNQVy8QGlNLXIW/Zaospo530ECzVSemnjiTZM smb9+VnmxN5DlXClU5Q/tU0Xgi8UovhoLjzFaDf1MLX7ymvaHwM6ycLmPLt8rDQWxCXYb/ xtGwBnBcJzVr7JHx0oD+hNBefwLewx5g4/ycCNj2xvaTVgJDmip1btFr5oAMTbwIGAfn/4 +j2pAIUy0BuM9M3vg1Ag/K8EqasDhIC5Ag0WLs5DRxVYr5zfb+l/5Vd4wKYQlgUBmKexGE pqR0aTLfXO2g+NaGRESnR3NCX8Qtm3Deo9f+tbLZ9u5Q2KvK1NQ1a1nX2Djqmw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGQSd20kZz1BLH; Mon, 09 Jun 2025 21:45:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559Lj5Mv063034; Mon, 9 Jun 2025 21:45:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559Lj5Nf063031; Mon, 9 Jun 2025 21:45:05 GMT (envelope-from git) Date: Mon, 9 Jun 2025 21:45:05 GMT Message-Id: <202506092145.559Lj5Nf063031@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 2ab7cbdc346e - main - net80211: LinuxKPI: migrate HE defines to net80211, put correct values List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2ab7cbdc346e2a174a7bee4ce44c4f78b1ca093b Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=2ab7cbdc346e2a174a7bee4ce44c4f78b1ca093b commit 2ab7cbdc346e2a174a7bee4ce44c4f78b1ca093b Author: Bjoern A. Zeeb AuthorDate: 2025-06-03 12:35:33 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-09 21:44:26 +0000 net80211: LinuxKPI: migrate HE defines to net80211, put correct values Migrate most LinuxKPI 802.11 definitions for HE IEs to net80211. During that process also properly define them as most of them only had dummy values. Some of the definitions are sparse; that is, only the bits used by drivers so far were listed and annotated with the standards section. There seems to be little point to mangle the names and have two copies of all these bit field definitions. We can add "_S" (shift/mask) variants to those we need in net80211 (if we do). Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D50677 --- .../linuxkpi/common/include/linux/ieee80211.h | 4 - sys/compat/linuxkpi/common/include/net/cfg80211.h | 172 +---------------- sys/net80211/ieee80211.h | 209 ++++++++++++++++++++- 3 files changed, 209 insertions(+), 176 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/ieee80211.h b/sys/compat/linuxkpi/common/include/linux/ieee80211.h index fe2055f05969..3644ef80861b 100644 --- a/sys/compat/linuxkpi/common/include/linux/ieee80211.h +++ b/sys/compat/linuxkpi/common/include/linux/ieee80211.h @@ -495,10 +495,6 @@ enum ieee80211_category { WLAN_CATEGORY_SA_QUERY = 8, /* net80211::IEEE80211_ACTION_CAT_SA_QUERY */ }; -struct ieee80211_he_6ghz_capa { - uint16_t capa; -}; - /* 80211-2020 9.3.3.2 Format of Management frames */ struct ieee80211_mgmt { __le16 frame_control; diff --git a/sys/compat/linuxkpi/common/include/net/cfg80211.h b/sys/compat/linuxkpi/common/include/net/cfg80211.h index c806afb971e6..18b34f0e90ec 100644 --- a/sys/compat/linuxkpi/common/include/net/cfg80211.h +++ b/sys/compat/linuxkpi/common/include/net/cfg80211.h @@ -44,6 +44,8 @@ #include #include +#include + /* linux_80211.c */ extern int linuxkpi_debug_80211; #ifndef D80211_TODO @@ -640,176 +642,6 @@ struct linuxkpi_ieee80211_regdomain { struct ieee80211_reg_rule reg_rules[]; }; -/* XXX-BZ this are insensible values probably ... */ -#define IEEE80211_HE_MAC_CAP0_HTC_HE 0x1 -#define IEEE80211_HE_MAC_CAP0_TWT_REQ 0x2 -#define IEEE80211_HE_MAC_CAP0_TWT_RES 0x4 - -#define IEEE80211_HE_MAC_CAP1_LINK_ADAPTATION 0x1 -#define IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_RX_QOS_8 0x2 -#define IEEE80211_HE_MAC_CAP1_TF_MAC_PAD_DUR_16US 0x4 -#define IEEE80211_HE_MAC_CAP1_TF_MAC_PAD_DUR_MASK 0x8 - -#define IEEE80211_HE_MAC_CAP2_32BIT_BA_BITMAP 0x1 -#define IEEE80211_HE_MAC_CAP2_ACK_EN 0x2 -#define IEEE80211_HE_MAC_CAP2_BSR 0x4 -#define IEEE80211_HE_MAC_CAP2_LINK_ADAPTATION 0x8 -#define IEEE80211_HE_MAC_CAP2_BCAST_TWT 0x10 -#define IEEE80211_HE_MAC_CAP2_ALL_ACK 0x20 -#define IEEE80211_HE_MAC_CAP2_MU_CASCADING 0x40 -#define IEEE80211_HE_MAC_CAP2_TRS 0x80 - -#define IEEE80211_HE_MAC_CAP3_OMI_CONTROL 0x02 -#define IEEE80211_HE_MAC_CAP3_OFDMA_RA 0x04 -#define IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_EXT_1 0x08 -#define IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_EXT_2 0x10 -#define IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_EXT_3 0x18 -#define IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_MASK 0x18 -#define IEEE80211_HE_MAC_CAP3_FLEX_TWT_SCHED 0x40 -#define IEEE80211_HE_MAC_CAP3_RX_CTRL_FRAME_TO_MULTIBSS 0x80 - -#define IEEE80211_HE_MAC_CAP4_AMDSU_IN_AMPDU 0x1 -#define IEEE80211_HE_MAC_CAP4_BQR 0x2 -#define IEEE80211_HE_MAC_CAP4_MULTI_TID_AGG_TX_QOS_B39 0x4 -#define IEEE80211_HE_MAC_CAP4_AMSDU_IN_AMPDU 0x8 -#define IEEE80211_HE_MAC_CAP4_OPS 0x10 -#define IEEE80211_HE_MAC_CAP4_BSRP_BQRP_A_MPDU_AGG 0x20 - -#define IEEE80211_HE_MAC_CAP5_HE_DYNAMIC_SM_PS 0x1 -#define IEEE80211_HE_MAC_CAP5_HT_VHT_TRIG_FRAME_RX 0x2 -#define IEEE80211_HE_MAC_CAP5_MULTI_TID_AGG_TX_QOS_B40 0x4 -#define IEEE80211_HE_MAC_CAP5_MULTI_TID_AGG_TX_QOS_B41 0x8 -#define IEEE80211_HE_MAC_CAP5_UL_2x996_TONE_RU 0x10 -#define IEEE80211_HE_MAC_CAP5_OM_CTRL_UL_MU_DATA_DIS_RX 0x20 -#define IEEE80211_HE_MAC_CAP5_PUNCTURED_SOUNDING 0x40 -#define IEEE80211_HE_MAC_CAP5_SUBCHAN_SELECTIVE_TRANSMISSION 0x80 - -#define IEEE80211_HE_MCS_NOT_SUPPORTED 0x0 -#define IEEE80211_HE_MCS_SUPPORT_0_7 0x1 -#define IEEE80211_HE_MCS_SUPPORT_0_9 0x2 -#define IEEE80211_HE_MCS_SUPPORT_0_11 0x4 - -#define IEEE80211_HE_6GHZ_CAP_TX_ANTPAT_CONS 0x01 -#define IEEE80211_HE_6GHZ_CAP_RX_ANTPAT_CONS 0x02 -#define IEEE80211_HE_6GHZ_CAP_MIN_MPDU_START 0x04 -#define IEEE80211_HE_6GHZ_CAP_MAX_MPDU_LEN 0x08 -#define IEEE80211_HE_6GHZ_CAP_MAX_AMPDU_LEN_EXP 0x10 -#define IEEE80211_HE_6GHZ_CAP_SM_PS 0x20 - -#define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G 0x1 -#define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G 0x2 -#define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_IN_2G 0x4 -#define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G 0x8 -#define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_RU_MAPPING_IN_2G 0x10 -#define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_RU_MAPPING_IN_5G 0x20 -#define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_MASK 0x40 -#define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_MASK_ALL 0xff - -#define IEEE80211_HE_PHY_CAP1_DEVICE_CLASS_A 0x1 -#define IEEE80211_HE_PHY_CAP1_LDPC_CODING_IN_PAYLOAD 0x2 -#define IEEE80211_HE_PHY_CAP1_MIDAMBLE_RX_TX_MAX_NSTS 0x4 -#define IEEE80211_HE_PHY_CAP1_PREAMBLE_PUNC_RX_MASK 0x8 -#define IEEE80211_HE_PHY_CAP1_HE_LTF_AND_GI_FOR_HE_PPDUS_0_8US 0x10 - -#define IEEE80211_HE_PHY_CAP2_MIDAMBLE_RX_TX_MAX_NSTS 0x1 -#define IEEE80211_HE_PHY_CAP2_NDP_4x_LTF_AND_3_2US 0x2 -#define IEEE80211_HE_PHY_CAP2_STBC_TX_UNDER_80MHZ 0x4 -#define IEEE80211_HE_PHY_CAP2_STBC_RX_UNDER_80MHZ 0x8 -#define IEEE80211_HE_PHY_CAP2_DOPPLER_TX 0x10 -#define IEEE80211_HE_PHY_CAP2_UL_MU_PARTIAL_MU_MIMO 0x20 -#define IEEE80211_HE_PHY_CAP2_UL_MU_FULL_MU_MIMO 0x40 - -#define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_MASK 0x1 -#define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_NO_DCM 0x2 -#define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_NO_DCM 0x4 -#define IEEE80211_HE_PHY_CAP3_DCM_MAX_RX_NSS_1 0x8 -#define IEEE80211_HE_PHY_CAP3_DCM_MAX_TX_NSS_1 0x10 -#define IEEE80211_HE_PHY_CAP3_SU_BEAMFORMER 0x20 -#define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_16_QAM 0x40 -#define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_16_QAM 0x80 -#define IEEE80211_HE_PHY_CAP3_DCM_MAX_TX_NSS_2 0x10 -#define IEEE80211_HE_PHY_CAP3_RX_PARTIAL_BW_SU_IN_20MHZ_MU 0x20 -#define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_BPSK 0x40 -#define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_BPSK 0x80 -#define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_MASK 0x80 -#define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_QPSK 0x80 -#define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_QPSK 0x80 -#define IEEE80211_HE_PHY_CAP3_DCM_MAX_RX_NSS_2 0x80 - -#define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_8 0x1 -#define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_8 0x2 -#define IEEE80211_HE_PHY_CAP4_SU_BEAMFORMEE 0x4 -#define IEEE80211_HE_PHY_CAP4_MU_BEAMFORMER 0x8 -#define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_4 0x10 -#define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_4 0x20 -#define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_MASK 0x40 -#define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_MASK 0x80 -#define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_5 0x80 -#define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_5 0x80 - -#define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_2 0x1 -#define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_2 0x2 -#define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_MASK 0x4 -#define IEEE80211_HE_PHY_CAP5_NG16_MU_FEEDBACK 0x8 -#define IEEE80211_HE_PHY_CAP5_NG16_SU_FEEDBACK 0x10 -#define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_MASK 0x20 - -#define IEEE80211_HE_PHY_CAP6_PPE_THRESHOLD_PRESENT 0x1 -#define IEEE80211_HE_PHY_CAP6_TRIG_MU_BEAMFORMER_FB 0x2 -#define IEEE80211_HE_PHY_CAP6_TRIG_SU_BEAMFORMER_FB 0x4 -#define IEEE80211_HE_PHY_CAP6_TRIG_SU_BEAMFORMING_FB 0x8 -#define IEEE80211_HE_PHY_CAP6_TRIG_MU_BEAMFORMING_PARTIAL_BW_FB 0x20 -#define IEEE80211_HE_PHY_CAP6_CODEBOOK_SIZE_42_SU 0x40 -#define IEEE80211_HE_PHY_CAP6_CODEBOOK_SIZE_75_MU 0x80 -#define IEEE80211_HE_PHY_CAP6_PARTIAL_BW_EXT_RANGE 0x80 -#define IEEE80211_HE_PHY_CAP6_TRIG_CQI_FB 0x80 -#define IEEE80211_HE_PHY_CAP6_PARTIAL_BANDWIDTH_DL_MUMIMO 0x80 - -#define IEEE80211_HE_PHY_CAP7_HE_SU_MU_PPDU_4XLTF_AND_08_US_GI 0x1 -#define IEEE80211_HE_PHY_CAP7_MAX_NC_1 0x2 -#define IEEE80211_HE_PHY_CAP7_MAX_NC_2 0x4 -#define IEEE80211_HE_PHY_CAP7_MAX_NC_MASK 0x6 -#define IEEE80211_HE_PHY_CAP7_POWER_BOOST_FACTOR_AR 0x8 -#define IEEE80211_HE_PHY_CAP7_POWER_BOOST_FACTOR_SUPP 0x10 -#define IEEE80211_HE_PHY_CAP7_STBC_RX_ABOVE_80MHZ 0x20 -#define IEEE80211_HE_PHY_CAP7_STBC_TX_ABOVE_80MHZ 0x40 -#define IEEE80211_HE_PHY_CAP7_PSR_BASED_SR 0x80 - -#define IEEE80211_HE_PHY_CAP8_20MHZ_IN_160MHZ_HE_PPDU 0x1 -#define IEEE80211_HE_PHY_CAP8_20MHZ_IN_40MHZ_HE_PPDU_IN_2G 0x2 -#define IEEE80211_HE_PHY_CAP8_80MHZ_IN_160MHZ_HE_PPDU 0x4 -#define IEEE80211_HE_PHY_CAP8_DCM_MAX_RU_242 0x8 -#define IEEE80211_HE_PHY_CAP8_DCM_MAX_RU_484 0x10 -#define IEEE80211_HE_PHY_CAP8_DCM_MAX_RU_996 0x18 -#define IEEE80211_HE_PHY_CAP8_DCM_MAX_RU_2x996 0x20 -#define IEEE80211_HE_PHY_CAP8_DCM_MAX_RU_MASK 0x28 -#define IEEE80211_HE_PHY_CAP8_HE_ER_SU_PPDU_4XLTF_AND_08_US_GI 0x40 -#define IEEE80211_HE_PHY_CAP8_HE_ER_SU_1XLTF_AND_08_US_GI 0x80 - -#define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_0US 0x1 -#define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_16US 0x2 -#define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_8US 0x4 -#define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_MASK 0x8 -#define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_RESERVED 0x10 -#define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_POS 0x0 -#define IEEE80211_HE_PHY_CAP9_NON_TRIGGERED_CQI_FEEDBACK 0x20 -#define IEEE80211_HE_PHY_CAP9_RX_FULL_BW_SU_USING_MU_WITH_COMP_SIGB 0x4 -#define IEEE80211_HE_PHY_CAP9_RX_FULL_BW_SU_USING_MU_WITH_NON_COMP_SIGB 0x8 -#define IEEE80211_HE_PHY_CAP9_RX_1024_QAM_LESS_THAN_242_TONE_RU 0x10 -#define IEEE80211_HE_PHY_CAP9_TX_1024_QAM_LESS_THAN_242_TONE_RU 0x20 -#define IEEE80211_HE_PHY_CAP9_LONGER_THAN_16_SIGB_OFDM_SYM 0x40 - -#define IEEE80211_HE_PHY_CAP10_HE_MU_M1RU_MAX_LTF 0x1 - -#define IEEE80211_HE_OPERATION_BSS_COLOR_DISABLED 0x1 -#define IEEE80211_HE_OPERATION_BSS_COLOR_OFFSET 0x2 -#define IEEE80211_HE_OPERATION_ER_SU_DISABLE 0x4 - -#define IEEE80211_HE_SPR_HESIGA_SR_VAL15_ALLOWED 0x01 -#define IEEE80211_HE_SPR_NON_SRG_OBSS_PD_SR_DISALLOWED 0x02 -#define IEEE80211_HE_SPR_NON_SRG_OFFSET_PRESENT 0x04 -#define IEEE80211_HE_SPR_SRG_INFORMATION_PRESENT 0x08 - #define IEEE80211_EHT_MAC_CAP0_EPCS_PRIO_ACCESS 0x01 #define IEEE80211_EHT_MAC_CAP0_MAX_MPDU_LEN_11454 0x02 #define IEEE80211_EHT_MAC_CAP0_MAX_MPDU_LEN_MASK 0x03 diff --git a/sys/net80211/ieee80211.h b/sys/net80211/ieee80211.h index c782e09a522d..cfe545b24c26 100644 --- a/sys/net80211/ieee80211.h +++ b/sys/net80211/ieee80211.h @@ -4,6 +4,10 @@ * Copyright (c) 2001 Atsushi Onoe * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting * All rights reserved. + * Copyright (c) 2020-2025 The FreeBSD Foundation + * + * Portions of this software were 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 @@ -1109,6 +1113,177 @@ struct ieee80211_ie_vht_txpwrenv { * HE */ +/* + * 802.11ax-2021, 9.4.2.248.2 HE MAC Capabilities Information field. + */ +/* B0..B7 */ +#define IEEE80211_HE_MAC_CAP0_HTC_HE (1<<0) +#define IEEE80211_HE_MAC_CAP0_TWT_REQ (1<<1) +#define IEEE80211_HE_MAC_CAP0_TWT_RES (1<<2) + +/* B8..B15 */ +#define IEEE80211_HE_MAC_CAP1_TF_MAC_PAD_DUR_16US (1<<3) +#define IEEE80211_HE_MAC_CAP1_TF_MAC_PAD_DUR_MASK (1<<3 | 1<<2) +#define IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_RX_QOS_8 (1<<6 | 1<<5 | 1<<4) +#define IEEE80211_HE_MAC_CAP1_LINK_ADAPTATION (1<<7) +/* Note: B15|B16 are split between octets %!$@??? */ + +/* B16..B23 */ +#define IEEE80211_HE_MAC_CAP2_LINK_ADAPTATION (1<<0) +#define IEEE80211_HE_MAC_CAP2_ALL_ACK (1<<1) +#define IEEE80211_HE_MAC_CAP2_TRS (1<<2) +#define IEEE80211_HE_MAC_CAP2_BSR (1<<3) +#define IEEE80211_HE_MAC_CAP2_BCAST_TWT (1<<4) +#define IEEE80211_HE_MAC_CAP2_32BIT_BA_BITMAP (1<<5) +#define IEEE80211_HE_MAC_CAP2_MU_CASCADING (1<<6) +#define IEEE80211_HE_MAC_CAP2_ACK_EN (1<<7) + +/* B24..B31 */ +#define IEEE80211_HE_MAC_CAP3_OMI_CONTROL (1<<1) +#define IEEE80211_HE_MAC_CAP3_OFDMA_RA (1<<2) +#define IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_EXT_1 (1<<3) +#define IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_EXT_2 (1<<4) +#define IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_EXT_3 (1<<4 | 1<<3) +#define IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_MASK (1<<4 | 1<<3) +#define IEEE80211_HE_MAC_CAP3_FLEX_TWT_SCHED (1<<6) +#define IEEE80211_HE_MAC_CAP3_RX_CTRL_FRAME_TO_MULTIBSS (1<<7) + +/* B32..B39 */ +#define IEEE80211_HE_MAC_CAP4_BSRP_BQRP_A_MPDU_AGG (1<<0) +#define IEEE80211_HE_MAC_CAP4_BQR (1<<2) +#define IEEE80211_HE_MAC_CAP4_OPS (1<<5) +#define IEEE80211_HE_MAC_CAP4_AMSDU_IN_AMPDU (1<<6) +#define IEEE80211_HE_MAC_CAP4_MULTI_TID_AGG_TX_QOS_B39 (1<<7) +/* Note: B39|B40|B41 are split between octets %!$@??? */ + +/* B40..B47 */ +#define IEEE80211_HE_MAC_CAP5_MULTI_TID_AGG_TX_QOS_B40 (1<<0) +#define IEEE80211_HE_MAC_CAP5_MULTI_TID_AGG_TX_QOS_B41 (1<<1) +#define IEEE80211_HE_MAC_CAP5_SUBCHAN_SELECTIVE_TRANSMISSION (1<<2) +#define IEEE80211_HE_MAC_CAP5_UL_2x996_TONE_RU (1<<3) +#define IEEE80211_HE_MAC_CAP5_OM_CTRL_UL_MU_DATA_DIS_RX (1<<4) +#define IEEE80211_HE_MAC_CAP5_HE_DYNAMIC_SM_PS (1<<5) +#define IEEE80211_HE_MAC_CAP5_PUNCTURED_SOUNDING (1<<6) +#define IEEE80211_HE_MAC_CAP5_HT_VHT_TRIG_FRAME_RX (1<<7) + +/* + * 802.11ax-2021, 9.4.2.248.3 HE PHY Capabilities Information field. + */ +/* B0..B7 */ +#define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_IN_2G (1<<1) +#define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G (1<<2) +#define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G (1<<3) +#define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G (1<<4) +#define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_MASK_ALL (1<<4 | 1<<3 | 1<<2 | 1<<1) +#define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_RU_MAPPING_IN_2G (1<<5) +#define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_RU_MAPPING_IN_5G (1<<6) +#define IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_MASK (1<<6 | 1<<5 | 1<<4 | 1<<3 | 1<<2 | 1<<1) + +/* B8..B15 */ +#define IEEE80211_HE_PHY_CAP1_PREAMBLE_PUNC_RX_MASK (1<<3 | 1<<2 | 1<<1 | 1<<0) +#define IEEE80211_HE_PHY_CAP1_DEVICE_CLASS_A (1<<4) +#define IEEE80211_HE_PHY_CAP1_LDPC_CODING_IN_PAYLOAD (1<<5) +#define IEEE80211_HE_PHY_CAP1_HE_LTF_AND_GI_FOR_HE_PPDUS_0_8US (1<<6) +#define IEEE80211_HE_PHY_CAP1_MIDAMBLE_RX_TX_MAX_NSTS (1<<7) +/* Note: B15|B16 are split between octets %!$@??? */ + +/* B16..B23 */ +#define IEEE80211_HE_PHY_CAP2_MIDAMBLE_RX_TX_MAX_NSTS (1<<0) +#define IEEE80211_HE_PHY_CAP2_NDP_4x_LTF_AND_3_2US (1<<1) +#define IEEE80211_HE_PHY_CAP2_STBC_TX_UNDER_80MHZ (1<<2) +#define IEEE80211_HE_PHY_CAP2_STBC_RX_UNDER_80MHZ (1<<3) +#define IEEE80211_HE_PHY_CAP2_DOPPLER_TX (1<<4) +#define IEEE80211_HE_PHY_CAP2_DOPPLER_RX (1<<5) +#define IEEE80211_HE_PHY_CAP2_UL_MU_FULL_MU_MIMO (1<<6) +#define IEEE80211_HE_PHY_CAP2_UL_MU_PARTIAL_MU_MIMO (1<<7) + +/* B24..B31 */ +#define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_NO_DCM 0x00 +#define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_BPSK (1<<0) +#define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_QPSK (1<<1) +#define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_16_QAM (1<<1 | 1<<0) +#define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_MASK (1<<1 | 1<<0) +#define IEEE80211_HE_PHY_CAP3_DCM_MAX_TX_NSS_1 0x00 +#define IEEE80211_HE_PHY_CAP3_DCM_MAX_TX_NSS_2 (1<<2) +#define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_NO_DCM 0x00 +#define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_BPSK (1<<3) +#define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_QPSK (1<<4) +#define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_16_QAM (1<<4 | 1<<3) +#define IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_MASK (1<<4 | 1<<3) +#define IEEE80211_HE_PHY_CAP3_DCM_MAX_RX_NSS_1 0x00 +#define IEEE80211_HE_PHY_CAP3_DCM_MAX_RX_NSS_2 (1<<5) +#define IEEE80211_HE_PHY_CAP3_RX_PARTIAL_BW_SU_IN_20MHZ_MU (1<<6) +#define IEEE80211_HE_PHY_CAP3_SU_BEAMFORMER (1<<7) + +/* B32..B39 */ +#define IEEE80211_HE_PHY_CAP4_SU_BEAMFORMEE (1<<0) +#define IEEE80211_HE_PHY_CAP4_MU_BEAMFORMER (1<<1) +#define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_4 (1<<3 | 1<<2) +#define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_5 (1<<4) +#define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_8 (1<<4 | 1<<3 | 1<<2) +#define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_MASK (1<<4 | 1<<3 | 1<<2) +#define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_4 (1<<6 | 1<<5) +#define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_5 (1<<7) +#define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_8 (1<<7 | 1<<6 | 1<<5) +#define IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_MASK (1<<7 | 1<<6 | 1<<5) + +/* B40..B47 */ +#define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_2 (1<<0) +#define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_MASK (1<<2 | 1<<1 | 1<<0) +#define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_2 (1<<3) +#define IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_MASK (1<<5 | 1<<4 | 1<<3) +#define IEEE80211_HE_PHY_CAP5_NG16_SU_FEEDBACK (1<<6) +#define IEEE80211_HE_PHY_CAP5_NG16_MU_FEEDBACK (1<<7) + +/* B48..B55 */ +#define IEEE80211_HE_PHY_CAP6_CODEBOOK_SIZE_42_SU (1<<0) +#define IEEE80211_HE_PHY_CAP6_CODEBOOK_SIZE_75_MU (1<<1) +#define IEEE80211_HE_PHY_CAP6_TRIG_SU_BEAMFORMING_FB (1<<2) +#define IEEE80211_HE_PHY_CAP6_TRIG_MU_BEAMFORMING_PARTIAL_BW_FB (1<<3) +#define IEEE80211_HE_PHY_CAP6_TRIG_CQI_FB (1<<4) +#define IEEE80211_HE_PHY_CAP6_PARTIAL_BW_EXT_RANGE (1<<5) +#define IEEE80211_HE_PHY_CAP6_PARTIAL_BANDWIDTH_DL_MUMIMO (1<<6) +#define IEEE80211_HE_PHY_CAP6_PPE_THRESHOLD_PRESENT (1<<7) + +/* B56..B63 */ +#define IEEE80211_HE_PHY_CAP7_PSR_BASED_SR (1<<0) +#define IEEE80211_HE_PHY_CAP7_POWER_BOOST_FACTOR_SUPP (1<<1) +#define IEEE80211_HE_PHY_CAP7_HE_SU_MU_PPDU_4XLTF_AND_08_US_GI (1<<2) +#define IEEE80211_HE_PHY_CAP7_MAX_NC_1 (1<<3) +#define IEEE80211_HE_PHY_CAP7_MAX_NC_2 (1<<4) +#define IEEE80211_HE_PHY_CAP7_MAX_NC_MASK (1<<5 | 1<<4 | 1<<3) +#define IEEE80211_HE_PHY_CAP7_STBC_TX_ABOVE_80MHZ (1<<6) +#define IEEE80211_HE_PHY_CAP7_STBC_RX_ABOVE_80MHZ (1<<7) + +/* B64..B71 */ +#define IEEE80211_HE_PHY_CAP8_HE_ER_SU_PPDU_4XLTF_AND_08_US_GI (1<<0) +#define IEEE80211_HE_PHY_CAP8_20MHZ_IN_40MHZ_HE_PPDU_IN_2G (1<<1) +#define IEEE80211_HE_PHY_CAP8_20MHZ_IN_160MHZ_HE_PPDU (1<<2) +#define IEEE80211_HE_PHY_CAP8_80MHZ_IN_160MHZ_HE_PPDU (1<<3) +#define IEEE80211_HE_PHY_CAP8_HE_ER_SU_1XLTF_AND_08_US_GI (1<<4) +#define IEEE80211_HE_PHY_CAP8_DCM_MAX_RU_242 0x00 +#define IEEE80211_HE_PHY_CAP8_DCM_MAX_RU_484 (1<<6) +#define IEEE80211_HE_PHY_CAP8_DCM_MAX_RU_996 (1<<7) +#define IEEE80211_HE_PHY_CAP8_DCM_MAX_RU_2x996 (1<<7 | 1<<6) +#define IEEE80211_HE_PHY_CAP8_DCM_MAX_RU_MASK (1<<7 | 1<<6) + +/* B72..B79 */ +#define IEEE80211_HE_PHY_CAP9_LONGER_THAN_16_SIGB_OFDM_SYM (1<<0) +#define IEEE80211_HE_PHY_CAP9_NON_TRIGGERED_CQI_FEEDBACK (1<<1) +#define IEEE80211_HE_PHY_CAP9_TX_1024_QAM_LESS_THAN_242_TONE_RU (1<<2) +#define IEEE80211_HE_PHY_CAP9_RX_1024_QAM_LESS_THAN_242_TONE_RU (1<<3) +#define IEEE80211_HE_PHY_CAP9_RX_FULL_BW_SU_USING_MU_WITH_COMP_SIGB (1<<4) +#define IEEE80211_HE_PHY_CAP9_RX_FULL_BW_SU_USING_MU_WITH_NON_COMP_SIGB (1<<5) +#define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_0US 0x00 +#define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_8US 1 +#define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_16US 2 +#define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_RESERVED 3 +#define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_POS 6 +#define IEEE80211_HE_PHY_CAP9_NOMINAL_PKT_PADDING_MASK (1<<7 | 1<<6) + +/* B80..B87 */ +#define IEEE80211_HE_PHY_CAP10_HE_MU_M1RU_MAX_LTF (1<<0) + /* * 802.11ax-2021, * 9.4.2.248.2 HE MAC Capabilities Information field. @@ -1120,6 +1295,13 @@ struct ieee80211_he_cap_elem { } __packed; /* 802.11ax-2021, 9.4.2.248.4 Supported HE-MCS And NSS Set field. */ +enum ieee80211_he_mcs_support { + IEEE80211_HE_MCS_SUPPORT_0_7 = 0, /* HE-MCS 0-7 for n NSS */ + IEEE80211_HE_MCS_SUPPORT_0_9 = 1, /* HE-MCS 0-9 for n NSS */ + IEEE80211_HE_MCS_SUPPORT_0_11 = 2, /* HE-MCS 0-11 for n NSS */ + IEEE80211_HE_MCS_NOT_SUPPORTED = 3 /* n NSS not supported. */ +}; + struct ieee80211_he_mcs_nss_supp { uint16_t rx_mcs_80; uint16_t tx_mcs_80; @@ -1140,8 +1322,12 @@ struct net80211_he_cap { }; /* 802.11ax-2021, 9.4.2.249 HE Operation element. */ +#define IEEE80211_HE_OPERATION_ER_SU_DISABLE (1<<16) +#define IEEE80211_HE_OPERATION_BSS_COLOR_OFFSET 24 +#define IEEE80211_HE_OPERATION_BSS_COLOR_DISABLED (1<<31) + struct ieee80211_he_operation { - uint32_t he_oper_params; + uint32_t he_oper_params; /* (3) params | (1) bss color info */ uint16_t he_mcs_nss_set; uint8_t optional[0]; } __packed; @@ -1165,8 +1351,27 @@ struct ieee80211_mu_edca_param_set { struct ieee80211_he_mu_edca_param_ac_rec param_ac_recs[4]; }; } __packed; -#endif /* _KERNEL || WANT_NET80211 */ +/* 802.11ax-2021, 9.4.2.252 Spatial Reuse Parameter Set element */ +/* Figure 9-788r-SR Control field format */ +#define IEEE80211_HE_SPR_NON_SRG_OBSS_PD_SR_DISALLOWED (1<<1) +#define IEEE80211_HE_SPR_NON_SRG_OFFSET_PRESENT (1<<2) +#define IEEE80211_HE_SPR_SRG_INFORMATION_PRESENT (1<<3) +#define IEEE80211_HE_SPR_HESIGA_SR_VAL15_ALLOWED (1<<4) + +/* 802.11ax-2021, 9.4.2.263 HE 6 GHz Band Capabilities element */ +/* Figure 9-788aj-Capabilities Information field format */ +#define IEEE80211_HE_6GHZ_CAP_MIN_MPDU_START (1<<2 | 1<<1 | 1<<0) +#define IEEE80211_HE_6GHZ_CAP_MAX_AMPDU_LEN_EXP (1<<5 | 1<<4 | 1<<3) +#define IEEE80211_HE_6GHZ_CAP_MAX_MPDU_LEN (1<<7 | 1<<6) +#define IEEE80211_HE_6GHZ_CAP_SM_PS (1<<10 | 1<<9) +#define IEEE80211_HE_6GHZ_CAP_RX_ANTPAT_CONS (1<<12) +#define IEEE80211_HE_6GHZ_CAP_TX_ANTPAT_CONS (1<<13) + +struct ieee80211_he_6ghz_capa { + uint16_t capa; +}; +#endif /* _KERNEL || WANT_NET80211 */ /* * Management information element payloads. From nobody Mon Jun 9 21:45:06 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGQSg17xYz5yXv4; Mon, 09 Jun 2025 21: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGQSf3Y4Mz4H5l; Mon, 09 Jun 2025 21: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=1749505506; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UMP8k6vCPUr5BFQz1FlVZ2Mp0mrZRAl22rxFm30Tkfw=; b=oxnHF+lMmv19CP/L7+YfYE14HY9BbVc/6B12H+BPJ3MvgCRX8KbpeTSDi1ek9uzSo5xlgB WgggYKCOU697AKp3fiFrUpPb6Hz4hpO8gAMQRLnBRgbXOJYFDmXCuRTZRDtl3p0yaNRqkZ /tVEx37XAk0zKdUyU9xNHklE03WCv77DnXw7qNytogFZoPfw6EWvE4nXfZi7OpfUtPTWQN 0mk5YhUOmWPSvQXV7++KV0Y0RfhjkkQsGfanbZWe9kcGEZjTMzSV6E61wqQhP4Z+bcjYaH EcNQj3rNbx4YEnf+LfRSKHPailUE3EIEHViBJFknoEGSxtTot6Ixdtfot/TsYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749505506; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UMP8k6vCPUr5BFQz1FlVZ2Mp0mrZRAl22rxFm30Tkfw=; b=XV6vYOLCMaWeB0VGAcAfeLy804a6xZBuuUPEDbAw5ClgF9+StA6I0PnJJ7QbXgB/2dwKs5 vO1y4X2EGSbTVA7f0sA36qQ9a6/IwLnNyFLJbWdddeoYyz+UvurEabyILwS3IV5fP8O0Wa 7uGrGjgoOJ2P5UVzn6TnMgd29XRBY/qoRpSmenIPnluWENbbcgqAxrGPP8Qkp13pivxYo4 TcUCO9dlxMLeUUYhacQiDuTCflF5cxgd6lCJui3GIvIcDWaTRfShEHLFQjefehlgScHVBY k01+ss2i/1kNh/G5ARhN3Lzrl0zIIhYeB2QLpFDiz9BI8vdYB7dzE9pFeZ2vUA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749505506; a=rsa-sha256; cv=none; b=Im1FMNIjZCupq5W7gMbnhEGj1GnaMb2Ceh2LU0Cy/7DEAKc5QADfEdx42KT2Baol7G0sml FymxDqIT4ecPQIbtyPM4L3iyXxhIgftmPDcc1IK/Dyu1kIcnJe7qJDqqo8WBXBfaw0Vjou XnZnEzMtUBSHKh3zxwTUF2mr7qAHmy4ClhzrsmLoNmLlofabKvhr8V4D5pZJQtuegxqZ5f odtXAb/MnTXFRvkr0JhreFasm3DxjbsOp+I7isQjW1qjxkmwPpwliga+d55XAy9ucJ+iy9 iTLLXE1pTEk+nv3EiX1MA8rJ+IABP70wNlTj4DVHkshSwJpR4JHx5MXbSk0ICA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGQSf2ZtSz1CF2; Mon, 09 Jun 2025 21:45:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559Lj6tl063071; Mon, 9 Jun 2025 21:45:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559Lj6ot063068; Mon, 9 Jun 2025 21:45:06 GMT (envelope-from git) Date: Mon, 9 Jun 2025 21:45:06 GMT Message-Id: <202506092145.559Lj6ot063068@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: a2a15732eb1d - main - ifconfig: 802.11: decode more information elements (IEs) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a2a15732eb1db4616aa628ae8bfd4047c40dbaee Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=a2a15732eb1db4616aa628ae8bfd4047c40dbaee commit a2a15732eb1db4616aa628ae8bfd4047c40dbaee Author: Bjoern A. Zeeb AuthorDate: 2025-06-02 16:06:50 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-09 21:44:26 +0000 ifconfig: 802.11: decode more information elements (IEs) Start dealing with Element ID Extension present (IE T=255) and start parsing elemants from the Element ID Extension set. Namely (partially) decode HE_CAPA, HE_OPER, MU_EDCA_PARAM_SET, and as well as SUP_OP_CLASS. For length reasons also rename UNKNOWN_ELEMID_%d to ELEMID_%d. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D50678 --- sbin/ifconfig/ifieee80211.c | 229 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 226 insertions(+), 3 deletions(-) diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c index 2f79f2e92e60..e73dcc2c4f24 100644 --- a/sbin/ifconfig/ifieee80211.c +++ b/sbin/ifconfig/ifieee80211.c @@ -2778,6 +2778,177 @@ printwmeinfo(if_ctx *ctx, const char *tag, const u_int8_t *ie) } } +static void +printhecap(if_ctx *ctx, const char *tag, const uint8_t *ie) +{ + const struct ieee80211_he_cap_elem *hecap; + const struct ieee80211_he_mcs_nss_supp *mcsnss; + unsigned int i; + uint8_t chw; + + printf("%s", tag); + if (!ctx->args->verbose) + return; + + /* Check that the right size. */ + if (ie[1] < 1 + sizeof(*hecap) + 4) { + printf("", ie[1]); + return; + } + /* Skip Element ID, Length, EID Extension. */ + hecap = (const struct ieee80211_he_cap_elem *)(ie + 3); + + /* XXX-BZ we need to somehow decode each field? */ + printf("mac_cap_info); i++) + printf(" %#04x", hecap->mac_cap_info[i]); + printf(" phy_cap"); + for (i = 0; i < nitems(hecap->phy_cap_info); i++) + printf(" %#04x", hecap->phy_cap_info[i]); + + chw = hecap->phy_cap_info[0]; + ie = (const uint8_t *)(const void *)(hecap + 1); + mcsnss = (const struct ieee80211_he_mcs_nss_supp *)ie; + /* Cannot use <= as < is a delimiter. */ + printf(" rx/tx_he_mcs map: loweq80 %#06x/%#06x", + mcsnss->rx_mcs_80, mcsnss->tx_mcs_80); + ie += 2; + if ((chw & (1<<2)) != 0) { + printf(" 160 %#06x/%#06x", + mcsnss->rx_mcs_160, mcsnss->tx_mcs_160); + ie += 2; + } + if ((chw & (1<<3)) != 0) { + printf(" 80+80 %#06x/%#06x", + mcsnss->rx_mcs_80p80, mcsnss->tx_mcs_80p80); + ie += 2; + } + /* TODO: ppet = (struct ... *)ie; */ + + printf(">"); +} + +static void +printheoper(if_ctx *ctx, const char *tag, const uint8_t *ie) +{ + printf("%s", tag); + if (ctx->args->verbose) { + const struct ieee80211_he_operation *heoper; + uint32_t params; + + /* Check that the right size. */ + if (ie[1] < 1 + sizeof(*heoper)) { + printf("", ie[1]); + return; + } + /* Skip Element ID, Length, EID Extension. */ + heoper = (const struct ieee80211_he_operation *)(ie + 3); + + /* XXX-BZ we need to somehow decode each field? */ + params = heoper->he_oper_params & 0x00ffffff; + printf("he_oper_params & 0xff000000) >> 24); + printf(" mcs_nss %#06x", heoper->he_mcs_nss_set); + if ((params & (1 << 14)) != 0) { + printf(" vht_op 0-3"); + } + if ((params & (1 << 15)) != 0) { + printf(" max_coh_bssid 0-1"); + } + if ((params & (1 << 17)) != 0) { + printf(" 6ghz_op 0-5"); + } + printf(">"); + } +} + +static void +printmuedcaparamset(if_ctx *ctx, const char *tag, const uint8_t *ie) +{ + static const char *acnames[] = { "BE", "BK", "VO", "VI" }; + const struct ieee80211_mu_edca_param_set *mu_edca; + int i; + + printf("%s", tag); + if (!ctx->args->verbose) + return; + + /* Check that the right size. */ + if (ie[1] != 1 + sizeof(*mu_edca)) { + printf("", ie[1]); + return; + } + /* Skip Element ID, Length, EID Extension. */ + mu_edca = (const struct ieee80211_mu_edca_param_set *)(ie + 3); + + printf("mu_qos_info); + ie++; + for (i = 0; i < WME_NUM_AC; i++) { + const struct ieee80211_he_mu_edca_param_ac_rec *ac = + &mu_edca->param_ac_recs[i]; + + printf(" %s[aifsn %u ecwmin %u ecwmax %u timer %u]", acnames[i], + ac->aifsn, + _IEEE80211_MASKSHIFT(ac->ecw_min_max, WME_PARAM_LOGCWMIN), + _IEEE80211_MASKSHIFT(ac->ecw_min_max, WME_PARAM_LOGCWMAX), + ac->mu_edca_timer); + } + printf(">"); +} + +static void +printsupopclass(if_ctx *ctx, const char *tag, const u_int8_t *ie) +{ + uint8_t len, i; + + printf("%s", tag); + if (!ctx->args->verbose) + return; + + /* Check that the right size. */ + len = ie[1]; + if (len < 2) { + printf("", ie[1]); + return; + } + + ie += 2; + i = 0; + printf(" 1 && i < len && *(ie + i) != 130) { + printf(" parsing error at %#0x>", i); + return; + } + /* Skip OneHundredAndThirty Delimiter. */ + i++; + if (i < len && *(ie + i) != 0) + printf(" ext seq"); + while (i < len && *(ie + i) != 0) { + printf(" %u", *(ie + i)); + i++; + } + if (i > 1 && i < len && *(ie + i) != 0) { + printf(" parsing error at %#0x>", i); + return; + } + /* Skip Zero Delimiter. */ + i++; + if ((i + 1) < len) + printf(" duple seq"); + while ((i + 1) < len) { + printf(" %u/%u", *(ie + i), *(ie + i + 1)); + i += 2; + } + printf(">"); +} + static void printvhtcap(if_ctx *ctx, const char *tag, const u_int8_t *ie) { @@ -3616,7 +3787,22 @@ iswpsoui(const uint8_t *frm) } static const char * -iename(int elemid) +ie_ext_name(uint8_t ext_elemid) +{ + static char iename_buf[32]; + + switch (ext_elemid) { + case IEEE80211_ELEMID_EXT_HE_CAPA: return " HECAP"; + case IEEE80211_ELEMID_EXT_HE_OPER: return " HEOPER"; + case IEEE80211_ELEMID_EXT_MU_EDCA_PARAM_SET: return " MU_EDCA_PARAM_SET"; + } + snprintf(iename_buf, sizeof(iename_buf), " ELEMID_EXT_%d", + ext_elemid & 0xff); + return (const char *) iename_buf; +} + +static const char * +iename(uint8_t elemid, const u_int8_t *vp) { static char iename_buf[64]; switch (elemid) { @@ -3638,6 +3824,8 @@ iename(int elemid) case IEEE80211_ELEMID_IBSSDFS: return " IBSSDFS"; case IEEE80211_ELEMID_RESERVED_47: return " RESERVED_47"; + case IEEE80211_ELEMID_SUP_OP_CLASS: + return " SUP_OP_CLASS"; case IEEE80211_ELEMID_MOBILITY_DOMAIN: return " MOBILITY_DOMAIN"; case IEEE80211_ELEMID_RRM_ENACAPS: @@ -3648,12 +3836,41 @@ iename(int elemid) case IEEE80211_ELEMID_CCKM: return " CCKM"; case IEEE80211_ELEMID_EXTCAP: return " EXTCAP"; case IEEE80211_ELEMID_RSN_EXT: return " RSNXE"; + case IEEE80211_ELEMID_EXTFIELD: + if (vp[1] >= 1) + return ie_ext_name(vp[2]); + break; } - snprintf(iename_buf, sizeof(iename_buf), " UNKNOWN_ELEMID_%d", + snprintf(iename_buf, sizeof(iename_buf), " ELEMID_%d", elemid); return (const char *) iename_buf; } +static void +printexties(if_ctx *ctx, const u_int8_t *vp, unsigned int maxcols) +{ + const int verbose = ctx->args->verbose; + + if (vp[1] < 1) + return; + + switch (vp[2]) { + case IEEE80211_ELEMID_EXT_HE_CAPA: + printhecap(ctx, " HECAP", vp); + break; + case IEEE80211_ELEMID_EXT_HE_OPER: + printheoper(ctx, " HEOPER", vp); + break; + case IEEE80211_ELEMID_EXT_MU_EDCA_PARAM_SET: + printmuedcaparamset(ctx, " MU_EDCA_PARAM_SET", vp); + break; + default: + if (verbose) + printie(ctx, iename(vp[0], vp), vp, 2+vp[1], maxcols); + break; + } +} + static void printies(if_ctx *ctx, const u_int8_t *vp, int ielen, unsigned int maxcols) { @@ -3705,6 +3922,9 @@ printies(if_ctx *ctx, const u_int8_t *vp, int ielen, unsigned int maxcols) case IEEE80211_ELEMID_HTCAP: printhtcap(ctx, " HTCAP", vp); break; + case IEEE80211_ELEMID_SUP_OP_CLASS: + printsupopclass(ctx, " SUP_OP_CLASS", vp); + break; case IEEE80211_ELEMID_HTINFO: if (verbose) printhtinfo(ctx, " HTINFO", vp); @@ -3734,9 +3954,12 @@ printies(if_ctx *ctx, const u_int8_t *vp, int ielen, unsigned int maxcols) case IEEE80211_ELEMID_RSN_EXT: printrsnxe(ctx, " RSNXE", vp, 2+vp[1]); break; + case IEEE80211_ELEMID_EXTFIELD: + printexties(ctx, vp, maxcols); + break; default: if (verbose) - printie(ctx, iename(vp[0]), vp, 2+vp[1], maxcols); + printie(ctx, iename(vp[0], vp), vp, 2+vp[1], maxcols); break; } ielen -= 2+vp[1]; From nobody Mon Jun 9 23:47:58 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGTBQ4fNHz5yh8J; Mon, 09 Jun 2025 23:47:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGTBQ42wDz3DpV; Mon, 09 Jun 2025 23:47:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749512878; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gf3wiXqtotXNp+eavBrSTaTk+LFMT4b/OlDdTEvs08M=; b=H8zW1X/IhNM3DIbB8qS0A6GdaDTyZUnI4lxhFxYviPOowh4cmLRXBuWtkZHFKcu6fUzf23 4a5C0ieehzvxRcfLvwb78neMCqODU++9AIGXQ7YdJ5if4bBLjaR9+sk1/vkqt1253rZHca kJY90FEhWyC0wXliOw5Fx7tcuH+gc9xLKeQZbEiqX+0wou1nZoW/Re6tGmUg8c9xpi49aU jdU0W8Ix4L8I6oWxLPO0KEm8dyhmE6NeKaDP7nfcZpYjN1qXN/3JeMAxwJ8DUs6kllx+v2 QQ3umkZVt1bE30PZXqzdpD65y4Hi0NCgiT7Kz4IQbxt9TsenDCyWvKNTedX0sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749512878; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gf3wiXqtotXNp+eavBrSTaTk+LFMT4b/OlDdTEvs08M=; b=VcP4jzO824NyaFaqqnUfQZPrJgEk7pri5dUU1ugxXWos3W0KiGXEC0JaRVA7YI5/9j4VKr mRn39pyom86wwydvIHOl1vV2I91HdTv7miukmPAxtJVx+Msd3fwsT+CQgjAOfOON1Io2fc 1u8H1LK6CHgr5k9Ud6p8sxYUdnxAXQ7q52wbP5NQU4QEJLJYZyShLSC8BET5LwVahd1WxU Iz+UZjTIVR6T1M9+vt9sOAm5tCaR5su51cBMShSR8jjkMx1JVQGAUEK2vtFe3uy1Y1i78b lXGY+X9rKg0wbfdNB3uCVB8Uu9485Gj+lN/x9wWL446nzfWca+WYzAkoQcWUug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749512878; a=rsa-sha256; cv=none; b=KQmdXIQ9H7fxFm2PiQsWHW3JaJYTr7zEysc1sNZm/wxfwWS8yu/BQxHNiIuzXRe3984bO6 ZMSynMEUrlyoC0cDPfBpzSEwVOuK/r3CSA4w5CW6otivLt7wJqVC/anMr606DiNvf/LHKg VNtSH9NV8px6HL/+pvPlsSVL87m6QuJTwB0lkwI9Rug8cQAdecRql1qMcLQSDTFABXx04C gKRPQpodBtZYYI/qTiXepiq9IMp6eosb8q1hMEYXVl+XU/JLvCgWnHHgREVpnkJ7vyQicO 7EIDAsdZyCxYTBimgrGLV6kn3ATuQAULGi564iiKvz4nhfGc8mWpa21HKPQS0g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGTBQ3dVyz2P1; Mon, 09 Jun 2025 23:47:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559NlwQo088639; Mon, 9 Jun 2025 23:47:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559NlwaF088636; Mon, 9 Jun 2025 23:47:58 GMT (envelope-from git) Date: Mon, 9 Jun 2025 23:47:58 GMT Message-Id: <202506092347.559NlwaF088636@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: b471d23a6a66 - main - ktls: add global generation count List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b471d23a6a667f54c84b3bb7ed04ea75931ef2b8 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b471d23a6a667f54c84b3bb7ed04ea75931ef2b8 commit b471d23a6a667f54c84b3bb7ed04ea75931ef2b8 Author: Konstantin Belousov AuthorDate: 2025-05-21 01:03:13 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-09 23:47:12 +0000 ktls: add global generation count Reviewed by: jhb, markj Sponsored by: NVidia networking Differential revision: https://reviews.freebsd.org/D50653 --- sys/kern/uipc_ktls.c | 8 ++++++++ sys/sys/ktls.h | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index 5e9dd254debd..b479ca9c3ed7 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -595,6 +595,8 @@ start: return (error); } +uint64_t ktls_glob_gen = 1; + static int ktls_create_session(struct socket *so, struct tls_enable *en, struct ktls_session **tlsp, int direction) @@ -819,6 +821,8 @@ ktls_create_session(struct socket *so, struct tls_enable *en, arc4rand(tls->params.iv + 8, sizeof(uint64_t), 0); } + atomic_thread_fence_rel(); + tls->gen = atomic_fetchadd_64(&ktls_glob_gen, 1); *tlsp = tls; return (0); } @@ -861,6 +865,8 @@ ktls_clone_session(struct ktls_session *tls, int direction) memcpy(tls_new->params.cipher_key, tls->params.cipher_key, tls->params.cipher_key_len); + atomic_thread_fence_rel(); + tls_new->gen = atomic_fetchadd_64(&ktls_glob_gen, 1); return (tls_new); } @@ -1940,6 +1946,8 @@ ktls_destroy(struct ktls_session *tls) MPASS(tls->refcount == 0); + atomic_add_acq_64(&ktls_glob_gen, 1); + inp = tls->inp; if (tls->tx) { wlocked = INP_WLOCKED(inp); diff --git a/sys/sys/ktls.h b/sys/sys/ktls.h index 0e52d643fe3b..8dad53868686 100644 --- a/sys/sys/ktls.h +++ b/sys/sys/ktls.h @@ -206,9 +206,12 @@ struct ktls_session { /* Used to destroy any kTLS session */ struct task destroy_task; + + uint64_t gen; } __aligned(CACHE_LINE_SIZE); extern unsigned int ktls_ifnet_max_rexmit_pct; +extern uint64_t ktls_glob_gen; typedef enum { KTLS_MBUF_CRYPTO_ST_MIXED = 0, @@ -258,5 +261,11 @@ ktls_free(struct ktls_session *tls) ktls_destroy(tls); } +static inline bool +ktls_session_genvis(const struct ktls_session *ks, uint64_t gen) +{ + return (ks != NULL && ks->gen <= gen); +} + #endif /* !_KERNEL */ #endif /* !_SYS_KTLS_H_ */ From nobody Mon Jun 9 23:47:59 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGTBS0Gsmz5yhF2; Mon, 09 Jun 2025 23:48:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGTBR505Lz3Dpb; Mon, 09 Jun 2025 23:47:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749512879; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2fzW485NqcEC9sB8YEk+m8K+5IR8uTcg87JNwoAxv8I=; b=IV/tCD9ISjIlPK7JJ9bvzWvA35+dvy0Mhac+149qGy5iATh5KpSXOyVuPqrh5NrIp27Vwx B0XjNmJs00oxckQQuVK3OER/ilMR5sPncv6KBkpT2fSIEno6Dk9h0Z5xf4KpowCp1lBWE7 5d042qBCh0Oggt2bL2148VrVtzbScf14cHZ/tKTvn/Zb+MGpC454VrkQaUt4Jjbz1icpkN urhMF+evLJG2pjAd1C+SZL6X4fE9o821eZe0KyITJWbqSxG8s6Waei6aBVaJ1u1u7caGW8 spCiCQ/RMZjyeuRRR1awuRAZ4EGocuDnGtgH6OLYbfJtTn8vIrIUlKWyyY5PAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749512879; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2fzW485NqcEC9sB8YEk+m8K+5IR8uTcg87JNwoAxv8I=; b=aVJxiTOuCW5lHHQSdmItHrFRt7r0LNwzHk/PlvHOD35wa6o2y6z0bSixGexYfAx+S3Jvd+ W2XHGW5aOH7Qyv1dPX2Yv9wjaFr4/llE1Qy4X+kXx5e/qVeQxSDinrt/jkNvsjtEd/3CHf TNl/kzJuh39WzpaVKECOfGnzRriAhFtm/ewYMc27+RA8i8M6RxZhbBnKrGg6QKvjcLyv6T w2HHevL60h38zHQUm3taFA3DOQ9MacQeURn689rGaHmv+cHAIj6M2ozHmyJAnQSRCMBMOx aeD0fAeskDdbfZj7zM+Omwm4y5/Z7RMGIjwJWJxjhmoa0LjLuWKt2VkwBAsgPQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749512879; a=rsa-sha256; cv=none; b=ONQGFPN6ZEB6inhh1z4WBgdojtfnQVXgH7vpRnFXqg8WDaZBPG+JaNqnmVpPs60D4S7nPn kDznsfXLAE2Gppk5BzP4cWNl4xeRYImh4rnhRpmFxK2PD/zmRC9hNqfvLlO/BvN3FlIDoE Uo3I+edhWLvtUi73Xky1q0PHplRwec1SMrMHDeLEvCDNuQDjfkXjDAyjyE3rK7O7FHWw8p 2XFn4fOy9Ru4CPzJl+86o0HRx2ogBLa+GaJd8nnSe2yE1S+rl67+8uTZ+rA5AblkxuvF7P CAUhu1NRB1EkI5ADwJf1iLypf/pAqDLtynxtetbd5SK7rCEOAcEwVd1fj+SM2g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGTBR4ZwTz1yq; Mon, 09 Jun 2025 23:47:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559Nlxkm088676; Mon, 9 Jun 2025 23:47:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559NlxQ5088673; Mon, 9 Jun 2025 23:47:59 GMT (envelope-from git) Date: Mon, 9 Jun 2025 23:47:59 GMT Message-Id: <202506092347.559NlxQ5088673@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: c9e9a0fe5b0f - main - ktls: define struct xktls_session and converter from ktls_session into external representation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c9e9a0fe5b0f88561f55fb2f6f5354fbbd96dd5d Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c9e9a0fe5b0f88561f55fb2f6f5354fbbd96dd5d commit c9e9a0fe5b0f88561f55fb2f6f5354fbbd96dd5d Author: Konstantin Belousov AuthorDate: 2025-05-20 08:06:23 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-09 23:47:12 +0000 ktls: define struct xktls_session and converter from ktls_session into external representation Reviewed by: jhb (previous version), markj Sponsored by: NVidia networking Differential revision: https://reviews.freebsd.org/D50653 --- sys/kern/uipc_ktls.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++ sys/netinet/in_pcb.h | 24 ++++++++++++++++++++++++ sys/sys/ktls.h | 27 ++++++++++++++++++++++++++ 3 files changed, 104 insertions(+) diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index b479ca9c3ed7..1cbaa7db2e84 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -3447,3 +3447,56 @@ ktls_disable_ifnet(void *arg) TASK_INIT(&tls->disable_ifnet_task, 0, ktls_disable_ifnet_help, tls); (void)taskqueue_enqueue(taskqueue_thread, &tls->disable_ifnet_task); } + +void +ktls_session_to_xktls_onedir(const struct ktls_session *ktls, bool export_keys, + struct xktls_session_onedir *xk) +{ + if_t ifp; + struct m_snd_tag *st; + + xk->gen = ktls->gen; +#define A(m) xk->m = ktls->params.m + A(cipher_algorithm); + A(auth_algorithm); + A(cipher_key_len); + A(auth_key_len); + A(max_frame_len); + A(tls_vmajor); + A(tls_vminor); + A(tls_hlen); + A(tls_tlen); + A(tls_bs); + A(flags); + if (export_keys) { + memcpy(&xk->iv, &ktls->params.iv, XKTLS_SESSION_IV_BUF_LEN); + A(iv_len); + } else { + memset(&xk->iv, 0, XKTLS_SESSION_IV_BUF_LEN); + xk->iv_len = 0; + } +#undef A + if ((st = ktls->snd_tag) != NULL && + (ifp = ktls->snd_tag->ifp) != NULL) + strncpy(xk->ifnet, if_name(ifp), sizeof(xk->ifnet)); +} + +void +ktls_session_copy_keys(const struct ktls_session *ktls, + uint8_t *data, size_t *sz) +{ + size_t t, ta, tc; + + if (ktls == NULL) { + *sz = 0; + return; + } + t = *sz; + tc = MIN(t, ktls->params.cipher_key_len); + if (data != NULL) + memcpy(data, ktls->params.cipher_key, tc); + ta = MIN(t - tc, ktls->params.auth_key_len); + if (data != NULL) + memcpy(data + tc, ktls->params.auth_key, ta); + *sz = ta + tc; +} diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h index 5fe12c4f1e76..57cf15ca37fc 100644 --- a/sys/netinet/in_pcb.h +++ b/sys/netinet/in_pcb.h @@ -303,6 +303,30 @@ struct sockopt_parameters { char sop_optval[]; }; +#ifdef _SYS_KTLS_H_ +struct xktls_session { + uint32_t tsz; /* total sz of elm, next elm is at this+tsz */ + uint32_t fsz; /* size of the struct up to keys */ + uint64_t inp_gencnt; + kvaddr_t so_pcb; + struct in_conninfo coninf; + u_short rx_vlan_id; + struct xktls_session_onedir rcv; + struct xktls_session_onedir snd; +/* + * Next are + * - keydata for rcv, first cipher of length rcv.cipher_key_len, then + * authentication of length rcv.auth_key_len; + * - driver data (string) of length rcv.drv_st_len, if the rcv session is + * offloaded to ifnet rcv.ifnet; + * - keydata for snd, first cipher of length snd.cipher_key_len, then + * authentication of length snd.auth_key_len; + * - driver data (string) of length snd.drv_st_len, if the snd session is + * offloaded to ifnet snd.ifnet; + */ +}; +#endif /* _SYS_KTLS_H_ */ + #ifdef _KERNEL int sysctl_setsockopt(SYSCTL_HANDLER_ARGS, struct inpcbinfo *pcbinfo, int (*ctloutput_set)(struct inpcb *, struct sockopt *)); diff --git a/sys/sys/ktls.h b/sys/sys/ktls.h index 8dad53868686..0f9e5c5ed87b 100644 --- a/sys/sys/ktls.h +++ b/sys/sys/ktls.h @@ -145,6 +145,28 @@ struct tls_get_record { uint16_t tls_length; }; +#define XKTLS_SESSION_IV_BUF_LEN 32 +struct xktls_session_onedir { + uint64_t gen; + uint64_t rsrv1[8]; + uint32_t rsrv2[8]; + uint8_t iv[XKTLS_SESSION_IV_BUF_LEN]; + int cipher_algorithm; + int auth_algorithm; + uint16_t cipher_key_len; + uint16_t iv_len; + uint16_t auth_key_len; + uint16_t max_frame_len; + uint8_t tls_vmajor; + uint8_t tls_vminor; + uint8_t tls_hlen; + uint8_t tls_tlen; + uint8_t tls_bs; + uint8_t flags; + uint16_t drv_st_len; + char ifnet[16]; /* IFNAMSIZ */ +}; + #ifdef _KERNEL struct tls_session_params { @@ -267,5 +289,10 @@ ktls_session_genvis(const struct ktls_session *ks, uint64_t gen) return (ks != NULL && ks->gen <= gen); } +void ktls_session_to_xktls_onedir(const struct ktls_session *ks, + bool export_keys, struct xktls_session_onedir *xktls_od); +void ktls_session_copy_keys(const struct ktls_session *ktls, + uint8_t *data, size_t *sz); + #endif /* !_KERNEL */ #endif /* !_SYS_KTLS_H_ */ From nobody Mon Jun 9 23:48:00 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGTBT0Mpyz5yhBh; Mon, 09 Jun 2025 23:48:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGTBS62wqz3Dr2; Mon, 09 Jun 2025 23:48:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749512880; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pu+7yfJZ81C/VY5fSU8aabDz+ydKLekqxAR8EOvDfRQ=; b=kiaz243d9eo2w9eoXcNc5OGFZkSJRUvP6HdWwZs1gteOeqkyjXd/qM503xmKuBVRHcWke7 gnKAqeJ2PyVwyBEVYFqT/ll/Q7R+sr0Om3ICVzZ7BHtRtriE0UodiuBBmtqFdw79NLpb6C TRhpaLo++VTT1wxyI1Wagc6XhOWz5p9Vy3QEHE2QGCmOkg92cJOSUUQ02HXvUyj5JYF1xN 6A113lL1tiWqIaY5/GYWs2aYtxN6L6CmQdIeEYhcTjklOQPk5NQjzqGVKnLz8h82TtWU/S XtDbs2rsNi04k+o2Uoyfaow+mMUkAsMl3l4k7GoNXCu0FFXt89Yh0NfOREjLHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749512880; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pu+7yfJZ81C/VY5fSU8aabDz+ydKLekqxAR8EOvDfRQ=; b=MhHGfdiZ/3o4Pr4SvZy+F30QB5TJuNqlMXsfeBAnn/+mjw1l5NFHe8+knEWpJ9t+bXLEs8 e3KcAgW4C5W6m145n5HdgmDU3O3IIFa+pwR31X8gV6lDCV1vdvHrAxjIAlkEmsAsXY9i4h wO776dm9hCOHRti1494tG27L0dSk9WdXs6H546+I5tQGlv7R5cDGpG9m/cLwqZecaLlO/0 hSy7egQU84SosSwineT6KGBaSzE7W6dR/z/KIIBdGfzw/RrVgBojG1g2amOLacY3rGgPES 6i1Ky59xemv5B5OcEcbE5XB0yvCUayUhMl/E3drzYghDOov9+/p1edgZk8ROfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749512880; a=rsa-sha256; cv=none; b=WpIxFujNRYDiS13geOXneNeJYyE688sy8mUa3jMb+sl3G/2gDXdITkEL+MNfjJ9s6f8bg7 lttdPeEDvu39AFQqP6xhKthYC4U8hEuuu6qH/FDY9utClDirLAaezp4KGXw7iASsxcVeXw lFZMRUzSPqzCdXPrdXTA76tPz8DhNa7rmG1Yi++Dhqo3rDwBuIwYpZ29dL+KrGgmJH5H6y /Hb9wI2GVZ0aZ7ujx5TGuCEV8MWj9N20mIExgU01ajLho7xjSoGArjwOkZDRmcztL0OPed 5YspU4mSW50whJDMnBa4Du3UshX1u1KvCmeIN/+tUOmX1gqQHysmCM4G/bhngw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGTBS5Y3mz2P2; Mon, 09 Jun 2025 23:48:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559Nm0aC088716; Mon, 9 Jun 2025 23:48:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559Nm0fo088713; Mon, 9 Jun 2025 23:48:00 GMT (envelope-from git) Date: Mon, 9 Jun 2025 23:48:00 GMT Message-Id: <202506092348.559Nm0fo088713@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 27f680beb58a - main - send tags: add a status report method List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 27f680beb58aec0a7eaf2d20b8d7e82d3aeb46ab Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=27f680beb58aec0a7eaf2d20b8d7e82d3aeb46ab commit 27f680beb58aec0a7eaf2d20b8d7e82d3aeb46ab Author: Konstantin Belousov AuthorDate: 2025-05-31 03:59:41 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-09 23:47:12 +0000 send tags: add a status report method Reviewed by: jhb, markj Sponsored by: NVidia networking Differential revision: https://reviews.freebsd.org/D50653 --- sys/net/if_var.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/net/if_var.h b/sys/net/if_var.h index 83d33330987e..08435e7bd5f6 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -297,12 +297,14 @@ typedef int (if_snd_tag_modify_t)(struct m_snd_tag *, union if_snd_tag_modify_pa typedef int (if_snd_tag_query_t)(struct m_snd_tag *, union if_snd_tag_query_params *); typedef void (if_snd_tag_free_t)(struct m_snd_tag *); typedef struct m_snd_tag *(if_next_send_tag_t)(struct m_snd_tag *); +typedef int (if_snd_tag_status_str_t)(struct m_snd_tag *, char *buf, size_t *sz); struct if_snd_tag_sw { if_snd_tag_modify_t *snd_tag_modify; if_snd_tag_query_t *snd_tag_query; if_snd_tag_free_t *snd_tag_free; if_next_send_tag_t *next_snd_tag; + if_snd_tag_status_str_t *snd_tag_status_str; u_int type; /* One of IF_SND_TAG_TYPE_*. */ }; From nobody Mon Jun 9 23:48:01 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGTBV5zz5z5ygk0; Mon, 09 Jun 2025 23:48:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGTBT74PXz3F24; Mon, 09 Jun 2025 23:48:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749512882; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UNWKHFAAPZW0CF4jetl1o0giDecQe2E8APLvmJ7O8rY=; b=mXjrGz2XijF6PaoouEH5ExX8xdn3EUPQ8FzU0RsqKU/cw33efFjy2w9U+sFqVmI7GLL+yi n+2j3BCyxLhoOg/McWqeFuV18vTeFuwK6LPyAa8nw1h5uGqFnUse+zyDvZy+NBVQ+RX5Ux DI0FJcp2dPXf9lmaomiID/JBTvXvzl5JukSUihNZmTnM40sHpJnLy+CtfCZ0OH2cTj/7a/ kHLxDLg3WIYda17FmkS8FJwC9jl9oDdE2pgeTrGf6RgBJBsfe1RRiHKFi51eQWoMGgp4UY moRKqVpKp/w8qLd+Shdb1ncYU8QpC1pB/QEkgA20JjqthYcuIHzJrYGTqhjFvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749512882; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UNWKHFAAPZW0CF4jetl1o0giDecQe2E8APLvmJ7O8rY=; b=s+5uL7ieU9CNymltCyyyts9hwt8mF9ZLOiP+uZ9Z3oxP7fu/J741Mh0SL7+AuNPsgCEFcx 8YnOjiRQW/KPqeenLr5PbppLv/Y6EI9QosTLpsb3WgQGTMH7isTFkoyZroRaX4JHsW5jFi Xt0TD14W0tEESzBQIoeqXdwVxLkBtmMXpqn4H3bi6GpyOFpXLnm6PXRF8hh3p3DFEnX/2I RcrfTELJqjyk1t4fewortSW1sbJkzw0v9/HZDdq9vWHg44C42pRRAXxyx/cuQR3Cpe5haP 1KHI7ajez69vHxU3GXj3lAf53odQrqQ4fQ25NBo2iNJyNCGrNrZQHeIolMADCw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749512882; a=rsa-sha256; cv=none; b=oH0KX4nK/E7Q536Y5Qn92Itux5AVq8Jce9p3ky4E4jK88PLLxWu8pyznf6rhW0jwn8Gr6h acdcGdSOji/PW80RY+Gube2qm21OFUNa5WYOIOLYIuuGdj0B/ZGlvlrSfOCZ+vIO3amNGB pH7OrOQcplL78iSf/w81tXGc4HxpROX30soZ/5OTg74fmNK/rdkwjUAWn6kGAprAA0oIGy q8qQGeWvnpRPaUbV2xI19twhnow1i+gKQdAzzOWCLmSLgZjwksdlZov+df/2mhvDNN3mqm zhX/XSRU9JGhOC7TZepBwqEcIL+73BWQHOnRnbLs9mpC6Agb6QN/Krf5ywc4PQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGTBT6TBBz2P3; Mon, 09 Jun 2025 23:48:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559Nm10t088756; Mon, 9 Jun 2025 23:48:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559Nm1tK088753; Mon, 9 Jun 2025 23:48:01 GMT (envelope-from git) Date: Mon, 9 Jun 2025 23:48:01 GMT Message-Id: <202506092348.559Nm1tK088753@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 0d5b6fb6aee8 - main - kern_prot: extract code to check that active ids are superset of obj ids List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0d5b6fb6aee8faff5265d429daaf61e7b79c5252 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0d5b6fb6aee8faff5265d429daaf61e7b79c5252 commit 0d5b6fb6aee8faff5265d429daaf61e7b79c5252 Author: Konstantin Belousov AuthorDate: 2025-06-07 13:47:34 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-09 23:47:12 +0000 kern_prot: extract code to check that active ids are superset of obj ids Export it as a helper cr_xids_subset(). Reviewed by: markj Sponsored by: NVidia networking Differential revision: https://reviews.freebsd.org/D50653 --- sys/kern/kern_prot.c | 64 ++++++++++++++++++++++++++++++++-------------------- sys/sys/ucred.h | 1 + 2 files changed, 40 insertions(+), 25 deletions(-) diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index cc140d28e13d..d9aeec68e620 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -2150,6 +2150,43 @@ SYSCTL_PROC(_security_bsd, OID_AUTO, unprivileged_proc_debug, CTLFLAG_MPSAFE, 0, 0, sysctl_unprivileged_proc_debug, "I", "Unprivileged processes may use process debugging facilities"); +/* + * Return true if the object owner/group ids are subset of the active + * credentials. + */ +bool +cr_xids_subset(struct ucred *active_cred, struct ucred *obj_cred) +{ + int i; + bool grpsubset, uidsubset; + + /* + * Is p's group set a subset of td's effective group set? This + * includes p's egid, group access list, rgid, and svgid. + */ + grpsubset = true; + for (i = 0; i < obj_cred->cr_ngroups; i++) { + if (!groupmember(obj_cred->cr_groups[i], active_cred)) { + grpsubset = false; + break; + } + } + grpsubset = grpsubset && + groupmember(obj_cred->cr_rgid, active_cred) && + groupmember(obj_cred->cr_svgid, active_cred); + + /* + * Are the uids present in obj_cred's credential equal to + * active_cred's effective uid? This includes obj_cred's + * euid, svuid, and ruid. + */ + uidsubset = (active_cred->cr_uid == obj_cred->cr_uid && + active_cred->cr_uid == obj_cred->cr_svuid && + active_cred->cr_uid == obj_cred->cr_ruid); + + return (uidsubset && grpsubset); +} + /*- * Determine whether td may debug p. * Returns: 0 for permitted, an errno value otherwise @@ -2161,7 +2198,7 @@ SYSCTL_PROC(_security_bsd, OID_AUTO, unprivileged_proc_debug, int p_candebug(struct thread *td, struct proc *p) { - int error, grpsubset, i, uidsubset; + int error; KASSERT(td == curthread, ("%s: td not curthread", __func__)); PROC_LOCK_ASSERT(p, MA_OWNED); @@ -2178,35 +2215,12 @@ p_candebug(struct thread *td, struct proc *p) if ((error = cr_bsd_visible(td->td_ucred, p->p_ucred))) return (error); - /* - * Is p's group set a subset of td's effective group set? This - * includes p's egid, group access list, rgid, and svgid. - */ - grpsubset = 1; - for (i = 0; i < p->p_ucred->cr_ngroups; i++) { - if (!groupmember(p->p_ucred->cr_groups[i], td->td_ucred)) { - grpsubset = 0; - break; - } - } - grpsubset = grpsubset && - groupmember(p->p_ucred->cr_rgid, td->td_ucred) && - groupmember(p->p_ucred->cr_svgid, td->td_ucred); - - /* - * Are the uids present in p's credential equal to td's - * effective uid? This includes p's euid, svuid, and ruid. - */ - uidsubset = (td->td_ucred->cr_uid == p->p_ucred->cr_uid && - td->td_ucred->cr_uid == p->p_ucred->cr_svuid && - td->td_ucred->cr_uid == p->p_ucred->cr_ruid); - /* * If p's gids aren't a subset, or the uids aren't a subset, * or the credential has changed, require appropriate privilege * for td to debug p. */ - if (!grpsubset || !uidsubset) { + if (!cr_xids_subset(td->td_ucred, p->p_ucred)) { error = priv_check(td, PRIV_DEBUG_DIFFCRED); if (error) return (error); diff --git a/sys/sys/ucred.h b/sys/sys/ucred.h index 7d04ea7de97f..ddd8f3ddb63d 100644 --- a/sys/sys/ucred.h +++ b/sys/sys/ucred.h @@ -237,6 +237,7 @@ void cru2xt(struct thread *td, struct xucred *xcr); void crsetgroups(struct ucred *cr, int ngrp, const gid_t *groups); void crsetgroups_fallback(struct ucred *cr, int ngrp, const gid_t *groups, const gid_t fallback); +bool cr_xids_subset(struct ucred *active_cred, struct ucred *obj_cred); /* * Returns whether gid designates a primary group in cred. From nobody Mon Jun 9 23:48:02 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGTBX11h5z5ygw1; Mon, 09 Jun 2025 23:48:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGTBW0Ndvz3DrX; Mon, 09 Jun 2025 23:48:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749512883; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b1zDFRTtYEIWpzoPBuf2cNwnmppgHLhz6Bh4GkLGqsY=; b=ZwYby4188RxJnmc6MdNB2O7Xy135sR1ejdJlKxcKZwhWgBiHOV3PotkCJYUydSQqqw7K/F ySazQK66kzmv74oVqr0KkO0GBQFGwCqcykZDv8QFSpktI+bAEROX661OcxKFjGtFn2FQMO 4nn7WNlP/19LdSLAUcWniUPaz/wDYYt9bgMYhKUQmIVRnxUBGXY2AluCBQHBAwaMp96FIL 4V9+uUqxgG55bfTS247XA3Epbv3LyB2HwAe+CK442VR7edIvQt1utUuU4cF9dkjdqI4iTI 9wz8BdYdEIuFqBXc4LWXTrI3Fy4vUrzots/EJCZ4T/vCL39ZL+OaaU4jF5yRJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749512883; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b1zDFRTtYEIWpzoPBuf2cNwnmppgHLhz6Bh4GkLGqsY=; b=qrTTxFUZkku/CXSSe7Mm3vKdVZX3UHMg6T1QrEHyUYzwVCpBdeJ+u5/6rmsNSVP2NCSkBq 0U8OckU5TRtaLUsNTeOkWUrtRU/qbYUPqxMFrgOXYfKUomlRVlyHRpWyoIvIA/yDzd4QVh YiZQ/OuzLOz06oUOo5AZg+C3ubRbb3Tlu3VPvqSqMmyPCn6vG9mk8WPJX0qjW0CfxOWfIF iXjYvuJMK4bZZkLAP/PG8FjVdb73J7z50x6hUh8WibFSKWoeiTZSCpZM9BdE3rPYiyLUhL RBZigcOEDLt/rvXE3QIXUn+LlGZQFSCzA/1it4AfpX8L7RAwhMovbl3yu6484w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749512883; a=rsa-sha256; cv=none; b=jnqLtr9AUBaKp25CLqi0uFpvLgyoVh5uJ9bNQ9eYdoh1jAU4/V8ZFUEhB8Pfy8fXlBPOqg YcMJZ20eb+f5V9Gh6+tHEYBm2wRUFHHe8mHJet0Ol6Za9i1KXf9tmY4fdIkQR5WsxJyOr2 MhLQKdsOlCpKkOm9Y70ME5IgS3yahfKCPeYMq2vGGlXTstDoUDhMFTogU3yh2a5PKbXYl/ sawrWz+0A4CSYCqHJOSN1Gt4RrAPmUPd9mUE540ENZOW37l6E7tCjLe/opOILkJAXEkOWY m/YX5bNGAMpexNjqUFTuX48nUCCPJ8lT0HUetUAxlmZ47MMQn2SFohv8s4Kamw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGTBV752Nz2NL; Mon, 09 Jun 2025 23:48:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559Nm2e1088794; Mon, 9 Jun 2025 23:48:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559Nm2Ma088791; Mon, 9 Jun 2025 23:48:02 GMT (envelope-from git) Date: Mon, 9 Jun 2025 23:48:02 GMT Message-Id: <202506092348.559Nm2Ma088791@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: e17485c2bdc1 - main - inpcb: provide policy cr_canexport_ktlskeys() and the privilege PRIV_NETINET_KTLSKEYS List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e17485c2bdc164a73c72aa73006025a31983e20b Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e17485c2bdc164a73c72aa73006025a31983e20b commit e17485c2bdc164a73c72aa73006025a31983e20b Author: Konstantin Belousov AuthorDate: 2025-06-07 13:49:11 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-09 23:47:13 +0000 inpcb: provide policy cr_canexport_ktlskeys() and the privilege PRIV_NETINET_KTLSKEYS The policy defines the visibility of the ktls session keys to a thread. Reviewed by: markj Sponsored by: NVidia networking Differential revision: https://reviews.freebsd.org/D50653 --- sys/netinet/in_prot.c | 14 ++++++++++++++ sys/netinet/in_systm.h | 2 ++ sys/sys/priv.h | 1 + 3 files changed, 17 insertions(+) diff --git a/sys/netinet/in_prot.c b/sys/netinet/in_prot.c index 204f4f60456e..d81f24d6c040 100644 --- a/sys/netinet/in_prot.c +++ b/sys/netinet/in_prot.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -72,3 +73,16 @@ cr_canseeinpcb(struct ucred *cred, struct inpcb *inp) return (0); } + +bool +cr_canexport_ktlskeys(struct thread *td, struct inpcb *inp) +{ + int error; + + if (cr_canseeinpcb(td->td_ucred, inp) == 0 && + cr_xids_subset(td->td_ucred, inp->inp_cred)) + return (true); + error = priv_check(td, PRIV_NETINET_KTLSKEYS); + return (error == 0); + +} diff --git a/sys/netinet/in_systm.h b/sys/netinet/in_systm.h index 2f057b962d79..e2f553ec461c 100644 --- a/sys/netinet/in_systm.h +++ b/sys/netinet/in_systm.h @@ -58,8 +58,10 @@ typedef u_int32_t n_time; /* ms since 00:00 UTC, byte rev */ #ifdef _KERNEL struct inpcb; struct ucred; +struct thread; int cr_canseeinpcb(struct ucred *cred, struct inpcb *inp); +bool cr_canexport_ktlskeys(struct thread *td, struct inpcb *inp); uint32_t iptime(void); #endif diff --git a/sys/sys/priv.h b/sys/sys/priv.h index 9a1886454d86..1f73877ab450 100644 --- a/sys/sys/priv.h +++ b/sys/sys/priv.h @@ -406,6 +406,7 @@ #define PRIV_NETINET_SETHDROPTS 505 /* Set certain IPv4/6 header options. */ #define PRIV_NETINET_BINDANY 506 /* Allow bind to any address. */ #define PRIV_NETINET_HASHKEY 507 /* Get and set hash keys for IPv4/6. */ +#define PRIV_NETINET_KTLSKEYS 508 /* Read ktls session keys. */ /* * Placeholders for IPX/SPX privileges, not supported any more. From nobody Mon Jun 9 23:48:04 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGTBX5jwNz5yh8M; Mon, 09 Jun 2025 23:48:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGTBX1ZlMz3Drs; Mon, 09 Jun 2025 23:48:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749512884; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hUQ/oGVqS8cmVD13HG96IGm9Qi6qSRPL9vgd5yu2OsI=; b=MCE7XBkgVeDsttB7S1pE0ceFdvM9k4WkcYSoL0ymKKPBKLO+CFtG880Pfy+Q7ocTKAumjh +wbA9KHXtulcGKFQmiPdTqFhgM+TuuL3UD9+6dToj7p1qNeT9UMCzqDrB0WHfRFsAP3a6l EH9Ft2qBLvX9cJmS3bprQCpf9UUHj5z2PCvceZdBBz5H7YMSfmVvAev7XX/ZOndB3TsX3O NdlFbgq41a5Tyi04jdiGvUWm77pls9KPj1UJlBSmN4XlzZazMLdPvi3pCPhkvlg8rAWtLF 3d6Np/7VaIfugdOtJHkFKwoE4QtOoc5kZ4zm7gb+kuWWonvq9KnknKvSaYJRJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749512884; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hUQ/oGVqS8cmVD13HG96IGm9Qi6qSRPL9vgd5yu2OsI=; b=Aa1dTccPyrLsNuHmcxAlGTBQdXzogQ8gmsdAMrRumH4m2iEQ+W7eyttRQXEFSvBQiDCoqf yBhBp8fXDfppaGrvuodpyFznhXEVjh9zumc1nj/sGuKTFUp1NsKpap9FsREnkVo6o+drL/ ioptSgbGWdweM17qCLLbhMozG688u1H6VF5EM+f1seSMJ0KSqqPMW0ivsSQoG/em6Wj0ni 2NKFUm29j8aCby9rkAKau6+zjiRksfxn8FsFz+/lXNYR5a1GKNvhWm30LM5Z9o+tz5KwEE mspaYeToncDd5R9H3MCfRCvKLcKGgHnspssFVf9PltFkQSkZAoQvwOfIphGGpw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749512884; a=rsa-sha256; cv=none; b=wFR00P++7iYTT+woU+D/OgpIIIOyTzLdCpMErTSaymQTCPUjJY29c0+CxTsKdg74PqIDE0 NSN8+FcPQ5sNnbkVBYx6MlPHEnNgTl82ahVadgZ2u5b4WH66iqVmXIUiprWCod/oV8KGC7 GbAir4IEbmhtsPvs0BeAQg/XLlJqhAJ9jjdkCU4PVAUMxeKD4274FT9x23Vz1qWLm+o/Zl WXV8Q95PP6yXUJkoDmgwbqORP+4jkgkS5H2jCTb6p4eYHfMdYzjj8x54xYLiO84ybSKkxY lMxnQczmoXdmadpZtIeArrj1gJNMODbUsvtin0c83ud4WqQp7JZZuemqVSodFA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGTBX0xQlz1tQ; Mon, 09 Jun 2025 23:48:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559Nm4pF088830; Mon, 9 Jun 2025 23:48:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559Nm4O4088827; Mon, 9 Jun 2025 23:48:04 GMT (envelope-from git) Date: Mon, 9 Jun 2025 23:48:04 GMT Message-Id: <202506092348.559Nm4O4088827@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 5fea0d9e9dbf - main - sysctl net.inet.tcp.ktlslist List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5fea0d9e9dbfe741ab614d05d916ab91472144bf Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=5fea0d9e9dbfe741ab614d05d916ab91472144bf commit 5fea0d9e9dbfe741ab614d05d916ab91472144bf Author: Konstantin Belousov AuthorDate: 2025-05-20 08:07:49 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-09 23:47:13 +0000 sysctl net.inet.tcp.ktlslist Reviewed by: jhb (previous version), markj Sponsored by: NVidia networking Differential revision: https://reviews.freebsd.org/D50653 --- sys/netinet/tcp_subr.c | 212 +++++++++++++++++++++++++++++++++++++++++++++++++ sys/netinet/tcp_var.h | 3 + 2 files changed, 215 insertions(+) diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index f3f28f54c459..f766bf25ad66 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -2664,6 +2664,218 @@ SYSCTL_PROC(_net_inet_tcp, TCPCTL_PCBLIST, pcblist, NULL, 0, tcp_pcblist, "S,xtcpcb", "List of active TCP connections"); +#define SND_TAG_STATUS_MAXLEN 128 + +#ifdef KERN_TLS +static int +tcp_ktlslist(SYSCTL_HANDLER_ARGS, bool export_keys) +{ + struct xinpgen xig; + struct inpcb *inp; + struct socket *so; + struct ktls_session *ksr, *kss; + char *buf; + struct xktls_session *xktls; + uint64_t ipi_gencnt; + size_t buflen, len, sz; + u_int cnt; + int error; + bool ek, p; + + if (req->newptr != NULL) + return (EPERM); + + len = 0; + cnt = 0; + ipi_gencnt = V_tcbinfo.ipi_gencnt; + bzero(&xig, sizeof(xig)); + xig.xig_len = sizeof(xig); + xig.xig_gen = atomic_load_acq_64(&ktls_glob_gen); + xig.xig_sogen = so_gencnt; + + struct inpcb_iterator inpi = INP_ALL_ITERATOR(&V_tcbinfo, + INPLOOKUP_RLOCKPCB); + while ((inp = inp_next(&inpi)) != NULL) { + if (inp->inp_gencnt > ipi_gencnt || + cr_canseeinpcb(req->td->td_ucred, inp) != 0) + continue; + + so = inp->inp_socket; + if (so != NULL && so->so_gencnt <= xig.xig_sogen) { + p = false; + ek = export_keys && cr_canexport_ktlskeys( + req->td, inp); + ksr = so->so_rcv.sb_tls_info; + if (ktls_session_genvis(ksr, xig.xig_gen)) { + p = true; + if (ek) { + sz = SIZE_T_MAX; + ktls_session_copy_keys(ksr, + NULL, &sz); + len += sz; + } + if (ksr->snd_tag != NULL && + ksr->snd_tag->sw->snd_tag_status_str != + NULL) { + sz = SND_TAG_STATUS_MAXLEN; + ksr->snd_tag->sw->snd_tag_status_str( + ksr->snd_tag, NULL, &sz); + len += sz; + } + } + kss = so->so_snd.sb_tls_info; + if (ktls_session_genvis(kss, xig.xig_gen)) { + p = true; + if (ek) { + sz = SIZE_T_MAX; + ktls_session_copy_keys(kss, + NULL, &sz); + len += sz; + } + if (kss->snd_tag != NULL && + kss->snd_tag->sw->snd_tag_status_str != + NULL) { + sz = SND_TAG_STATUS_MAXLEN; + kss->snd_tag->sw->snd_tag_status_str( + kss->snd_tag, NULL, &sz); + len += sz; + } + } + if (p) { + len += sizeof(*xktls); + len = roundup2(len, __alignof(struct + xktls_session)); + } + } + } + if (req->oldptr == NULL) { + len += 2 * sizeof(xig); + len += 3 * len / 4; + req->oldidx = len; + return (0); + } + + if ((error = sysctl_wire_old_buffer(req, 0)) != 0) + return (error); + + error = SYSCTL_OUT(req, &xig, sizeof xig); + if (error != 0) + return (error); + + buflen = roundup2(sizeof(*xktls) + 2 * TLS_MAX_PARAM_SIZE + + 2 * SND_TAG_STATUS_MAXLEN, __alignof(struct xktls_session)); + buf = malloc(buflen, M_TEMP, M_WAITOK | M_ZERO); + struct inpcb_iterator inpi1 = INP_ALL_ITERATOR(&V_tcbinfo, + INPLOOKUP_RLOCKPCB); + while ((inp = inp_next(&inpi1)) != NULL) { + if (inp->inp_gencnt > ipi_gencnt || + cr_canseeinpcb(req->td->td_ucred, inp) != 0) + continue; + + so = inp->inp_socket; + if (so == NULL) + continue; + + p = false; + ek = export_keys && cr_canexport_ktlskeys(req->td, inp); + ksr = so->so_rcv.sb_tls_info; + kss = so->so_snd.sb_tls_info; + xktls = (struct xktls_session *)buf; + if (ktls_session_genvis(ksr, xig.xig_gen)) { + p = true; + ktls_session_to_xktls_onedir(ksr, ek, &xktls->rcv); + } + if (ktls_session_genvis(kss, xig.xig_gen)) { + p = true; + ktls_session_to_xktls_onedir(kss, ek, &xktls->snd); + } + if (!p) + continue; + + xktls->inp_gencnt = inp->inp_gencnt; + xktls->so_pcb = (kvaddr_t)inp; + memcpy(&xktls->coninf, &inp->inp_inc, sizeof(xktls->coninf)); + len = sizeof(*xktls); + if (ktls_session_genvis(ksr, xig.xig_gen)) { + if (ek) { + sz = buflen - len; + ktls_session_copy_keys(ksr, buf + len, &sz); + len += sz; + } else { + xktls->rcv.cipher_key_len = 0; + xktls->rcv.auth_key_len = 0; + } + if (ksr->snd_tag != NULL && + ksr->snd_tag->sw->snd_tag_status_str != NULL) { + sz = SND_TAG_STATUS_MAXLEN; + ksr->snd_tag->sw->snd_tag_status_str( + ksr->snd_tag, buf + len, &sz); + len += sz; + } + } + if (ktls_session_genvis(kss, xig.xig_gen)) { + if (ek) { + sz = buflen - len; + ktls_session_copy_keys(kss, buf + len, &sz); + len += sz; + } else { + xktls->snd.cipher_key_len = 0; + xktls->snd.auth_key_len = 0; + } + if (kss->snd_tag != NULL && + kss->snd_tag->sw->snd_tag_status_str != NULL) { + sz = SND_TAG_STATUS_MAXLEN; + kss->snd_tag->sw->snd_tag_status_str( + kss->snd_tag, buf + len, &sz); + len += sz; + } + } + len = roundup2(len, __alignof(*xktls)); + xktls->tsz = len; + xktls->fsz = sizeof(*xktls); + + error = SYSCTL_OUT(req, xktls, len); + if (error != 0) { + INP_RUNLOCK(inp); + break; + } + cnt++; + } + + if (error == 0) { + atomic_thread_fence_rel(); + xig.xig_gen = atomic_load_64(&ktls_glob_gen); + xig.xig_sogen = so_gencnt; + xig.xig_count = cnt; + error = SYSCTL_OUT(req, &xig, sizeof(xig)); + } + + zfree(buf, M_TEMP); + return (error); +} + +static int +tcp_ktlslist_nokeys(SYSCTL_HANDLER_ARGS) +{ + return (tcp_ktlslist(oidp, arg1, arg2, req, false)); +} + +static int +tcp_ktlslist_wkeys(SYSCTL_HANDLER_ARGS) +{ + return (tcp_ktlslist(oidp, arg1, arg2, req, true)); +} + +SYSCTL_PROC(_net_inet_tcp, TCPCTL_KTLSLIST, ktlslist, + CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE, + NULL, 0, tcp_ktlslist_nokeys, "S,xktls_session", + "List of active kTLS sessions for TCP connections"); +SYSCTL_PROC(_net_inet_tcp, TCPCTL_KTLSLIST_WKEYS, ktlslist_wkeys, + CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE, + NULL, 0, tcp_ktlslist_wkeys, "S,xktls_session", + "List of active kTLS sessions for TCP connections with keys"); +#endif /* KERN_TLS */ + #ifdef INET static int tcp_getcred(SYSCTL_HANDLER_ARGS) diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index ddc701581f90..4d49f5d2a954 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -1234,6 +1234,9 @@ struct tcp_function_info { #define TCPCTL_SACK 14 /* Selective Acknowledgement,rfc 2018 */ #define TCPCTL_DROP 15 /* drop tcp connection */ #define TCPCTL_STATES 16 /* connection counts by TCP state */ +#define TCPCTL_KTLSLIST 17 /* connections with active ktls + session */ +#define TCPCTL_KTLSLIST_WKEYS 18 /* KTLSLIST with key data exported */ #ifdef _KERNEL #ifdef SYSCTL_DECL From nobody Mon Jun 9 23:48:05 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGTBY3kv6z5yhFG; Mon, 09 Jun 2025 23:48:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGTBY2dK8z3F5B; Mon, 09 Jun 2025 23:48:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749512885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aCXO0d3g+IYUTW6uZhqfufOqRMR+V7JO2whwHdsravg=; b=LOKz8wJJXvjPxALvoeb/gYdoHSJKS0GSE1lkqWeyTSahaiMlfaBXh0HxsOLyIzd/wv4iOS S0x7fiA/+RV4SjpLKaKN9+RT6FXsbSqPrh8w6xg4PY23S2IJqaGFa1pJdkszeV/8PH0nzf c77l8109MLdw0kL7lZn7FmGV7iWNIBYjPieE05hBzr0wnLXtp/10W+53DbZ/mQqpYtNffO BN+FQzyI2VDPPmPbkYQwF2CYjyAIV7D6qOv8cNHrcimHMVsMyEmv30PmnNtKEXhFIiknfZ x114BLuJvo/WL6OZsY7aFWh7EUQVV8jFfR1kWPEf7F+uaYT3+pbdYWVA+1r5hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749512885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aCXO0d3g+IYUTW6uZhqfufOqRMR+V7JO2whwHdsravg=; b=ZqK1mShIkSP4nzDn+IUZDksQo0p2bNGvzQY8x0PSgjqimO2tPOmidYnS9nTKqGq099AOqd YGYJCwTzZ/a8Lz5KERLBpikwMWeFKcb5fa86q02xlBoDGPRxsP4p48uriECSOeMV44PvZp 558ROaP8Xina68teir66d7Bqc0EOv7pspVv+nh9wQtCFgT8yzxv775cQgT84dvFx4Iiw9D nbanOBZ05deuzGMVuW0z9fymqIKkibgwuY1hc4P7PAOZVsqJAefgBKxkyIpg3mM9G1Fnyt Fc+a8Ft+NNOyz6uXltlH9oLvkcJFg6vyyReZccyYW/WzLKvxu+JA9WJp+Tw5Ug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749512885; a=rsa-sha256; cv=none; b=slxH0iced0D+5sgMcZ9AzSNdh4lMtQMzXQe9+XY3A7p+WtWKIDlso+p5SMsmhYiRVum0d8 jgePKv7OXPOE2N2pFMvfdoW9YaRdPBfeafczwiw8ekoXkyn9PWLSe3+G2Dr6MsaPQYFvzU L+zONTZwNzdCGcnKQ8DH5NSn6ALThfkMLvaVvi+OWdW35yVJ4ag9JgcN8nkYpdCWYovea3 PNK7cxFXzO6e8rpw7+WpX7rp9DbcgVR6E1zPy5BzDhbtiAn9y2udZP2S23eSH0nKIX+MBf nxF6JrFznV/jmEHZ1ArOVnDTTEHT8I+St57o1fNicGOKq2RQXbI+/XtGSDW1Xw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGTBY1xWCz2P4; Mon, 09 Jun 2025 23:48:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559Nm5mj088865; Mon, 9 Jun 2025 23:48:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559Nm53k088861; Mon, 9 Jun 2025 23:48:05 GMT (envelope-from git) Date: Mon, 9 Jun 2025 23:48:05 GMT Message-Id: <202506092348.559Nm53k088861@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 4b17a918a9df - main - netinet/in_prot.c: normalize includes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4b17a918a9df1e11ab57de3cd38351e922086f53 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=4b17a918a9df1e11ab57de3cd38351e922086f53 commit 4b17a918a9df1e11ab57de3cd38351e922086f53 Author: Konstantin Belousov AuthorDate: 2025-06-07 13:54:50 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-09 23:47:13 +0000 netinet/in_prot.c: normalize includes Remove sys/cdefs.h. Remote opt_inet*.h, they are not used. Order alphabetically. Update the herald comment. Reviewed by: markj Sponsored by: NVidia networking Differential revision: https://reviews.freebsd.org/D50653 --- sys/netinet/in_prot.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/sys/netinet/in_prot.c b/sys/netinet/in_prot.c index d81f24d6c040..69f0f3694096 100644 --- a/sys/netinet/in_prot.c +++ b/sys/netinet/in_prot.c @@ -26,22 +26,17 @@ */ /* - * System calls related to processes and protection + * Helpers related to visibility and protection of sockets and inpcb. */ -#include -#include "opt_inet.h" -#include "opt_inet6.h" - -#include #include +#include #include #include #include #include #include #include -#include #include #include From nobody Mon Jun 9 23:53:14 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGTJW13srz5yhGg; Mon, 09 Jun 2025 23:53:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGTJW0bQYz3KGB; Mon, 09 Jun 2025 23:53:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749513195; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aAMWYsjTqRAmX1f4vBjEsKhRnTY0ZKCmau04os22s+8=; b=T62UMZeN67UxOZnTPHDXK7o9G5nuwAPP7XIP0K+1VfMbDa7sXgYxTPNQryxhsyPJeRpUBh GImIEAvDdmJkNpNF7hvpQ1hJo596kt3NQwhLafUxjq+6I2UUuTnFlsee97jLFRiOlKDrdS KfXDqUqGYtRKLFI1/PZvNHNU/wEdzh5TpnGtJW1ae5V180SLygYXS8iDsoe6sm1cr3Lx7z 5rj6Nt7d47U0S/97SYaU7n13LXZJzsZ2QtsMBb5Bh5Eg4Ne4zLvxv6Mw85nStsjMFri4TG SHwoLfRHB91cq+ma+Kr3SyOEPgpkEVHUFeLz/lkZ7H2k3Mwb+wP9cDG0RToHZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749513195; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aAMWYsjTqRAmX1f4vBjEsKhRnTY0ZKCmau04os22s+8=; b=Z23akwqNscVpy2Zl4EV0ykLo/6NVISusUEO8DnWH9JkzZ6wGPruzQGnATwe5B1GuQ/M5Dj 9p5+6cx6OAUyIUKhVmK/FRKds4hJEe1fW/DZLb3+m32AYlJALaZ9OhR/Wjwt3QrY2lo55v ykJhvav0diyhS3dHkQlBIR5QVNc3LWS37NWm0gE0Gk6ruqj6Wo1D3EoCGA+b4KJwS8e5Aj XzARDRSDhhoMyFOKxVesfYNR2kdbsKbUD8znAfUCsKTwz2qS+PqQIu3a9MYuL9rhfMCRF/ EN4mqnVQabmKPtx16I07a1RGpPAnKxySQBWszTAzmfABIs+ETDXq23b4f+MLAA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749513195; a=rsa-sha256; cv=none; b=yaYv7zYry9g+IQ/+subIx9I2kSt0bSCWQH85y45c48tcMoljlu1TSjbGcMBp9oayy3G0PV XxurLX1dsbS1gBFgr0ggJ8YFG6OH/7ujPsyCBs2JdY6H0jbtxwX+BthfMqQYKb1dJddzi6 WxdgAYdBYuxuD4rAjLGbV4xgJ/lUGZMv9Pg5p8tMGtGgylMm5TrekjAyb6cqpw32pxcLrJ hfVLaF2jaF/GXDLbIAVuJnXf7ZWSFwFvmI0uio06M9MzQ7BTf4hPpgyZCB+jb035FKnr41 i3W6sZIXt05bIW1g26qN7rpwW34j0VfCUJSe9Zt9190nex30j/IjgqDGAj07xw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGTJW08Cjz2BX; Mon, 09 Jun 2025 23:53:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559NrEl2006657; Mon, 9 Jun 2025 23:53:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559NrE0Z006654; Mon, 9 Jun 2025 23:53:14 GMT (envelope-from git) Date: Mon, 9 Jun 2025 23:53:14 GMT Message-Id: <202506092353.559NrE0Z006654@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 8226a8b58810 - main - kern_sigsuspend(): style List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8226a8b588101b7540249fa208a7ea67e4523c73 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8226a8b588101b7540249fa208a7ea67e4523c73 commit 8226a8b588101b7540249fa208a7ea67e4523c73 Author: Konstantin Belousov AuthorDate: 2025-06-08 03:23:31 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-09 23:50:42 +0000 kern_sigsuspend(): style Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D50752 --- sys/kern/kern_sig.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index f5ebd7c7b1ce..a98bee38e75c 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -1657,8 +1657,8 @@ kern_sigsuspend(struct thread *td, sigset_t mask) */ (p->p_sysent->sv_set_syscall_retval)(td, EINTR); for (has_sig = 0; !has_sig;) { - while (msleep(&p->p_sigacts, &p->p_mtx, PPAUSE|PCATCH, "pause", - 0) == 0) + while (msleep(&p->p_sigacts, &p->p_mtx, PPAUSE | PCATCH, + "pause", 0) == 0) /* void */; thread_suspend_check(0); mtx_lock(&p->p_sigacts->ps_mtx); From nobody Mon Jun 9 23:53:15 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGTJX1zXZz5yhPH; Mon, 09 Jun 2025 23:53:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGTJX14Snz3K7x; Mon, 09 Jun 2025 23:53:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749513196; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kBA95oFXXKmowMhFScMqcR6OXviQwoaHHtppaIEZl9g=; b=vEtp3YLY67MHAX+MgEbV1Qtfk3HPm+oxHhOB+2iEgTqZZUev/gdtZmKQFruC5xl0bt3JNx LNgyStyV8jKw0w+Dr8XvvvildJ+O4tgo5d0S/zo8NCHnCeXN9alIAQlYu451zA8p4nL7pd UjU5x49E67J7hLdNbbn21M4Yom0U6hpllNSb8F5vQoiLCSzJWS4n74wH6Cgys/li66yz0W 1AW4MAWMQZ+OMYqVDtP2D2K1KgUU9w19Wsm0XhZ1T88xG0BQgACCfFid6GBYetTeRmXhE3 I5NdynoO5hegfcbRHLw47pmdAfDVzVgaMKdC+OtAkxeu3YiW9kLUKd/+axxwQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749513196; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kBA95oFXXKmowMhFScMqcR6OXviQwoaHHtppaIEZl9g=; b=Ka0E2wUXV0iJ4GpZ7ZwuqpyIqHPezYr/hfy2c8xMskr0eIIf+PH11p10rNUijEiYW8VrZH gylWUeOvY9lzigE2OjEwehoVKHNAp0Nhd6e9mm9Whk0DaRvQiQxYmJS0+TNW0nYAdkpHAz 9w91pDyHZRbiQkkntufGe991irsdLO1HB+bftf1V/+0w0NESdMoQLWCR1lUtqe2WsLYZtB HZPuxeVvIZn6oZ/UUCQZECAZh+LfrVNQubNjuo7cHICxsU4e+l/eQnYWnfvjv1XWYasqLz mv1o6KO5oPJRMZ0Io6xj2Cc9vRBQPQzwbPxZxMzYLzTdf5VpeNMr8BA54fzZbw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749513196; a=rsa-sha256; cv=none; b=eUlLv/Rla/f09+DJZa/oGOchkezQWbE2wRDVjLwpe/P/vA/UgCDfl/e94kY0hZbGJBdwvN NK2TxfjPiejV5L7iqUGA7OQRkx3NuyWumxZXGI94Qh/e/d0ec3woyU8ae7y69q1SS0aAsQ hxSR741fHwB/cYeBBKC8urnYV4ml6cm5KmX5fAL/JKsLWHx8mYLYqtxrGloH/14ymCDSP5 VEMiP7oAK5+5b/wMywAEwUj/kr3Pd3KgxQQzAV2qV1jURmn3ndAzvgy/cKB4fwKvjL4viK SxBNItdKgbdMaVqZtzrqw7QDne7fxP7o0+BXkAKM80xiPf+g5tJAG6D+AR47Dw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGTJX0fdbz26s; Mon, 09 Jun 2025 23:53:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559NrFDB006690; Mon, 9 Jun 2025 23:53:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559NrFcQ006687; Mon, 9 Jun 2025 23:53:15 GMT (envelope-from git) Date: Mon, 9 Jun 2025 23:53:15 GMT Message-Id: <202506092353.559NrFcQ006687@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 2be717b45a33 - main - kern_sigsuspend: rename wchan List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2be717b45a33b733d7a79c996897f60c8ed70735 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2be717b45a33b733d7a79c996897f60c8ed70735 commit 2be717b45a33b733d7a79c996897f60c8ed70735 Author: Konstantin Belousov AuthorDate: 2025-06-09 02:53:00 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-09 23:50:51 +0000 kern_sigsuspend: rename wchan The existing name "pause" is not most intuitive to guess where the process sleep. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D50752 --- sys/kern/kern_sig.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index a98bee38e75c..3df4e8f0fb25 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -1658,7 +1658,7 @@ kern_sigsuspend(struct thread *td, sigset_t mask) (p->p_sysent->sv_set_syscall_retval)(td, EINTR); for (has_sig = 0; !has_sig;) { while (msleep(&p->p_sigacts, &p->p_mtx, PPAUSE | PCATCH, - "pause", 0) == 0) + "sigsusp", 0) == 0) /* void */; thread_suspend_check(0); mtx_lock(&p->p_sigacts->ps_mtx); From nobody Mon Jun 9 23:53:17 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGTJY3gBLz5yh9h; Mon, 09 Jun 2025 23:53:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGTJY2Gzjz3K81; Mon, 09 Jun 2025 23:53:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749513197; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=75h5LjOHwJM0sG+qwVl3W0ujCvV9qOQQUwSzoawItCk=; b=ytcsVzugAqq2kI1dO4MzFEwouZ7pr1G1Rh7nRONpPUbKQHBhKTJFA0RKnU/rYOoJR5+KVn RyNp5mjW+JWoxMXQ1L1CbSwFEk1O6nxBoT2hU4ceHluY7PScL5vz+sE8LxHEdjWKJ7O8Hr ewWQZXL3KXQFa933jugZUNUx4JMhleCBHJD7f2By11iw1BUx1nUaveZuOpoXqVC2uGtkGP T5nfP86CxPobZRKA9NIU4yDB7uQESgDd1bK8cRSypU3fq1QtJiu/Xt8pSciGgcow0EhUYv jBLOvhHMgfVg+3hXegPZpvW5ye9UT056pQAggOjUISFaBkkBIhhbXRQZijgfew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749513197; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=75h5LjOHwJM0sG+qwVl3W0ujCvV9qOQQUwSzoawItCk=; b=cw15oe1cvg2D+nutUdbi0xdmli0A2ALz3dviHOIJjaNynzFsR/bID9K5S4IxFaNTmjKk5R PcFbpi9YdCIscpIR/spjh+PExJH0QrjiBZscKOAU5E1isvoJP2KCCX1MXtqSFqzkfJorbB Z1PShRocLh7EJnhIUjTlSzgVm1OGvxjaiaX/Wb4E1cH/mhRYxs16xnkgsDrDcEtcm8aGWP xfCkjEOdExa25uSETFzG+o5Z0snVVmTXlTwXQ/Qi0WJeJxX2ZDgZrjBzpjapNJ2NB+MiLN 1/1OVV6GOxoxi7tZIjqom0vwaCtMb6b+twNwpt9QXa9KDUJ2RZU1km3atYwyhA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749513197; a=rsa-sha256; cv=none; b=pn4NlY9NtCkgypdylpmeCwh66LXGJxg1DD5gOobjsOVwHu0cp50ht5kSFDv+ZdU7lWxWUu D6Gyt5r/+FMVr5qZruj/qQlcrXjg8lhUUctEZjqcfxAHA5301eWKMVAlj4+04lHZGx62Z/ D8+7mqEDwbKiKMw5YPXlpvWoTTCGr9Vq5jFVO1mD/Id6q0sRzKWp2sQW+76Jrwp2VsVWhY pIPPLdlh36kO9k9CDlyXS5jON32bcLwF1+VcuN3T8ATH2j/1o2bsOSz7xb6xNmr7iYIv3P JodQlYQQqRF4qEk6B22jPTu7vsP3GK2n6UVaJs/ilBKRsKXU3JE3hLAnbeai2w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGTJY1bk9z26t; Mon, 09 Jun 2025 23:53:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559NrHQI006728; Mon, 9 Jun 2025 23:53:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559NrHqr006725; Mon, 9 Jun 2025 23:53:17 GMT (envelope-from git) Date: Mon, 9 Jun 2025 23:53:17 GMT Message-Id: <202506092353.559NrHqr006725@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 8dda34d0ef79 - main - exit1(): Ensure that SIGCHLD from reparented child is queued to reaper List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8dda34d0ef79d0d247b3487ae0499bdf12c9209e Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8dda34d0ef79d0d247b3487ae0499bdf12c9209e commit 8dda34d0ef79d0d247b3487ae0499bdf12c9209e Author: Konstantin Belousov AuthorDate: 2025-06-08 07:31:28 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-09 23:50:57 +0000 exit1(): Ensure that SIGCHLD from reparented child is queued to reaper We have a reaper R and child A with grandchild B. Now, suppose that B already have exited, and that A did not waited on B. When A is exiting, its child B is reparented to R, but its p_ksi was already queued for A. This means that SIGCHLD is not queued to R, it is only marked as pending in bitmap. If other SIGCHLD is queued, we would miss a delivery of the notification for B exiting. Additionally, R does not see siginfo for B. Do not even try to send SIGCHLD if the target is zombie. Only update the ksi state for possible consumption by the reaper. Tested by: pho Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D50752 --- sys/kern/kern_sig.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 3df4e8f0fb25..c972d0620ab2 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -3732,7 +3732,14 @@ sigparent(struct proc *p, int reason, int status) if (KSI_ONQ(p->p_ksi)) return; } - pksignal(p->p_pptr, SIGCHLD, p->p_ksi); + + /* + * Do not consume p_ksi if parent is zombie, since signal is + * dropped immediately. Instead, keep it since it might be + * useful for reaper. + */ + if (p->p_pptr->p_state != PRS_ZOMBIE) + pksignal(p->p_pptr, SIGCHLD, p->p_ksi); } static void From nobody Mon Jun 9 23:53:18 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGTJZ5zFQz5yhGn; Mon, 09 Jun 2025 23:53:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGTJZ2zfrz3KLx; Mon, 09 Jun 2025 23:53:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749513198; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NGnxa9W/SdTwyOXTHFSQMzxm8Wx6tqnXcNQD7cpsZfI=; b=QRe4lW6P17bByyBb7QVDj7p/caYcAWap7paBjuaVnDd2lZ5MzORIUXllwBftIfXHZ9L93Y f8WJtOy0u+UUqacasZzSEaDTLC/GKpV8bs1e7aZwcbnLpLNO8X3twtw5O/78rdhXmBOtdb jun/7azZNoyPdTLzPhzfvdGhj22tVOVSK8OvzzQmxZuVbSjuSBUR10KTGs9gSP609Iqulx JsWmQDPoyfB/vKb9ZkpDMhL64ndfzS+8ytcw8g1HBQjT4lWmTjCErjnUjqYtS73R3iGxOY xjJglK5RnaRgUN5E+rFfltrSXqNer2fTXhVycBTwtV/iOnXqkMqr8+jXEz9j/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749513198; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NGnxa9W/SdTwyOXTHFSQMzxm8Wx6tqnXcNQD7cpsZfI=; b=wqI5hVE+7KzlJHhAyMkseRkXfuQxhR80fdQMDTqovg3QeftF96zYm7BXFQw+MjfTAhEEZR S7TILx7gjIqGfMD1YHcSWrNqT93QNsE6AOyoBNxM5hKTzq8AvgRehxSHbK/rTeIo26687x aGbLvVRLERqK3aC5A9eOwXXS14j7Mow6F9iz+uyUb1QGRX7Aa0tvcuKx7HA6CcO8kEVEcB cJtWfL9vbsFwYha4Na/J5SKpN+Cz7MYmDxN+NlPEPsN8yrjyS24G+6+gXWX9CfqifNJ+Dm X4ZqGBvBkDfMno+aQmGtEBfDXEBy4R4IYCZcEgSPFaheIcKLMw6I8CoSFVDqdA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749513198; a=rsa-sha256; cv=none; b=C0e9HYZAj/10IsnBjG18yV58sb7ZiQkiMSKI8Hjnz0PbXOGBwGaDaT/NfvostB2z0+gXL3 S0w8s50gX35M4doXKqU+wf2CWcfvL7ZLvPXyz36v/FAwNRWn66j357r0RBb/g5nq7z4RMy diGB0CvnFOddO564j0UM1g5RRmdgHYiGqIwljFMnOw7Dc25YUHmYRFFKCW+nl8PSzmwMHk EMQo/38WaIEwQCtmZivzbDfUtaVCZLQjTkeWRROgJrye+IhqSMi5EohatkJhHF8NK1MncA KXEcx/5BeJINp4peeWvSZlHCXck/mqlHAGCmHysmS5OCeIOubJqz+PDnwK3w+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 4bGTJZ2N7yz1wh; Mon, 09 Jun 2025 23:53:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559NrIrX006760; Mon, 9 Jun 2025 23:53:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559NrIWv006757; Mon, 9 Jun 2025 23:53:18 GMT (envelope-from git) Date: Mon, 9 Jun 2025 23:53:18 GMT Message-Id: <202506092353.559NrIWv006757@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 15e4b8d5ef84 - main - timeout(1): silence warnings for ESRCH List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 15e4b8d5ef845066819c4cbb5d03b63148688298 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=15e4b8d5ef845066819c4cbb5d03b63148688298 commit 15e4b8d5ef845066819c4cbb5d03b63148688298 Author: Konstantin Belousov AuthorDate: 2025-06-07 11:24:32 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-09 23:51:06 +0000 timeout(1): silence warnings for ESRCH It is possible for the child to become zombie and then there is nothing to signal. Reported and tested by: pho Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D50752 --- bin/timeout/timeout.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/bin/timeout/timeout.c b/bin/timeout/timeout.c index e9c4e22fc7d3..424e72dac9ad 100644 --- a/bin/timeout/timeout.c +++ b/bin/timeout/timeout.c @@ -188,16 +188,23 @@ static void send_sig(pid_t pid, int signo, bool foreground) { struct procctl_reaper_kill rk; + int error; logv("sending signal %s(%d) to command '%s'", sys_signame[signo], signo, command); if (foreground) { - if (kill(pid, signo) == -1) - warnx("kill(%d, %s)", (int)pid, sys_signame[signo]); + if (kill(pid, signo) == -1) { + if (errno != ESRCH) + warnx("kill(%d, %s)", (int)pid, + sys_signame[signo]); + } } else { memset(&rk, 0, sizeof(rk)); rk.rk_sig = signo; - if (procctl(P_PID, getpid(), PROC_REAP_KILL, &rk) == -1) + error = procctl(P_PID, getpid(), PROC_REAP_KILL, &rk); + if (error == 0 || (error == -1 && errno == ESRCH)) + ; + else if (error == -1) warnx("procctl(PROC_REAP_KILL)"); else if (rk.rk_fpid > 0) warnx("failed to signal some processes: first pid=%d", From nobody Mon Jun 9 23:53:19 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGTJb5wKtz5yhfY; Mon, 09 Jun 2025 23:53:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGTJb3w9Cz3KVj; Mon, 09 Jun 2025 23:53:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749513199; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vy5LRLfJkxfWdRvFkuP/eSendQCSWOpLCVNDdRv42xg=; b=cfe0JMf3aAUaNukrs+2JQ75htYkf8EVgkhjJQL6p2pcMxZ+ld9iZhbOGCC8R2c2wWYeHlW MdPWnUpVrHvTh7tzJ+W/Dl4y6BIKJmTMr0YwI1CWL2nL9jVWS/r5foOeGTZYpZmk0EKNJi GTttkIzgIfElTHdKTXmyLd6ALw5fEzWKhUd6rnGAXlLrxPgfXZ4MZlkFPpRm71PWefoUfN QiwVS2DLefhhEevwtXZg+4rJH+bZ7+3urExNJi1WS7TxNQBvkcsAM1toHtg3/j4c7tTwju 6jWhyodLswHRx+NaPGyH8RqiX+M5KhxIShYN4kg6CWlgkonFTRMerzlVaw4DOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749513199; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vy5LRLfJkxfWdRvFkuP/eSendQCSWOpLCVNDdRv42xg=; b=It5tEyaAK7aHU3Jzdx3Wu85tc/UrIzHLqBxWACdUuzlzKu4II93cU29+ukZAWDJ4US5y0R EQNtr6k7bcJBDNI15LcF10Z04m6Y71Ii/UiBCgLON1yfgQzYcEj8yP5t/dKoO6IbMpag/x jhXUN5iWlW0vO8C96qicsod9U3I5NarKPnwzd1Gl9fJga8swt5+J3HgAVXm2Qm29pULfRH DNMR3fT2FeyIYgMDqSmWig3JLK7tTR/ftoS4USBCp78wSB6VRf9vnUBf9K1UJnVc9d32+X /kW6wDKKBer+Bnd0BrxHEeavnJxZvMrx0LUvuuZNfFuX8CObb/J3L/YcaA+p/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749513199; a=rsa-sha256; cv=none; b=wunvVQz2uBolxQj+bdwFufCoi92cS1x84kg3+3nxMaJz8yQPlqUDgio/tDusil7gqBe+TZ LY7rvXIzEOaLyvdWT0breMKnm8qZLDlzl8eNE9O/v3p6rg6eFy3NDK1MoS0IJJ4gw3C5Wg jDzIKz8k5VVTI9XpDKHT7RGu3aPen9fBpcewXsYel/hV6PJstmm4Hvd73Zw1QhKZAfHvis SpdI4D3DNQJTAIUIXCtwJWimNxkxG5GIeWFGLOLTS5PP5HVYqLmfTexpnG+Cr/l+SrCWkE 58lmHiT9ukUjab/kwXzli8As96dNNGUCzs7Rk7FGuNQTTfF1tMZzNUAEtQhJDA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGTJb3Ksdz2Q0; Mon, 09 Jun 2025 23:53:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559NrJgD006792; Mon, 9 Jun 2025 23:53:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559NrJsJ006789; Mon, 9 Jun 2025 23:53:19 GMT (envelope-from git) Date: Mon, 9 Jun 2025 23:53:19 GMT Message-Id: <202506092353.559NrJsJ006789@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: bff05e8a8c3c - main - timeout(1): print errno when signalling syscalls failed List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bff05e8a8c3c64bfe6152870cb758d00991ec66b Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=bff05e8a8c3c64bfe6152870cb758d00991ec66b commit bff05e8a8c3c64bfe6152870cb758d00991ec66b Author: Konstantin Belousov AuthorDate: 2025-06-07 11:29:15 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-09 23:51:13 +0000 timeout(1): print errno when signalling syscalls failed Tested by: pho Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D50752 --- bin/timeout/timeout.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/bin/timeout/timeout.c b/bin/timeout/timeout.c index 424e72dac9ad..05904522c5b5 100644 --- a/bin/timeout/timeout.c +++ b/bin/timeout/timeout.c @@ -195,7 +195,7 @@ send_sig(pid_t pid, int signo, bool foreground) if (foreground) { if (kill(pid, signo) == -1) { if (errno != ESRCH) - warnx("kill(%d, %s)", (int)pid, + warn("kill(%d, %s)", (int)pid, sys_signame[signo]); } } else { @@ -204,11 +204,13 @@ send_sig(pid_t pid, int signo, bool foreground) error = procctl(P_PID, getpid(), PROC_REAP_KILL, &rk); if (error == 0 || (error == -1 && errno == ESRCH)) ; - else if (error == -1) - warnx("procctl(PROC_REAP_KILL)"); - else if (rk.rk_fpid > 0) - warnx("failed to signal some processes: first pid=%d", - (int)rk.rk_fpid); + else if (error == -1) { + warn("procctl(PROC_REAP_KILL)"); + if (rk.rk_fpid > 0) + warnx( + "failed to signal some processes: first pid=%d", + (int)rk.rk_fpid); + } logv("signaled %u processes", rk.rk_killed); } From nobody Mon Jun 9 23:53:20 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGTJd0sGFz5yhDS; Mon, 09 Jun 2025 23:53:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGTJc4WgBz3KW5; Mon, 09 Jun 2025 23:53:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749513200; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=omqn7VBhtvaBdfVFXuADBOomu2tGRCIAIYQJaQXQGJs=; b=lU22YV7+ZytTBLPxSnfBbQr58OEa+sDtxPzSyxyVhAtyVpn5qZHVY1rEmurLSwODGOQHbe tv4HgwvtWu2in/CA6l58frSeAnezIdorByxl00lrtq9sXPtW2/DwWaCzEhQAA9Rg/r2WtM sKTMvUjG4e3Li6tTbfTQ4ZTuqhHCyK/FiBKnpxUGhUdruJQUuidWCHt0V9R4NilEkFAmmm brjM9lExLmKN6Nf3UJlqSlSF4tqgDCpfGeituT8tr6w8pLNPK5T3PbKbjE6cSxTG+Wl8Q9 H3AJi/J0LXDNCGoOe5OjZ1z5PMUFz08XkXWjU9HeSBCzTJH1w/NWt2+ru/VwBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749513200; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=omqn7VBhtvaBdfVFXuADBOomu2tGRCIAIYQJaQXQGJs=; b=GUhSJVK8x1AapqwrP85Vm0I7Q50Bo9jLpTduEFneuLtpph1ly1pqjmWuYqFnhkCeCiOj6G PQ3PFIda4IlPEwoq0mUVis22TRdV0rDFMGhP0KgX/um6btPCwvFoiZvdKXA+FUApNqCiJx 709BiMX+ObNHSURYR5Nww9YcPjWH3CagkLbfSwAP6Ue2kToaJSfucik78GN6wKhvgeZL5n RDUpj2uxGyVYx6dwiYsMUeIxUBVS2Id/4afpEtHVrfZ4r7mzdRRtNnNooHyb+Ke+XtQ/sf 0/bKQSxxsrM/OHL6gXVRvdgiJH2dDz59JZdMkU1JWIfxgsmknT3c0PJxzHnN/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749513200; a=rsa-sha256; cv=none; b=GmizEACstd3b/qozAjpxn4pMks0h/ewLWL4cxXib+XYAdfpiPw1xNyTtuCphHvZAeDTJPO mSPXP9Lofy8TIduWXrBI7qy74FnUrJbWZQ5vyt48PKSu07U+DrSNEvV3RaF3t6mnXoah/E 9MBmtaAOef7XHjkkHoif7rL3M3P43siXkJZOMyoiHhYkKEa+6CXJFLLu5yfW6q2kJib2Gu aJI6g5njua0t+fdfbGU9mps1PyeX+5fT+fdsKtS/I5Dh4z+KETn6NXY6OQi0lkqe0XnsVo /lM+qQJL78SGXL7qxRfxy6igfQZmRJyNN3uWvToBfFThnYT7e/PGbunq2D/yRw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGTJc3tM7z1kg; Mon, 09 Jun 2025 23:53:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559NrKVI006825; Mon, 9 Jun 2025 23:53:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559NrK5H006822; Mon, 9 Jun 2025 23:53:20 GMT (envelope-from git) Date: Mon, 9 Jun 2025 23:53:20 GMT Message-Id: <202506092353.559NrK5H006822@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: aa8cdb7cae7b - main - timeout(1): only start the child command after the parent is fully set up List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aa8cdb7cae7b7550d5cb81d85ee294c4f182f694 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=aa8cdb7cae7b7550d5cb81d85ee294c4f182f694 commit aa8cdb7cae7b7550d5cb81d85ee294c4f182f694 Author: Konstantin Belousov AuthorDate: 2025-06-08 15:47:49 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-09 23:51:19 +0000 timeout(1): only start the child command after the parent is fully set up Since the default disposition for SIGCHLD is ignore, the prematurely exited child would cause SIGCHLD dropped. This makes timeout(1) hang, because REAP_STATUS reports a zombie not waited for, but SIGCHLD for it was already lost, so the main loop cannot exit, instead calling into sigsuspend(). Reported and tested by: pho Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D50752 --- bin/timeout/timeout.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/bin/timeout/timeout.c b/bin/timeout/timeout.c index 05904522c5b5..f47976aa27df 100644 --- a/bin/timeout/timeout.c +++ b/bin/timeout/timeout.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include +#include #include #include #include @@ -283,6 +283,8 @@ main(int argc, char **argv) int ch, status, sig; int pstat = 0; pid_t pid, cpid; + int pp[2], error; + char c; double first_kill; double second_kill = 0; bool foreground = false; @@ -351,6 +353,9 @@ main(int argc, char **argv) if (sigprocmask(SIG_BLOCK, &allmask, &oldmask) == -1) err(EXIT_FAILURE, "sigprocmask()"); + if (pipe2(pp, O_CLOEXEC) == -1) + err(EXIT_FAILURE, "pipe2"); + pid = fork(); if (pid == -1) { err(EXIT_FAILURE, "fork()"); @@ -366,6 +371,11 @@ main(int argc, char **argv) if (sigprocmask(SIG_SETMASK, &oldmask, NULL) == -1) err(EXIT_FAILURE, "sigprocmask(oldmask)"); + error = read(pp[0], &c, 1); + if (error == -1) + err(EXIT_FAILURE, "read from control pipe"); + if (error == 0) + errx(EXIT_FAILURE, "eof from control pipe"); execvp(argv[0], argv); warn("exec(%s)", argv[0]); _exit(errno == ENOENT ? EXIT_CMD_NOENT : EXIT_CMD_ERROR); @@ -391,6 +401,11 @@ main(int argc, char **argv) signal(SIGTTOU, SIG_IGN); set_interval(first_kill); + error = write(pp[1], "a", 1); + if (error == -1) + err(EXIT_FAILURE, "write to control pipe"); + if (error == 0) + errx(EXIT_FAILURE, "short write to control pipe"); sigemptyset(&zeromask); for (;;) { From nobody Mon Jun 9 23:53:21 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGTJf3RhBz5yhPS; Mon, 09 Jun 2025 23:53:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGTJd5Fwvz3KKY; Mon, 09 Jun 2025 23:53:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749513201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z53cA1/MKvO6U159sZia7UE9TbtDTj6AqR00Nm/9BSc=; b=heFhtIdr1FNrUFLErMFAyS2aAuS1c33tq7kBC+XGVN4cUwBkx+ITfE8CgLVCMuozbEe/ne hEvKxadgp61fM2Hzy9D2bDv//OmfZakztLUzJDsKMtU/OXpu6AAzGuY+TKFS0BJ5oETGYr dXqknUn6NaGfJFGSyH2npmNcUe4DQK6TaQTIHE+0j/uVGcNXvrtYt6elqzxAACDx1uN+ZT biGL2GrxYPydHb6a+HSw7AEQwUH4IXCuvahV9DoZJcpwkEqmQnm347vRYVGD+7+7u4iPRq mEF9n8QFQkixCDGs22D0pqMjWbeXvWGmobX30sqzRQ3KF3Jm00eSGA3tM2hBrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749513201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z53cA1/MKvO6U159sZia7UE9TbtDTj6AqR00Nm/9BSc=; b=tDVAxIZGT6Wi/lunOKDjNmCIF8YDHAqQOWF8FPRY5HA7uoLpqnkN1vj058zM5EFPLn6nlD Ao8+iK5CqPVjX1cxw8M90prUOX5TFXKWFS38M5MKkzmhDggW4cV1yUxU6g10vy9rmgz4mK ix7lUsDnMywgGAntaAIjE8szoqYBDAxCxNDmyqBVJummUd84eEE3RCIqyVN8wVau31xeff NQKPriS2IqkgMeb7FuFttOa4TjRsox0HoHxaCwJTOcUGLQ5vFVs1OEL2s1dfRddDTi9pgC TOCWP8jbqaxyI6RXFDwKXpYxrR4kTuVKWVumtuBPXn/d9OJ79tuGEfrXkvMuWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749513201; a=rsa-sha256; cv=none; b=pGmJ0iTW8UedjRlNonM4QuIBFIRSclsqcjCPw4BWsm/Z/wWj0ryFU9vbz+1cFYtbDLOIYB 9j5XGSVDCF4r8fp3PcVpfpVwT2ToDVghCkECJ7GWdqXV/eRpA2quQGJZCFKyRjpYvCD3qX 1lutZrixaxl7H3eQdcY5eNVu/gKA5xJyaDm266ew1WGPzkzkJaOc/mj/tUKN/pxaIapsQ9 dQ/VcpRh1YmxBl0VZqIloHDcP0ej59R9D0X5xOEkXFc0ZsfhhM0pWP1gBg/FYTEnfXghYR AbBNf8JUgSTxatUzeoX/+0CSgZuUGOcUWi4ReQIwwfVMUT4x7JOWHhZ2jd4SJw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGTJd4bnMz1wj; Mon, 09 Jun 2025 23:53:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559NrLSO006858; Mon, 9 Jun 2025 23:53:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559NrLOa006855; Mon, 9 Jun 2025 23:53:21 GMT (envelope-from git) Date: Mon, 9 Jun 2025 23:53:21 GMT Message-Id: <202506092353.559NrLOa006855@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 81ef00125056 - main - timeout(1): pass full 32bit error return code from the exited child List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 81ef00125056a68ca3bba1424d6cb13533bf474c Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=81ef00125056a68ca3bba1424d6cb13533bf474c commit 81ef00125056a68ca3bba1424d6cb13533bf474c Author: Konstantin Belousov AuthorDate: 2025-06-09 03:20:16 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-09 23:52:34 +0000 timeout(1): pass full 32bit error return code from the exited child Switch to use waitid(2) to receive siginfo_t with the complete error code from the exited process. Tested by: pho Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D50752 --- bin/timeout/timeout.c | 58 ++++++++++++++++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 21 deletions(-) diff --git a/bin/timeout/timeout.c b/bin/timeout/timeout.c index f47976aa27df..58a5797f3eaf 100644 --- a/bin/timeout/timeout.c +++ b/bin/timeout/timeout.c @@ -277,12 +277,25 @@ kill_self(int signo) sys_signame[signo], signo); } +static void +log_termination(const char *name, const siginfo_t *si) +{ + if (si->si_code == CLD_EXITED) { + logv("%s: pid=%d, exit=%d", name, si->si_pid, si->si_status); + } else if (si->si_code == CLD_DUMPED || si->si_code == CLD_KILLED) { + logv("%s: pid=%d, sig=%d", name, si->si_pid, si->si_status); + } else { + logv("%s: pid=%d, reason=%d, status=%d", si->si_pid, + si->si_code, si->si_status); + } +} + int main(int argc, char **argv) { - int ch, status, sig; + int ch, sig; int pstat = 0; - pid_t pid, cpid; + pid_t pid; int pp[2], error; char c; double first_kill; @@ -295,6 +308,7 @@ main(int argc, char **argv) sigset_t zeromask, allmask, oldmask; struct sigaction sa; struct procctl_reaper_status info; + siginfo_t si, child_si; const char optstr[] = "+fhk:ps:v"; const struct option longopts[] = { @@ -414,26 +428,27 @@ main(int argc, char **argv) if (sig_chld) { sig_chld = 0; - while ((cpid = waitpid(-1, &status, WNOHANG)) != 0) { - if (cpid < 0) { + for (;;) { + memset(&si, 0, sizeof(si)); + error = waitid(P_ALL, -1, &si, WEXITED | + WNOHANG); + if (error == -1) { if (errno != EINTR) break; - } else if (cpid == pid) { - pstat = status; + } else if (si.si_pid == pid) { + child_si = si; child_done = true; - logv("child terminated: pid=%d, " - "exit=%d, signal=%d", - (int)pid, WEXITSTATUS(status), - WTERMSIG(status)); - } else { + log_termination("child terminated", + &child_si); + } else if (si.si_pid != 0) { /* * Collect grandchildren zombies. * Only effective if we're a reaper. */ - logv("collected zombie: pid=%d, " - "exit=%d, signal=%d", - (int)cpid, WEXITSTATUS(status), - WTERMSIG(status)); + log_termination("collected zombie", + &si); + } else /* si.si_pid == 0 */ { + break; } } if (child_done) { @@ -482,13 +497,14 @@ main(int argc, char **argv) if (timedout && !preserve) { pstat = EXIT_TIMEOUT; + } else if (child_si.si_code == CLD_DUMPED || + child_si.si_code == CLD_KILLED) { + kill_self(child_si.si_status); + /* NOTREACHED */ + } else if (child_si.si_code == CLD_EXITED) { + pstat = child_si.si_status; } else { - if (WIFSIGNALED(pstat)) - kill_self(WTERMSIG(pstat)); - /* NOTREACHED */ - - if (WIFEXITED(pstat)) - pstat = WEXITSTATUS(pstat); + pstat = EXIT_FAILURE; } return (pstat); From nobody Mon Jun 9 23:53:22 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGTJg0C7Dz5yh9p; Mon, 09 Jun 2025 23:53:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGTJf64tjz3KH5; Mon, 09 Jun 2025 23:53:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749513202; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o37HJRFZZPHu5HCME+Zw6k8/jJ9L4pAZXwT2X0qyTWg=; b=hjcGoFP6gC4PIJKJoZX94ODZ07UiGzJbsS/VnFZPbcZ+t5dwBKR1ibwFRemCUTbVdnQ6Xl JsRNmIX7TuowTUavVcOqOwBY1eMT7HG4WfHCZ/xEH0o1Tz2Y0vLjh5gMly5NRICO4094zy mf9p5RX6aw2bAiyCIZkjhs184c3/5uGqKRcYI/rScX78Rkn0HHLTXmpGzEGbQpyEn1lkNu i0QWouQSsvseVdWQsEfyJj1wx8HYi0kW8r6/0LUcitKvTpRMfGIU6E2snK0ZXwat4+HUm+ KNbTgEKmzxVOH5WYbD1Au4/gIRr655qhfcEFUnRfLfb6t9uMGfBahRHo+OJv6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749513202; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o37HJRFZZPHu5HCME+Zw6k8/jJ9L4pAZXwT2X0qyTWg=; b=Eo95Pas395qRqaMV/oIowFoGVPd628AkqICQcAilmVhBVgfWdKEZ9pcQ1rTvZwrBTxmo/5 ounW0+cfxzTJcYRCa4HoTUo8SOnlMUV6FQmfAafQi3TLz2PtV8kALYj9tLcEbOfDkhyVGg BJX1dabCwfAvvzVxRlwtn5MxbU8XkEttHEVHR5Z/juyHneuAyOTEzy68LzApusapOLTGWu 32+vk9xpwh8xDRZPhWrVtiwtDvH3zxrs8wh9jLfD5Z3UhFrW1SMLNmvAoFf3hD9NPxpv22 36lETSa80WpE/CU6iP5IR8mXW7E9UGV6w8ztrNhvc/jR5QfOVQfjK9prF8OpqA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749513202; a=rsa-sha256; cv=none; b=xs0mnWqHz95gkWXIPVmyL8kCF/Ao1vmbWZ3RpKSiZsA6WeUiSaovGQ5g9fm0lr7wvPpnFE 1jhmRDSShC2M08fBU1i0CDtOmaDDidprXXbyojpYEiNl3jZy/HwlzREkn+jKu+C5cXtsQF Tx8x1Xx/NUmQ+5xrsH3SiR5QPygUDHhkv7zeZLG39lYu8U0hzUZPyZob0+ZwUGxLke0ZEp 2jz+nUqzNXoY0zNA904AazOVOUmuAVq2jNpodFD7zgwICSfytU1G5offtQ4MalPB8nhCaY BjQTh6OAWxlmc7SL1CHhtzsChJXMXDcji8vt9powG2Z+YDkTmI59TVcEh8b+bw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGTJf5WYSz2f0; Mon, 09 Jun 2025 23:53:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 559NrMks006897; Mon, 9 Jun 2025 23:53:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 559NrML1006894; Mon, 9 Jun 2025 23:53:22 GMT (envelope-from git) Date: Mon, 9 Jun 2025 23:53:22 GMT Message-Id: <202506092353.559NrML1006894@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 4078e0d1d6f8 - main - timeout(1) tests: atf_fail requires a reason List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4078e0d1d6f8189bff44fcad04df256220035f76 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=4078e0d1d6f8189bff44fcad04df256220035f76 commit 4078e0d1d6f8189bff44fcad04df256220035f76 Author: Konstantin Belousov AuthorDate: 2025-06-09 10:26:07 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-09 23:52:41 +0000 timeout(1) tests: atf_fail requires a reason Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D50752 --- bin/timeout/tests/timeout_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/timeout/tests/timeout_test.sh b/bin/timeout/tests/timeout_test.sh index a72aed609d47..b1bf69968e84 100644 --- a/bin/timeout/tests/timeout_test.sh +++ b/bin/timeout/tests/timeout_test.sh @@ -112,7 +112,7 @@ with_a_child_body() { out=$(sleep .1 & exec timeout .5 sh -c 'sleep 2; echo foo') status=$? - test "$out" = "" && test $status = 124 || atf_fail + test "$out" = "" && test $status = 124 || atf_fail "wrong status $status" } From nobody Tue Jun 10 00:17:26 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGTrj46nDz5ykPj; Tue, 10 Jun 2025 00:17:41 +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 4bGTrh4jNwz3hSk; Tue, 10 Jun 2025 00:17:40 +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 55A0HQph068520; Tue, 10 Jun 2025 03:17:29 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 55A0HQph068520 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 55A0HQu8068519; Tue, 10 Jun 2025 03:17:26 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 10 Jun 2025 03:17:26 +0300 From: Konstantin Belousov To: Gleb Smirnoff Cc: Rick Macklem , Dag-Erling =?utf-8?B?U23DuHJncmF2?= , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 79d0f4474653 - main - rpcbind: Ensure krpc is present. Message-ID: References: <202506091053.559ArJ8k043104@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Rspamd-Queue-Id: 4bGTrh4jNwz3hSk X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_RCPT(0.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] On Mon, Jun 09, 2025 at 01:51:15PM -0700, Gleb Smirnoff wrote: > On Mon, Jun 09, 2025 at 01:28:30PM -0700, Rick Macklem wrote: > R> My vague recollection (I'll admit I cannot be bothered looking at the > R> older code) > R> is that rpcbind would accept queries on a AF_LOCAL (unix domain) socket for > R> local RPC processes. > R> > R> glebius@ does not want RPCs to be done over AF_LOCAL sockets (he would > R> have to explain why), so he created an RPC layer in the krpc for netlink as an > R> alternative and converted all utilities that were doing RPCs over AF_LOCAL > R> sockets to use it. > > Not exactly. I don't want kernel RPC to userland to use AF_LOCAL. A process to > a process RPC of course continues to use AF_LOCAL. > > What would be better for rpcbind: to skip providing kernel RPC services if > krpc(4) not detected at startup, or to autoload krpc? The latter makes it safe > for a scenario when NFS is instantiated at a later runtime of a machine, when > rpcbind already runs. The former scenario would require a restart of rpcbind. > IMO rpcbind must not load any modules. It should communicate with krpc if available. The krpc load is the global system policy decision, it should be handled in rc scripts, as it is common for such decisions. The loading would be enabled if some component requires krpc, which means if nfsd enabled. It would be ordered before rpcbind startup, of course. From nobody Tue Jun 10 03:02:02 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGYVQ4K6Jz5yx9v; Tue, 10 Jun 2025 03:02:06 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGYVQ3260z4FdW; Tue, 10 Jun 2025 03:02:06 +0000 (UTC) (envelope-from glebius@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749524526; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=DcNlAqpu7LzdABVgxzISHQz+i8c5XCYra+EMTfIqp28=; b=QtdED4QmhvxEI5BvlO9NWUE2n1xfZxCMVGglXwDDkLB+Z2IR6UXoL4wtTnFLqWusWQm1dK qZ1d5hRVxrn9F9IwMnbnv3YkW2lTkL3+kpzTtWjX9IC+GniUHtW/7CCbmcFhvq9vBzcapM 856iThU2VLC8v6LHFBojU/dFbPt4e/jeQIByXWcBEM4mkReOdlf3Nc7LxlZ7Jldjg7Bbxy t68nsq1bhIrDkD2wY9laR8WgUxvEdNp65v+rMK0mSm3PA2aMWAX61HDczrZdIaPdgYiRJS j2K2um9O9AVWoUp/wYBtwMH/OasjyanVApIEE9F/G0x5LSAaA/MYW9HGxDMg+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749524526; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=DcNlAqpu7LzdABVgxzISHQz+i8c5XCYra+EMTfIqp28=; b=crZ2flBJgGiRTbmVCnFAivNQtyINvzpnRbB7vaMkjClafOnldGC96gqWu9FRZRXboPsSmG zSYIzNpu2DZxI3J5RMrO+LnUiBX7sPSa6y0GGUsq7rBiHYasHgduohQpm8vwfXY/D4n1SC oEWkpoHDMbjvaX1hVlpnoj8SVzi88YeYxhNjpD4+hcRFeT7ymHIkpD5IlRdSKdUeUCjMg+ ylwj/75vUoQ4rfs5uuzAVnsaLcqLdy9Bj6U3yRVPM8xhDV/uCHWCmRQaLqfvREKSSfFRlO CtyP0wz0hyI2E1aYS9MMaFMcTOsJenmsPp6idmu+rmOO7E1JG1XKcKTMqARNgA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749524526; a=rsa-sha256; cv=none; b=ufKRcDcQwKoBGMacqLK7eoddf52QLdmK0Y2VTY4XGkiBlJBBzt67lCUkStvpE58I68sAk/ 4SXi//VYU15mw3Bbmyq6lgPt+3CRNDxrdqPfNidDtSuziFiyZOec7teUazmCO6EcpYRJan 3Dy1GIwb21LjYSkKtlDPdY4pnQ0F8mkpyCTvsPE5xu+Qb7QJwsaK1qFo4o+RvKxTPBxJpS VUa+1QwCXBdpuIRRbYZLgb/VL0iIILsu/oVN28C9QJRe3QGsyWiwy9qeUVJgVo+IQXuT2X OIpX/wtAF8uzhhKEL3VlZhMYnCyQKdJPUfZLkaV/StUyepy4T8AO5I9bz+QIAQ== Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: glebius) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bGYVP4V0pz1p1; Tue, 10 Jun 2025 03:02:05 +0000 (UTC) (envelope-from glebius@freebsd.org) Date: Mon, 9 Jun 2025 20:02:02 -0700 From: Gleb Smirnoff To: Konstantin Belousov Cc: Rick Macklem , Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 79d0f4474653 - main - rpcbind: Ensure krpc is present. Message-ID: References: <202506091053.559ArJ8k043104@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Tue, Jun 10, 2025 at 03:17:26AM +0300, Konstantin Belousov wrote: K> > R> My vague recollection (I'll admit I cannot be bothered looking at the K> > R> older code) K> > R> is that rpcbind would accept queries on a AF_LOCAL (unix domain) socket for K> > R> local RPC processes. K> > R> K> > R> glebius@ does not want RPCs to be done over AF_LOCAL sockets (he would K> > R> have to explain why), so he created an RPC layer in the krpc for netlink as an K> > R> alternative and converted all utilities that were doing RPCs over AF_LOCAL K> > R> sockets to use it. K> > K> > Not exactly. I don't want kernel RPC to userland to use AF_LOCAL. A process to K> > a process RPC of course continues to use AF_LOCAL. K> > K> > What would be better for rpcbind: to skip providing kernel RPC services if K> > krpc(4) not detected at startup, or to autoload krpc? The latter makes it safe K> > for a scenario when NFS is instantiated at a later runtime of a machine, when K> > rpcbind already runs. The former scenario would require a restart of rpcbind. K> > K> K> IMO rpcbind must not load any modules. It should communicate with krpc if K> available. K> K> The krpc load is the global system policy decision, it should be handled K> in rc scripts, as it is common for such decisions. The loading would be K> enabled if some component requires krpc, which means if nfsd enabled. K> It would be ordered before rpcbind startup, of course. My only concern is that it would require restart of rpcbind, if sysadmin decides to configure NFS later after startup. -- Gleb Smirnoff From nobody Tue Jun 10 03:19:18 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGYtG4gYtz5yy9Z; Tue, 10 Jun 2025 03:19:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGYtG41Msz4Hrk; Tue, 10 Jun 2025 03:19:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749525558; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1ir4ROhUmlaLW59d1YkJ/I1+8lEEXGADv2h11DbRsuU=; b=NWG3eHay//YzqQnuQHTaaAMsXyCIK1AiWpjqgxSaGfizoSqGgMu2OwmrykaYkJEqHykt5/ 2nL/ZE0GBRk1IfD62gJwaxgxGTahdufvuS/uxfNpxnMLdpTdIAKkBLnteH8zi2dwNhx2SV GEnoRgR98lyqER32JU607GFhVWP6i6NF7utQD9sCuFL++lCwKgpAfv1gVbKnTk4zbBwD7F AZ/ZBGxoJflatcaq1BlW3TcFFfKDimm3CRqTZVvoQblRWp5zH+JVVawtnTA5AtnYp6PeFp O84mZHLZzDc7sNTMBJ/SfpBghfmuvNqVCgpZhJRd6sg6crgOEHXGbFuXzp8CPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749525558; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1ir4ROhUmlaLW59d1YkJ/I1+8lEEXGADv2h11DbRsuU=; b=dbHGmAZ0fV2qoBW/lW1POEHp5w8bnTRKI0LcjvYQp2AhYA3wiiUvvKiohv4+zsfKLmqgzX P6qc6gUUCWomdTsL/aqZOcYt7Clkz0MLPdmkVtMfAocMzI7VlaFRRhDeaN09ZxnB8jLqz0 Fxlp9XompdMlQ26VWi2pXhCdMfXSO0cRT1/+YTDijXLfr9/Q0Zst5qyv/InjjSFY8FwqFd jlfLjJw+Lwoz+V4giZf5MxclULOjdGV/ZQgijVwQGbUcvuIrtPM4guoxmIjHWf3t6OGsEY Ivc0yxcP5nrSOT94nAGSa5WgKHF3oWgcQQ0CHPz3YXGJEeFmwGMA2ffPew7rqg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749525558; a=rsa-sha256; cv=none; b=MxucnnxKyzzAv68CUcQOAh1fKLvuRbjzUDpiKqGB0/VJY8s/oW+zXLKD9aZgJ55mxhw9T9 vzUE1+ivX1GD+2+PxrLVAhEwU6HYvC5oW13x/UGYA6gUnFRQ2BJUpo32TSTh18CBYfGbHQ BnERHemxXvLmQX0eWsyfoV9UTX2e5PoVxNe0FC/TIKhY4wfSHiuyKXMo9lOpamgbnOKf9R PHoYmFXs4NRKLRJYlgv5qMv62cQa/AjS3Us0A8jTtfy27M8r+JWaxnutEu1lthBhRr8FfU c9+3eo3NWoVUdIYYvxOZ2tJnRNw4CK1J9f1fq/QZ+L7SaDDwEIRnrb1/5hArJA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGYtG3cVbz7ZN; Tue, 10 Jun 2025 03:19:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55A3JItt085986; Tue, 10 Jun 2025 03:19:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55A3JIoH085983; Tue, 10 Jun 2025 03:19:18 GMT (envelope-from git) Date: Tue, 10 Jun 2025 03:19:18 GMT Message-Id: <202506100319.55A3JIoH085983@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 6e60aff53dd8 - main - pf: fix NOINET6 build List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6e60aff53dd8cc631b61ca94b87246f78756ce6d Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=6e60aff53dd8cc631b61ca94b87246f78756ce6d commit 6e60aff53dd8cc631b61ca94b87246f78756ce6d Author: Gleb Smirnoff AuthorDate: 2025-06-10 03:18:50 +0000 Commit: Gleb Smirnoff CommitDate: 2025-06-10 03:18:50 +0000 pf: fix NOINET6 build --- sys/netpfil/pf/pf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index fa4c4b73809c..03179541b890 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -377,10 +377,12 @@ static u_int16_t pf_calc_mss(struct pf_addr *, sa_family_t, static int pf_check_proto_cksum(struct mbuf *, int, int, u_int8_t, sa_family_t); static int pf_walk_header(struct pf_pdesc *, struct ip *, u_short *); +#ifdef INET6 static int pf_walk_option6(struct pf_pdesc *, struct ip6_hdr *, int, int, u_short *); static int pf_walk_header6(struct pf_pdesc *, struct ip6_hdr *, u_short *); +#endif static void pf_print_state_parts(struct pf_kstate *, struct pf_state_key *, struct pf_state_key *); static int pf_patch_8(struct pf_pdesc *, u_int8_t *, u_int8_t, From nobody Tue Jun 10 03:19:19 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGYtH70Kyz5yxlh; Tue, 10 Jun 2025 03:19:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGYtH5FCJz4J6q; Tue, 10 Jun 2025 03:19:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749525559; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5uYbTJonTUaAjwXPWx2C24H2CTA7EkDKe3Tw3nkjRFw=; b=A7aRQs6UJj+eS/OKfODkcfCgvJiOMKqAc6YONvYOtxLR9JAG8XpMWNf9tJu/dgiEhaZ0Ky pmXYHemmaSktJdVGmVBHqu5ru+c17vF/qYPuxaVyojWRafibNFwEFhp3vAiTIDQe4fhPvX s/PVMbDiCgMWawTbgPz6i3mhWLQHW0yiNE7wLaBTi0vmJgvDD9odf0Nc2yYOKDZspCoX9+ 5hYv4uEFO0teWNhGzbqSO23L/FQWIfErGO39pNwojzijHt7MFBlF2PUkqgExGCBRZ6LMv5 ASCTw1KYS4QZkeULtQ9AIfquQM5yo7JomD3OVCDuMnsLmUHi7DxwuAxlXoFW1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749525559; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5uYbTJonTUaAjwXPWx2C24H2CTA7EkDKe3Tw3nkjRFw=; b=A66MLapBM9PwyPS6VAwVv0V3YMbpgi+mefVP5suMjFvcwy2MoR6qQuLlKqkQbjiNPrgdUc bfP1Rl327yTrLAFJbwcLnrA6sbVSzs+IRlYjK7Wn+mpt8sl18ow6PTzMYMUSO42E6uDr2N ZCrtqdQs0vkO9DK7byjHHSDrfNNkFa3QFdBiZmHvHvBYvB06biHGefsYurXEqMizoUe+3o JLwmIx42w8TIU3tVeyg3wSA/1MIrRxQA3eG43+Jrma9BoSfRb8MoXhn0SfcfSaO6WLefuh OX3MR0nFSHVgohWbr9b/xT0efFmMQ42+m4eYewWU1MAFiTdnZLswgp6iEn8ugw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749525559; a=rsa-sha256; cv=none; b=jBWPYGyUijIF98v1c6QoWoM/gVnSzW8L5/gd/9L4jm3u9Zga8ZyolrvV2X6mEzn1BTZzS1 fhcPx9RJYuI2QVkNNkC1DOChifgaPHqbW+81iFrB6MkjPdYDOg7LG7NeeVZ8ljZp4dAlMs rMA+ApZa7U/hWuZARlknLYEIpKvJU0lvvMU5wXb7F1GRifPFkXnGWE6hcLqcl1s5+Sr45M /cbJDJfn8T0Laa1iDIHd4sDgdbhH2ABBoFGB85DK3M+vK8D3aTyFPdW8CSjTh4ygmFXXNi KE/uuZpnwA/6Pwb182JRGjLvi+SMzlJuri6XgXA+j4XxEMpuuhvEQThRkErHlw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGYtH4qdFz7jc; Tue, 10 Jun 2025 03:19:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55A3JJAp086019; Tue, 10 Jun 2025 03:19:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55A3JJr1086016; Tue, 10 Jun 2025 03:19:19 GMT (envelope-from git) Date: Tue, 10 Jun 2025 03:19:19 GMT Message-Id: <202506100319.55A3JJr1086016@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 948078b65c27 - main - pf: fix !VIMAGE build List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 948078b65c275acfa55afe56a9bbdeb2f61f1e2a Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=948078b65c275acfa55afe56a9bbdeb2f61f1e2a commit 948078b65c275acfa55afe56a9bbdeb2f61f1e2a Author: Gleb Smirnoff AuthorDate: 2025-06-10 03:19:04 +0000 Commit: Gleb Smirnoff CommitDate: 2025-06-10 03:19:04 +0000 pf: fix !VIMAGE build --- sys/netpfil/pf/pf_norm.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index 45f4415d084b..94a436cdbfd6 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -124,8 +124,6 @@ TAILQ_HEAD(pf_cachequeue, pf_fragment); RB_HEAD(pf_frnode_tree, pf_frnode); VNET_DEFINE_STATIC(struct pf_fragqueue, pf_fragqueue); #define V_pf_fragqueue VNET(pf_fragqueue) -VNET_DEFINE_STATIC(struct pf_frag_tree, pf_frag_tree); -#define V_pf_frag_tree VNET(pf_frag_tree) static __inline int pf_frnode_compare(struct pf_frnode *, struct pf_frnode *); VNET_DEFINE_STATIC(struct pf_frnode_tree, pf_frnode_tree); From nobody Tue Jun 10 06:06:06 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGdZl0tjfz609c4; Tue, 10 Jun 2025 06:06:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGdZk6j6gz3q0d; Tue, 10 Jun 2025 06:06:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749535566; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dTBEgXUtt3GPDY5ddMu9XmOlAWdd408PREp691NLwA8=; b=nxUiIL7clASPFQkduW00NLLnPlQU5O+T8AMV1y+m8DRp7xpXhdpwsfre4lvWZYMVET9erj wK0g+LjD/7OZ5DfNR6QbMRBMlQgF/hL9V23ZipfTe23yMID8uTco1DoY+KnpLH1Pq7l+Rn Yb9ZBscIqq7Fia9WyNXOEROfPzT8naSbhT1rDHg0TpzbUh22h9OLQTs+5iNeDuEd/T4oom /4iPWYfKDQvS/cmnEni1OxgN/4jy1vz3B35RCsiF+/SFXJIMpuc87jRTOEwJNLrfbdrYOM RPWo7fXxhFd8VtmigkR5u9cfXxpBvxTmOMqlAUDlZgOSU9gZcM2sLMX23tHQEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749535566; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dTBEgXUtt3GPDY5ddMu9XmOlAWdd408PREp691NLwA8=; b=yitOwEWw7JT3G7kxqXcLh1dlD5jOf28z5svpRZGf5lBsxaw67wP7QSSEZm+IkUyk/24WfQ maiikk18hdZqCskq1oRxjJosOMurlMu6SsbCAMHW9oWMcYNWNPKeAwk2jar2gp99WwMhfU xIAmY2H9k6Tj90ELFix79BK/6IvSMwCIm5pfEszCr/T4wkcPNAOnYjLUqZeEickVIgDm2v vKjtJ/Nz7yjJRNotfWMl+9fFJOwLyX690xwwUYNTwdC2xJ0PFqX7zzDil7CgSNi9XdcqOr R2PMCLTLg3mh4SV1JW5us86NazHWUUICoyxOt4PVu7CGACZlUI/r6KwqhrRHCg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749535567; a=rsa-sha256; cv=none; b=XdFJ3XSQGcHQGUfCfiXvCIel3omZs+Sb58u2gY0DJRebepnCKwHmCMPYTlWhebB3vYfhbZ 3dLu3QGOcmdX9wFoKkGGMtfxPCrdkphMeVaQpniLCyHdDjFRPr6ppci0GFnQXHKxeJBmRU vbqzN62d2nwh9lZ84guzpcoOK+6OUQNVeIHKZMW805JIu44f4+xGLw8iYZtN1riOWEESz3 LZE3+C5cVZKc9o1Cj4yUTYXd2sWdvxfntW4GTEmkrvw5RUWPNKFpLvJ47X8Zyy3uzyQjPc bPUPIld2G0nIJTZ6o3cNEe4slMQyQs4EzQaezkUd88+OLDf1enua+oJ3E174sQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGdZk63vHzDF6; Tue, 10 Jun 2025 06:06:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55A666OR003551; Tue, 10 Jun 2025 06:06:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55A666XL003548; Tue, 10 Jun 2025 06:06:06 GMT (envelope-from git) Date: Tue, 10 Jun 2025 06:06:06 GMT Message-Id: <202506100606.55A666XL003548@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 19e599c0e00d - main - tests/unix_stream: refactor event mech tests List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 19e599c0e00dcf0699c38798e5d58fb8423e5810 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=19e599c0e00dcf0699c38798e5d58fb8423e5810 commit 19e599c0e00dcf0699c38798e5d58fb8423e5810 Author: Gleb Smirnoff AuthorDate: 2025-06-10 02:59:31 +0000 Commit: Gleb Smirnoff CommitDate: 2025-06-10 04:57:04 +0000 tests/unix_stream: refactor event mech tests Provide a context that can be used both for writability and readability checks. This collapses two check functions per mech into one. Provide a possibility to check advanced features of an event mech, e.g. returned kev_flags for kevent(2). Should be no functional change. --- tests/sys/kern/unix_stream.c | 293 ++++++++++++++++++++++++------------------- 1 file changed, 161 insertions(+), 132 deletions(-) diff --git a/tests/sys/kern/unix_stream.c b/tests/sys/kern/unix_stream.c index f8ba288308bd..72dbe8ca1d92 100644 --- a/tests/sys/kern/unix_stream.c +++ b/tests/sys/kern/unix_stream.c @@ -102,98 +102,78 @@ ATF_TC_BODY(send_0, tc) close(sv[1]); } -static void -check_readable_select(int fd, int expect, bool timeout) -{ - fd_set rdfds; - int nfds; - - FD_ZERO(&rdfds); - FD_SET(fd, &rdfds); - nfds = select(fd + 1, &rdfds, NULL, NULL, timeout ? - &(struct timeval){.tv_usec = 1000} : NULL); - ATF_REQUIRE_MSG(nfds == expect, - "select() returns %d errno %d", nfds, errno); -} +struct check_ctx; +typedef void check_func_t(struct check_ctx *); +struct check_ctx { + check_func_t *method; + int sv[2]; + bool timeout; + union { + enum { SELECT_RD, SELECT_WR } select_what; + short poll_events; + short kev_filter; + }; + int nfds; + union { + short poll_revents; + unsigned short kev_flags; + }; +}; static void -check_writable_select(int fd, int expect, bool timeout) +check_select(struct check_ctx *ctx) { - fd_set wrfds; + fd_set fds; int nfds; - FD_ZERO(&wrfds); - FD_SET(fd, &wrfds); - nfds = select(fd + 1, NULL, &wrfds, NULL, timeout ? - &(struct timeval){.tv_usec = 1000} : NULL); - ATF_REQUIRE_MSG(nfds == expect, + FD_ZERO(&fds); + FD_SET(ctx->sv[0], &fds); + nfds = select(ctx->sv[0] + 1, + ctx->select_what == SELECT_RD ? &fds : NULL, + ctx->select_what == SELECT_WR ? &fds : NULL, + NULL, + ctx->timeout ? &(struct timeval){.tv_usec = 1000} : NULL); + ATF_REQUIRE_MSG(nfds == ctx->nfds, "select() returns %d errno %d", nfds, errno); } static void -check_readable_poll(int fd, int expect, bool timeout) +check_poll(struct check_ctx *ctx) { struct pollfd pfd[1]; int nfds; pfd[0] = (struct pollfd){ - .fd = fd, - .events = POLLIN | POLLRDNORM, + .fd = ctx->sv[0], + .events = ctx->poll_events, }; - nfds = poll(pfd, 1, timeout ? 1 : INFTIM); - ATF_REQUIRE_MSG(nfds == expect, + nfds = poll(pfd, 1, ctx->timeout ? 1 : INFTIM); + ATF_REQUIRE_MSG(nfds == ctx->nfds, "poll() returns %d errno %d", nfds, errno); + ATF_REQUIRE((pfd[0].revents & ctx->poll_revents) == ctx->poll_revents); } static void -check_writable_poll(int fd, int expect, bool timeout) -{ - struct pollfd pfd[1]; - int nfds; - - pfd[0] = (struct pollfd){ - .fd = fd, - .events = POLLOUT | POLLWRNORM, - }; - nfds = poll(pfd, 1, timeout ? 1 : INFTIM); - ATF_REQUIRE_MSG(nfds == expect, - "poll() returns %d errno %d", nfds, errno); -} - -static void -check_writable_kevent(int fd, int expect, bool timeout) +check_kevent(struct check_ctx *ctx) { struct kevent kev; int nfds, kq; ATF_REQUIRE(kq = kqueue()); - EV_SET(&kev, fd, EVFILT_WRITE, EV_ADD, 0, 0, NULL); + EV_SET(&kev, ctx->sv[0], ctx->kev_filter, EV_ADD, 0, 0, NULL); nfds = kevent(kq, &kev, 1, NULL, 0, NULL); ATF_REQUIRE_MSG(nfds == 0, "kevent() returns %d errno %d", nfds, errno); - nfds = kevent(kq, NULL, 0, &kev, 1, timeout ? + nfds = kevent(kq, NULL, 0, &kev, 1, ctx->timeout ? &(struct timespec){.tv_nsec = 1000000} : NULL); - ATF_REQUIRE_MSG(nfds == expect, + ATF_REQUIRE_MSG(nfds == ctx->nfds, "kevent() returns %d errno %d", nfds, errno); + ATF_REQUIRE(kev.ident == (uintptr_t)ctx->sv[0] && + kev.filter == ctx->kev_filter && + (kev.flags & ctx->kev_flags) == ctx->kev_flags); close(kq); } -typedef void check_writable_func_t(int, int, bool); -struct check_writable_ctx { - check_writable_func_t *method; - int fd; -}; - -static void * -check_writable_blocking_thread(void *arg) -{ - struct check_writable_ctx *ctx = arg; - - ctx->method(ctx->fd, 1, false); - - return (NULL); -} - static void full_socketpair(int *sv) { @@ -210,13 +190,19 @@ full_socketpair(int *sv) free(buf); } +static void * +pthread_wrap(void *arg) +{ + struct check_ctx *ctx = arg; + + ctx->method(ctx); + + return (NULL); +} + static void -full_writability_check(int *sv, check_writable_func_t method) +full_writability_check(struct check_ctx *ctx) { - struct check_writable_ctx ctx = { - .method = method, - .fd = sv[0], - }; pthread_t thr; void *buf; u_long space; @@ -225,26 +211,30 @@ full_writability_check(int *sv, check_writable_func_t method) ATF_REQUIRE((buf = malloc(space)) != NULL); /* First check with timeout, expecting 0 fds returned. */ - method(sv[0], 0, true); + ctx->timeout = true; + ctx->nfds = 0; + ctx->method(ctx); /* Launch blocking thread. */ - ATF_REQUIRE(pthread_create(&thr, NULL, check_writable_blocking_thread, - &ctx) == 0); + ctx->timeout = false; + ctx->nfds = 1; + ATF_REQUIRE(pthread_create(&thr, NULL, pthread_wrap, ctx) == 0); /* Sleep a bit to make sure that thread is put to sleep. */ usleep(10000); ATF_REQUIRE(pthread_peekjoin_np(thr, NULL) == EBUSY); /* Read some data and re-check, the fd is expected to be returned. */ - ATF_REQUIRE(read(sv[1], buf, space) == (ssize_t)space); - - method(sv[0], 1, true); + ATF_REQUIRE(read(ctx->sv[1], buf, space) == (ssize_t)space); /* Now check that thread was successfully woken up and exited. */ ATF_REQUIRE(pthread_join(thr, NULL) == 0); - close(sv[0]); - close(sv[1]); + /* Extra check repeating what joined thread already did. */ + ctx->method(ctx); + + close(ctx->sv[0]); + close(ctx->sv[1]); free(buf); } @@ -254,130 +244,169 @@ full_writability_check(int *sv, check_writable_func_t method) ATF_TC_WITHOUT_HEAD(full_writability_select); ATF_TC_BODY(full_writability_select, tc) { - int sv[2]; + struct check_ctx ctx = { + .method = check_select, + .select_what = SELECT_WR, + }; - full_socketpair(sv); - full_writability_check(sv, check_writable_select); - close(sv[0]); - close(sv[1]); + full_socketpair(ctx.sv); + full_writability_check(&ctx); + close(ctx.sv[0]); + close(ctx.sv[1]); } ATF_TC_WITHOUT_HEAD(full_writability_poll); ATF_TC_BODY(full_writability_poll, tc) { - int sv[2]; + struct check_ctx ctx = { + .method = check_poll, + .poll_events = POLLOUT | POLLWRNORM, + }; - full_socketpair(sv); - full_writability_check(sv, check_writable_poll); - close(sv[0]); - close(sv[1]); + full_socketpair(ctx.sv); + full_writability_check(&ctx); + close(ctx.sv[0]); + close(ctx.sv[1]); } ATF_TC_WITHOUT_HEAD(full_writability_kevent); ATF_TC_BODY(full_writability_kevent, tc) { - int sv[2]; + struct check_ctx ctx = { + .method = check_kevent, + .kev_filter = EVFILT_WRITE, + }; - full_socketpair(sv); - full_writability_check(sv, check_writable_kevent); - close(sv[0]); - close(sv[1]); + full_socketpair(ctx.sv); + full_writability_check(&ctx); + close(ctx.sv[0]); + close(ctx.sv[1]); } ATF_TC_WITHOUT_HEAD(connected_writability); ATF_TC_BODY(connected_writability, tc) { - int sv[2]; + struct check_ctx ctx = { + .timeout = true, + .nfds = 1, + }; - do_socketpair(sv); - check_writable_select(sv[0], 1, true); - check_writable_poll(sv[0], 1, true); - check_writable_kevent(sv[0], 1, true); - close(sv[0]); - close(sv[1]); + do_socketpair(ctx.sv); + + ctx.select_what = SELECT_WR; + check_select(&ctx); + ctx.poll_events = POLLOUT | POLLWRNORM; + check_poll(&ctx); + ctx.kev_filter = EVFILT_WRITE; + check_kevent(&ctx); + + close(ctx.sv[0]); + close(ctx.sv[1]); } ATF_TC_WITHOUT_HEAD(unconnected_writability); ATF_TC_BODY(unconnected_writability, tc) { - int s; + struct check_ctx ctx = { + .timeout = true, + .nfds = 0, + }; + + ATF_REQUIRE((ctx.sv[0] = socket(PF_LOCAL, SOCK_STREAM, 0)) > 0); - ATF_REQUIRE((s = socket(PF_LOCAL, SOCK_STREAM, 0)) > 0); - check_writable_select(s, 0, true); - check_writable_poll(s, 0, true); - check_writable_kevent(s, 0, true); - close(s); + ctx.select_what = SELECT_WR; + check_select(&ctx); + ctx.poll_events = POLLOUT | POLLWRNORM; + check_poll(&ctx); + ctx.kev_filter = EVFILT_WRITE; + check_kevent(&ctx); + + close(ctx.sv[0]); } ATF_TC_WITHOUT_HEAD(peerclosed_writability); ATF_TC_BODY(peerclosed_writability, tc) { - struct kevent kev; - int sv[2], kq; - - do_socketpair(sv); - close(sv[1]); + struct check_ctx ctx = { + .timeout = false, + .nfds = 1, + }; - check_writable_select(sv[0], 1, false); - check_writable_poll(sv[0], 1, false); + do_socketpair(ctx.sv); + close(ctx.sv[1]); - ATF_REQUIRE(kq = kqueue()); - EV_SET(&kev, sv[0], EVFILT_WRITE, EV_ADD, 0, 0, NULL); - ATF_REQUIRE(kevent(kq, &kev, 1, &kev, 1, NULL) == 1); - ATF_REQUIRE(kev.ident == (uintptr_t)sv[0] && - kev.filter == EVFILT_WRITE && - kev.flags == EV_EOF); + ctx.select_what = SELECT_WR; + check_select(&ctx); + ctx.poll_events = POLLOUT | POLLWRNORM; + check_poll(&ctx); + ctx.kev_filter = EVFILT_WRITE; + ctx.kev_flags = EV_EOF; + check_kevent(&ctx); - close(sv[0]); + close(ctx.sv[0]); } ATF_TC_WITHOUT_HEAD(peershutdown_writability); ATF_TC_BODY(peershutdown_writability, tc) { - int sv[2]; + struct check_ctx ctx = { + .timeout = false, + .nfds = 1, + }; - do_socketpair(sv); - shutdown(sv[1], SHUT_RD); + do_socketpair(ctx.sv); + shutdown(ctx.sv[1], SHUT_RD); - check_writable_select(sv[0], 1, false); - check_writable_poll(sv[0], 1, false); + ctx.select_what = SELECT_WR; + check_select(&ctx); + ctx.poll_events = POLLOUT | POLLWRNORM; + check_poll(&ctx); /* * XXXGL: historically unix(4) sockets were not reporting peer's * shutdown(SHUT_RD) as our EV_EOF. The kevent(2) manual page says * "filter will set EV_EOF when the reader disconnects", which is hard * to interpret unambigously. For now leave the historic behavior, * but we may want to change that in uipc_usrreq.c:uipc_filt_sowrite(), - * and then this test will look like the peerclosed_writability test. + * and then this test will also expect EV_EOF in returned flags. */ - check_writable_kevent(sv[0], 1, false); + ctx.kev_filter = EVFILT_WRITE; + check_kevent(&ctx); - close(sv[0]); - close(sv[1]); + close(ctx.sv[0]); + close(ctx.sv[1]); } ATF_TC_WITHOUT_HEAD(peershutdown_readability); ATF_TC_BODY(peershutdown_readability, tc) { + struct check_ctx ctx = { + .timeout = false, + .nfds = 1, + }; ssize_t readsz; - int sv[2]; char c; - do_socketpair(sv); - shutdown(sv[1], SHUT_WR); + do_socketpair(ctx.sv); + shutdown(ctx.sv[1], SHUT_WR); /* * The other side should flag as readable in select(2) to allow it to * read(2) and observe EOF. Ensure that both poll(2) and select(2) * are consistent here. */ - check_readable_select(sv[0], 1, false); - check_readable_poll(sv[0], 1, false); + ctx.select_what = SELECT_RD; + check_select(&ctx); + ctx.poll_events = POLLIN | POLLRDNORM; + check_poll(&ctx); - readsz = read(sv[0], &c, sizeof(c)); + /* + * Also check that read doesn't block. + */ + readsz = read(ctx.sv[0], &c, sizeof(c)); ATF_REQUIRE_INTEQ(0, readsz); - close(sv[0]); - close(sv[1]); + close(ctx.sv[0]); + close(ctx.sv[1]); } ATF_TP_ADD_TCS(tp) From nobody Tue Jun 10 06:06:07 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGdZm6rGkz609qg; Tue, 10 Jun 2025 06:06:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGdZm0Xl4z3pq7; Tue, 10 Jun 2025 06:06:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749535568; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Pn+YKLYW26k+Ixq2pVvTfm1XVbFDJGZNYoda/Ff/zYg=; b=NRPrJy+3FFGv7NjF+VRXcdbKiQY63mIDB8nqCj5Tcr7LgdeCOHRFyG36v7OTTFzF4IWtoQ nJSq5yI0L4pSuIdIqREF9W9hfB60lguaRDh9G0nkxRejOkRUeXB1IUarp5LP86DMAs8y1I 33It2XK8bbLOJdSshmufgAiUwDGECEuwf326YNwvrgh7lX7RZdqmND0QUGm3RSwYgWlzEJ IbcGcBCetKKseWmiuyG7G0f0yWn8HmquqrC8dbd6PT4dV8QN+tp+54ImKiijqrO2YerZ80 2t7E4OLV8jDgTvBEeHZHkX3TFcEy72rRZ79zvjmoHci05VegAQDuiL+A10V2FQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749535568; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Pn+YKLYW26k+Ixq2pVvTfm1XVbFDJGZNYoda/Ff/zYg=; b=H5JRjHMYu7pj0WGI9SAzHZzSsTeCnBTiTgedC8w9Gw3Xfn02fJqmyRyv7X2F5eq207X3O0 NmPlnUuXypdDHAAdN2nbb8XwSUj43jzrk282r5gqpe86rRPAWLBrRVrU8wtQ1/2hu1N0UN 2L5yPgq0xImBEie2QsyGEtS6ADZhlMivxpHBdePzl+6gqti3FiBwyNOaeUatRx8pSLZAAB pY50RsTd1mpTTI+VhVftwZt4QpbhmZlmBbQg344LZcH3xsi/6zDGnMnaE62IcZ1uAuYm1C Ij2J+FvNu/E/0WRbiLzcVT+o2vfXirKkZLTMU1FeRvFBc0rVcCQ94F/OImxmIA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749535568; a=rsa-sha256; cv=none; b=fbrDC8fxfG/6CT8QjzqC/dHR4u4m9TFAH4h/fFEUUddPjUAZp7z/xhL4uEcwDoQifCLG1b Ib+sDVkZmsdaXyFuiwi9u7odqiN39Oseddhtel6/SmwcAUVgjwgrN3hbEUw9NRcOFrzgwt 2kWwPVD+0ksBI4iIpOlISjAWKDVKgu6eNu7DlhpxfLOcBMfR0OMQIX2oqb5XGGCbSlkRuQ tLUzYeUkySDzqnFvchuAxZh8wZ05WmZDemgps5uz58TmwD0rG01/zmZC+PQRyg2zsqC7ZI d258gAJ668ldjb5nbK8J41VwYxpoMzPQGtCnGgTsV8YRc+4T4Va1ZI2eSeTIQg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGdZl6ztvzD2n; Tue, 10 Jun 2025 06:06:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55A6671M003587; Tue, 10 Jun 2025 06:06:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55A667mM003584; Tue, 10 Jun 2025 06:06:07 GMT (envelope-from git) Date: Tue, 10 Jun 2025 06:06:07 GMT Message-Id: <202506100606.55A667mM003584@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: c73436000a48 - main - unix/stream: rename uipc_wakeup() to uipc_wakeup_writer() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c73436000a48ef573a76d1049a74d41004b592a8 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=c73436000a48ef573a76d1049a74d41004b592a8 commit c73436000a48ef573a76d1049a74d41004b592a8 Author: Gleb Smirnoff AuthorDate: 2025-06-10 05:10:44 +0000 Commit: Gleb Smirnoff CommitDate: 2025-06-10 06:05:07 +0000 unix/stream: rename uipc_wakeup() to uipc_wakeup_writer() Also remove reference to sowakeup(), it may cause more confustion than help. No functional change. --- sys/kern/uipc_usrreq.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 95d857b2625d..c176119382fa 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -1304,7 +1304,7 @@ out: } /* - * Our version of sowakeup(), used by recv(2) and shutdown(2). + * Wakeup a writer, used by recv(2) and shutdown(2). * * @param so Points to a connected stream socket with receive buffer locked * @@ -1314,7 +1314,7 @@ out: * receive lock is protecting us from the peer going away. */ static void -uipc_wakeup(struct socket *so) +uipc_wakeup_writer(struct socket *so) { struct sockbuf *sb = &so->so_rcv; struct selinfo *sel; @@ -1347,7 +1347,7 @@ uipc_cantrcvmore(struct socket *so) SOCK_RECVBUF_LOCK(so); so->so_rcv.sb_state |= SBS_CANTRCVMORE; if (so->so_rcv.uxst_peer != NULL) - uipc_wakeup(so); + uipc_wakeup_writer(so); else SOCK_RECVBUF_UNLOCK(so); } @@ -1503,7 +1503,7 @@ restart: if ((aio = sb->uxst_flags & UXST_PEER_AIO)) sb->uxst_flags &= ~UXST_PEER_AIO; - uipc_wakeup(so); + uipc_wakeup_writer(so); /* * XXXGL: need to go through uipc_lock_peer() after * the receive buffer lock dropped, it was protecting From nobody Tue Jun 10 06:06:09 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGdZn3CpHz609lQ; Tue, 10 Jun 2025 06:06:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGdZn1CZTz3phD; Tue, 10 Jun 2025 06:06:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749535569; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+Pznwrcd988KwRRzD8ZbaezwD5BNwCr2x1keUo7QdkA=; b=nakAy9ABtJO67vHue31/VwWwwYPwdaz86m9FcEDMed3TuqnPT/k/AD0BZvIv9JCpaYsNCo 1oKWbYO98PyVlLWfEBwVqy+LUNhfY+4r9ycpOoRJu1gS4uaiWy7rejqJMPOCe+uh5njXA0 YQFkvuGeLQ/amFCQgbrBqKLgQcmdJcwz6Nkfa9xCnlCUk6oUwEvYUl4e1VM37U/lrQIZjA hKeN8IXOmwB/fbx6Hv2tSyEkZiG9wd1RuQyWWgSz3FLjr+IWnB/k4YYcVrVzmyhMcpfTOk PxoG3AIMF2j8Cys9hgYIhKbkTYPjCTIKPVL+388FA6RNPvxUO/NjHMtgZ0QWCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749535569; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+Pznwrcd988KwRRzD8ZbaezwD5BNwCr2x1keUo7QdkA=; b=qc8JeaRVs+mRDicoAIph23U1nbmLFImFsqSrF8qOd543rwOlgGVgnsH6kyAc1yUKBVfxHi cYA7CNwgICDYczY4ha/hCjID7QfFsQREqcK5+1cGjhC/Wb8A0Tv5E0Ev0eVy6XqRo9rk77 5mo6Ej7EJxYJ4/ij0wHZKPUSCY+TkHjtNhf+0iDomoTu2ZkN5YQmRJk+UV8CmcDxxGlxMo 2Dlq1KnGREFIIhh9zQ6Oh9n8zVCbSiq7QWN6r3E1UGA3a3GbfwPLYRInYSMssnjnDdJHdh erIeDmDyBxtobII3jiJkG9vUdLuvX1Y8cT/kQOAzq6twAK7YnaNF2saf00PxWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749535569; a=rsa-sha256; cv=none; b=mO7YhbtezuUahWffUGMWFdu/XZyKursTCml0CKmhIQCmryveY+He9qCZNAkG1bNrw+cDQx CiWX7k8e/MobpoiDNHRtAlxM2b9m9vOhaawKLVkD4Wcbsp1rye8tmzAgvDMDNWHAhv7HDG ch9arsGsyeZl88Ia7kUNrT5gzNOLrwFkSmU4HPKgKJwf7bQMm39LAhfa8y1kd+JsPfNJj/ bGClWgYRwTuRROaiMvMZoHiWUWXnx08rCMZo6nqloftjJpUsLOrYB4/OxI9eMa+WCdTe/U dpjMo9t3W9tHQcufiH3ThU3e/SQXOp3sY3Nfm5afMA09v3HTBKL/nOruA1dGeg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGdZn0p92zDHd; Tue, 10 Jun 2025 06:06:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55A669RS003627; Tue, 10 Jun 2025 06:06:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55A669DP003624; Tue, 10 Jun 2025 06:06:09 GMT (envelope-from git) Date: Tue, 10 Jun 2025 06:06:09 GMT Message-Id: <202506100606.55A669DP003624@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 52c0aa086d6b - main - unix/stream: shutdown(SHUT_WR) shall trigger read event on peer List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 52c0aa086d6b3184f6dfb83faa70be98e7d8e1df Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=52c0aa086d6b3184f6dfb83faa70be98e7d8e1df commit 52c0aa086d6b3184f6dfb83faa70be98e7d8e1df Author: Gleb Smirnoff AuthorDate: 2025-06-10 06:01:53 +0000 Commit: Gleb Smirnoff CommitDate: 2025-06-10 06:05:07 +0000 unix/stream: shutdown(SHUT_WR) shall trigger read event on peer Reported by: kp, brd Fixes: d15792780760ef94647af9b377b5f0a80e1826bc --- sys/kern/uipc_usrreq.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index c176119382fa..3f6535567e9d 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -1346,6 +1346,8 @@ uipc_cantrcvmore(struct socket *so) SOCK_RECVBUF_LOCK(so); so->so_rcv.sb_state |= SBS_CANTRCVMORE; + selwakeuppri(&so->so_rdsel, PSOCK); + KNOTE_LOCKED(&so->so_rdsel.si_note, 0); if (so->so_rcv.uxst_peer != NULL) uipc_wakeup_writer(so); else From nobody Tue Jun 10 06:06:10 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGdZp4Nr7z609c7; Tue, 10 Jun 2025 06:06:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGdZp28LDz3pmW; Tue, 10 Jun 2025 06:06:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749535570; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qv2gselyAxipliYizKgxUr6gxzByVZO376i9+jnE51s=; b=rVfEKnOGVxnxxMQRRqm2a2sBJKqI7WkTxftczy7ZzSq6GYhxS+WeioZxyFa6XVdC5OrCyW ZGqoALmd58HETc8cDArDXzwSfA2MmLN+MZ330n3EWNEPm9oezAGsI27oJQbO61NyTQllRn igEyGc2ra4SixSZXLlYGn/FaRjfvPs5VlmjvXkRALX4UixR0sclGOk7RM9wJFA9DSX66A9 fPm71pp+V6AVJlLYPEBGClOXl9rQijCd35cyweddc1h3GT5hKIbpusbusi50pkYkkf+P/g 2zOrDU+vBkK//6Tv84yishLiTiJlMqHDLEsKQNSyyTJgYvHs/kXRU+ied6Sscw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749535570; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qv2gselyAxipliYizKgxUr6gxzByVZO376i9+jnE51s=; b=hmlF9MpOnlVdg11Z1HNcy+UfheEHGCW9FTf1kP1QmmXq04y65GQV6MWwBKB4i4IeIYDgVD vIQnui98UEMYfbF6PAunDSrPCeJMOEOpUANDdBElIStWfMFmIqFRMgGOdcUBKc0ZXDFPQ0 etOSqFiGcd7LHa2+NhxNZbhOP4cx5LVBj5aG9d3bkiuSOVRUZLMdfwyBpbVcS4Id6PllbS uti+N5Ws/BkVs8JfDJxu7FbBXmjxAmhYUswrAm/gzaZRyyE/gX//Qtl30uHwwVI3L+Uy7j cfs/QUMo6ziKrcldZyoUKRvlZXF2Ik0DSwgmvcT8QrTpcLWCEXpyY3PIzJSXKg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749535570; a=rsa-sha256; cv=none; b=OyZPZNviC9QX/z+E/zmR1BRAX8RbuTgU9QxvRqrPX+o+0m1RNiE7O/q7GaL9YlKHlbrSML 1X/+lWdS2kO20k1/vgXuma0+jWeS4+gxtLuCOOqVB4DBcrmluYRyGS+Zya8QntMbsNZ3ge vaybp+QaKYSHWFYn9+jMZi8ECzMgiv8EXcKhIMQPH3DJXb4+ZjyyFbZcr0rL2UGQcByvxA IQt+KPTG4SUFEF5b6QW9yvcDcgxRFtcHxATPMPsvSNotIE+53unJRp6BJ4MPK3KWePSLBv s8pdJFzcD8A+JvgwrDqOxGJALbIBia7o3QJKsbYDfxlW4a665dPbaQ1hbtr3Jw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGdZp1kvfzD3d; Tue, 10 Jun 2025 06:06:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55A66AH4003667; Tue, 10 Jun 2025 06:06:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55A66AJN003664; Tue, 10 Jun 2025 06:06:10 GMT (envelope-from git) Date: Tue, 10 Jun 2025 06:06:10 GMT Message-Id: <202506100606.55A66AJN003664@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 83259da6c778 - main - tests/unix_stream: peer's shutdown(SHUT_WR) must wake up any event mech List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 83259da6c7782cfdc4d53dbf938d4962e82f3b81 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=83259da6c7782cfdc4d53dbf938d4962e82f3b81 commit 83259da6c7782cfdc4d53dbf938d4962e82f3b81 Author: Gleb Smirnoff AuthorDate: 2025-06-10 04:54:48 +0000 Commit: Gleb Smirnoff CommitDate: 2025-06-10 06:05:07 +0000 tests/unix_stream: peer's shutdown(SHUT_WR) must wake up any event mech --- tests/sys/kern/unix_stream.c | 77 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 69 insertions(+), 8 deletions(-) diff --git a/tests/sys/kern/unix_stream.c b/tests/sys/kern/unix_stream.c index 72dbe8ca1d92..bb811f78f620 100644 --- a/tests/sys/kern/unix_stream.c +++ b/tests/sys/kern/unix_stream.c @@ -200,6 +200,25 @@ pthread_wrap(void *arg) return (NULL); } +/* + * Launch a thread that would block in event mech and return it. + */ +static pthread_t +pthread_create_blocked(struct check_ctx *ctx) +{ + pthread_t thr; + + ctx->timeout = false; + ctx->nfds = 1; + ATF_REQUIRE(pthread_create(&thr, NULL, pthread_wrap, ctx) == 0); + + /* Sleep a bit to make sure that thread is put to sleep. */ + usleep(10000); + ATF_REQUIRE(pthread_peekjoin_np(thr, NULL) == EBUSY); + + return (thr); +} + static void full_writability_check(struct check_ctx *ctx) { @@ -215,14 +234,7 @@ full_writability_check(struct check_ctx *ctx) ctx->nfds = 0; ctx->method(ctx); - /* Launch blocking thread. */ - ctx->timeout = false; - ctx->nfds = 1; - ATF_REQUIRE(pthread_create(&thr, NULL, pthread_wrap, ctx) == 0); - - /* Sleep a bit to make sure that thread is put to sleep. */ - usleep(10000); - ATF_REQUIRE(pthread_peekjoin_np(thr, NULL) == EBUSY); + thr = pthread_create_blocked(ctx); /* Read some data and re-check, the fd is expected to be returned. */ ATF_REQUIRE(read(ctx->sv[1], buf, space) == (ssize_t)space); @@ -409,6 +421,52 @@ ATF_TC_BODY(peershutdown_readability, tc) close(ctx.sv[1]); } +static void +peershutdown_wakeup(struct check_ctx *ctx) +{ + pthread_t thr; + + ctx->timeout = false; + ctx->nfds = 1; + + do_socketpair(ctx->sv); + thr = pthread_create_blocked(ctx); + shutdown(ctx->sv[1], SHUT_WR); + ATF_REQUIRE(pthread_join(thr, NULL) == 0); + + close(ctx->sv[0]); + close(ctx->sv[1]); +} + +ATF_TC_WITHOUT_HEAD(peershutdown_wakeup_select); +ATF_TC_BODY(peershutdown_wakeup_select, tc) +{ + peershutdown_wakeup(&(struct check_ctx){ + .method = check_select, + .select_what = SELECT_RD, + }); +} + +ATF_TC_WITHOUT_HEAD(peershutdown_wakeup_poll); +ATF_TC_BODY(peershutdown_wakeup_poll, tc) +{ + peershutdown_wakeup(&(struct check_ctx){ + .method = check_poll, + .poll_events = POLLIN | POLLRDNORM | POLLRDHUP, + .poll_revents = POLLRDHUP, + }); +} + +ATF_TC_WITHOUT_HEAD(peershutdown_wakeup_kevent); +ATF_TC_BODY(peershutdown_wakeup_kevent, tc) +{ + peershutdown_wakeup(&(struct check_ctx){ + .method = check_kevent, + .kev_filter = EVFILT_READ, + .kev_flags = EV_EOF, + }); +} + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, getpeereid); @@ -421,6 +479,9 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, peerclosed_writability); ATF_TP_ADD_TC(tp, peershutdown_writability); ATF_TP_ADD_TC(tp, peershutdown_readability); + ATF_TP_ADD_TC(tp, peershutdown_wakeup_select); + ATF_TP_ADD_TC(tp, peershutdown_wakeup_poll); + ATF_TP_ADD_TC(tp, peershutdown_wakeup_kevent); return atf_no_error(); } From nobody Tue Jun 10 06:08:57 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGdf22Ydpz609ws; Tue, 10 Jun 2025 06:08:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGdf20JP2z3s3M; Tue, 10 Jun 2025 06:08:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749535738; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KVplNptTV/lYZerrnaX9i8VzZFsXP3gG3lgpMylVUbQ=; b=FYN5NzNfdkuFQHg60rR1/GuIL2SSbzIx2bQRCOztwWUq8eeJIvXbB8ZAJUFSE/6czUD2OO 7mmFxWstTdOYHh253bAaHoDZPpq2RbEPovNCd+Kxh9Z16sbd4dw0vzo9V9yQppySmWfi9y BhY2v3CekeVNuhrrndoKU84QgxtikKxq30wYzXXrm3AVK1Q4bUKF83fAyNzpGpJXxWZuaj eki+wcOgylhScBTMKWyzEu1pyCVqaE+YsAkyvU177G0fVNoTjtrL5VTxLc5JDEGLiXhy2I MiLlj/9O8BDTmXXl+PWA3A21tU9iSUdlLk2o21A2PVrU0CHfxZ3eZNvhdctFFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749535738; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KVplNptTV/lYZerrnaX9i8VzZFsXP3gG3lgpMylVUbQ=; b=OqFrPmP5DZyxHGNjJQ/BZ6FrdkNlkrOFxmEajm0oeez+/nA5gxEG+GiVdYIWd6f89CDUWj BtS1l+X1cWXnvL1LswvfYcYHX5U0V01jgg2BdgPCoNr7Eweoy38AfoCBXosSc7xiY/MgD9 QP1thbf5lTeWcpF88sUhNIXl3NOjtDxF++CtR07QNVOq2R9azjSGR4vPgiZZi+mL+O48KV 4TOW/M5FPR7FrvCpXbv89rO7i3XGc4R85E8NPqYOIQej+8tuqm4Fv8pEufGfmAzPrqXZEf Th8z/IR0bw2AqkH9DzP2GPeV4rHB5QB1srWmJrTnnpfdftFVBaTvd6twsXrcbA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749535738; a=rsa-sha256; cv=none; b=G6smqRMz+URP5bqthDYFtIZH/OZvkJ/gscBnZU+mxKcOGQocKYVLHLMzcpxnZwC1ypQioj klW5A2jOpFmhw922j+KEsHSNrF30BoCsH8RgZI6G2VtJbex3UB4q1WL7wh0DQLAGAZMbUs LdavixA3lqhCiJzPB8WjSISzYlKqX69ZkZZ6fLYx0XgJRfkZSURnqJ+j29QzT+c/JtxXng dJg2lODyz5jJw2aOZ+dl35GsInFW1KWc34/CmgDDbyyNYnr9vjkHfl6M6xLI2EcaHKmXCQ jQbtSaoLDvLAQKWTmTdVE+rbhTCOdmJleUxKHIJjC+VcgOb/86IZr10dlFa7Sg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGdf16vM7zD2q; Tue, 10 Jun 2025 06:08:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55A68vEd004771; Tue, 10 Jun 2025 06:08:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55A68vgl004768; Tue, 10 Jun 2025 06:08:57 GMT (envelope-from git) Date: Tue, 10 Jun 2025 06:08:57 GMT Message-Id: <202506100608.55A68vgl004768@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: acded1a4c42a - main - cp: Improve -p flag tests. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: acded1a4c42a6ce713a85b323ec39af86cf17679 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=acded1a4c42a6ce713a85b323ec39af86cf17679 commit acded1a4c42a6ce713a85b323ec39af86cf17679 Author: Dag-Erling Smørgrav AuthorDate: 2025-06-10 06:08:36 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2025-06-10 06:08:51 +0000 cp: Improve -p flag tests. In addition to verifying that ACLs and flags are copied with the -p flag, verify that they are not copied without it. Sponsored by: Klara, Inc. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D50714 --- bin/cp/tests/cp_test.sh | 56 ++++++++++++++++++++++++++++--------------------- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/bin/cp/tests/cp_test.sh b/bin/cp/tests/cp_test.sh index 5e9a1899ff75..f06238c89367 100755 --- a/bin/cp/tests/cp_test.sh +++ b/bin/cp/tests/cp_test.sh @@ -188,18 +188,22 @@ pflag_acls_body() ! setfacl -m g:staff:d::allow dir/file ; then atf_skip "file system does not support ACLs" fi - atf_check cp -p dir/file dst - atf_check -o match:"group:staff:-+d-+" getfacl dst - rm dst - mkdir dst - atf_check cp -rp dir dst - atf_check -o not-match:"group:staff:-+D-+" getfacl dst - atf_check -o match:"group:staff:-+D-+" getfacl dst/dir - atf_check -o match:"group:staff:-+d-+" getfacl dst/dir/file - rm -rf dst - atf_check cp -rp dir dst - atf_check -o match:"group:staff:-+D-+" getfacl dst/ - atf_check -o match:"group:staff:-+d-+" getfacl dst/file + atf_check -o match:"group:staff:-+D-+" getfacl dir + atf_check -o match:"group:staff:-+d-+" getfacl dir/file + # file-to-file copy without -p + atf_check cp dir/file dst1 + atf_check -o not-match:"group:staff:-+d-+" getfacl dst1 + # file-to-file copy with -p + atf_check cp -p dir/file dst2 + atf_check -o match:"group:staff:-+d-+" getfacl dst2 + # recursive copy without -p + atf_check cp -r dir dst3 + atf_check -o not-match:"group:staff:-+D-+" getfacl dst3 + atf_check -o not-match:"group:staff:-+d-+" getfacl dst3/file + # recursive copy with -p + atf_check cp -rp dir dst4 + atf_check -o match:"group:staff:-+D-+" getfacl dst4 + atf_check -o match:"group:staff:-+d-+" getfacl dst4/file } atf_test_case pflag_flags @@ -211,18 +215,22 @@ pflag_flags_body() ! chflags nodump dir/file ; then atf_skip "file system does not support flags" fi - atf_check cp -p dir/file dst - atf_check -o match:"nodump" stat -f%Sf dst - rm dst - mkdir dst - atf_check cp -rp dir dst - atf_check -o not-match:"nodump" stat -f%Sf dst - atf_check -o match:"nodump" stat -f%Sf dst/dir - atf_check -o match:"nodump" stat -f%Sf dst/dir/file - rm -rf dst - atf_check cp -rp dir dst - atf_check -o match:"nodump" stat -f%Sf dst - atf_check -o match:"nodump" stat -f%Sf dst/file + atf_check -o match:"nodump" stat -f%Sf dir + atf_check -o match:"nodump" stat -f%Sf dir/file + # file-to-file copy without -p + atf_check cp dir/file dst1 + atf_check -o not-match:"nodump" stat -f%Sf dst1 + # file-to-file copy with -p + atf_check cp -p dir/file dst2 + atf_check -o match:"nodump" stat -f%Sf dst2 + # recursive copy without -p + atf_check cp -r dir dst3 + atf_check -o not-match:"nodump" stat -f%Sf dst3 + atf_check -o not-match:"nodump" stat -f%Sf dst3/file + # recursive copy with -p + atf_check cp -rp dir dst4 + atf_check -o match:"nodump" stat -f%Sf dst4 + atf_check -o match:"nodump" stat -f%Sf dst4/file } recursive_link_setup() From nobody Tue Jun 10 07:20:26 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGgDW1P1gz60GVd; Tue, 10 Jun 2025 07:20:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGgDV6xkBz3Npd; Tue, 10 Jun 2025 07:20:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749540027; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WuHfZzcIQ1p8YTkeajNL3lUSd+gKoR7G/0qhmBhWRTA=; b=a18RnkDPwAZ3imchqeZqlSz84IYuaWSZF2PoOKRW0rvtpLb3bicdI4yO5KzHQUwK8tGghi Dwv8Y55ydXswhIe//G4TpwZM6Zcu2OVDcb7UtHC/4v7d27mqOGJWbHRR4Gc9T+w+r1/wdd cpNsSEUekrkqwsxWXhzuR/39wwsigtTXrybvalWSNQ2RJGKzE6dSZwduAyJyUxOGFOkf2F cVnzJY8L9npG6OCtlfHpC0O4iyVhjsg1jfAYAZyrS3sbY4CVRQbKNhN6qGPIFP2PNoJypD /PKr8PZozkOl5iTcBJnbg7K1tLHpPZca75lCMz/8qi1RyN489Dyy/n9DiKaYCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749540027; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WuHfZzcIQ1p8YTkeajNL3lUSd+gKoR7G/0qhmBhWRTA=; b=Bw4OAg1W968IKGU2HxBNoLeR4Ss+My1kwg/dfHtxC7bMdlDMkCOkC6cou9O0RRO+1U7sN0 7XLDuG7SyU8ujM3CvWAu7/2WIQoRQKuYaEy89/nKncFZni8Vh9RexB30Yjjf8TjWbB2XVH 9sBzSPcQoxuT1CYT/O3rXIMZr/RIZxG5BKREI9JDo6r+JeC2RIfDjI/k/s9uB2qeLK6P5Z +ZgJpsvxdzZhlJ2AwPp/kHnRyW8zF+Q51nG5gTZkDGvcJnU0R3tiAXZ1FhNVpgL8nnj20f EdmQsK2T0Ue5wl1NH+T2sylKM7WeGgwgiY9oPn2iRdyNKZkGKBEolfDmtUpOkw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749540027; a=rsa-sha256; cv=none; b=OUY+SrmhfWZTHNMBFeMIWl1vhNgjxTYMJYe+05/QlGy/IzHA3HZYNaPoSYpDj/GpQlJeCm E5Te0d0/B3KPv9C+79Pf/LPLBHbk4i904DuVXpouMFDx8VYTLdM46Zu+Bx8BSZx1mN0glc jlszb8GdAExo1e9knm2GzP7ysP9STeWPu9Rt79CB98YBNLzr2rMoT/jvYc1relCbsaqiwc w1hmPVjA06ohED2kCm9fhm61i7BWc5Ta64zDx8RU1D2nk487MTry52qTXhNvRb/XeyT8gH C2aRqbb8Oa0WmmHlxB20B2mazn8ZqXXsIOWU9oYTNNrjlgTYflbXmy2kGKHZNA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGgDV6Y2PzX2L; Tue, 10 Jun 2025 07:20:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55A7KQNe045034; Tue, 10 Jun 2025 07:20:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55A7KQSG045031; Tue, 10 Jun 2025 07:20:26 GMT (envelope-from git) Date: Tue, 10 Jun 2025 07:20:26 GMT Message-Id: <202506100720.55A7KQSG045031@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 09545628f0cd - main - nuageinit: fix using user_data as a script List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 09545628f0cd58406a47f302fb8584a5292d4b1a Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=09545628f0cd58406a47f302fb8584a5292d4b1a commit 09545628f0cd58406a47f302fb8584a5292d4b1a Author: Baptiste Daroussin AuthorDate: 2025-06-10 07:09:47 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-10 07:20:23 +0000 nuageinit: fix using user_data as a script In official cloudinit, when a user_data file starts with '#!' it should be execute late in the boot process. To respect this nuageinit now copy the user_data script into a /var/cache/nuageinit/user_data if found and a new "firsboot" rcscript anchored to the 'local' rc script is responsible to execute it if found. Note by doing this, we fix another issue we had with nuageinit, if the cloudinit provider provides the user_data scriptout with the executable permission, previous implementation was not working, like apparently what Digital Ocean is doing. PR: 287183 Reported by: olgeni@ --- libexec/nuageinit/nuageinit | 15 ++++++++++----- libexec/nuageinit/tests/nuageinit.sh | 30 ++++++++++++++++++++++++++++-- libexec/rc/rc.d/Makefile | 3 ++- libexec/rc/rc.d/nuageinit_user_data_script | 25 +++++++++++++++++++++++++ 4 files changed, 65 insertions(+), 8 deletions(-) diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit index dda3ae482859..f2f15f0d36f0 100755 --- a/libexec/nuageinit/nuageinit +++ b/libexec/nuageinit/nuageinit @@ -396,9 +396,14 @@ if line == "#cloud-config" then if obj.package_upgrade then nuage.upgrade_packages() end -else - local res, err = os.execute(path .. "/" .. ud) - if not res then - nuage.err("error executing user-data script: " .. err) - end +elseif line:sub(1, 2) == "#!" then + -- delay for execution at rc.local time -- + f = io.open(path .. "/" .. ud) + local content = f:read("*a") + f:close() + nuage.mkdir_p(root .. "/var/cache/nuageinit") + f = assert(io.open(root .. "/var/cache/nuageinit/user_data", "w")) + f:write(content) + f:close() + sys_stat.chmod(root .. "/var/cache/nuageinit/user_data", 493) end diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index 5fc811f1dcb5..be8b186d933b 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -27,6 +27,7 @@ atf_test_case config2_userdata_runcmd atf_test_case config2_userdata_packages atf_test_case config2_userdata_update_packages atf_test_case config2_userdata_upgrade_packages +atf_test_case config2_userdata_shebang setup_test_adduser() { @@ -73,7 +74,8 @@ nocloud_userdata_script_body() printf "instance-id: iid-local01\n" > "${PWD}"/media/nuageinit/meta-data printf "#!/bin/sh\necho yeah\n" > "${PWD}"/media/nuageinit/user-data chmod 755 "${PWD}"/media/nuageinit/user-data - atf_check -s exit:0 -o inline:"yeah\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit nocloud + atf_check -s exit:0 /usr/libexec/nuageinit "${PWD}"/media/nuageinit nocloud + atf_check -o inline:"#!/bin/sh\necho yeah\n" cat var/cache/nuageinit/user_data } nocloud_user_data_script_body() @@ -82,7 +84,8 @@ nocloud_user_data_script_body() printf "instance-id: iid-local01\n" > "${PWD}"/media/nuageinit/meta-data printf "#!/bin/sh\necho yeah\n" > "${PWD}"/media/nuageinit/user_data chmod 755 "${PWD}"/media/nuageinit/user_data - atf_check -s exit:0 -o inline:"yeah\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit nocloud + atf_check -s exit:0 /usr/libexec/nuageinit "${PWD}"/media/nuageinit nocloud + atf_check -o inline:"#!/bin/sh\necho yeah\n" cat var/cache/nuageinit/user_data } nocloud_userdata_cloudconfig_users_head() @@ -810,6 +813,28 @@ EOF atf_check -o inline:"pkg upgrade -y\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 } +config2_userdata_shebang_body() +{ + mkdir -p media/nuageinit + setup_test_adduser + printf "{}" > media/nuageinit/meta_data.json + cat > media/nuageinit/user_data < media/nuageinit/user_data <&1 | tee -a /var/log/nuageinit.log +} + +# Share the same config as nuageinit +load_rc_config nuageinit +run_rc_command "$1" From nobody Tue Jun 10 09:11:18 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGjhg37SPz5tVRK; Tue, 10 Jun 2025 09:11:31 +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 4bGjhf6j2bz3GNy; Tue, 10 Jun 2025 09:11:30 +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 55A9BIu7024063; Tue, 10 Jun 2025 12:11:21 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 55A9BIu7024063 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 55A9BIQK024062; Tue, 10 Jun 2025 12:11:18 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 10 Jun 2025 12:11:18 +0300 From: Konstantin Belousov To: Gleb Smirnoff Cc: Rick Macklem , Dag-Erling =?utf-8?B?U23DuHJncmF2?= , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 79d0f4474653 - main - rpcbind: Ensure krpc is present. Message-ID: References: <202506091053.559ArJ8k043104@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Rspamd-Queue-Id: 4bGjhf6j2bz3GNy X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_RCPT(0.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] On Mon, Jun 09, 2025 at 08:02:02PM -0700, Gleb Smirnoff wrote: > On Tue, Jun 10, 2025 at 03:17:26AM +0300, Konstantin Belousov wrote: > K> > R> My vague recollection (I'll admit I cannot be bothered looking at the > K> > R> older code) > K> > R> is that rpcbind would accept queries on a AF_LOCAL (unix domain) socket for > K> > R> local RPC processes. > K> > R> > K> > R> glebius@ does not want RPCs to be done over AF_LOCAL sockets (he would > K> > R> have to explain why), so he created an RPC layer in the krpc for netlink as an > K> > R> alternative and converted all utilities that were doing RPCs over AF_LOCAL > K> > R> sockets to use it. > K> > > K> > Not exactly. I don't want kernel RPC to userland to use AF_LOCAL. A process to > K> > a process RPC of course continues to use AF_LOCAL. > K> > > K> > What would be better for rpcbind: to skip providing kernel RPC services if > K> > krpc(4) not detected at startup, or to autoload krpc? The latter makes it safe > K> > for a scenario when NFS is instantiated at a later runtime of a machine, when > K> > rpcbind already runs. The former scenario would require a restart of rpcbind. > K> > > K> > K> IMO rpcbind must not load any modules. It should communicate with krpc if > K> available. > K> > K> The krpc load is the global system policy decision, it should be handled > K> in rc scripts, as it is common for such decisions. The loading would be > K> enabled if some component requires krpc, which means if nfsd enabled. > K> It would be ordered before rpcbind startup, of course. > > My only concern is that it would require restart of rpcbind, if sysadmin > decides to configure NFS later after startup. Well, yes. Apparently we already have the feature called 'warmstart', where rpcbind can be restarted and existing registrations are reloaded. So it is in fact already solved, assuming admin is careful enough to use -w. From nobody Tue Jun 10 09:33:22 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGk9t3LC2z5tX9R; Tue, 10 Jun 2025 09:33:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGk9t2bS8z3NPP; Tue, 10 Jun 2025 09:33:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749548002; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EyB1F0QhmupGHaaobmIkYy/vqD0ID5glXnB6289mtHI=; b=g3IqGoEoxYkAT5ft96xQERkkq4qjOcf1YnK/8EmzRqj3JRBDAcVu5QinvvrmB9MEnKZllR YuhWjoKnw1geLHGvclgQb8XlZtyT22wrcKKC5EyGZegTnZgxl/zH59ppvbXSNEWtCW5nYy 1uHse061keX0dH19GwcWFgWdH+9Z8HzmSgD96865PfoJayXR9bsZbdB4XHHnTEQESBgiLD WkFiOFlf73Sv8NsySgEdISf02cRHvSiPg9DeicHAFhWdgMnb+DD9v1nvpy2uoxCUvk2sE1 uANlW5T+nPqRQjfUFv3Tq4rx4+FwVkbreMFbzafKBl2z5d7OajwqRQBPbMEv8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749548002; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EyB1F0QhmupGHaaobmIkYy/vqD0ID5glXnB6289mtHI=; b=Cg7OYwt5K1Tn1D5KoWlG4ffdRHdUgsFOVb+dGhdCPdAhHNmoT7x8skm9pJwtN/+eP5W+bB UMVQfPjzG045Ey5zqk5NYeLw3W+7C11SB1lTUC53eN1iNMU2mlUFgWHoX7ECtht62EoTcD Ed7p0Iqbqm3OwTQzPlAmQlr5I6ZwLzCxHvINRPByF1JeJa0lsS8CkyDrCsvUL2lY+WrKKm nXiVyDR93QVB5P5bYafEv2JMrrQ9Lr+ztnCFHbGy3y94aycBy7mfDWU8oYskznVdKL5zsE K0d3R58bkZ+vZwYsTjSdpErlXytaazgD4XX1QzbvJ9yn5ChlcLP44WjxxZBW/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749548002; a=rsa-sha256; cv=none; b=GEu8Dn7FjygCdQd4uvN2iGuJVv6+G/8O7ta9BFv1rw3v6jOFIel30JI42/m8I+O9PwQ6LD x6dHKV+neKO34xuOKOIS8taRnyc/iosTtj8gXoO8/eED83NW/GRcPHyA1/UuGbvEYZ98m3 RklHJSuyWEWUNbHA4vq7EmFvbksBJVIBsNxHfMiRyNKMWt2MeOu3Tqm7fd7Dl1e/15RNmC oB6UBDbiYBJT2yQojU+lG70Xj5MAatPVPSeUoZsRskVu+PKeDM5kmeW8E6KGDZ7uftrlyX 2K1ewVl5/cFVVAaKDFan1VVqcZXfr8UEHqRzIz/ZyDbo64rknXvc6+IlrR0XlA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGk9t1w3czbyB; Tue, 10 Jun 2025 09:33:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55A9XMjQ099024; Tue, 10 Jun 2025 09:33:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55A9XMaW099021; Tue, 10 Jun 2025 09:33:22 GMT (envelope-from git) Date: Tue, 10 Jun 2025 09:33:22 GMT Message-Id: <202506100933.55A9XMaW099021@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 8feca60d6ee9 - main - nuageinit: runcmd should also be executed late List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8feca60d6ee983ef3c81903675b4d9c3218c7e7a Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=8feca60d6ee983ef3c81903675b4d9c3218c7e7a commit 8feca60d6ee983ef3c81903675b4d9c3218c7e7a Author: Baptiste Daroussin AuthorDate: 2025-06-10 09:28:49 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-10 09:28:49 +0000 nuageinit: runcmd should also be executed late Execute the runcmd specified in cloudinit at the same moment as the user_data script aka late in the boot process, to respect cloudinit specifications --- libexec/nuageinit/nuageinit | 13 ++++++++++--- libexec/nuageinit/tests/nuageinit.sh | 12 +++++++----- libexec/rc/rc.d/nuageinit_user_data_script | 4 ++++ 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit index f2f15f0d36f0..cd5912c54975 100755 --- a/libexec/nuageinit/nuageinit +++ b/libexec/nuageinit/nuageinit @@ -379,11 +379,18 @@ if line == "#cloud-config" then nuage.chpasswd(obj.chpasswd) end if obj.runcmd then + f = nil for _, c in ipairs(obj.runcmd) do - if not os.execute(c) then - nuage.warn("Failed to execute '" .. c .. "'") - -- execute the next command anyway -- + if f == nil then + nuage.mkdir_p(root .. "/var/cache/nuageinit") + f = assert(io.open(root .. "/var/cache/nuageinit/runcmds", "w")) + f:write("#!/bin/sh\n") end + f:write(c .. "\n") + end + if f ~= nil then + f:close() + sys_stat.chmod(root .. "/var/cache/nuageinit/runcmds", 493) end end if obj.packages then diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index be8b186d933b..3d0033a648de 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -728,18 +728,20 @@ runcmd: - plop EOF chmod 755 "${PWD}"/media/nuageinit/user_data - atf_check -s exit:0 -e inline:"sh: plop: not found\nnuageinit: Failed to execute 'plop'\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 + atf_check -s exit:0 /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 + test -f var/cache/nuageinit/runcmds || atf_fail "File not created" + test -x var/cache/nuageinit/runcmds || atf_fail "Missing execution permission" + atf_check -o inline:"#!/bin/sh\nplop\n" cat var/cache/nuageinit/runcmds cat > media/nuageinit/user_data << 'EOF' #cloud-config runcmd: - - echo "yeah!" > "${PWD}"/media/nuageinit/runcmd_echo - - uname -s > "${PWD}"/media/nuageinit/runcmd_uname + - echo "yeah!" + - uname -s EOF chmod 755 "${PWD}"/media/nuageinit/user_data atf_check /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 - atf_check -s exit:0 -o inline:"yeah!\n" cat "${PWD}"/media/nuageinit/runcmd_echo - atf_check -s exit:0 -o inline:"FreeBSD\n" cat "${PWD}"/media/nuageinit/runcmd_uname + atf_check -o inline:"#!/bin/sh\necho \"yeah!\"\nuname -s\n" cat var/cache/nuageinit/runcmds } config2_userdata_packages_head() diff --git a/libexec/rc/rc.d/nuageinit_user_data_script b/libexec/rc/rc.d/nuageinit_user_data_script index 94d5d008a7fc..97ccc45f8658 100755 --- a/libexec/rc/rc.d/nuageinit_user_data_script +++ b/libexec/rc/rc.d/nuageinit_user_data_script @@ -15,6 +15,10 @@ rcvar="nuageinit_enable" execute_user_data_script() { + if [ -x /var/cache/nuageinit/runcmds ]; then + echo "Executing 'runcmd'" | tee -e /var/log/nuageinit.log + /var/cache/nuageinit/runcmds 2>&1 | tee -a /var/log/nuageinit.log + fi test -x /var/cache/nuageinit/user_data || return echo "Executing user_data script" | tee -a /var/log/nuageinnit.log /var/cache/nuageinit/user_data 2>&1 | tee -a /var/log/nuageinit.log From nobody Tue Jun 10 09:33:23 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGk9v45Yqz5tXHZ; Tue, 10 Jun 2025 09:33:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGk9v3PTdz3Nd0; Tue, 10 Jun 2025 09:33:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749548003; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ePn6a7bsU3ZE5xyOAEqaIPoDPza7jKcT5QcApvWNzq8=; b=LH89I1y/xPahm6XaMK+WCRMmEsHp+VUoSiNRXG7bJrsNy6rBXz8ug9AtBEsmxyhaAgDgt2 5QGcIzs3SDDEWvJfjZcG+De1079UmaB0SWRDLFyZqMYf4EKjVcDdDKsPty+sV/cCike9R9 cryObm1GqPxAML8r1Jw41k/Z4kd1+Obi479hni/f2yr6k2UqEL84hepN6zSJ4gMtUe4p26 fxB+ycWNaDAPljhyFjF6uk6Jb6udjdtkO8d0KLkdWY2rBvjbOplViZqcFbxa1uKgQoQ/kO zxoWGTETo+uxPQjB4EhSiHlDmi0f8+Jg98b0oa4FLFXEYlDF3OvXYxrftwci2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749548003; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ePn6a7bsU3ZE5xyOAEqaIPoDPza7jKcT5QcApvWNzq8=; b=IJmvb9F6ZQ0WDpX3w3Fo1/x9EPqkLN9wExPBy0mRW8tBbgEIXHByzm1D+DWbImi4cKQRX5 dYdwPCk+s2TCxAnXkZbnhkry0ZU/F3i/xUZof0c0/bgen9uK0lFzi6ZN8cUHIQsERpK2fa XQXQYu+O1jd/LkuMDq7gAoa/g9TcMQf6rb21kBeW6N2NnxRwvJrXZ/36ZWcPGVaq2EAgN2 jX3RZZN5f0zce9LGk7MruNuG3GCJ38wxLbq0tOZMqrAtzXSt8Qu7q+9WdVeJgqSp133BUh FeHs2QLDRaax9prHmlBX1YSI98fYd4CozuZK9WbKWPaPI1aDK3G3XWEzd87erA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749548003; a=rsa-sha256; cv=none; b=QmhkkWTXsorNBFYsYXOeazsLnGElj4rvTpQfYRnZWJCE7akzDD1xKzA7gzPFqvrej4K6HH YAbaL7ENlWQ552KnGtS32gallvCsrq4BtsTQIrdWDylMAN1zfYR1q8zrLXMhkYDyclR5ob zv3R/R6rhsKmEkpnhe+G4rK0zIs3oz8Xe08UOlzKVz1YaeSXgkeas2x3o3WZGlLQG1zw9o JCNtfDtdS5XLoSqeYRodm93xTzkl6nPKyL43TOtmuFz9RS0/PufFeptaIT+S5W3IKPhcDU jbVDiqzNjsZ1l6mquXdYDaGxnqLMlZSjojmEizOCruzvJBmGldgT35mC/t/DWw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGk9v2rvpzcFS; Tue, 10 Jun 2025 09:33:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55A9XNEA099062; Tue, 10 Jun 2025 09:33:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55A9XNaf099059; Tue, 10 Jun 2025 09:33:23 GMT (envelope-from git) Date: Tue, 10 Jun 2025 09:33:23 GMT Message-Id: <202506100933.55A9XNaf099059@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: f678c4759027 - main - nuageinit: pet luacheck List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f678c47590276aa8acdacdecfb78cc6c44bbf449 Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=f678c47590276aa8acdacdecfb78cc6c44bbf449 commit f678c47590276aa8acdacdecfb78cc6c44bbf449 Author: Baptiste Daroussin AuthorDate: 2025-06-10 09:32:06 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-10 09:32:06 +0000 nuageinit: pet luacheck Rename path into ni_path (ni stands for nuageinit) which is more understandable and avoid a shadowing warning because we also use a variable named path later. Add a missing local --- libexec/nuageinit/nuageinit | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit index cd5912c54975..c874f40b38a8 100755 --- a/libexec/nuageinit/nuageinit +++ b/libexec/nuageinit/nuageinit @@ -12,7 +12,7 @@ local sys_stat = require("posix.sys.stat") if #arg ~= 2 then nuage.err("Usage: " .. arg[0] .. " ( | )", false) end -local path = arg[1] +local ni_path = arg[1] local citype = arg[2] local default_user = { @@ -189,7 +189,7 @@ end if citype == "config-2" then local parser = ucl.parser() - local res, err = parser:parse_file(path .. "/meta_data.json") + local res, err = parser:parse_file(ni_path .. "/meta_data.json") if not res then nuage.err("error parsing config-2 meta_data.json: " .. err) @@ -204,9 +204,9 @@ if citype == "config-2" then nuage.sethostname(obj["hostname"]) -- network - config2_network(path) + config2_network(ni_path) elseif citype == "nocloud" then - local f, err = io.open(path .. "/meta-data") + local f, err = io.open(ni_path .. "/meta-data") if err then nuage.err("error parsing nocloud meta-data: " .. err) end @@ -229,9 +229,9 @@ end -- deal with user-data local ud = nil local f = nil -userdatas = {"user-data", "user_data"} +local userdatas = {"user-data", "user_data"} for _, v in pairs(userdatas) do - f = io.open(path .. "/" .. v, "r") + f = io.open(ni_path .. "/" .. v, "r") if f then ud = v break @@ -243,7 +243,7 @@ end local line = f:read("*l") f:close() if line == "#cloud-config" then - f = io.open(path .. "/" .. ud) + f = io.open(ni_path .. "/" .. ud) local obj = yaml.eval(f:read("*a")) f:close() if not obj then @@ -405,7 +405,7 @@ if line == "#cloud-config" then end elseif line:sub(1, 2) == "#!" then -- delay for execution at rc.local time -- - f = io.open(path .. "/" .. ud) + f = io.open(ni_path .. "/" .. ud) local content = f:read("*a") f:close() nuage.mkdir_p(root .. "/var/cache/nuageinit") From nobody Tue Jun 10 13:34:24 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGqX10dh7z5xcrQ; Tue, 10 Jun 2025 13:34:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGqX06tVfz4PxV; Tue, 10 Jun 2025 13:34:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749562465; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2iMgLxuAa61Zsp/QD9RbK757RsJhpsKoDZfs/q9afBE=; b=tzCQDqcoAqjVq8YrTphVqaq2mbJzLwIL45nYzAx/+oZyFcfMwmdu7JPte//1RJE4/NDh7T ggERSTZJ/Sot9z+r2f3bE2tIJ7K5gVi4wu54SFQUYP35Y/ifrYlQEtiAmf/49Y9EtrH/aV +Rv78Fz/qaJr3Hm9trjx5VaWX6ctnRVTnS094f6EA6lvE4onLwZQ6JqKabJR5hSMP5mYw2 ff0SFbygl7n2BLd00Df7vhurdvNoHEvn6rX2CPbGorYQOKh3Ge2JGr0R7Vc+cZ4BtDv5+c oW9zvjJMUvHEwbQLl0grBjTcroAjbxyXJS0gvY5hB4Cwwm/wav0qDQzCVGZ43Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749562465; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2iMgLxuAa61Zsp/QD9RbK757RsJhpsKoDZfs/q9afBE=; b=tZCBzww5zKQgdcCT8cP3IaKo4dZbYMrb9oCDd5rYngcfxwRMvh3ruRuJTAqV8mOHMvL2VF qF0RXzV0BnxixMSin4l8pNNriC2iwq4RtmT1urO6aY9pUerm6CBAIXlwRsq1zkT/mkfME/ xcsoAbezN4qCj5Wh02AFN3CfEtP2KHfJq6NwTBjBeBmcZ5AQNGA2aNAnjR4NXQgbe7hk3c 0pWSQZsQ7x9vkmmyaof7iwKZZSUIFjj/VjI1yI+AA7nrvLpP/m27sS+o7wfP4PIK4Dc3Nq weDwMcRSitE+Ns/c8gIQJfytmvgEMrcUoTT80XriRolfk+iWqHjitl5i01fUtA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749562465; a=rsa-sha256; cv=none; b=iuZDshOpkDzNIs9YEbuMHv2q5mmML/pxU7ykJVMpkc/3otiEd/SdfjELlIg9vdHC9leC+U kRLp78YfZpi1463oaJuSaPhJAXhemPAsYRcWIvKUdmoBLybjqLpp7HE75Wv2yjH4c4N8iB zNttbMrC2E6wTwglq9UL0CtIxDG7qIPiagU2Hn7WSL8MEJReAl4wU4mJXmcZq3y+A0MLRI l1T/zADpm8F4NNNrb/WTX+hBeevh+dzHGXtWSrQ0vITmE3kjh5PmsrMY8EuxpH30kA16uw ytIV0Yqvfc2YNIYeeFwjTZXg5slDdGu4GQxq77lcGFWOVwvrMEwP7VMEWoeQnA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGqX06TpyzkGY; Tue, 10 Jun 2025 13:34:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55ADYOi5050937; Tue, 10 Jun 2025 13:34:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55ADYOqn050934; Tue, 10 Jun 2025 13:34:24 GMT (envelope-from git) Date: Tue, 10 Jun 2025 13:34:24 GMT Message-Id: <202506101334.55ADYOqn050934@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: a62c6b0de48a - main - ddb: add optional printing of BBLog entries List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a62c6b0de48a5b9b752976b2675ac807684b7fdb Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=a62c6b0de48a5b9b752976b2675ac807684b7fdb commit a62c6b0de48a5b9b752976b2675ac807684b7fdb Author: Michael Tuexen AuthorDate: 2025-06-10 13:29:26 +0000 Commit: Michael Tuexen CommitDate: 2025-06-10 13:29:26 +0000 ddb: add optional printing of BBLog entries Add a /b option to show tcpcb and show all tcpcbs to print BBLog entries. Right now this supports the entries generated by the FreeBSD default TCP stack. It should help in debugging issues reported by syzkaller. The syntax for printing sent and received packets is similar to the one used by packetdrill, since the output of ddb will be used to create packetdrill scripts for debugging. Reviewed by: thj Tested by: thj MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D50629 --- share/man/man4/ddb.4 | 12 +- sys/netinet/tcp_log_buf.c | 381 ++++++++++++++++++++++++++++++++++++++++++++++ sys/netinet/tcp_log_buf.h | 4 + sys/netinet/tcp_usrreq.c | 15 +- 4 files changed, 405 insertions(+), 7 deletions(-) diff --git a/share/man/man4/ddb.4 b/share/man/man4/ddb.4 index 9a9af553b29d..3c4894c03d62 100644 --- a/share/man/man4/ddb.4 +++ b/share/man/man4/ddb.4 @@ -24,7 +24,7 @@ .\" any improvements or extensions that they make and grant Carnegie Mellon .\" the rights to redistribute these changes. .\" -.Dd May 28, 2025 +.Dd June 10, 2025 .Dt DDB 4 .Os .Sh NAME @@ -604,9 +604,12 @@ The modifier will print command line arguments for each process. .\" .Pp -.It Ic show Cm all tcpcbs Ns Op Li / Ns Cm l +.It Ic show Cm all tcpcbs Ns Op Li / Ns Cm b Ns Cm l Show the same output as "show tcpcb" does, but for all TCP control blocks within the system. +The +.Cm b +modifier will request BBLog entries to be printed. Using the .Cm l modifier will limit the output to TCP control blocks, which are locked. @@ -1103,7 +1106,7 @@ on i386.) Not present on some platforms. .\" .Pp -.It Ic show Cm tcpcb Ar addr +.It Ic show Cm tcpcb Ns Oo Li / Ns Cm b Oc Ar addr Print TCP control block .Vt struct tcpcb lying at address @@ -1111,6 +1114,9 @@ lying at address For exact interpretation of output, visit .Pa netinet/tcp.h header file. +The +.Cm b +modifier will request BBLog entries to be printed. .\" .Pp .It Ic show Cm thread Op Ar addr | tid diff --git a/sys/netinet/tcp_log_buf.c b/sys/netinet/tcp_log_buf.c index f540c7d3e70e..3c62d3b07f99 100644 --- a/sys/netinet/tcp_log_buf.c +++ b/sys/netinet/tcp_log_buf.c @@ -29,6 +29,7 @@ #include #include "opt_inet.h" +#include "opt_ddb.h" #include #include #include @@ -43,11 +44,18 @@ #include #include #include +#ifdef DDB +#include +#endif #include #include /* Must come after qmath.h and tree.h */ #include #include +#ifdef DDB +#include +#endif + #include #include #include @@ -2972,3 +2980,376 @@ skip_closed_req: done: INP_WUNLOCK(inp); } + +#ifdef DDB +static void +db_print_indent(int indent) +{ + int i; + + for (i = 0; i < indent; i++) + db_printf(" "); +} + +static void +db_print_tcphdr(struct tcp_log_buffer *tlm_buf) +{ + struct sackblk sack; + struct tcphdr *th; + int cnt, i, j, opt, optlen, num_sacks; + uint32_t val, ecr; + uint16_t mss; + uint16_t flags; + + if ((tlm_buf->tlb_eventflags & TLB_FLAG_HDR) == 0) { + return; + } + th = &tlm_buf->tlb_th; + flags = tcp_get_flags(th); + if (flags & TH_FIN) { + db_printf("F"); + } + if (flags & TH_SYN) { + db_printf("S"); + } + if (flags & TH_RST) { + db_printf("R"); + } + if (flags & TH_PUSH) { + db_printf("P"); + } + if (flags & TH_ACK) { + db_printf("."); + } + if (flags & TH_URG) { + db_printf("U"); + } + if (flags & TH_ECE) { + db_printf("E"); + } + if (flags & TH_FIN) { + db_printf("F"); + } + if (flags & TH_CWR) { + db_printf("W"); + } + if (flags & TH_FIN) { + db_printf("F"); + } + if (flags & TH_AE) { + db_printf("A"); + } + db_printf(" %u:%u(%u)", ntohl(th->th_seq), + ntohl(th->th_seq) + tlm_buf->tlb_len, tlm_buf->tlb_len); + if (flags & TH_ACK) { + db_printf(" ack %u", ntohl(th->th_ack)); + } + db_printf(" win %u", ntohs(th->th_win)); + if (flags & TH_URG) { + db_printf(" urg %u", ntohs(th->th_urp)); + } + cnt = (th->th_off << 2) - sizeof(struct tcphdr); + if (cnt > 0) { + db_printf(" <"); + for (i = 0; i < cnt; i += optlen) { + opt = tlm_buf->tlb_opts[i]; + if (opt == TCPOPT_EOL || opt == TCPOPT_NOP) { + optlen = 1; + } else { + if (cnt - i < 2) { + break; + } + optlen = tlm_buf->tlb_opts[i + 1]; + if (optlen < 2 || optlen > cnt - i) { + break; + } + } + if (i > 0) { + db_printf(","); + } + switch (opt) { + case TCPOPT_EOL: + db_printf("eol"); + break; + case TCPOPT_NOP: + db_printf("nop"); + break; + case TCPOPT_MAXSEG: + if (optlen != TCPOLEN_MAXSEG) { + break; + } + bcopy(tlm_buf->tlb_opts + i + 2, &mss, + sizeof(uint16_t)); + db_printf("mss %u", ntohs(mss)); + break; + case TCPOPT_WINDOW: + if (optlen != TCPOLEN_WINDOW) { + break; + } + db_printf("wscale %u", + tlm_buf->tlb_opts[i + 2]); + break; + case TCPOPT_SACK_PERMITTED: + if (optlen != TCPOLEN_SACK_PERMITTED) { + break; + } + db_printf("sackOK"); + break; + case TCPOPT_SACK: + if (optlen == TCPOLEN_SACKHDR || + (optlen - 2) % TCPOLEN_SACK != 0) { + break; + } + num_sacks = (optlen - 2) / TCPOLEN_SACK; + db_printf("sack"); + for (j = 0; j < num_sacks; j++) { + bcopy(tlm_buf->tlb_opts + i + 2 + + j * TCPOLEN_SACK, &sack, + TCPOLEN_SACK); + db_printf(" %u:%u", ntohl(sack.start), + ntohl(sack.end)); + } + break; + case TCPOPT_TIMESTAMP: + if (optlen != TCPOLEN_TIMESTAMP) { + break; + } + bcopy(tlm_buf->tlb_opts + i + 2, &val, + sizeof(uint32_t)); + bcopy(tlm_buf->tlb_opts + i + 6, &ecr, + sizeof(uint32_t)); + db_printf("TS val %u ecr %u", ntohl(val), + ntohl(ecr)); + break; + case TCPOPT_SIGNATURE: + db_printf("md5"); + if (optlen > 2) { + db_printf(" "); + } + for (j = 0; j < optlen - 2; j++) { + db_printf("%02x", + tlm_buf->tlb_opts[i + 2 + j]); + } + break; + case TCPOPT_FAST_OPEN: + db_printf("FO"); + if (optlen > 2) { + db_printf(" "); + } + for (j = 0; j < optlen - 2; j++) { + db_printf("%02x", + tlm_buf->tlb_opts[i + 2 + j]); + } + break; + default: + db_printf("opt=%u len=%u", opt, optlen); + break; + } + } + db_printf(">"); + } +} +static void +db_print_pru(struct tcp_log_buffer *tlm_buf) +{ + switch (tlm_buf->tlb_flex1) { + case PRU_ATTACH: + db_printf("ATTACH"); + break; + case PRU_DETACH: + db_printf("DETACH"); + break; + case PRU_BIND: + db_printf("BIND"); + break; + case PRU_LISTEN: + db_printf("LISTEN"); + break; + case PRU_CONNECT: + db_printf("CONNECT"); + break; + case PRU_ACCEPT: + db_printf("ACCEPT"); + break; + case PRU_DISCONNECT: + db_printf("DISCONNECT"); + break; + case PRU_SHUTDOWN: + db_printf("SHUTDOWN"); + break; + case PRU_RCVD: + db_printf("RCVD"); + break; + case PRU_SEND: + db_printf("SEND"); + break; + case PRU_ABORT: + db_printf("ABORT"); + break; + case PRU_CONTROL: + db_printf("CONTROL"); + break; + case PRU_SENSE: + db_printf("SENSE"); + break; + case PRU_RCVOOB: + db_printf("RCVOOB"); + break; + case PRU_SENDOOB: + db_printf("SENDOOB"); + break; + case PRU_SOCKADDR: + db_printf("SOCKADDR"); + break; + case PRU_PEERADDR: + db_printf("PEERADDR"); + break; + case PRU_CONNECT2: + db_printf("CONNECT2"); + break; + case PRU_FASTTIMO: + db_printf("FASTTIMO"); + break; + case PRU_SLOWTIMO: + db_printf("SLOWTIMO"); + break; + case PRU_PROTORCV: + db_printf("PROTORCV"); + break; + case PRU_PROTOSEND: + db_printf("PROTOSEND"); + break; + case PRU_SEND_EOF: + db_printf("SEND_EOF"); + break; + case PRU_SOSETLABEL: + db_printf("SOSETLABEL"); + break; + case PRU_CLOSE: + db_printf("CLOSE"); + break; + case PRU_FLUSH: + db_printf("FLUSH"); + break; + default: + db_printf("Unknown PRU (%u)", tlm_buf->tlb_flex1); + break; + } + if (tlm_buf->tlb_errno >= 0) { + db_printf(", error: %d", tlm_buf->tlb_errno); + } +} + +static void +db_print_rto(struct tcp_log_buffer *tlm_buf) +{ + tt_what what; + tt_which which; + + what = (tlm_buf->tlb_flex1 & 0xffffff00) >> 8; + which = tlm_buf->tlb_flex1 & 0x000000ff; + switch (what) { + case TT_PROCESSING: + db_printf("Processing "); + break; + case TT_PROCESSED: + db_printf("Processed "); + break; + case TT_STARTING: + db_printf("Starting "); + break; + case TT_STOPPING: + db_printf("Stopping "); + break; + default: + db_printf("Unknown operation (%u) for ", what); + break; + } + switch (which) { + case TT_REXMT: + db_printf("Retransmission "); + break; + case TT_PERSIST: + db_printf("Persist "); + break; + case TT_KEEP: + db_printf("Keepalive "); + break; + case TT_2MSL: + db_printf("2 MSL "); + break; + case TT_DELACK: + db_printf("Delayed ACK "); + break; + default: + db_printf("Unknown (%u) ", which); + break; + } + db_printf("timer"); + if (what == TT_STARTING) { + db_printf(": %u ms", tlm_buf->tlb_flex2); + } +} + +static void +db_print_usersend(struct tcp_log_buffer *tlm_buf) +{ + if ((tlm_buf->tlb_eventflags & TLB_FLAG_RXBUF) == 0) { + return; + } + if ((tlm_buf->tlb_eventflags & TLB_FLAG_TXBUF) == 0) { + return; + } + db_printf("usersend: rcv.acc: %u rcv.ccc: %u snd.acc: %u snd.ccc: %u", + tlm_buf->tlb_rxbuf.tls_sb_acc, tlm_buf->tlb_rxbuf.tls_sb_ccc, + tlm_buf->tlb_txbuf.tls_sb_acc, tlm_buf->tlb_txbuf.tls_sb_ccc); +} + +void +db_print_bblog_entries(struct tcp_log_stailq *log_entries, int indent) +{ + struct tcp_log_mem *log_entry; + struct tcp_log_buffer *tlm_buf, *prev_tlm_buf; + int64_t delta_t; + + indent += 2; + prev_tlm_buf = NULL; + STAILQ_FOREACH(log_entry, log_entries, tlm_queue) { + db_print_indent(indent); + tlm_buf = &log_entry->tlm_buf; + if (prev_tlm_buf == NULL) { + db_printf(" 0.000 "); + } else { + delta_t = sbttoms(tvtosbt(tlm_buf->tlb_tv) - + tvtosbt(prev_tlm_buf->tlb_tv)); + db_printf("+%u.%03u ", (uint32_t)(delta_t / 1000), + (uint32_t)(delta_t % 1000)); + } + switch (tlm_buf->tlb_eventid) { + case TCP_LOG_IN: + db_printf("< "); + db_print_tcphdr(tlm_buf); + break; + case TCP_LOG_OUT: + db_printf("> "); + db_print_tcphdr(tlm_buf); + break; + case TCP_LOG_RTO: + db_print_rto(tlm_buf); + break; + case TCP_LOG_PRU: + db_print_pru(tlm_buf); + break; + case TCP_LOG_USERSEND: + db_print_usersend(tlm_buf); + break; + default: + break; + } + db_printf("\n"); + prev_tlm_buf = tlm_buf; + if (db_pager_quit) + break; + } +} +#endif diff --git a/sys/netinet/tcp_log_buf.h b/sys/netinet/tcp_log_buf.h index 06b2998b19ed..eb33a9c15ebb 100644 --- a/sys/netinet/tcp_log_buf.h +++ b/sys/netinet/tcp_log_buf.h @@ -585,5 +585,9 @@ tcp_log_event(struct tcpcb *tp, struct tcphdr *th, struct sockbuf *rxbuf, } #endif /* TCP_BLACKBOX */ +#ifdef DDB +void db_print_bblog_entries(struct tcp_log_stailq *log_entries, int indent); +#endif + #endif /* _KERNEL */ #endif /* __tcp_log_buf_h__ */ diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index a7a1d98fd193..1eee45e3c2ac 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -3083,7 +3083,7 @@ db_print_bblog_state(int state) } static void -db_print_tcpcb(struct tcpcb *tp, const char *name, int indent) +db_print_tcpcb(struct tcpcb *tp, const char *name, int indent, bool show_bblog) { db_print_indent(indent); @@ -3208,35 +3208,42 @@ db_print_tcpcb(struct tcpcb *tp, const char *name, int indent) db_print_indent(indent); db_printf("t_lognum: %d t_loglimit: %d t_logsn: %u\n", tp->t_lognum, tp->t_loglimit, tp->t_logsn); + + if (show_bblog) { + db_print_bblog_entries(&tp->t_logs, indent); + } } DB_SHOW_COMMAND(tcpcb, db_show_tcpcb) { struct tcpcb *tp; + bool show_bblog; if (!have_addr) { db_printf("usage: show tcpcb \n"); return; } + show_bblog = strchr(modif, 'b') != NULL; tp = (struct tcpcb *)addr; - db_print_tcpcb(tp, "tcpcb", 0); + db_print_tcpcb(tp, "tcpcb", 0, show_bblog); } DB_SHOW_ALL_COMMAND(tcpcbs, db_show_all_tcpcbs) { VNET_ITERATOR_DECL(vnet_iter); struct inpcb *inp; - bool only_locked; + bool only_locked, show_bblog; only_locked = strchr(modif, 'l') != NULL; + show_bblog = strchr(modif, 'b') != NULL; VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); CK_LIST_FOREACH(inp, &V_tcbinfo.ipi_listhead, inp_list) { if (only_locked && inp->inp_lock.rw_lock == RW_UNLOCKED) continue; - db_print_tcpcb(intotcpcb(inp), "tcpcb", 0); + db_print_tcpcb(intotcpcb(inp), "tcpcb", 0, show_bblog); if (db_pager_quit) break; } From nobody Tue Jun 10 14:10:07 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGrKD3BLhz5xgg8; Tue, 10 Jun 2025 14:10:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGrKD2ZBfz3Kbj; Tue, 10 Jun 2025 14:10:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749564608; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z7wNna6NYP2bcZ/3qXZXxdJaaiw8eP6yfwNZ+XmIGFw=; b=M59AqxlsDim+kBolwiHw2JlU7taMoY0XMJIuP5DlLbc8oFyXzlX2WTTYs2rg8jGEnpbsXy Us8xn4hTr5CladmXF1WTZ6j/nrJ8Z1IK7Cmd3llyiZ8ZOFLjazwHkHnjVWU6XFO/ljgwzC 2hPsG831ac7cVEG/DHbfNpOl62132d6y+HPk9RtwxJJ822k24D4U5N4q9eiQB/8fXqT+xM 8SBudqw+ZW8XhXVIGCYV3Tz3ONrGGsjiiUNtA8YIi85XXLFTXRElfojrMfc5/1U0SG7qo9 RFqKdHPVB9ET7HId2CIHkDQbuMJdfdol/KH0veVQm/CW1mUTGXIR3Vq2QUrrQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749564608; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z7wNna6NYP2bcZ/3qXZXxdJaaiw8eP6yfwNZ+XmIGFw=; b=vEp2Zg38uI82b8cBq9LWoHy8nq6Tr6o/Euu9LlAFrrvDa4LQJdBWNsPrNG+pmQGkbL8iwU nkPw2hnuPoCbOKj4ktl7Z05Qo/PY8vs8lokrTc//8l0Qwv2hSGuhmbiMWI7qmkxBwZcIfr w8tXC6HPWF1HocitgUuLd70D7jZIo9RjPZemaNAPWMPkABIx91FpFzQntxq3mNBB+0WGR2 zz+VQ22g7UNHbj2bBJpQRLd9mO+tAM+pqcYuZfVUhsiIDpdGkQw6NSxF3XKAgUiqMDiohS tk555MsPb4ReW84KSVDXAepfQXx9zWzK5GvsBpKY1Hh/e+C8BrrFQTfuheKlvg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749564608; a=rsa-sha256; cv=none; b=Sr9e4t/Ki30FeIsqk/Mq/Cnhj1RtW6J2o6wVbzqBb00NnQC2ywsMxvVFXAZ/gVvT0PYPiI 3dlvmSFraKfa6bPEMsedP7ySv9Avi0V9RhMPWKoBQ6VZbCmNxQqJ3GgajIx446XosAFblL L1oLPjhUDYiyb+yzxKRo4VRpWBYnpQEoZt9FKkRhz9gOmeV9bK/nP3lyohXzHIwd+fmvEq IIhnK5VoIXz9Rl1IxysosVogWFZ1xpXeFfXWfkM4eBSaMeDcShYAJPH6Zk6tukdLHQ9d1V NzVF6JohP8DoREJeyEGXnqVmDrdCQUs9kL3b5qr/d8htYkO2zauZNpYTujqMng== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGrKD1ZLQzlPj; Tue, 10 Jun 2025 14:10:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55AEA7l0014437; Tue, 10 Jun 2025 14:10:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55AEA7K5014434; Tue, 10 Jun 2025 14:10:07 GMT (envelope-from git) Date: Tue, 10 Jun 2025 14:10:07 GMT Message-Id: <202506101410.55AEA7K5014434@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 20c636620c69 - main - libclang_rt: Descend into libclang_rt to clean List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 20c636620c6955795f97619d22c7eca9f8599ad7 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=20c636620c6955795f97619d22c7eca9f8599ad7 commit 20c636620c6955795f97619d22c7eca9f8599ad7 Author: Mark Johnston AuthorDate: 2025-06-10 14:09:12 +0000 Commit: Mark Johnston CommitDate: 2025-06-10 14:09:12 +0000 libclang_rt: Descend into libclang_rt to clean Otherwise, during a clean buildworld we don't descend into libclang_rt to remove object files. Reviewed by: brooks, dim, emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D50766 --- lib/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Makefile b/lib/Makefile index 1924df391072..82d461fe0873 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -180,7 +180,8 @@ SUBDIR.${MK_LDNS}+= libldns SUBDIR.${MK_STATS}+= libstats # The libraries under libclang_rt can only be built by clang. -.if ${COMPILER_TYPE} == "clang" && ${MK_CLANG} != "no" +.if (${COMPILER_TYPE} == "clang" || make(clean) || make(cleandir)) && \ + ${MK_CLANG} != "no" _libclang_rt= libclang_rt .elif (${MK_ASAN} != "no" || ${MK_UBSAN} != "no") && make(all) .error Requested build with sanitizers but cannot build runtime libraries! From nobody Tue Jun 10 15:41:44 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGtM036jPz5xpsR; Tue, 10 Jun 2025 15:41:48 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGtM00Jkrz3XLC; Tue, 10 Jun 2025 15:41:48 +0000 (UTC) (envelope-from glebius@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749570108; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=BdZ9MvxAmUusn9E2zgw15xvmMJPgRsnAChKoykQYt74=; b=fTb5t1dDA9Xx0ss5qOgy+/+U+epfaOi7F9nxQ7Yo0UOQDIyieXCFTs08pHeH4Mlv8Kn8fM 9L1iMYDhNTJBppmWQWDBOEOwuq72DjrOPZ6NPWqERsXcisnzaTbs9bhffugUA0octrtf7E S3uDvOLzOeuC8iVZfinuO7Z7Uck+0a/xT/Jqle4BDNW/akTjVSHqDANBcrqiQeKNgwB3he 6w+6Pn8kuEBADFq8LJO7tAQjeqlRgENT5uE3ZsUEggG/yUZ7mWVIfY9TbQQKUwEi/hNbiP QkJOT581Llm8rb465Prdr5JCNMGBe3q+4gBDBSFLM6qilohVRUa9tQtp/ZeYkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749570108; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=BdZ9MvxAmUusn9E2zgw15xvmMJPgRsnAChKoykQYt74=; b=r6wouVWJlhkCaYKCYhRO6cyXkfDxfmzPEEMIiTYFXPGmUSyvETsZtMHeLfUGWMTkyj3aHF s2Kd94qbs17gHsK4v0alwtA7JX3bMJ5uLAr6eQHb+QCoDZCbwTk7XiPY62+phsXjl0/jmW lsz9aa2wxf7eL0njSEMStzvlSIoB9vlVsmbX1nNOUada3pS7yLj8QB1WjNtiQEirImjD4a mYqKFM6OSfHSUCGtntTS0WkbVdclWtDTnCWQyfZu/evenbLLWBKjuyey/tgzbld1y5JxQf gYlYx59cAsS3+wQQtSxaIK9+8FKQHTqBkYGxtFYX+0X/AcG6sC7usIN3/P4HCg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749570108; a=rsa-sha256; cv=none; b=gIouEQQ7UCFgf2fLDoDHtjKn607UWcJ3kw9KUj70GqRXHoGIZi9A4ZEBURhc4gJfzAgjTq O40I7uaI4ggcA3iqN8DzLrmqi9k21c13zDcZwTa4BvBhNxoIqnBCMBdltDIu7rgxZ0jkRH CSb2uWdlyepMREeB9DunGvJ3vk89kN6p7LcAJ/OqaENnLdSaYn/Qn0SodOKHnWYFVeFs7c UgCuCRI+EMjLuj3YAzt41SA3YQl76/ncAoIkYRqnaTXkiiZWdsALSd8JgRgMUh8nMRu3mp 4iZRZOf6KOrOPsoIgz9KerKe6h/OGbKlRhPAjecxXXP3l4nI5Yf3SC48xH0ueA== Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: glebius) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bGtLz1fDGzH28; Tue, 10 Jun 2025 15:41:47 +0000 (UTC) (envelope-from glebius@freebsd.org) Date: Tue, 10 Jun 2025 08:41:44 -0700 From: Gleb Smirnoff To: Konstantin Belousov Cc: Rick Macklem , Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 79d0f4474653 - main - rpcbind: Ensure krpc is present. Message-ID: References: <202506091053.559ArJ8k043104@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Tue, Jun 10, 2025 at 12:11:18PM +0300, Konstantin Belousov wrote: K> Apparently we already have the feature called 'warmstart', where rpcbind K> can be restarted and existing registrations are reloaded. So it is in K> fact already solved, assuming admin is careful enough to use -w. Ok, then all that needs to be done is revert this: --- a/usr.sbin/rpcbind/rpcbind.c +++ b/usr.sbin/rpcbind/rpcbind.c @@ -159,10 +159,6 @@ main(int argc, char *argv[]) update_bound_sa(); - /* Ensure krpc is loaded */ - if (modfind("krpc") < 0 && kldload("krpc") < 0) - err(1, "krpc"); - /* Check that another rpcbind isn't already running. */ if ((rpcbindlockfd = open(RPCBINDDLOCK, O_RDONLY|O_CREAT, 0444)) < 0) err(1, "%s", RPCBINDDLOCK); Without these lines, rpcbind will log: Jun 10 08:34:23 bobrik rpcbind[885]: netlink: could not create service And continue with /var/run/rpcbind.sock set up and ready to service requests from applications. We can add an extra message for verbosity: @@ -223,7 +219,10 @@ main(int argc, char *argv[]) } endnetconfig(nc_handle); - init_transport(&netlink_nconf); + if (init_transport(&netlink_nconf) != 0) { + syslog(LOG_ERR, "krpc(4) module missing? " + "Continuing without netlink/krpc transport"); + } /* * Allocate pipe fd to wake main thread from signal handler in non-racy I really don't have a strong opinion on what would be right here. I have no idea on how wide is the use of rpcbind w/o NFS. Kostik, Rick and Dag-Erling, may you together come to agreement on what is right here? -- Gleb Smirnoff From nobody Tue Jun 10 15:57:11 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGtj74TFtz5xr3V; Tue, 10 Jun 2025 15:57:31 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGtj72Tz3z3bmd; Tue, 10 Jun 2025 15:57:31 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-604f5691bceso11443776a12.0; Tue, 10 Jun 2025 08:57:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1749571044; x=1750175844; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=DPvtk71TNBrQ3yfgqFyDaXRHAsffmwNJ8ev8Bv/LnIs=; b=R1VfQItyWzW4L0+b7+qSSKOsQLmJgQFjs1xwOyJEpV92yENo86txA/0MEjRZMkJjwW RIMe08oc5z+yOC31hcT7Kzf4qFChJoujkIC83ylhi+85f7GbNn/8y2QYAzYwuwIA+pqF N6MSFRiZ/TRb0dsetRENQgQh4hsQ9VqluoUPGDr5FOwNa3PRp+0o8B+0kbLEY0aQrJbl DkI0tyRh7gPnoQeimJD2FVFKnO5SxSRHaOWNYs3yuhHfDUDhEh/52lIn+fNWroS6hYH5 2eMIQQ6Kdl7L4QbuWQHXH8YgGoH2j/fp9uLh3lthdC73EzxtOFE1Y6Q3pNBF6Lj5ZJsF qJxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749571044; x=1750175844; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DPvtk71TNBrQ3yfgqFyDaXRHAsffmwNJ8ev8Bv/LnIs=; b=QR65Kegc13rOPCs3MKZRWzFcQB8/XRas0IuRGZS2Z3NdpL1SDDB77ovUXhCYURcRX7 mHQScawgC2/oVQWZG3qj66rTxNU8Jeggo6EkSon5M7D/2ZDhUV4dITvkjW4iNrgvlzXT +PKM7cfvyiErkCGxE0n9VDczLuIqw+pRt7YvIVWuSFsZKAvQ24edofAO5rNAe7v4EvJm k6XVtJXGzEhHH32w2ZQqagxl18Xi3uCqbYR0V7QPiKfkzVZfgAijfdfKRaCPqcS3m0tp K1fAZgogfnS2GfnH8D+r7C23If5VM0yQetwU7acKLZ48kxMkKMapAEZf/7drSlhxEIJu HkKA== X-Forwarded-Encrypted: i=1; AJvYcCUe+apnpMjj3kFVz91A0zuVXQXpymOr09BUS+s67ddFR9ImIpPf2tZb+21ydV/D6zKcKWJ7M7hWXaPptRh7nlg=@freebsd.org, AJvYcCWbXqCgPUQkB5CkL3Nav/MOJRIyP10L3HePxFs9VVnhPq0fkwgLTK+5+Ivf29O4VMdVdluCCRwVMEek1sI5wXc8wAv9sA==@freebsd.org, AJvYcCXO/6eYzC3kHvG+zkDsBW+8lo0911XF9K7ba6IiKZlSwSOPlcr0VMeO/w4Hz7K0ICOSq9g=@freebsd.org, AJvYcCXfxc26ZMde5KKshpnmVqfeaqwbtNMXDgqK0AxnlJ4Y4HvrG8YEhmcrdNsGWw90C4mtCux+nWMOEAN4puocmKTsHatiaR0=@freebsd.org X-Gm-Message-State: AOJu0YxNdXjwCBOAT0lj3MePjl81REVQYg4M6QtOLXn7hQjS5BNNHe0M vkgGRxYtqhqPcjSbwhFrhdPjh22A5JJEu/QKZlwegCcSORtya8J53GF3FcUUyua8FNpIC4mdYpT f6INhcLmcvsPWgqY9Y2mJcckzC4BD/ZBYsDq/uw== X-Gm-Gg: ASbGncvZrO3WfzrELoGHKn5rYu8RYOWqdUn3epRb3OYt1SYnAeUVF9VclTsPRdAOUES nCE5VA/nNXasInuyMIXi3qNgWC5rr3We+zjddBvg3c7kLdRzgWrKM8tA8QM6mtHLFqPxsQ+5bw0 ytWf57U1xTCKgtHTeKihixVygw8Or+jlOHg1lAGVHq15y/+19Bz4ImMoxuFFSS/msqe2f4JhImd Uc= X-Google-Smtp-Source: AGHT+IGSd2mDCmQId9W8+Q6yFC/x4WQu3ts6ikNfWzKB6G8i+bw02kYCdAC/d6mgDDEVgk1w196sf0pjWwPmPTxpDtE= X-Received: by 2002:a17:907:2d22:b0:ade:2e4b:50db with SMTP id a640c23a62f3a-ade7abfbdcfmr285238366b.10.1749571044156; Tue, 10 Jun 2025 08:57:24 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202506091053.559ArJ8k043104@gitrepo.freebsd.org> In-Reply-To: From: Rick Macklem Date: Tue, 10 Jun 2025 08:57:11 -0700 X-Gm-Features: AX0GCFvGk4UTjVPDEmr0Kxg739PuLuS4wF5NDqVvXWIW5fT7b4kEok3CkYlGip0 Message-ID: Subject: Re: git: 79d0f4474653 - main - rpcbind: Ensure krpc is present. To: Gleb Smirnoff Cc: Konstantin Belousov , =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4bGtj72Tz3z3bmd X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; TAGGED_FROM(0.00)[] On Tue, Jun 10, 2025 at 8:41=E2=80=AFAM Gleb Smirnoff = wrote: > > CAUTION: This email originated from outside of the University of Guelph. = Do not click links or open attachments unless you recognize the sender and = know the content is safe. If in doubt, forward suspicious emails to IThelp@= uoguelph.ca. > > On Tue, Jun 10, 2025 at 12:11:18PM +0300, Konstantin Belousov wrote: > K> Apparently we already have the feature called 'warmstart', where rpcbi= nd > K> can be restarted and existing registrations are reloaded. So it is in > K> fact already solved, assuming admin is careful enough to use -w. > > Ok, then all that needs to be done is revert this: > > --- a/usr.sbin/rpcbind/rpcbind.c > +++ b/usr.sbin/rpcbind/rpcbind.c > @@ -159,10 +159,6 @@ main(int argc, char *argv[]) > > update_bound_sa(); > > - /* Ensure krpc is loaded */ > - if (modfind("krpc") < 0 && kldload("krpc") < 0) > - err(1, "krpc"); > - > /* Check that another rpcbind isn't already running. */ > if ((rpcbindlockfd =3D open(RPCBINDDLOCK, O_RDONLY|O_CREAT, 0444)= ) < 0) > err(1, "%s", RPCBINDDLOCK); > > Without these lines, rpcbind will log: > > Jun 10 08:34:23 bobrik rpcbind[885]: netlink: could not create service > > And continue with /var/run/rpcbind.sock set up and ready to service > requests from applications. > > We can add an extra message for verbosity: > > @@ -223,7 +219,10 @@ main(int argc, char *argv[]) > } > endnetconfig(nc_handle); > > - init_transport(&netlink_nconf); > + if (init_transport(&netlink_nconf) !=3D 0) { > + syslog(LOG_ERR, "krpc(4) module missing? " > + "Continuing without netlink/krpc transport"); > + } > > /* > * Allocate pipe fd to wake main thread from signal handler in no= n-racy > > I really don't have a strong opinion on what would be right here. I have= no > idea on how wide is the use of rpcbind w/o NFS. Kostik, Rick and Dag-Erl= ing, > may you together come to agreement on what is right here? I don't have a strong opinion on it either, since most kernel configs include NFS options, so the krpc is there anyhow. rick > > -- > Gleb Smirnoff From nobody Tue Jun 10 16:36:28 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGvZ50kZfz5xvBP; Tue, 10 Jun 2025 16:36:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGvZ500mYz3jxZ; Tue, 10 Jun 2025 16:36:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749573389; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kUvydJL4t6h2xr9OlE6qRw2R945C7xYFfnlJxBJHwe0=; b=RzKUoHo6E6j3KiZv7g0jA8Aec7kRXELGGoVHX6sHC/ybFZxzSyuJHuIl9FzjFj3GwqVpUn v9KDILsvmyiR5Zi8G+sr3qC9X8amQgs3f2pGCXfcBfo1Z4jhVHCPWKblQ8ceu3H3RnB0LT 25M5eqsNXtDZZWe0m1hS+0mnFIAyWsQQ/YX0jNF3em2LF9YuNuDBMygxQPMDrRLiTQT0Ou MPf66Ip6ZL+LwW5MH0nm078ln4oktU1yCgnRURb2hPuT9THKNcXEY7AYSkwxC7HKPRZmSH m4QjOygJSPoZQo+a8/CW/ZfnxJUt29qOQFlfZf+J/fjpW9xwgyIyuu8V0aP3Kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749573389; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kUvydJL4t6h2xr9OlE6qRw2R945C7xYFfnlJxBJHwe0=; b=s+lpYYAPGj/fkeyF89hw8IJO5ndJP2XMRhbfqH19WA1QJ3K2vQvum16xZlCPycavrDkUuR 3317SPUNEXBl+Fdmgy4466XteZ5G/18hAcGTIXs09Ishc/S0nJpH4z69xg8+dOQCfOek36 6BVFILpuy0CT/NhGelswgswpFuLHpGiLY5UIFMYtJOUiYywgVzgq4gpCncUBlQU5VkQyYD MIVN2E/t8qGwo2XFOFrMOnw8/z/KAezH6lw87mHPRle/Aasf8v0zSLu+GtqyRP6KTcMH6z wEFVckQIvAAzly3nCPSn1NF9rXD2WGekBj/Yjv8yYzmauZMJFe+C+8GllHClrQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749573389; a=rsa-sha256; cv=none; b=fV9aMoBZAoMyuqW/x4UL0HuK2XzPw2pgUFzYVh6cVlC8LIfwy1/0lF32yTKPOV+gcCyiO5 i8PB5/S4+k07hnIKSiHKvcAMN5Wabgbt2Hqzhp+6T1+Tm1WdE6MVYeozqhjqcFRRAVvgpS ptjsnhsQL4e2fYaDoLUs5DywKt0uUghCMxlJSBsTz9IMsgboBkJ43nvEFWpVZRzWSn9HyG zfwUa3rEWWZHQFLeV8wyziqPv/wHGtPwZjnDXeskYDtZMn83KU6GojRQHfzShokVwRXIox YXUdSRF7tQtPBBIjNGYo3jxDFMwh9ssBewZE0fQNqU7U80inr+j9lfejZq0ZfQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGvZ46V1szpZH; Tue, 10 Jun 2025 16:36:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55AGaSLx090666; Tue, 10 Jun 2025 16:36:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55AGaSLp090663; Tue, 10 Jun 2025 16:36:28 GMT (envelope-from git) Date: Tue, 10 Jun 2025 16:36:28 GMT Message-Id: <202506101636.55AGaSLp090663@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 0dc78204a7dc - main - ddb: fix handling of BBLog entries when BBLog is disabled List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0dc78204a7dcbc51bfab4c701e1335084548bc05 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=0dc78204a7dcbc51bfab4c701e1335084548bc05 commit 0dc78204a7dcbc51bfab4c701e1335084548bc05 Author: Michael Tuexen AuthorDate: 2025-06-10 16:32:39 +0000 Commit: Michael Tuexen CommitDate: 2025-06-10 16:32:39 +0000 ddb: fix handling of BBLog entries when BBLog is disabled Fixes: a62c6b0de48a ("ddb: add optional printing of BBLog entries") MFC after: 1 week Sponsored by: Netflix, Inc. --- sys/netinet/tcp_log_buf.h | 7 +++---- sys/netinet/tcp_usrreq.c | 5 +++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/sys/netinet/tcp_log_buf.h b/sys/netinet/tcp_log_buf.h index eb33a9c15ebb..fef32e16b2e4 100644 --- a/sys/netinet/tcp_log_buf.h +++ b/sys/netinet/tcp_log_buf.h @@ -570,6 +570,9 @@ void tcp_log_flowend(struct tcpcb *tp); void tcp_log_sendfile(struct socket *so, off_t offset, size_t nbytes, int flags); int tcp_log_apply_ratio(struct tcpcb *tp, int ratio); +#ifdef DDB +void db_print_bblog_entries(struct tcp_log_stailq *log_entries, int indent); +#endif #else /* !TCP_BLACKBOX */ #define tcp_log_verbose (false) @@ -585,9 +588,5 @@ tcp_log_event(struct tcpcb *tp, struct tcphdr *th, struct sockbuf *rxbuf, } #endif /* TCP_BLACKBOX */ -#ifdef DDB -void db_print_bblog_entries(struct tcp_log_stailq *log_entries, int indent); -#endif - #endif /* _KERNEL */ #endif /* __tcp_log_buf_h__ */ diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 1eee45e3c2ac..cd273803dacf 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -3210,7 +3210,12 @@ db_print_tcpcb(struct tcpcb *tp, const char *name, int indent, bool show_bblog) tp->t_lognum, tp->t_loglimit, tp->t_logsn); if (show_bblog) { +#ifdef TCP_BLACKBOX db_print_bblog_entries(&tp->t_logs, indent); +#else + db_print_indent(indent); + db_printf("BBLog not supported\n"); +#endif } } From nobody Tue Jun 10 17:28:15 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGwjs0gc5z5y05g; Tue, 10 Jun 2025 17:28:17 +0000 (UTC) (envelope-from des@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGwjs04wCz3stQ; Tue, 10 Jun 2025 17:28:17 +0000 (UTC) (envelope-from des@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749576497; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iPr0q29gs533lCwSAuMK6OSTUJxq9PvlMgmK+4FdXOg=; b=mwH+2Xn5TNZaQ5rOoE0C5RpDgsASavTodb1qavlFq0uR5F8AW9eixdCdyp5RswCfLYlHSS j3SvgfWLDBwKu/n5B1ef7uYm3GjGBE9ElhzkbWHgOAV2kmv9CvLqjK2fTxTsQpxXL9FApb 27Klh3fP3v85IolVSYSdFLjXCxfbMAkb8+vOUz84zq0lKnZW7esEjHi/SDyqudp0p8Ikh/ icqC+ux5aJEHUjhhJmE4RWNe5+Du9HRvX96f+o6wBjAr6bkqDn+K2KMT1gBtEYdmb+MSSl 9rJFuxxwgFfEm09QxnrPxspUajb+IPf1RS0dovxuJtI0wqPwdQv6iYOZuot1jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749576497; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iPr0q29gs533lCwSAuMK6OSTUJxq9PvlMgmK+4FdXOg=; b=JrU1NF1B5UQM6qQ1PGSecbe3kBpLv8hA9ajoH2/4qUNrm1FmbsXXk3dzcYSMGb+5SOdjhW dMdRXOIo9Hdk6uvBQIbH6U16SQwRA8Hf789LCpjzwzIZpO+Y0k6cq6uec9rpSMB26SBfo0 xx/ifF4EoZM52Qtac4CzjPmllc14da3rKB1IJbqBR/pvz1YcLssixoCS3cxvxg+6KAV3vN cJXw694k3TklMOD4UNW2mXbqHh8FZwBTptGOBmX9coW0qSoxVYwEcjwdW4LAEXbeiIpJH9 haj9fEVuRB1PIIdR0vYkOaiPnDh9eXyH1ZIJP+M46iT73wbMWwCi1t5G+KimwA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749576497; a=rsa-sha256; cv=none; b=SU2PqJsSgsfeP9VO4yJ6+eBp6WkqcEIFc6CS/iywa0ikuw3Kf7OypqbBoMA4HgZ7yCZbQ5 aVawXq5mBwoEisKQGKZzOkwxMOsxya5fRJTTMaLMK/lmW3T6GDbsSo8kK1I2o/bYGa/Mw/ 666JxPq3rii5D9f9mwGKjb9TLZPdrE4Rtv4oRHoqmnuaOHzfqRw3/pukayK1O4yGxZqxzn FQjyz4Hp6x2Yk++pTsHB69ewwDkaNj6l+eiSgAiRrwYJ8ZRdFVsTgvE4pC4eVIHR6ZXZ+y +uFAikErmGrJNHZgCHUaeGV4MW+it9eeKtOtF15OV3S/RZY9TZC74UPskrLnRQ== Received: from ltc.des.dev (unknown [IPv6:2a01:e0a:c54:bed0:922e:16ff:fef1:acef]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: des) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bGwjr5rsVzKd1; Tue, 10 Jun 2025 17:28:16 +0000 (UTC) (envelope-from des@freebsd.org) Received: by ltc.des.dev (Postfix, from userid 1001) id 1602253C0A; Tue, 10 Jun 2025 19:28:15 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Rick Macklem Cc: Gleb Smirnoff , Konstantin Belousov , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 79d0f4474653 - main - rpcbind: Ensure krpc is present. In-Reply-To: (Rick Macklem's message of "Tue, 10 Jun 2025 08:57:11 -0700") References: <202506091053.559ArJ8k043104@gitrepo.freebsd.org> User-Agent: Gnus/5.13 (Gnus v5.13) Date: Tue, 10 Jun 2025 19:28:15 +0200 Message-ID: <865xh3jykw.fsf@ltc.des.dev> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Rick Macklem writes: > Gleb Smirnoff writes: > > Konstantin Belousov writes: > > > Apparently we already have the feature called 'warmstart', where rpcb= ind > > > can be restarted and existing registrations are reloaded. So it is in > > > fact already solved, assuming admin is careful enough to use -w. > > I really don't have a strong opinion on what would be right here. I ha= ve no > > idea on how wide is the use of rpcbind w/o NFS. Kostik, Rick and Dag-E= rling, > > may you together come to agreement on what is right here? > I don't have a strong opinion on it either, since most kernel configs > include NFS options, so the krpc is there anyhow. It is not in fact =E2=80=9Calready solved=E2=80=9D, and I'm frankly disgust= ed at the amount of energy being spent on bikeshedding this after the fact compared with the complete lack of interest in the problem prior to my commit. Not everybody runs GENERIC. Practically nobody uses NIS. Something needs to ensure that krpc is loaded when rpcbind starts in nearly 100% of rpcbind use cases. My original choice was a small change to the rc script, but Rick insisted on doing it directly in rpcbind instead, although he now conveniently washes his hands of it. Konstantin, I don't care how you solve this, but I need NFS to work, and I don't ever want to see =E2=80=9Cnetlink: could not create service=E2=80= =9D on my console again. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@FreeBSD.org From nobody Tue Jun 10 18:35:48 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGyCr3GLdz5y5F7; Tue, 10 Jun 2025 18:35:52 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGyCr2Q2rz3cgp; Tue, 10 Jun 2025 18:35:52 +0000 (UTC) (envelope-from kp@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749580552; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fjm+Ju5X9GyV4p3MEzPbuyEqRSc4WKPgIj7KAH444cY=; b=U1xyW2RGJMH1ZUiZ7tL7yjNvdQihLWrhrBDnVLCLpuQQ3oQOi4UlK75P4UNOKUBykv/wIS 34EwU6B4smOi5Yq6PH9md7zCLx60r7KosQvELnHCpFrC0Rs7wEJtIaAMnEvFcLqLpmr8VX iCs19/5qbz8wYEYfYKRBlyXjv8wljqSMvnODk32jj6EZgvEaOnDJE2R7fyH0Jsf9rFN34+ ncgtGQfvsvKxs4IKnjB8i3iQnacY0bXt1rh+Y+KsfjLpuc3ekTIc1scO8NAMrpPspD/Ips hNUgSjiEGEuxuEDSoSbjZnfA2Cbl0OZsjRaN3F3649qFezLraUJUO2CBGVfrMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749580552; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fjm+Ju5X9GyV4p3MEzPbuyEqRSc4WKPgIj7KAH444cY=; b=hHLhPAbVv/VQtQ6P+qPjASa9QTc/KdYhK6jLXWyTQoyOrl1lATPik7n5sh6JsKzWe90UI0 QyImDJFATFVZmfkTFUtediVGoX8J6FHpc1IrMIZxQjjvKTthy8quxYm3B2pvPI1IKCik5s vJqaLokzjceQ0PPqifh4Df2sWuQ8LwdDjBKCjbOK605LCfkONrPf8ofJFw9/BZDES7cHgn UxzcRdPLrUtLKZJqP0sROLCAznZGWBXOJRgdlATAuNrq7Jd6dfFr4Uf6cuzyAem0rkVZ3u UvJeEMQwRZ4oBJKixpFsJFmCWiw1Jon/H9M4vPt4/eqGMWFZxIVlxBT27zbshw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749580552; a=rsa-sha256; cv=none; b=rdFzgLeBpHfkjUccCWAgdGuTdxWXzWS84FbBk0n4Tt3QmO5SsGZySG/oUgroUCNpyHBcZ7 LxZoMpqpeLjsColGNFU5WKdEzHt54HxjRrzqrLmDN3ynlRUZax3F+xAV10ksAZTXFyh0RK aK4/EpzIDOOnV4F/HDNeq2IILgQs4S065CYFKTnM+4mt2Wg+aElVRJMOkWM7AnK3V0d8po bZSwWH42V9c9FBo44OzkqKSQCO/7NBpcq/meD34KTuw3DNAr6wtADa6zeNFR5ca0Cngf5d DoqrEWypGEPg+gDnyjiiNP4hQdeXjKOqgl1/mpy9jnSz+3tJVy3w8aJYfPRp4Q== Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx1.codepro.be", Issuer "R10" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bGyCr14gbzLwZ; Tue, 10 Jun 2025 18:35:52 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id B1F599DA5; Tue, 10 Jun 2025 20:35:49 +0200 (CEST) From: Kristof Provost To: Gleb Smirnoff Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 948078b65c27 - main - pf: fix !VIMAGE build Date: Tue, 10 Jun 2025 14:35:48 -0400 X-Mailer: MailMate (2.0r6255) Message-ID: <6347B11C-FEEE-41C3-8A88-B79BE06C1CE0@FreeBSD.org> In-Reply-To: <202506100319.55A3JJr1086016@gitrepo.freebsd.org> References: <202506100319.55A3JJr1086016@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_MailMate_ADE4FA85-C5E6-4EC9-8EAC-47829DBF6563_=" --=_MailMate_ADE4FA85-C5E6-4EC9-8EAC-47829DBF6563_= Content-Type: text/plain; charset=UTF-8; format=flowed; markup=markdown Content-Transfer-Encoding: quoted-printable On 9 Jun 2025, at 23:19, Gleb Smirnoff wrote: > The branch main has been updated by glebius: > > URL: = > https://cgit.FreeBSD.org/src/commit/?id=3D948078b65c275acfa55afe56a9bbd= eb2f61f1e2a > > commit 948078b65c275acfa55afe56a9bbdeb2f61f1e2a > Author: Gleb Smirnoff > AuthorDate: 2025-06-10 03:19:04 +0000 > Commit: Gleb Smirnoff > CommitDate: 2025-06-10 03:19:04 +0000 > > pf: fix !VIMAGE build Thanks for the fix. I was sure I=E2=80=99d done a make universe, but given the NOINET6 breaka= ge I = must be misremembering. Still, that wouldn=E2=80=99t have caught this one. It looks like we don=E2= =80=99t = have a single kernel config without VIMAGE left, and that makes it a bit = harder to detect this sort of breakage. I know that at least Netflix do care about that configuration, so I = think we should have a LINT-NOVIMAGE to make it at least a bit more = likely that we=E2=80=99ll detect such breakage before commits: = https://reviews.freebsd.org/D50780 =E2=80=94 Kristof --=_MailMate_ADE4FA85-C5E6-4EC9-8EAC-47829DBF6563_= Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On 9 Jun 2025, at 23:19, Gleb Smirnoff wrote:

The branch main has been updated by glebius:

URL: https://cgit.FreeBSD.org/src/co= mmit/?id=3D948078b65c275acfa55afe56a9bbdeb2f61f1e2a

commit 948078b65c275acfa55afe56a9bbdeb2f61f1e2a
Author: Gleb Smirnoff glebius@= FreeBSD.org
AuthorDate: 2025-06-10 03:19:04 +0000
Commit: Gleb Smirnoff glebius@= FreeBSD.org
CommitDate: 2025-06-10 03:19:04 +0000

pf=
: fix !VIMAGE build

Thanks for the fix.
I was sure I=E2=80=99d done a make universe, but given the NOINET6 breaka= ge I must be misremembering.

Still, that wouldn=E2=80=99t have caught this one. It loo= ks like we don=E2=80=99t have a single kernel config without VIMAGE left,= and that makes it a bit harder to detect this sort of breakage.
I know that at least Netflix do care about that configuration, so I think= we should have a LINT-NOVIMAGE to make it at least a bit more likely tha= t we=E2=80=99ll detect such breakage before commits: https://reviews.freebsd.org/D50780

=E2=80=94
Kristof

--=_MailMate_ADE4FA85-C5E6-4EC9-8EAC-47829DBF6563_=-- From nobody Tue Jun 10 19:52:36 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGzwP1YQMz5yBN9; Tue, 10 Jun 2025 19:52:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGzwN57C3z3XYH; Tue, 10 Jun 2025 19:52:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749585156; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qRsZDh+1c7MmGY0jQ1J2KVyoD/zhf+0aKdM73184dcE=; b=wnAUtsxrMBEFsFnWFULLmab6+YkrZnvgcN/0J2a5JahnBzPAHCbAnlrJJxIG5pa9vAaJ8/ kIVndpH1eQIQPrJ6UPUX3EkB32UQa+5vE901gLNQnrYNP62c1Wu5Ynj2hFOkZC8ntygZ+e WaumRIagolrFPSfjAXUwMBezsmmqs3wTpFgIM9tJPif26/cOzQ2GO7IkmBStlInhIqsoDN nz8S7RfeNdq7F1RuKr6p3OoV4s/RKEiHdPLvnRJSMrN4Ol4QzptdWkWIGblor9U57ixMva RXJmqks0T85F7uX/GW/jeX1AzcPvE1Z+poYoO/2AOMJc5ujt9aWAPvXKa1wY2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749585156; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qRsZDh+1c7MmGY0jQ1J2KVyoD/zhf+0aKdM73184dcE=; b=jzAxWbHjNuB1p0qC8sfPDaqFRx7ffbZjiwc/I4KA9waw4ehAGhimwUVGZEyYXbML/GxYWF xHEMTMLPGo46SLz3pXAGSP4LOWpf5kfUgf7rkWUiDw+G9gddkw6f/LGcuqxexi7HtT4L+T OZeeX+cKzGuXQ8Hoz8lMyKHWaDpD96JtQWzVSR8NlEgmYVpwDGBWWH5fxZ2CXE6qJ/IL/l QTtAKj58YUQBQhe5YLTVqF6fBQXSH9Alp9W10OyQ7zLhREL0at1TMSDbLpliXmXZyJ0Dmk NcdCR8dkayC3933TZ9+WephW0jefudb8/34bRchdaoh5L7UFE50Nqvp9GBjn4w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749585156; a=rsa-sha256; cv=none; b=OyXZxSi7LPLn8h2kqB8eNQizcQWP5fzQc8bVCLnVsVq7LUd/7ffZGv75nkMrBQdMQrup9W Lzm0G+ILHJTQrIm3IUY8WDMylxJ9HZoBHAMJxQTa8LIac/kNxS31mxm01gIBDnlGPyJiMZ EuwbQ7yAK3k75KVsuyI6LGZJMIFLm4p1aSvL+kW04QmUTtTEcyTGCPo0eJm9PA4aQUpb4y mFrVaQ5XTL7h0qbuJitCymffASV/+/VoeGj47TTYeOqvalUExuyoEQjMPQCPIuTZxNUfvG F9sIRhNjIGZccPghspzYgm/0Uxxg5cJXlXR+XV+A7TwxKwhMgabL2otXEOKMQw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGzwN4fFdzw2Y; Tue, 10 Jun 2025 19:52:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55AJqaMa062943; Tue, 10 Jun 2025 19:52:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55AJqaAO062940; Tue, 10 Jun 2025 19:52:36 GMT (envelope-from git) Date: Tue, 10 Jun 2025 19:52:36 GMT Message-Id: <202506101952.55AJqaAO062940@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 79005ea537d2 - main - sys: add LINT-NOVIMAGE List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 79005ea537d2f6972caee9f7f4f3455e4887dad2 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=79005ea537d2f6972caee9f7f4f3455e4887dad2 commit 79005ea537d2f6972caee9f7f4f3455e4887dad2 Author: Kristof Provost AuthorDate: 2025-06-10 18:32:09 +0000 Commit: Kristof Provost CommitDate: 2025-06-10 19:52:01 +0000 sys: add LINT-NOVIMAGE Ensure we have at least one kernel config that disables VIMAGE. Make it a little easier for us to catch errors that break this configuration. Reviewed by: glebius Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D50780 --- sys/amd64/conf/LINT-NOVIMAGE | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/amd64/conf/LINT-NOVIMAGE b/sys/amd64/conf/LINT-NOVIMAGE new file mode 100644 index 000000000000..e58df1214fe2 --- /dev/null +++ b/sys/amd64/conf/LINT-NOVIMAGE @@ -0,0 +1,4 @@ + +include LINT +ident LINT-NOVIMAGE +nooptions VIMAGE From nobody Wed Jun 11 04:04:36 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHBrC3YTCz5ycWT; Wed, 11 Jun 2025 04:04:43 +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 4bHBrC1PNWz3tmV; Wed, 11 Jun 2025 04:04:43 +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 55B44aHx051179; Wed, 11 Jun 2025 07:04:39 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 55B44aHx051179 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 55B44aDF051178; Wed, 11 Jun 2025 07:04:36 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 11 Jun 2025 07:04:36 +0300 From: Konstantin Belousov To: Dag-Erling =?utf-8?B?U23DuHJncmF2?= Cc: Rick Macklem , Gleb Smirnoff , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 79d0f4474653 - main - rpcbind: Ensure krpc is present. Message-ID: References: <865xh3jykw.fsf@ltc.des.dev> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <865xh3jykw.fsf@ltc.des.dev> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Rspamd-Queue-Id: 4bHBrC1PNWz3tmV X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_RCPT(0.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] On Tue, Jun 10, 2025 at 07:28:15PM +0200, Dag-Erling Smørgrav wrote: > Rick Macklem writes: > > Gleb Smirnoff writes: > > > Konstantin Belousov writes: > > > > Apparently we already have the feature called 'warmstart', where rpcbind > > > > can be restarted and existing registrations are reloaded. So it is in > > > > fact already solved, assuming admin is careful enough to use -w. > > > I really don't have a strong opinion on what would be right here. I have no > > > idea on how wide is the use of rpcbind w/o NFS. Kostik, Rick and Dag-Erling, > > > may you together come to agreement on what is right here? > > I don't have a strong opinion on it either, since most kernel configs > > include NFS options, so the krpc is there anyhow. > > It is not in fact “already solved”, and I'm frankly disgusted at the > amount of energy being spent on bikeshedding this after the fact > compared with the complete lack of interest in the problem prior to my > commit. > > Not everybody runs GENERIC. Right. > Practically nobody uses NIS. Wrong. > Something > needs to ensure that krpc is loaded when rpcbind starts in nearly 100% > of rpcbind use cases. My original choice was a small change to the rc > script, but Rick insisted on doing it directly in rpcbind instead, > although he now conveniently washes his hands of it. > > Konstantin, I don't care how you solve this, but I need NFS to work, and > I don't ever want to see “netlink: could not create service” on my > console again. And I do not want to get a host that cannot be logged in because rpcbind exited with an error that krpc cannot be loaded, thus making NIS nss unoperational. This happens somewhere not on my local machines, I would indeed not use NIS at home. Changing all fleet there because the proper fix is considered bikeshed is not feasible. From nobody Wed Jun 11 04:05:45 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHBsZ1mDxz5ycWb; Wed, 11 Jun 2025 04:05:54 +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 4bHBsY45Thz3vgl; Wed, 11 Jun 2025 04:05:53 +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 55B45juf051288; Wed, 11 Jun 2025 07:05:48 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 55B45juf051288 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 55B45jpv051286; Wed, 11 Jun 2025 07:05:45 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 11 Jun 2025 07:05:45 +0300 From: Konstantin Belousov To: Gleb Smirnoff Cc: Rick Macklem , Dag-Erling =?utf-8?B?U23DuHJncmF2?= , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 79d0f4474653 - main - rpcbind: Ensure krpc is present. Message-ID: References: <202506091053.559ArJ8k043104@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Rspamd-Queue-Id: 4bHBsY45Thz3vgl X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_RCPT(0.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] On Tue, Jun 10, 2025 at 08:41:44AM -0700, Gleb Smirnoff wrote: > On Tue, Jun 10, 2025 at 12:11:18PM +0300, Konstantin Belousov wrote: > K> Apparently we already have the feature called 'warmstart', where rpcbind > K> can be restarted and existing registrations are reloaded. So it is in > K> fact already solved, assuming admin is careful enough to use -w. > > Ok, then all that needs to be done is revert this: > > --- a/usr.sbin/rpcbind/rpcbind.c > +++ b/usr.sbin/rpcbind/rpcbind.c > @@ -159,10 +159,6 @@ main(int argc, char *argv[]) > > update_bound_sa(); > > - /* Ensure krpc is loaded */ > - if (modfind("krpc") < 0 && kldload("krpc") < 0) > - err(1, "krpc"); > - > /* Check that another rpcbind isn't already running. */ > if ((rpcbindlockfd = open(RPCBINDDLOCK, O_RDONLY|O_CREAT, 0444)) < 0) > err(1, "%s", RPCBINDDLOCK); > > Without these lines, rpcbind will log: > > Jun 10 08:34:23 bobrik rpcbind[885]: netlink: could not create service Well, absolutely minimal fix would be to change err() to warn(). > > And continue with /var/run/rpcbind.sock set up and ready to service > requests from applications. > > We can add an extra message for verbosity: > > @@ -223,7 +219,10 @@ main(int argc, char *argv[]) > } > endnetconfig(nc_handle); > > - init_transport(&netlink_nconf); > + if (init_transport(&netlink_nconf) != 0) { > + syslog(LOG_ERR, "krpc(4) module missing? " > + "Continuing without netlink/krpc transport"); > + } > > /* > * Allocate pipe fd to wake main thread from signal handler in non-racy > > I really don't have a strong opinion on what would be right here. I have no > idea on how wide is the use of rpcbind w/o NFS. Kostik, Rick and Dag-Erling, > may you together come to agreement on what is right here? > > -- > Gleb Smirnoff From nobody Wed Jun 11 07:28:37 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHHMT54xqz5yrnt; Wed, 11 Jun 2025 07:28:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHHMT4Rzxz42NT; Wed, 11 Jun 2025 07:28:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749626917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b1WeRYfGamUDVD3jXr866lYrx17bh8vuE1DHaGHS74Q=; b=QNGhwgybhhCyZnseyV48Bziz/E7qmmaM//+MPl+jEgTJQ7/sgzCkWZ5EFeV1HbV9+liaYm EGfcOiBjyUDvOrjwpfWq4i6MsrkKv89FUn0q4a8mdk2ZCbCFp7hIZbU7hJc1mQBfYYmkbS iaWmHcZmopLIbQ2WIodc+RV3L6OK66qbJTiJyJI0DfJoGcTkC7zaXW7DtUPp/TOBeS2eIs ZqmmXGiwXztkN5yJS2M1T1hCuvGx+he0GlTUnIEqzCg9vyqnGJhIJGiMIY1FjaigCa2g6G X70knuZ3xmvCF+eLrwXsQpuwzJI/pJ0Cb51+AeP7itbK14vKXl1o7rHTdFeiyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749626917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b1WeRYfGamUDVD3jXr866lYrx17bh8vuE1DHaGHS74Q=; b=nrNTtWe1HAMP1rLZ7uIOyBwmWdZ3ygCY4zAl569gJGUxrJnk84vSFP3Z51OrdAUS8Bg4Kf HoU21l1eRzS65sSZzkL1QndPQaRA3dfu8d5+80e+QulMGJMDcWmpY625gt60DIlDGF9G/b ZhnZEacz179WaVErFTywb8i+q67Iey4XnueW0TN5leRRVmeyLi4I3+TPiJ/lHGqh4OFMx2 HOhttCDmrhzK/gr3Rk+DVnU+cQinyDSKwgycFqaW8HjI+4tjgq0MDtXKHr+33wztIk8onY AAAUXeg0YaZz9TxCI9dzikSso/jcHIjOk6MOhHYezeQGI7Rr7nLkPwV2psgGSQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749626917; a=rsa-sha256; cv=none; b=Y6oP0aafoDM03HZJ1b2PslJR1AzBmtK7pg867wNGisoAC7GlqczsAFaCeHsQYG/2Gmdvxn +PUAjSV5gN+aOaH3XyMPdQPiC8Qt10RTl7wTayJYt6qIXGNCnCYf1DWNAX7NsbKk/cps5o J9h7VI5bwJndcYcDleCq/txB0syimdFN1HxWfpLe3evSVhvFo/11c4XunM+KoMRc9uCiMg 8ICwZgeCa+WyBD5T1Nns5FB5aes50xpwpvrAUj3EDVoHWXswcb88sj3ApKR0kG4djksX7p /tlnjVyAkWEgW18p4KZJINlV7ahH9lkk15yrR3hI10sTzN/dw0Bp9blE6SD0tQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bHHMT3xN8z2TN; Wed, 11 Jun 2025 07:28:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55B7SbsB056873; Wed, 11 Jun 2025 07:28:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55B7SbSc056870; Wed, 11 Jun 2025 07:28:37 GMT (envelope-from git) Date: Wed, 11 Jun 2025 07:28:37 GMT Message-Id: <202506110728.55B7SbSc056870@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 1254c42c68b6 - main - fwget: fix pci id 15d8 firmware List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1254c42c68b6f0c29654583220b0f4b29b75db49 Auto-Submitted: auto-generated The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=1254c42c68b6f0c29654583220b0f4b29b75db49 commit 1254c42c68b6f0c29654583220b0f4b29b75db49 Author: Ali Abdallah AuthorDate: 2025-06-11 06:56:47 +0000 Commit: Emmanuel Vadot CommitDate: 2025-06-11 07:27:54 +0000 fwget: fix pci id 15d8 firmware Pci video graphic card is 15d8 needs gpu-firmware-amd-kmod-picasso and it won't work with gpu-firmware-amd-kmod-raven. Tested on Thinkpad T495. PR: 287441 MFC After: 3 days --- usr.sbin/fwget/pci/pci_video_amd | 3 +++ 1 file changed, 3 insertions(+) diff --git a/usr.sbin/fwget/pci/pci_video_amd b/usr.sbin/fwget/pci/pci_video_amd index 98ecd5aaf236..5017789b9f28 100644 --- a/usr.sbin/fwget/pci/pci_video_amd +++ b/usr.sbin/fwget/pci/pci_video_amd @@ -96,6 +96,9 @@ pci_video_amd() 0x66a*) addpkg "gpu-firmware-amd-kmod-vega20" ;; + 0x15d8) + addpkg "gpu-firmware-amd-kmod-picasso" + ;; 0x15d*) addpkg "gpu-firmware-amd-kmod-raven" ;; From nobody Wed Jun 11 09:34:38 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHL8t6jg8z6018f; Wed, 11 Jun 2025 09:34:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHL8t5KBmz44Fw; Wed, 11 Jun 2025 09:34:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749634478; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iErWxVzvEt4hVg8WG68DjFiIiuUd6Q4U/szV51dSk50=; b=e85kw77GntHpLhr/b7xH4ODVcU5v5HZ3Rw2Lj1ZU53LFFYt6I6PwalbDSCL0cs95PusaE9 1F6dU2iNE2u/ICChlqBYa2IS/Zn1ImhVvdY0yDg3t2AWX/IhSODNYppiA80saeNgMEw0XN 4pcQdBbV+EEfQZxI/ndM/Naa21XTPcWlRQRsrBK6S0oF2dlZZl+mmT2lbydYPYFsDXhqE/ u4TYGKGIE3cOfod0y+///tLzClEHIeu8WstBOrAPJdMD8+jKax7Wgw4BA0ELXznPvjqZd7 NjRFv+RlBwDZgHQOeFmImHyAYV1IR9xI25szLZCfWSuW6k1OXs/GrzzY87nYig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749634478; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iErWxVzvEt4hVg8WG68DjFiIiuUd6Q4U/szV51dSk50=; b=A25XnBfR+RKRPLrdMAcVcVCmahzV1ur4XF+GZ+h139zWgm1Sf+S6qYYzUiJXwMWCoq7TEe Q5DvvjBFgPrl+dNh7lm8ztjG9er1nLQitLOHnzuwI1159ACR7gTxNmEnPBifjn0+4c9D4T RNudBNsq8wtOXmwqxDzpMREFuSpghhF1wJNb8EY2Sz1As//kMWa5UJBfjzpGMgB2hEqX/O rbMMYiUgoF3o0aA3HNWeWmLPwaDlzuvlerzXM9F3nNEQCYucYSk8w0OligwLC6LvrXjJA4 sfONUQPSi3UJ+TL4awqQGhcEQSQJz0cbx5/610/3AD8z/Me7cXCSfaxBmo4bRA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749634478; a=rsa-sha256; cv=none; b=PaUjBQsGW7SHqZZPf1Ok9UHdalvZQhee96sVNOvAb2QI2uhhN3ss7/uKYqCghYG8YlwwJw I/CSuemn9nfa9Vc4K3+AtZAuNsEEaIWdxubtE2F9Kyr5qfiZ93/TMK0Nbb0TO1wo+VulBv LPoobEevULd17g2LYxcDuk9EveTxV/Xn9/9BHjTsFiCNUewK4K1cylD928Dc4ZNMRaRytb 8VR3F8aAnivHq2+mW6ROViGAutS6rOrE1ch8kW21a+4BFdMKgQ1w2hAfZFiuQjBiUbY8Fn d40svRDyISLQ15jmwpDIVsBCpwqTGgOofIrn9X6SdpWNwb8JDJMD+WdkO5LNeg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bHL8t4qJcz5cs; Wed, 11 Jun 2025 09:34:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55B9YcPZ000922; Wed, 11 Jun 2025 09:34:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55B9YcAx000919; Wed, 11 Jun 2025 09:34:38 GMT (envelope-from git) Date: Wed, 11 Jun 2025 09:34:38 GMT Message-Id: <202506110934.55B9YcAx000919@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: d41a2ba73cbe - main - scmi: Avoid a use-after-free List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d41a2ba73cbe4ed9f3d3de5c4755fb5db6b80847 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=d41a2ba73cbe4ed9f3d3de5c4755fb5db6b80847 commit d41a2ba73cbe4ed9f3d3de5c4755fb5db6b80847 Author: Andrew Turner AuthorDate: 2025-06-09 22:30:36 +0000 Commit: Andrew Turner CommitDate: 2025-06-09 22:32:11 +0000 scmi: Avoid a use-after-free Use LIST_FOREACH_SAFE to avoid a use-after-free in scmi_reqs_pool_free. The next pointer will be invalid after the call to free meaning LIST_FOREACH will dereference a freed struct to move to the next item. Reviewed by: emaste Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D50753 --- sys/dev/firmware/arm/scmi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/firmware/arm/scmi.c b/sys/dev/firmware/arm/scmi.c index b27f7211201e..6f16b58f49bf 100644 --- a/sys/dev/firmware/arm/scmi.c +++ b/sys/dev/firmware/arm/scmi.c @@ -291,9 +291,9 @@ scmi_reqs_pool_allocate(device_t dev, const int max_msg, const int max_payld_sz) static void scmi_reqs_pool_free(struct scmi_reqs_pool *rp) { - struct scmi_req *req; + struct scmi_req *req, *tmp; - LIST_FOREACH(req, &rp->head, next) { + LIST_FOREACH_SAFE(req, &rp->head, next, tmp) { mtx_destroy(&req->mtx); free(req, M_DEVBUF); } From nobody Wed Jun 11 11:19:41 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHNXm6pBRz5xgdP for ; Wed, 11 Jun 2025 11:22:00 +0000 (UTC) (envelope-from andcarvaja@yahoo.fr) Received: from sonic305-46.consmr.mail.ir2.yahoo.com (sonic305-46.consmr.mail.ir2.yahoo.com [77.238.177.108]) (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 4bHNXm4ZCXz4Jj2 for ; Wed, 11 Jun 2025 11:22:00 +0000 (UTC) (envelope-from andcarvaja@yahoo.fr) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.fr header.s=s2048 header.b=JYkHM+ak; spf=pass (mx1.freebsd.org: domain of andcarvaja@yahoo.fr designates 77.238.177.108 as permitted sender) smtp.mailfrom=andcarvaja@yahoo.fr; dmarc=pass (policy=reject) header.from=yahoo.fr DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.fr; s=s2048; t=1749640913; bh=47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=; h=From:Subject:Date:To:References:From:Subject:Reply-To; b=JYkHM+akfJNYKpb9OqhGd1hm461Zay+p6qH24eKmeDrHOckKJ3HpQWAlmkYOiv1jyxEIqCvza7yWpI9C1PgLPbRQ7ke/Z8jN/LHNm3t2TYC+keVhl0PJDBt4ndt4Ecjq9TwUiXDUNIo0DPURjfQfrUPwSPoe9OJTjj8IrMn1I3qfq4QOvesJ6Mr74sFdQd6vH+ePDxUqQoW0yMSvJjv95/NVI0nXrZP9LGOJ2S4srt758/3dH2EMprlIHrYNnxu0CsLJI+WfWEIsPp0EgvpdkAMphYqO4cydDJ9wNjWEZJL99/aQ1rOM3MRVBmqQnm4tCnD7clK7M6zmATTeRQpNAA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1749640913; bh=idMZJjlGZMxCaX5TYtL66E+2P+vKovoHWxdCBdgeNRL=; h=X-Sonic-MF:From:Subject:Date:To:From:Subject; b=J3v4QV06DH6qqgh83rIXbvcirkY3e+6awhKydLdjQGR0vNfCmnL4tkTUqcwlq8k87hEYrm9WEPJ7NI1qI5aiPdiUkSKz55dt5yeuFy2IIigjrQ2kS0sBSALSDmWK6y7S9addb3rUZdnEmLAnG/ziNLSN14AKT5mKjStXB3/8tWFAJg9tdiApdXruPA4IsQ/XQOhqYnzN+A3f8yTFv5c/2C4+HYKKrAew7tKDf23V67EC+LkFWjAUiTq9mapRQ7npvcqNw9l8wTwRyauMfrd0B7hpP3FoeuHKxNv8ZIqdCTZVYBwWerTnXJq24iTTfAFr8BISz9GvYU1s4SCGv2rdXQ== X-YMail-OSG: XDSQWqcVM1kc5ZMwYhf5nee0pGWzj9AF4RLN25plWLMzfhErRej8b4JTqYT26Pd 0alYw.73hkA1hEMaxVNdD_tWkYmfX6owkOe_ZT15EV0Ctl8fDWqMnpIguKEO15G9aJk6ld5xMYhZ 61.huZK6L7bi0x3E5LZtZ2SZGLcr8ZocVYdXHg8wx0FmgFa_Da3tOD8Th2saOpOCYC3G_8Tu8kEq 3lgk8TrcdWYdVVbp3mMyAaWs4Uprg1xQDdqVqyQYvX4cW1ShoExd9298RNcHYa2m_sk1Ga9NsQr. vvV5PpPppUY3d_reyz5VVDKU0yx2Pzjvil4GC8x5DCDBpE7dK_Z6hsq7FtqTYOeoeWdhACWHoi3d BGO5P8JYQqGaTBo3T5WwoRlYKTVE7wfCSmdCLqTPglXIF9qg1HUMtbYJw5U0lzHcd3XA8V8efAsp mKGIVgfwa4FqoJNMnQdVmMC5Sma_ieam5weE20iKNOgB2WfLQsOj6Zc_jKg78yyAXFtVYv8GBINI B00AjzAR53tb33s749KukVvtqc8djJmY5dFaromq0teW4_0QxlMiVf0dl7oHxQBQtNgFfZoJEgI6 irJJTiUZJctj2UTWtmCZLb8UMjCI8vgRYPgNBEjiz_Qeqhl.dHYaB.fQQRUqwS4ebxfNQWQyQJ4f M7A6JecY_VdQkUsuUPuE820ahP68.2ApU9TvDuWStaUII84dgWoP.9RNsdUidUZo.ennUQUlsAFX eEf9g7LpeyO39NnXA2Ur787CCCscESWl7WCoT25DSzdEyvwYN4ruW4nKhBZ.ue4rBXHle9xkvv7P s8.VOcIj6uml7fhKZ67R8NbCeffmcpwNByBNA1r809PGiGYUGIO_Mo5sVGkD5lp5mWJVky1x5.eG qDmaDjF7rsq0SORxn96VqElGI67DbtMKoTwNriirw0FCc50P9L415rwbEMppgEeKMG5hd9DNctdb FhOOt6uBt1nwHdCKfROtciWmn1ecYZbgJdE1xM20riAKldGFWBu61Hcn9RtsAjtRHwW5EBR_JN9N rXjJ2bKlyPWFrsZo8vsoxSHPHjPfqxQ8iLwYVNBHc06jxrzkV.6kJyZeyaUtpCtX9vfhucZ7lrv9 Lrycep_GWnT0_fDPiY9G3XpdMERmp6QFqGW_edkeWP0t3J3RDvfzFRm99GokPlf6yMWdBRUnthM_ iT24S_.E5c3vI8sXZ3Mnq3OUW_J47cUOMPjKl1x1Sc05WSZl_cBA6INba2PMUNVEt2svzGWfqXx1 BOGeq6TQm.q5S3ZJS8FF2IeA8mBctpst9Q.Gpx0bXrjRkpi5pxyaXwjIKmc3CwIkDIdSjMit8TzO Vcjd5zA1uk6A3rTbE_QyZyY_hBeKNRDEYeviylw98aE6bnGPz1cHdzlrMgc1m9oKqQjCHfvc3lgP 5mgu12glr_X.BaQhhDDzRjrrjyL9jwQ1jYs5MpeYo2uNYtZcPDZsf0ZstjPUEqB3QLgbLLeDbsT1 yIYGi.Nw7VCzL0SRqD4FYVNTImoqT61nWWO.R3bS4Pcqo.BC0imB3vyqDZgLQ0mgPSM.QtVBi8uH 5Ef3LfnxRcu_KgV4yWhO7YAXkq1wNza9qBM0pR_3Lt_qx8WtYP1lB5D.7qzBgA.aKJakn9ZlAS.W jHF36JSS2EMi.C0IrVNFAwMHs8pEtin7vRYko7J4XfeJp7_8XHEDpoUUi34QGlPjPDbgVIgMlJGv WPrCfg1jccwA6qCTkWMuvlNbMcCwG3vM2YRSHau9N.Ycs5D.g8FuEeKMjvjE1tyzqa4IosrddXK. RkUiGPFWHR3Dbmm4GQHola.SC.QiyqdlId.swrSlkVFKarrfYB2JDyLP.SBYoFfB4DK04vd3CTLi t5GB7oKmzztoIJgSjXuDUD5CVbf.xrLOZI3GCYUm3IlTClUI1gae.k30COumNUX1jXyEOigr3scI qE3lnT3BBH4x8dP82Hde.tVrnFcbNOtKIrrJmUAuJ.1SyRdvf1jb3HEwGC.BQ0PE_FaqpuW1A28l X4F4wlKQ8dXujxygQuLkg4GqOE6n3OISiZiZRcM3IbdE.RnELorXCgvBXxCKRd26N240itAK8cG1 4_Oztb.ZNtFy92QHl4FCTW42ne.PeaVl5MXbufo2v.NfptPAy.HJru1KTF15BMBY5nAQtXPVKRJA osl97vvjWl25og6.Gzre6uOyousC7VDAAmErwJaccXGD2vnKj5WAM7pmOX8daCpM5sPd..SFju8K Ua1JKydQDvAe0pPNM2GUFJnnQKaX3SjddplbF27zzd7Ic9D.uRl9PFoOJNCs_tEmGoikC0BLKhn8 rVLiudeY4_WbzhXzIe6550HG.H.6nd348hvgpk7Bxi6I. X-Sonic-MF: X-Sonic-ID: 24c14bd1-009b-48b4-9cba-a3ecf53a303c Received: from sonic.gate.mail.ne1.yahoo.com by sonic305.consmr.mail.ir2.yahoo.com with HTTP; Wed, 11 Jun 2025 11:21:53 +0000 Received: by hermes--production-ir2-858bd4ff7b-2xfhr (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 8cb7c91f34d28568592972e267000947; Wed, 11 Jun 2025 11:19:52 +0000 (UTC) From: Polux Andy Content-Type: text/plain Content-Transfer-Encoding: 7bit List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.600.51.1.1\)) Subject: unsubscribe Message-Id: <443D8081-64D5-487E-BDF6-8099D6CA1387@yahoo.fr> Date: Wed, 11 Jun 2025 13:19:41 +0200 To: dev-commits-src-all-request@freebsd.org, src-committers@freebsd.org, "dev-commits-src-main@freebsd.org" X-Mailer: Apple Mail (2.3826.600.51.1.1) References: <443D8081-64D5-487E-BDF6-8099D6CA1387.ref@yahoo.fr> X-Spamd-Result: default: False [0.35 / 15.00]; NEURAL_SPAM_LONG(0.99)[0.986]; NEURAL_HAM_SHORT(-0.83)[-0.830]; NEURAL_SPAM_MEDIUM(0.79)[0.793]; MV_CASE(0.50)[]; DMARC_POLICY_ALLOW(-0.50)[yahoo.fr,reject]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; R_DKIM_ALLOW(-0.20)[yahoo.fr:s=s2048]; MIME_GOOD(-0.10)[text/plain]; RWL_MAILSPIKE_GOOD(-0.10)[77.238.177.108:from]; FREEMAIL_ENVFROM(0.00)[yahoo.fr]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_DN_EQ_ADDR_SOME(0.00)[]; FREEMAIL_FROM(0.00)[yahoo.fr]; ARC_NA(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; RCVD_IN_DNSWL_NONE(0.00)[77.238.177.108:from]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[yahoo.fr:+]; MLMMJ_DEST(0.00)[dev-commits-src-main@FreeBSD.org]; SINGLE_SHORT_PART(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:34010, ipnet:77.238.176.0/22, country:GB]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[] X-Rspamd-Queue-Id: 4bHNXm4ZCXz4Jj2 X-Spamd-Bar: / From nobody Wed Jun 11 14:35:20 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHSr82NW7z5xy62; Wed, 11 Jun 2025 14:35:36 +0000 (UTC) (envelope-from christos@freebsd.org) Received: from margiolis.net (mail.margiolis.net [95.179.159.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA512) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHSr654bPz3Smp; Wed, 11 Jun 2025 14:35:34 +0000 (UTC) (envelope-from christos@freebsd.org) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=margiolis.net header.s=default header.b=hJH3F1AK; spf=softfail (mx1.freebsd.org: 95.179.159.8 is neither permitted nor denied by domain of christos@freebsd.org) smtp.mailfrom=christos@freebsd.org; dmarc=fail reason="No valid SPF, DKIM not aligned (relaxed)" header.from=freebsd.org (policy=none) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=default; bh=MXrZkrLHg2CN Q8u76pF7w/EYCW8+qxQ+K5lRZC+zGSc=; h=in-reply-to:references:subject:cc: to:from:date; d=margiolis.net; b=hJH3F1AKSIliBBMttffT1uRKjjqr3x8lS3RH9 ipR9n4BNZp+AIZ6x/tW4cAXlDVgvjBXhdb6mU5UEsnLmZ8ubt1e7kvmeXW5/O6eVg9wXPP yT5AJLNa/hEvLK/LSn4BDo0qXABKdSt+AbAIJ1MWKyYwvCvAMDO/sjne29rVSkW0= Received: from pleb (gws2.pcigeomatics.com [216.191.123.182]) by margiolis.net (OpenSMTPD) with ESMTPSA id c7c2c7b9 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 11 Jun 2025 08:35:26 -0600 (MDT) Date: Wed, 11 Jun 2025 10:35:20 -0400 From: Christos Margiolis To: "Bjoern A. Zeeb" Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: e1bbaa71d62c - main - sound: Implement AFMT_FLOAT support Message-ID: <36dbfsom3zasjffsc5ggfbiownlcfby3ukcgzez3rrujtiqgbp@s23td5ttiuq2> References: <202503301748.52UHmPRF060200@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spamd-Result: default: False [-2.67 / 15.00]; NEURAL_HAM_SHORT(-1.00)[-0.998]; NEURAL_HAM_MEDIUM(-0.99)[-0.994]; NEURAL_HAM_LONG(-0.97)[-0.973]; MID_RHS_NOT_FQDN(0.50)[]; R_DKIM_ALLOW(-0.20)[margiolis.net:s=default]; MIME_GOOD(-0.10)[text/plain]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : No valid SPF, DKIM not aligned (relaxed),none]; TO_DN_SOME(0.00)[]; ASN(0.00)[asn:20473, ipnet:95.179.144.0/20, country:US]; MIME_TRACE(0.00)[0:+]; MISSING_XM_UA(0.00)[]; RCVD_COUNT_ONE(0.00)[1]; FREEFALL_USER(0.00)[christos]; ARC_NA(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all:c]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org,dev-commits-src-all@freebsd.org]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DKIM_TRACE(0.00)[margiolis.net:+] X-Rspamd-Queue-Id: 4bHSr654bPz3Smp X-Spamd-Bar: -- Bjoern A. Zeeb wrote: > On Sun, 30 Mar 2025, Christos Margiolis wrote: > > > The branch main has been updated by christos: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=e1bbaa71d62c8681a576f9f5bedf475c7541bd35 > > Could it be that they also need to be added to feed_volume_info_tab > below? Kernel LINT builds complain that they are unused. Yeap. Thanks for reporting this. https://reviews.freebsd.org/D50793 Christos From nobody Wed Jun 11 16:32:52 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHWRV0CxNz5y7PM; Wed, 11 Jun 2025 16:32:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHWRT04tcz3PXq; Wed, 11 Jun 2025 16:32:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749659573; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B7m57SxwfzBaGdPeNfvDJ+34AzXlYuXPSWYbIlyiIKE=; b=UuTLh/MBmjmQ6HBv2HN5isq1ttgnFxCrgKcGep5fKMxvDyz6N59Wmqr1gCFu4/FTPzA9AK wMRZaJu30EqjNwfeJ3jmG9iW8oHsWhlEoACj+l9wsmVcNT8MdTUgCP8DXbdd5/y95R66x+ i1X/+a2RxmJ2E/BbMrws49OMs/31g8zq5MfOn1/5c2AjOuCpKeRrh/2lX6v6vEX0Y87oAJ Zz0Yy/POyg1FL9BXksyxyB0p12DDfbqNQwaOooW4OImTiNLBuasifyctOFCkbI8E4gqUCW 4Kd0OkG1VhC8E42LLMSzO+2X/SDzI1FZKi/0B4/4ePyvheIPozy0qhgzlvf6lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749659573; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B7m57SxwfzBaGdPeNfvDJ+34AzXlYuXPSWYbIlyiIKE=; b=c5pJ5Gx2cDXD0+Qzw2GVdqyf59nNAwZlBur82R3Nn55hpZmVyqrFQ3CMnKLQaSjTI6tK+C Neb1D69eh/pUx4IX4XHgvnrHtOQoEArI833wEImqPWT88ozAHB1oR6GyitQGdA1CAsjW1t TbuKQq/CKdaHuCuzbQT6J8oP7ov5LFCKe8wpvCoqj1EvEEsrmHZiaSB/1rq6WKYZE7OKfg XiPKqaLlqCzplpSyvgOasCgUwFsuh2s9gqMj+NS5d6LHObYRYf6YUHQvE9n7SBiDM14T9j rfh6d0x9PO5kqhkJef1tfUmutMF8bo9UnicZyYmeYSteNLF93dlMyPxIYq6EvQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749659573; a=rsa-sha256; cv=none; b=gDq8r5LyU8VBX1h5OPZikERdm696o8c2ai3CWh0usbsv9ZLUyrXFhYem7O8CwU/DCyuF61 Fdzu05ADLR2RWLnKs2sV3ZGL9C8ffywE4MYgVe1REZNPBNKWiR45FNF6ozbgPr269/kxSp lckU3njefoWyxZ/qNh5pUy5PcEN8OfiKDaXa7ZKBQ6ohDro+OTaUggX4wUi1zZHFYDm2Sp Lbsy+Lk5w64bmUr+hkT3Nu8BaHGGRbK45aPYpmuNXoV+O4ADjxd2+cBcUoR1KBq9M53j/+ vScdDH6JX75wBpW4DDxcxxHngEIMKpwpwTwfcOEKAP8tpYACJmbi+5E3y0791g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bHWRS6kp3zb6q; Wed, 11 Jun 2025 16:32:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55BGWqmc094029; Wed, 11 Jun 2025 16:32:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55BGWqPx094026; Wed, 11 Jun 2025 16:32:52 GMT (envelope-from git) Date: Wed, 11 Jun 2025 16:32:52 GMT Message-Id: <202506111632.55BGWqPx094026@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 8ac82ba19efb - main - iwlwifi: add message how to install firmware on FreeBSD List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8ac82ba19efbaeec065621215c3843f054fa419e Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=8ac82ba19efbaeec065621215c3843f054fa419e commit 8ac82ba19efbaeec065621215c3843f054fa419e Author: Bjoern A. Zeeb AuthorDate: 2025-06-10 14:04:05 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-11 16:32:27 +0000 iwlwifi: add message how to install firmware on FreeBSD While it is too late for 14.3-R point people at fwget(8) to install firmware if the driver cannot find any. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: emaste, ziaee Differential Revision: https://reviews.freebsd.org/D50777 --- sys/contrib/dev/iwlwifi/iwl-drv.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/contrib/dev/iwlwifi/iwl-drv.c b/sys/contrib/dev/iwlwifi/iwl-drv.c index b99204d87283..b5c5268f8ddd 100644 --- a/sys/contrib/dev/iwlwifi/iwl-drv.c +++ b/sys/contrib/dev/iwlwifi/iwl-drv.c @@ -277,6 +277,9 @@ static int iwl_request_firmware(struct iwl_drv *drv, bool first) IWL_ERR(drv, "check git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git\n"); +#if defined(__FreeBSD__) + IWL_ERR(drv, "On FreeBSD the firmware package can be installed running fwget(8).\n"); +#endif return -ENOENT; } From nobody Wed Jun 11 17:00:19 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHX3816jmz5y9M8; Wed, 11 Jun 2025 17:00:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHX380KSdz3bFm; Wed, 11 Jun 2025 17:00:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749661220; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EjyViXnU+Mdq63OncH07Ce44OOTfYxIMGGAuoOYNgLU=; b=kk32QQtXDZ8BoDJ7wYDgjmGdm8bESRwDdO8SlpDB1nrdRP9AEYNuMQw2XOZRh6HT38vzsH kalglnJKaE76u/ROYrlZEapUpRm4R7QMvKiMBBuMJMc0mDc5XsfK7b5wWxksRv8c4VZlV3 WCY65lxwg84fS+c9vGNFBigC1FUP8ffSSp1D7uK2eZLp5muMEH7kr0hJYQ3DkGvdYm7cM6 Htdm9W2HSTNucvR9DssWIroVIW/hIPCjWysq9kSU0RzMQBjTK6nAzvpUyvUNoBVNmoo0XC 3tCvXZMqUib4voyVQ7s02UwvzPAKgBdo7v18SBz/frGob+GuTbsOr9ZBlnppvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749661220; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EjyViXnU+Mdq63OncH07Ce44OOTfYxIMGGAuoOYNgLU=; b=XHEUZNDQ5U+4LR8yYiNtu1oR67KEqtwVKxtzIu+g3rjFnYDj05DCNqB4cOUdIbX44Q8Aec 306SbomOuOdNAk9Ln23JhZBEZngNabl1Qrj9uryJyY/qHWvM3rAnqcTPKzGi3kU8lI2zS0 t3J5/h4upiwW9G1YktIztcUnc2TNinqgVNGu5xJkWYdEoHdGYbRmd2cXTrNH+PPU5qIt8Y U37vQ0I0DYjpxnE3VT5UvSf9/U0Uogwa9NnfiOrRdhwL3JBDVRDWodzihMFIJTgmiXHDUV g5Cl159V5X0z6Abet4ViuGRsjDH0aBmeiT1YnjS/ZPmrGMEIWus+HjOCFbv3Eg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749661220; a=rsa-sha256; cv=none; b=DEFz+cwQOPcRDA1CbQnKCYreYjZ40Mbj6kGjaKWuodB3X+X719IqdR7gZ841eJI2kdpR4y MV0N9V/a+6RbzBu8roV/QDe3vmytRhpEgbUtlF3UxxHFQeZspXaTNtVVPHpbO1gCpf8KRE KU/CtlOXnVC1EIhzQg8m+fPiKzN+cOHxkMHth8bHIN0qv3g4VeFO3CKZe4UzXRIZKrN79P YazMVz40B+bwXR3BLjvjp7afAtkWuNtW11rUcQePBYaCI2X2oEWw1eOtya9XY2+YQ7B6Wr 2iA0HI8xRm2wcGDaR129NsSxe/larVp/rkG/vLxq1tvyvYY79JPF6e4yDqwgZA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bHX376mTmzbg1; Wed, 11 Jun 2025 17:00:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55BH0Jpc042541; Wed, 11 Jun 2025 17:00:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55BH0JGv042539; Wed, 11 Jun 2025 17:00:19 GMT (envelope-from git) Date: Wed, 11 Jun 2025 17:00:19 GMT Message-Id: <202506111700.55BH0JGv042539@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: b01e971fd39d - main - Don't rely on sys/_types.h including sys/cdefs.h List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b01e971fd39d10273a387788019457792873e81c Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=b01e971fd39d10273a387788019457792873e81c commit b01e971fd39d10273a387788019457792873e81c Author: Brooks Davis AuthorDate: 2025-06-11 16:39:01 +0000 Commit: Brooks Davis CommitDate: 2025-06-11 16:39:01 +0000 Don't rely on sys/_types.h including sys/cdefs.h These headers relied in __BEGIN_DECS/__END_DECLS being defined when sys/_types.h was included, but there's not a requirement that this be the case. Reviewed by: imp Exp-run by: antoine (PR 286274) Pull Request: https://github.com/freebsd/freebsd-src/pull/1595 --- contrib/libexecinfo/execinfo.h | 2 ++ include/dlfcn.h | 1 + lib/msun/src/math.h | 1 + sys/sys/procdesc.h | 1 + 4 files changed, 5 insertions(+) diff --git a/contrib/libexecinfo/execinfo.h b/contrib/libexecinfo/execinfo.h index 22460967e83c..8a3c36b2da21 100644 --- a/contrib/libexecinfo/execinfo.h +++ b/contrib/libexecinfo/execinfo.h @@ -32,6 +32,8 @@ #ifndef _EXECINFO_H_ #define _EXECINFO_H_ +#include + #include __BEGIN_DECLS diff --git a/include/dlfcn.h b/include/dlfcn.h index 89ec43b332e9..9a4ac0faf786 100644 --- a/include/dlfcn.h +++ b/include/dlfcn.h @@ -32,6 +32,7 @@ #ifndef _DLFCN_H_ #define _DLFCN_H_ +#include #include /* diff --git a/lib/msun/src/math.h b/lib/msun/src/math.h index be7b86144738..aecc652ea08a 100644 --- a/lib/msun/src/math.h +++ b/lib/msun/src/math.h @@ -15,6 +15,7 @@ #ifndef _MATH_H_ #define _MATH_H_ +#include #include #include diff --git a/sys/sys/procdesc.h b/sys/sys/procdesc.h index 4e8b06fb7377..81102dffa6ff 100644 --- a/sys/sys/procdesc.h +++ b/sys/sys/procdesc.h @@ -108,6 +108,7 @@ int procdesc_falloc(struct thread *, struct file **, int *, int, #else /* !_KERNEL */ +#include #include #ifndef _PID_T_DECLARED From nobody Wed Jun 11 17:00:20 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHX391Y3Zz5y9cN; Wed, 11 Jun 2025 17:00:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHX390fKfz3b6r; Wed, 11 Jun 2025 17:00:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749661221; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hSh510vy09fyaY86IQ8ORcxipIm9hjqOCd7+R35fc40=; b=Ja6fQSgd6UGqM8qGY7uDNcX87RqVRjA5AILsyA9uE8ZK4fa9NoxhlLBa6bnYgAs2aX7cqY Ho8HWDhMDLsOaOnjQdCxopCTwlsdoMaCCMT87963GOcNPK0/e9eSYmDj2VARyrjWLXbFYz W7DBFHAzO0ax4dLStM6VHqF2DtHcF0kbJ4EEuSuzuWyhZhVTNWV6+GCNnrIxJ4kt0nFuqU DiP0+dBFLfRV1wbMiAigpSxfGsPSL9E2/jD0lKNaX6C30eMk1BdSEKD8XQ6N+eObCrbhxx WxVnPhpxFf8NrPz4J/gW7xt3/PjlVefd18uKkrGAAyXWN/RO+ijNSRQdET6jZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749661221; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hSh510vy09fyaY86IQ8ORcxipIm9hjqOCd7+R35fc40=; b=hsCAfOGTc5c4E/c9wyBtDieQFjAC5EXYAj8GWIIZvZ9/zx8W7fXTLf4fuOE8ejUF7QP99p 3ru1ZvLjQ2BQGZBVXRtWZFRrfWvz+0waPeuIvKhsloB30yROzeAgW+GMCoKpfvheMypT7p CFqC8xYikA2wNYibYIxSX9bFVAC16gkot7P0bl2jhAL5LRbC+c+fqx2hck+Wh9y0yVaZ4w ZjnkXBm+66u3A0AxE+oEfitTrWEPUfDD2orUmXCkPFXWcrDuVncieYifbuxP0tuW9JEhKt Hy+6XMikGP9QzIlAz9zDHW/CiNZS8dEwsZs77WTGWgFqNGV/y1XSn0IiEPc/qw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749661221; a=rsa-sha256; cv=none; b=ckRbxZOleUNtNAq2w2+4UNPpi85uyQCy7YEiD8xKxPyql1UOGKlVuR3BMKxQhoFIO46pQ2 HcAxUmuORsf3ZNZPXe8NjSpApdpA9IasWGYsl8CirQDZRMrtTIfCTKjnh5wSUsPu7m+vyJ iTZgiW6l7fMOfbEz+lrg6buEVif0qe/dLxHG7KuGFpPTeAtaAXJJWBWSzoKhSsNqKYsadT 7rlc9i/LIPJZibszcsH6dj9ejgF2jr6uYsRpbiMydcJyl14V2hzAhNdAcNY26ZgI8Yq3Ji QSMZB2j8zPqmxBRZ4IK+J983P8NmNwTJVJhJafkpg0ne099b7X8X0dHZKs8KVA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bHX390FSkzbg2; Wed, 11 Jun 2025 17:00:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55BH0KrG042577; Wed, 11 Jun 2025 17:00:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55BH0Ka6042574; Wed, 11 Jun 2025 17:00:20 GMT (envelope-from git) Date: Wed, 11 Jun 2025 17:00:20 GMT Message-Id: <202506111700.55BH0Ka6042574@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: ab3d713e93dc - main - sys/_types.h: use builtins to for __max_align_t List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ab3d713e93dc1d322398657125071101c08e2ce5 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=ab3d713e93dc1d322398657125071101c08e2ce5 commit ab3d713e93dc1d322398657125071101c08e2ce5 Author: Brooks Davis AuthorDate: 2025-06-11 16:39:01 +0000 Commit: Brooks Davis CommitDate: 2025-06-11 16:39:01 +0000 sys/_types.h: use builtins to for __max_align_t Use __attribute__((__aligned__(x))) and __alignof__(x) in places of local macros that ultimately wrap these. We don't support compilers that don't define these so there's little loss of generality. This mirrors Clang's stddef.h. Reviewed by: imp Exp-run by: antoine (PR 286274) Pull Request: https://github.com/freebsd/freebsd-src/pull/1595 --- sys/sys/_types.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/sys/_types.h b/sys/sys/_types.h index c84b84edd2b8..f6d1f26551e0 100644 --- a/sys/sys/_types.h +++ b/sys/sys/_types.h @@ -181,9 +181,11 @@ typedef __uint_least32_t __char32_t; #endif typedef struct { - long long __max_align1 __aligned(_Alignof(long long)); + long long __max_align1 + __attribute__((__aligned__(__alignof__(long long)))); #ifndef _STANDALONE - long double __max_align2 __aligned(_Alignof(long double)); + long double __max_align2 + __attribute__((__aligned__(__alignof__(long long)))); #endif } __max_align_t; From nobody Wed Jun 11 17:00:22 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHX3B4CMvz5y9S1; Wed, 11 Jun 2025 17:00:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHX3B1hgzz3bHx; Wed, 11 Jun 2025 17:00:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749661222; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I9ASj24P+qc/tAOeqIkbQlt0dtyWjBFMYldb6AnjWv4=; b=xXw0WTPadCe2oFuvKqnrkaf1z8rTQN/+KNWLEGSlYBKxy/KFOQViFdGjYGYGZFbPc2fBc0 Hk7z20gDsUcFGO8KWe9EH+/kqZT841xPyH5sc8oxXBlwWk+tcY3OWcecprjhftI+85ZGPy jCego67nzRoqZr2LZWWeEZdemGV1yT3WemK/xz5Z/TVJ88Yr+QcRx4WEIwDJmAEvtMK4dW gsn5llxGNwIHsoIYE1ZJWKaA0Fp6bubJRRNvwBbkFxMyYLc6wX3sbjHjpn7kmxrHqA6Wh5 i4fTq+8U1AuGGceasLo5jmEnTECs09mFFuNVJxmq04O8pnG1slQQhaRWzZHefg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749661222; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I9ASj24P+qc/tAOeqIkbQlt0dtyWjBFMYldb6AnjWv4=; b=PdUN+x6NK9dz4uKJnI7rG0g+Elfuz0wyShhv5KoMC0DLCHwuAO9wLgWcqjci2v1A23vZB2 Rii4HeNtt/u1ty/N7MpnxDusQn7/TtDQOIytJGOLFZKXkojHSCKfzY20InlSNvQgbpjRvG elXgQ3+Y0cyJn8XabcBlboO5/ufjKUVvx99iDsVDVTLGoG+Gpb6160t8Uzt6iFsVnohlwj gkbmnygez73jSEpd50czPTcANXI9pJVThomgitdb2P5nzqelFVulz31RXHmV0y4byQ55EX nmoKxZhzEljLT8rRslROpcFxMgHtuegPUsFImSmU0qOE/1mz/Y9Kf9QmCPjclw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749661222; a=rsa-sha256; cv=none; b=bM465DgsVJyiB5wkObFOJNKzdJE+GGACjaFMc6HmmYgjYoh2IIzi083GUY9LeC84aPwDt/ WoG0rVkKpqreky8b93oiQsanpBQ8ogsZdUX/C9Ega2zoHJfK08zuWaFcuPtNZwhswvydmw VwIVoG38Gnej4M0FBQ2z84Q9sHQ37+07R13O4ae4eLa9KN4x1/I/5Wl0CffWaGG/BRT3Rj d1OFTas7whMwI1DlzdD9QOmHTZz5tPsF3O3OoEl6d+34TBXMPWh3lKYge6Jo7zBm5QJ20Y onwdJLMDWLPUVom/fVwmeYFOBKaygGTNCHOwtIHKNfmy0bPGiU0rTTWcAf4jXg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bHX3B1BMZzcBG; Wed, 11 Jun 2025 17:00:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55BH0MoX042615; Wed, 11 Jun 2025 17:00:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55BH0MS0042612; Wed, 11 Jun 2025 17:00:22 GMT (envelope-from git) Date: Wed, 11 Jun 2025 17:00:22 GMT Message-Id: <202506111700.55BH0MS0042612@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 92ff108e99e5 - main - sys/_types.h: drop sys/cdefs.h include List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 92ff108e99e5c3904959a13ad5a99f63919cf62e Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=92ff108e99e5c3904959a13ad5a99f63919cf62e commit 92ff108e99e5c3904959a13ad5a99f63919cf62e Author: Brooks Davis AuthorDate: 2025-06-11 16:39:01 +0000 Commit: Brooks Davis CommitDate: 2025-06-11 16:39:01 +0000 sys/_types.h: drop sys/cdefs.h include We no longer use it and it pollutes downstream headers. Reviewed by: imp Exp-run by: antoine (PR 286274) Pull Request: https://github.com/freebsd/freebsd-src/pull/1595 --- sys/sys/_types.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/sys/_types.h b/sys/sys/_types.h index f6d1f26551e0..fe345b43d5eb 100644 --- a/sys/sys/_types.h +++ b/sys/sys/_types.h @@ -29,8 +29,6 @@ #ifndef _SYS__TYPES_H_ #define _SYS__TYPES_H_ -#include - /* * Basic types upon which most other types are built. * From nobody Wed Jun 11 17:00:23 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHX3C3CBlz5y9Vg; Wed, 11 Jun 2025 17:00:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHX3C2FB6z3b4r; Wed, 11 Jun 2025 17:00:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749661223; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NcIAsRo+7bYRuSo/CN9l5YkfsmIVVfKR6rcmTzolois=; b=bZc9KnfdcPoeUnKyeIKr5S9wkC2K9VV4VwFbaWzpt9W0bqwUxGf2jJZN4qFZvWp21EhQI6 c7kSNqlxPFk2IebA9325RMGUNrBiOyZ1cA/3pqQForWZ1aGERc+u9qjRuPN27Eb89DgSyZ qLNPuch5+VNlVorZiwSPc3HvRhxN66117ukN+UOE4qXd6L6uRDS6DFVmr3FFMjKQQkbfyQ JXCwqDX1se8lbQVq83iIk/bCXGXbIageMIXXhVAOEkg1PhBbsqEzyJQAp/NCa5GmU0x+40 9dMP1KxrP79Q1LMJa5NMj1LPeXADA/8Af5mBJ2YA79IAdQOQGVD7XZYvX/qjrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749661223; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NcIAsRo+7bYRuSo/CN9l5YkfsmIVVfKR6rcmTzolois=; b=qQEBlJ7yANElDPbf2wBlIfF4QQum2U/+Jy7lMW0E0h/9KaleWJaizqMuIb52Gm6VZXCtnj gbjNkxetzZE/Izq6cVmrEURTtslC5b87r8ZLiXwPv1sWAv2eB8wim2YBHAGSPaOTuf2Ppz gGim6C0pIULm3oPC+zTzw8S5AzaB6kkIV2nDZs91+pvNdjRIMSnnzAh9fUddsQNAtqgn67 QR1UXMceT5u2y+P0fab4Rs8Sze3nj+LqLFJZT39hBLL8BpwR6oj4I3J28ct22jtelO+QpN qhL9wu72OAgVLc45mVuIwTcfw5689O3JTOyvZIqcIK/rs141zsx4TgOIZ1wqvg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749661223; a=rsa-sha256; cv=none; b=JQNAf0x3w9EIhCSBvnr54CKfxX8s154N1SR1WWqoOcwj7fsaHazuyaTmtqIyQAkdeg12Q9 rx2tso020ZYaZ081UyE2WuDXrQqVGruVaevUBn9mhRkGaxuNzyTInNL1r8KLx/siB1a8+2 reN6L8Gdu5AycxpzRTb7r7Wg4XvP3xdeVZjbHR7vVtR2Jq/sVRiZHYyCAuZRT+7ZXdXXup Fyi+Qmh7Rpdup5sFlc3mKJEV4aCGJgUqEvi4+zHeNx2RloEFbSEVeqrWgh64S43txKmAfE dX0INDztH/4LILdpXWSMIQgiJNMtO0vtLhAsTDMuLgUT3AyIK0WYcis1rtfqyQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bHX3C1rVpzcBH; Wed, 11 Jun 2025 17:00:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55BH0N1B042648; Wed, 11 Jun 2025 17:00:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55BH0NtT042645; Wed, 11 Jun 2025 17:00:23 GMT (envelope-from git) Date: Wed, 11 Jun 2025 17:00:23 GMT Message-Id: <202506111700.55BH0NtT042645@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 5a2f6016dec6 - main - sys/cdefs.h: extract __*_VISIBLE to sys/_visible.h List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5a2f6016dec69cbcfe9595c7f40a7e44d85a9288 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=5a2f6016dec69cbcfe9595c7f40a7e44d85a9288 commit 5a2f6016dec69cbcfe9595c7f40a7e44d85a9288 Author: Brooks Davis AuthorDate: 2025-06-11 16:39:01 +0000 Commit: Brooks Davis CommitDate: 2025-06-11 16:39:01 +0000 sys/cdefs.h: extract __*_VISIBLE to sys/_visible.h Some headers need to support our non-portable visibility macros, but would be more portable if they provided less overall pollution (e.g., stddef.h currently provides __BEGIN_DECLS/__END_DECLS). Reviewed by: imp Exp-run by: antoine (PR 286274) Pull Request: https://github.com/freebsd/freebsd-src/pull/1595 --- sys/sys/_visible.h | 223 +++++++++++++++++++++++++++++++++++++++++++++++++++++ sys/sys/cdefs.h | 185 +------------------------------------------- 2 files changed, 224 insertions(+), 184 deletions(-) diff --git a/sys/sys/_visible.h b/sys/sys/_visible.h new file mode 100644 index 000000000000..de7542db27b5 --- /dev/null +++ b/sys/sys/_visible.h @@ -0,0 +1,223 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Berkeley Software Design, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _SYS__VISIBLE_H_ +#define _SYS__VISIBLE_H_ + +/*- + * The following definitions are an extension of the behavior originally + * implemented in , but with a different level of granularity. + * POSIX.1 requires that the macros we test be defined before any standard + * header file is included. + * + * Here's a quick run-down of the versions (and some informal names) + * defined(_POSIX_SOURCE) 1003.1-1988 + * encoded as 198808 below + * _POSIX_C_SOURCE == 1 1003.1-1990 + * encoded as 199009 below + * _POSIX_C_SOURCE == 2 1003.2-1992 C Language Binding Option + * encoded as 199209 below + * _POSIX_C_SOURCE == 199309 1003.1b-1993 + * (1003.1 Issue 4, Single Unix Spec v1, Unix 93) + * _POSIX_C_SOURCE == 199506 1003.1c-1995, 1003.1i-1995, + * and the omnibus ISO/IEC 9945-1: 1996 + * (1003.1 Issue 5, Single Unix Spec v2, Unix 95) + * _POSIX_C_SOURCE == 200112 1003.1-2001 (1003.1 Issue 6, Unix 03) + * with _XOPEN_SOURCE=600 + * _POSIX_C_SOURCE == 200809 1003.1-2008 (1003.1 Issue 7) + * IEEE Std 1003.1-2017 (Rev of 1003.1-2008) is + * 1003.1-2008 with two TCs applied and + * _XOPEN_SOURCE=700 + * _POSIX_C_SOURCE == 202405 1003.1-2004 (1003.1 Issue 8), IEEE Std 1003.1-2024 + * with _XOPEN_SOURCE=800 + * + * In addition, the X/Open Portability Guide, which is now the Single UNIX + * Specification, defines a feature-test macro which indicates the version of + * that specification, and which subsumes _POSIX_C_SOURCE. + * + * Our macros begin with two underscores to avoid namespace screwage. + */ + +/* Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. */ +#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 1 +#undef _POSIX_C_SOURCE /* Probably illegal, but beyond caring now. */ +#define _POSIX_C_SOURCE 199009 +#endif + +/* Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. */ +#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 2 +#undef _POSIX_C_SOURCE +#define _POSIX_C_SOURCE 199209 +#endif + +/* + * Deal with various X/Open Portability Guides and Single UNIX Spec. We use the + * '- 0' construct so software that defines _XOPEN_SOURCE to nothing doesn't + * cause errors. X/Open CAE Specification, August 1994, System Interfaces and + * Headers, Issue 4, Version 2 section 2.2 states an empty definition means the + * same thing as _POSIX_C_SOURCE == 2. This broadly mirrors "System V Interface + * Definition, Fourth Edition", but earlier editions suggest some ambiguity. + * However, FreeBSD has histoically implemented this as a NOP, so we just + * document what it should be for now to not break ports gratuitously. + */ +#ifdef _XOPEN_SOURCE +#if _XOPEN_SOURCE - 0 >= 800 +#define __XSI_VISIBLE 800 +#undef _POSIX_C_SOURCE +#define _POSIX_C_SOURCE 202405 +#elif _XOPEN_SOURCE - 0 >= 700 +#define __XSI_VISIBLE 700 +#undef _POSIX_C_SOURCE +#define _POSIX_C_SOURCE 200809 +#elif _XOPEN_SOURCE - 0 >= 600 +#define __XSI_VISIBLE 600 +#undef _POSIX_C_SOURCE +#define _POSIX_C_SOURCE 200112 +#elif _XOPEN_SOURCE - 0 >= 500 +#define __XSI_VISIBLE 500 +#undef _POSIX_C_SOURCE +#define _POSIX_C_SOURCE 199506 +#else +/* #define _POSIX_C_SOURCE 199209 */ +#endif +#endif + +/* + * Deal with all versions of POSIX. The ordering relative to the tests above is + * important. + */ +#if defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE) +#define _POSIX_C_SOURCE 198808 +#endif +#ifdef _POSIX_C_SOURCE +#if _POSIX_C_SOURCE >= 202405 +#define __POSIX_VISIBLE 202405 +#define __ISO_C_VISIBLE 2017 +#elif _POSIX_C_SOURCE >= 200809 +#define __POSIX_VISIBLE 200809 +#define __ISO_C_VISIBLE 1999 +#elif _POSIX_C_SOURCE >= 200112 +#define __POSIX_VISIBLE 200112 +#define __ISO_C_VISIBLE 1999 +#elif _POSIX_C_SOURCE >= 199506 +#define __POSIX_VISIBLE 199506 +#define __ISO_C_VISIBLE 1990 +#elif _POSIX_C_SOURCE >= 199309 +#define __POSIX_VISIBLE 199309 +#define __ISO_C_VISIBLE 1990 +#elif _POSIX_C_SOURCE >= 199209 +#define __POSIX_VISIBLE 199209 +#define __ISO_C_VISIBLE 1990 +#elif _POSIX_C_SOURCE >= 199009 +#define __POSIX_VISIBLE 199009 +#define __ISO_C_VISIBLE 1990 +#else +#define __POSIX_VISIBLE 198808 +#define __ISO_C_VISIBLE 0 +#endif /* _POSIX_C_SOURCE */ + +/* + * When we've explicitly asked for a newer C version, make the C variable + * visible by default. Also honor the glibc _ISOC{11,23}_SOURCE macros + * extensions. Both glibc and OpenBSD do this, even when a more strict + * _POSIX_C_SOURCE has been requested, and it makes good sense (especially for + * pre POSIX 2024, since C11 is much nicer than the old C99 base). Continue the + * practice with C23, though don't do older standards. Also, GLIBC doesn't have + * a _ISOC17_SOURCE, so it's not implemented here. glibc has earlier ISOCxx defines, + * but we don't implement those as they are not relevant enough. + */ +#if _ISOC23_SOURCE || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L) +#undef __ISO_C_VISIBLE +#define __ISO_C_VISIBLE 2023 +#elif _ISOC11_SOURCE || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) +#undef __ISO_C_VISIBLE +#define __ISO_C_VISIBLE 2011 +#endif +#else /* _POSIX_C_SOURCE */ +/*- + * Deal with _ANSI_SOURCE: + * If it is defined, and no other compilation environment is explicitly + * requested, then define our internal feature-test macros to zero. This + * makes no difference to the preprocessor (undefined symbols in preprocessing + * expressions are defined to have value zero), but makes it more convenient for + * a test program to print out the values. + * + * If a program mistakenly defines _ANSI_SOURCE and some other macro such as + * _POSIX_C_SOURCE, we will assume that it wants the broader compilation + * environment (and in fact we will never get here). + */ +#if defined(_ANSI_SOURCE) /* Hide almost everything. */ +#define __POSIX_VISIBLE 0 +#define __XSI_VISIBLE 0 +#define __BSD_VISIBLE 0 +#define __ISO_C_VISIBLE 1990 +#define __EXT1_VISIBLE 0 +#elif defined(_C99_SOURCE) /* Localism to specify strict C99 env. */ +#define __POSIX_VISIBLE 0 +#define __XSI_VISIBLE 0 +#define __BSD_VISIBLE 0 +#define __ISO_C_VISIBLE 1999 +#define __EXT1_VISIBLE 0 +#elif defined(_C11_SOURCE) /* Localism to specify strict C11 env. */ +#define __POSIX_VISIBLE 0 +#define __XSI_VISIBLE 0 +#define __BSD_VISIBLE 0 +#define __ISO_C_VISIBLE 2011 +#define __EXT1_VISIBLE 0 +#elif defined(_C23_SOURCE) /* Localism to specify strict C23 env. */ +#define __POSIX_VISIBLE 0 +#define __XSI_VISIBLE 0 +#define __BSD_VISIBLE 0 +#define __ISO_C_VISIBLE 2023 +#define __EXT1_VISIBLE 0 +#else /* Default environment: show everything. */ +#define __POSIX_VISIBLE 202405 +#define __XSI_VISIBLE 800 +#define __BSD_VISIBLE 1 +#define __ISO_C_VISIBLE 2023 +#define __EXT1_VISIBLE 1 +#endif +#endif /* _POSIX_C_SOURCE */ + +/* User override __EXT1_VISIBLE */ +#if defined(__STDC_WANT_LIB_EXT1__) +#undef __EXT1_VISIBLE +#if __STDC_WANT_LIB_EXT1__ +#define __EXT1_VISIBLE 1 +#else +#define __EXT1_VISIBLE 0 +#endif +#endif /* __STDC_WANT_LIB_EXT1__ */ + +#endif /* !_SYS__VISIBLE_H_ */ diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index e79cf2972f3f..3bc4389346d2 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -494,190 +494,7 @@ #define __RENAME(x) no renaming in kernel/standalone environment #endif -/*- - * The following definitions are an extension of the behavior originally - * implemented in , but with a different level of granularity. - * POSIX.1 requires that the macros we test be defined before any standard - * header file is included. - * - * Here's a quick run-down of the versions (and some informal names) - * defined(_POSIX_SOURCE) 1003.1-1988 - * encoded as 198808 below - * _POSIX_C_SOURCE == 1 1003.1-1990 - * encoded as 199009 below - * _POSIX_C_SOURCE == 2 1003.2-1992 C Language Binding Option - * encoded as 199209 below - * _POSIX_C_SOURCE == 199309 1003.1b-1993 - * (1003.1 Issue 4, Single Unix Spec v1, Unix 93) - * _POSIX_C_SOURCE == 199506 1003.1c-1995, 1003.1i-1995, - * and the omnibus ISO/IEC 9945-1: 1996 - * (1003.1 Issue 5, Single Unix Spec v2, Unix 95) - * _POSIX_C_SOURCE == 200112 1003.1-2001 (1003.1 Issue 6, Unix 03) - * with _XOPEN_SOURCE=600 - * _POSIX_C_SOURCE == 200809 1003.1-2008 (1003.1 Issue 7) - * IEEE Std 1003.1-2017 (Rev of 1003.1-2008) is - * 1003.1-2008 with two TCs applied and - * _XOPEN_SOURCE=700 - * _POSIX_C_SOURCE == 202405 1003.1-2004 (1003.1 Issue 8), IEEE Std 1003.1-2024 - * with _XOPEN_SOURCE=800 - * - * In addition, the X/Open Portability Guide, which is now the Single UNIX - * Specification, defines a feature-test macro which indicates the version of - * that specification, and which subsumes _POSIX_C_SOURCE. - * - * Our macros begin with two underscores to avoid namespace screwage. - */ - -/* Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. */ -#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 1 -#undef _POSIX_C_SOURCE /* Probably illegal, but beyond caring now. */ -#define _POSIX_C_SOURCE 199009 -#endif - -/* Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. */ -#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 2 -#undef _POSIX_C_SOURCE -#define _POSIX_C_SOURCE 199209 -#endif - -/* - * Deal with various X/Open Portability Guides and Single UNIX Spec. We use the - * '- 0' construct so software that defines _XOPEN_SOURCE to nothing doesn't - * cause errors. X/Open CAE Specification, August 1994, System Interfaces and - * Headers, Issue 4, Version 2 section 2.2 states an empty definition means the - * same thing as _POSIX_C_SOURCE == 2. This broadly mirrors "System V Interface - * Definition, Fourth Edition", but earlier editions suggest some ambiguity. - * However, FreeBSD has histoically implemented this as a NOP, so we just - * document what it should be for now to not break ports gratuitously. - */ -#ifdef _XOPEN_SOURCE -#if _XOPEN_SOURCE - 0 >= 800 -#define __XSI_VISIBLE 800 -#undef _POSIX_C_SOURCE -#define _POSIX_C_SOURCE 202405 -#elif _XOPEN_SOURCE - 0 >= 700 -#define __XSI_VISIBLE 700 -#undef _POSIX_C_SOURCE -#define _POSIX_C_SOURCE 200809 -#elif _XOPEN_SOURCE - 0 >= 600 -#define __XSI_VISIBLE 600 -#undef _POSIX_C_SOURCE -#define _POSIX_C_SOURCE 200112 -#elif _XOPEN_SOURCE - 0 >= 500 -#define __XSI_VISIBLE 500 -#undef _POSIX_C_SOURCE -#define _POSIX_C_SOURCE 199506 -#else -/* #define _POSIX_C_SOURCE 199209 */ -#endif -#endif - -/* - * Deal with all versions of POSIX. The ordering relative to the tests above is - * important. - */ -#if defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE) -#define _POSIX_C_SOURCE 198808 -#endif -#ifdef _POSIX_C_SOURCE -#if _POSIX_C_SOURCE >= 202405 -#define __POSIX_VISIBLE 202405 -#define __ISO_C_VISIBLE 2017 -#elif _POSIX_C_SOURCE >= 200809 -#define __POSIX_VISIBLE 200809 -#define __ISO_C_VISIBLE 1999 -#elif _POSIX_C_SOURCE >= 200112 -#define __POSIX_VISIBLE 200112 -#define __ISO_C_VISIBLE 1999 -#elif _POSIX_C_SOURCE >= 199506 -#define __POSIX_VISIBLE 199506 -#define __ISO_C_VISIBLE 1990 -#elif _POSIX_C_SOURCE >= 199309 -#define __POSIX_VISIBLE 199309 -#define __ISO_C_VISIBLE 1990 -#elif _POSIX_C_SOURCE >= 199209 -#define __POSIX_VISIBLE 199209 -#define __ISO_C_VISIBLE 1990 -#elif _POSIX_C_SOURCE >= 199009 -#define __POSIX_VISIBLE 199009 -#define __ISO_C_VISIBLE 1990 -#else -#define __POSIX_VISIBLE 198808 -#define __ISO_C_VISIBLE 0 -#endif /* _POSIX_C_SOURCE */ - -/* - * When we've explicitly asked for a newer C version, make the C variable - * visible by default. Also honor the glibc _ISOC{11,23}_SOURCE macros - * extensions. Both glibc and OpenBSD do this, even when a more strict - * _POSIX_C_SOURCE has been requested, and it makes good sense (especially for - * pre POSIX 2024, since C11 is much nicer than the old C99 base). Continue the - * practice with C23, though don't do older standards. Also, GLIBC doesn't have - * a _ISOC17_SOURCE, so it's not implemented here. glibc has earlier ISOCxx defines, - * but we don't implement those as they are not relevant enough. - */ -#if _ISOC23_SOURCE || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L) -#undef __ISO_C_VISIBLE -#define __ISO_C_VISIBLE 2023 -#elif _ISOC11_SOURCE || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) -#undef __ISO_C_VISIBLE -#define __ISO_C_VISIBLE 2011 -#endif -#else /* _POSIX_C_SOURCE */ -/*- - * Deal with _ANSI_SOURCE: - * If it is defined, and no other compilation environment is explicitly - * requested, then define our internal feature-test macros to zero. This - * makes no difference to the preprocessor (undefined symbols in preprocessing - * expressions are defined to have value zero), but makes it more convenient for - * a test program to print out the values. - * - * If a program mistakenly defines _ANSI_SOURCE and some other macro such as - * _POSIX_C_SOURCE, we will assume that it wants the broader compilation - * environment (and in fact we will never get here). - */ -#if defined(_ANSI_SOURCE) /* Hide almost everything. */ -#define __POSIX_VISIBLE 0 -#define __XSI_VISIBLE 0 -#define __BSD_VISIBLE 0 -#define __ISO_C_VISIBLE 1990 -#define __EXT1_VISIBLE 0 -#elif defined(_C99_SOURCE) /* Localism to specify strict C99 env. */ -#define __POSIX_VISIBLE 0 -#define __XSI_VISIBLE 0 -#define __BSD_VISIBLE 0 -#define __ISO_C_VISIBLE 1999 -#define __EXT1_VISIBLE 0 -#elif defined(_C11_SOURCE) /* Localism to specify strict C11 env. */ -#define __POSIX_VISIBLE 0 -#define __XSI_VISIBLE 0 -#define __BSD_VISIBLE 0 -#define __ISO_C_VISIBLE 2011 -#define __EXT1_VISIBLE 0 -#elif defined(_C23_SOURCE) /* Localism to specify strict C23 env. */ -#define __POSIX_VISIBLE 0 -#define __XSI_VISIBLE 0 -#define __BSD_VISIBLE 0 -#define __ISO_C_VISIBLE 2023 -#define __EXT1_VISIBLE 0 -#else /* Default environment: show everything. */ -#define __POSIX_VISIBLE 202405 -#define __XSI_VISIBLE 800 -#define __BSD_VISIBLE 1 -#define __ISO_C_VISIBLE 2023 -#define __EXT1_VISIBLE 1 -#endif -#endif /* _POSIX_C_SOURCE */ - -/* User override __EXT1_VISIBLE */ -#if defined(__STDC_WANT_LIB_EXT1__) -#undef __EXT1_VISIBLE -#if __STDC_WANT_LIB_EXT1__ -#define __EXT1_VISIBLE 1 -#else -#define __EXT1_VISIBLE 0 -#endif -#endif /* __STDC_WANT_LIB_EXT1__ */ +#include /* * Nullability qualifiers: currently only supported by Clang. From nobody Wed Jun 11 17:00:24 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHX3D3VkTz5y9CH; Wed, 11 Jun 2025 17:00:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHX3D2wpCz3b7X; Wed, 11 Jun 2025 17:00:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749661224; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1PrahWVUhBYRIrsILqAmk2rup7xZd364zXqdaE1rLhM=; b=XjLY9oUyxCE9GaWUKnhYztZWvd6tauVkOjr8s0+lbvxcYcAXP6iltXzgbFCIFxS6bvtnE1 6KHXWn8D86sfgQmKv+c3TIr4IBBNKt3CTCkNF6lNkhK5qoO8yOirntqoo1ASQSv3mQI1wT L6s8labFSbOqIZpyaBZEK/OutpdQsaCfsUMDv+5pi9d+jW9G2VeFuCCM+QYWtRUF4KWdOw MCcs7YuuKjo4BQJaWzT//AjnFQm8ztZxaOuiBwQR7+IrRRfwI8zZvRKB8IqNwIccgvwKpr p1lEQt9JzNkyxA4E8+vXgC9Eh+/ZhXQEVA/bSJWFnJGDiumrxgeyVdWg8DDzQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749661224; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1PrahWVUhBYRIrsILqAmk2rup7xZd364zXqdaE1rLhM=; b=uuK9JQfUl/tL/KfjC+AuBK7sOAteOTPqeXcVcNoGguGKtmHpYt2xkDWu95Czx0H/tWz5OI wgh/o5Mz7s4w/YkQAJEYls/39maFs8EPcxN3ZIo/3xiu75iGQMIXWm+gf4nA+VT0Za757F YMaa4K7bIPRAfOf8t782TZlqLQ5VtECUh3zh8wMb3d0YztQNwSAOfDWcsJ6XZo35Wrcast bv9wB+shYcRtutE2MdtpRiZPtcs7oX6upBs1T9w+UNlIXK9OIlY9V9ZiEi+dD3eEl9Kpnb gA4nnF7zO18+gfAOUr1pRJDrUrCDotXRPtSoY2deqaJ/uREIjgdvDtYUwc2Tcg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749661224; a=rsa-sha256; cv=none; b=whUFQ+FGNk4VvuMZvyrYuI9o4dKTea+DfsVNZHvXlPYC67NywplPbKC8/NdX9y+FR2mUv/ ytbq8/r8eSIwR0/NjbPfr6habl0ocZ64yjXVDE9cScwCaBzrebLpXPBoHlqrTmQtHn5meS y2pmi0xrAe14tl1YXfwAAzI97nO+RoPN6IqsXDzmZDZ0lXZYzrGOuf3gPEg+ophkiIAPBQ YE3DhR6JcpcSoQtgqB3+K1LL4NMVDaCXiNj88QFa6A8MlaHDw9UWDUfxpCocOrMn0N3QTV 2pDgRXnqqVoSZ+4G1Sn6jmUZeqiZ/h+PjtZH3Qp731elF0VFoYVUQUW3/NN+LQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bHX3D2Prmzc2G; Wed, 11 Jun 2025 17:00:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55BH0O5I042685; Wed, 11 Jun 2025 17:00:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55BH0OXZ042682; Wed, 11 Jun 2025 17:00:24 GMT (envelope-from git) Date: Wed, 11 Jun 2025 17:00:24 GMT Message-Id: <202506111700.55BH0OXZ042682@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 2e783ea70a7a - main - stddef.h: don't include sys/cdefs.h List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2e783ea70a7a1aa0bec116451d70abd8cf05ce42 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=2e783ea70a7a1aa0bec116451d70abd8cf05ce42 commit 2e783ea70a7a1aa0bec116451d70abd8cf05ce42 Author: Brooks Davis AuthorDate: 2025-06-11 16:39:02 +0000 Commit: Brooks Davis CommitDate: 2025-06-11 16:39:02 +0000 stddef.h: don't include sys/cdefs.h Switch to sys/_visible.h for visibility macros. Prefer __builtin_offsetof over __offset. sys/cdefs.h always defines __offsetof to __builtin_offsetof so just use the latter to remove a dependency on sys/cdefs.h. Realistically, we're never going to care about a compiler that doesn't supply this builtin. Add a somewhat questionable guard around the offsetof() definition because the compiler no longer thinks it the same as a number of other redundent definitions scattered around (e.g., in the openzfs codebase). It is actually the same and those defintions likely shouldn't exist at all, but it's easy to add a guard for now. Reviewed by: imp Exp-run by: antoine (PR 286274) Pull Request: https://github.com/freebsd/freebsd-src/pull/1595 --- include/stddef.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/stddef.h b/include/stddef.h index 2255ea47a49a..3ba9a9946b01 100644 --- a/include/stddef.h +++ b/include/stddef.h @@ -32,9 +32,9 @@ #ifndef _STDDEF_H_ #define _STDDEF_H_ -#include #include #include +#include #ifndef _PTRDIFF_T_DECLARED typedef __ptrdiff_t ptrdiff_t; @@ -61,7 +61,9 @@ typedef __max_align_t max_align_t; #endif #endif -#define offsetof(type, field) __offsetof(type, field) +#ifndef offsetof +#define offsetof(type, field) __builtin_offsetof(type, field) +#endif #if __EXT1_VISIBLE /* ISO/IEC 9899:2011 K.3.3.2 */ From nobody Wed Jun 11 17:00:25 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHX3F4y6Bz5y9lK; Wed, 11 Jun 2025 17:00:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHX3F3Q8Bz3bM6; Wed, 11 Jun 2025 17:00:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749661225; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wslQNL+3kC0ODwkx/zZ1if7Db0+uCvaYnhawA3xljGM=; b=GWykXkOC+eZXxbhprB8Z1CPVoPldbp1n3dHKZgknc55U5cW4W9QzrvFoRNDJ31XZ9x/fBu 36zN9A0t6g+Dob99GPa0JGRZzgWGYSYMLdZb1jETxEVLbthVYZxD6MyL2qFuvS8sZ33z3J RgdXoEhmlsynOXLMDhBOR9ezVbgACvuMIDX8YLYZrvyRga1Xd9/VjgI2l8Gv09jYaoLzn6 tJ3pHEhzhbW7rkA/MnehegV4/U/3Xq9VWltur75Je8CHHOQtDTLWgHnHiTi8tkjdkXFQVc hXatiQDYCz+m/aNpkYOle87xrdo/ne1nIv0p4Pz8qi88ZCYjw4t4LHQXHKx0eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749661225; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wslQNL+3kC0ODwkx/zZ1if7Db0+uCvaYnhawA3xljGM=; b=qWA9T9a/blKi4O6gsfqgtVrPpsx1L294nfNBLnJMh8gpOy58uoQhdhDdrDkpCdNyU8FDyf TKcZL+kx9JN6lEsmETMuHxCjakczsG+WCJcbICjHUnduG0g5P1x4ok1PTSxvc59xtJUmY5 2zgvH01g5WuRKUT63gbkGvNcnT2JrCy1wlEYdkaLgu1Y59RbwCw/KaUCnqaE/Z/sRhbd6t PY6C4o8bFw5Bv9y21aDv49Y+HbIIYyYsB4qXCN/f9C05kA6F1HaGwe45vjwEVyHSLIziKK 8S/nIKOY5jb/kZahZDZIbWP5hPuH/vVsjU8YUzRJhzFnzN3Usph54qeFKt8Zew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749661225; a=rsa-sha256; cv=none; b=IrfUakQnPJhA47hYrDCjPNi2xWAzgxc5OsirON/aSJOLzVCniD5eoflmB6z6YqVn620tAE jcll7y7FyTdqr0qAEG2xVbQmy6/0qlCz7wjvA/o2l79yD3vcMMw7+z6aWtzY9DmVeKHDOs T+Q6Tc8BbR6j+wzuBjLdkQSFLOoupoiQb4WtyK30Pa078V5mOBC60AXFqKE1NqHA7hi6f1 4WziW3I2leBldCeZlZnumhHwR7pNlqoRYPo/WdlRKa75KRAhNSWdIYsJhtzyFpSIrOAPxs trcp7qWfjx3UDgK3Qwu/8Kw49upWmBAyyJIMm4O1wXU5ORvFzBlmO3y0QZrxVg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bHX3F2wS7zc00; Wed, 11 Jun 2025 17:00:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55BH0Pfo042719; Wed, 11 Jun 2025 17:00:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55BH0PPx042716; Wed, 11 Jun 2025 17:00:25 GMT (envelope-from git) Date: Wed, 11 Jun 2025 17:00:25 GMT Message-Id: <202506111700.55BH0PPx042716@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: c190cd94b7bf - main - sys/_stdarg.h: drop cdefs.h and _types.h polution List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c190cd94b7bff590b06db906c56789525a991ece Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=c190cd94b7bff590b06db906c56789525a991ece commit c190cd94b7bff590b06db906c56789525a991ece Author: Brooks Davis AuthorDate: 2025-06-11 16:39:02 +0000 Commit: Brooks Davis CommitDate: 2025-06-11 16:39:02 +0000 sys/_stdarg.h: drop cdefs.h and _types.h polution Rely in sys/_visible for visibility macros and use __buitin_va_list instead of __va_list everywere we declare va_list. Reviewed by: imp Exp-run by: antoine (PR 286274) Pull Request: https://github.com/freebsd/freebsd-src/pull/1595 --- include/stdio.h | 2 +- include/wchar.h | 2 +- sys/sys/_stdarg.h | 7 +++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/include/stdio.h b/include/stdio.h index 3dedb8fd5a54..34e877b60c14 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -74,7 +74,7 @@ typedef __off64_t off64_t; #if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE #ifndef _VA_LIST_DECLARED -typedef __va_list va_list; +typedef __builtin_va_list va_list; #define _VA_LIST_DECLARED #endif #endif diff --git a/include/wchar.h b/include/wchar.h index e4b037c9b16f..bf07062935d5 100644 --- a/include/wchar.h +++ b/include/wchar.h @@ -78,7 +78,7 @@ typedef __size_t size_t; #if __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE #ifndef _VA_LIST_DECLARED -typedef __va_list va_list; +typedef __builtin_va_list va_list; #define _VA_LIST_DECLARED #endif #endif diff --git a/sys/sys/_stdarg.h b/sys/sys/_stdarg.h index 063e59dc83f6..3886f4632b10 100644 --- a/sys/sys/_stdarg.h +++ b/sys/sys/_stdarg.h @@ -31,12 +31,11 @@ #ifndef _SYS__STDARG_H_ #define _SYS__STDARG_H_ -#include -#include +#include #ifndef _VA_LIST_DECLARED - #define _VA_LIST_DECLARED - typedef __va_list va_list; +#define _VA_LIST_DECLARED +typedef __builtin_va_list va_list; #endif #define va_start(ap, last) __builtin_va_start((ap), (last)) From nobody Wed Jun 11 17:00:26 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHX3H12hkz5y9Zh; Wed, 11 Jun 2025 17:00:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHX3G4P8Jz3bQx; Wed, 11 Jun 2025 17: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=1749661226; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RNU7plgPDzry0woyIooZkXtyvBbrIAgFtpZFCW4HqQc=; b=cm8RVG+/2ukGvahWqfjR+1FnLVU4GiSeD2wo9ITxsgu6lVJYYUbA+ZVatTVCzbLarqGZCW M6pwWX4Qim2Z0GOwxUSembycHiJMJ8H2BXBvYfQk8gntHn2upoidcpGR3I95p/5p86a7eU NsslZUqOijCbe7JxiaZOmsCcKMRPxY9kxtG9yq+FHCzyZS2yfTNxFJ5Jf38jn3fWPZ2iKQ PZTY1a75A5dm8W/96JJBjB9lxnka2HPxXDuWzyOOOood/0146fxxJ9HOyhtXxRjn6V9wWf l612UzlRdjt2N0vOT/7HBMJ8DBOAglt5MGT1EiEf3pRVGhyakNZkHelYxGzbpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749661226; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RNU7plgPDzry0woyIooZkXtyvBbrIAgFtpZFCW4HqQc=; b=XTCcUsEGHZ+KRpL+Iqb7Tz0mabpw10stoXA/NmTFWRxfDKB11iq0EX4KPBimmkYARdXm0Q EdSbFvHTvHomj36Xjvtb8NOrk5FYD6SxDIghMRbr82XhzP4ybbUY5IwHVeGZCaT46teS7q GnDbPSbcUvqHrvCJ/g0uL5a9dwaRp+7mAJQ1I0/Aqp+U9IYhmKFswZWIZilrXq78tdlvNU URgOF5K8WUTwwepdzYS+VhAc9LzdNeO9IeByNF+3dd3Vx+5oa1ARy1ordCb2lE+jhBnyAQ +BS9TdB1b0PTWEPmLXi9n2y1rv+Cw++CAGeJ0D6mOOjR4U0XQjibZE9OEjW4Aw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749661226; a=rsa-sha256; cv=none; b=bCj5M8N2AU7Uz/9g43Ym5NocQS3A3STMHxpWpjHkl37oDxnIBh3o7SDjfxr8/INSssxFEk xqFaM2u0M6LggKgu2tgap9ZKyWw9kOD9Ec+9U4fbX5lF6Xzvn/hAfK79yGY+3/hQ7A5ysD vqqrSm6YfSXq6Tr2j9CLO41wSq6n2YpOKFxRWfAcJ5TDbG1+d84p9nYH8NPJDdFJtjRHS3 zWN5w3AWpOO4e1RIMdRilE6qgdjnqbPqQfU8oTAZnXIi6YjeUiu4SYEtAqfFPjQk6ixLMb dTR85QRp6tCI/jFVDiybDms9lCAN0PPVdbcMgkgoqiQP0VAPRYSSjv8FhrW9KA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bHX3G3v4hzc01; Wed, 11 Jun 2025 17:00:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55BH0Qm6042752; Wed, 11 Jun 2025 17:00:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55BH0Qu2042749; Wed, 11 Jun 2025 17:00:26 GMT (envelope-from git) Date: Wed, 11 Jun 2025 17:00:26 GMT Message-Id: <202506111700.55BH0Qu2042749@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 2d92a5abefc9 - main - Add sys/stdarg.h List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2d92a5abefc9cf6aa81fb7d23f8fcca4f1d6026d Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=2d92a5abefc9cf6aa81fb7d23f8fcca4f1d6026d commit 2d92a5abefc9cf6aa81fb7d23f8fcca4f1d6026d Author: Brooks Davis AuthorDate: 2025-06-11 16:39:02 +0000 Commit: Brooks Davis CommitDate: 2025-06-11 16:39:02 +0000 Add sys/stdarg.h While the type of va_list and implementation of va_*() psuedo functions varies (sometimes greatly) by architecture, they will always be defined by the compiler in a consistant way that does not require machine dependent handling. MFC after: 1 week Reviewed by: imp Exp-run by: antoine (PR 286274) Pull Request: https://github.com/freebsd/freebsd-src/pull/1595 --- include/Makefile | 4 ++-- sys/sys/stdarg.h | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/Makefile b/include/Makefile index 09b16d1f029e..af7ef2337941 100644 --- a/include/Makefile +++ b/include/Makefile @@ -39,9 +39,9 @@ INCS= a.out.h ar.h assert.h bitstring.h byteswap.h \ .PATH: ${SRCTOP}/contrib/libc-vis INCS+= vis.h -MHDRS= float.h floatingpoint.h stdarg.h +MHDRS= float.h floatingpoint.h -PHDRS= _semaphore.h +PHDRS= _semaphore.h stdarg.h LHDRS= aio.h errno.h fcntl.h linker_set.h poll.h stdatomic.h stdint.h \ syslog.h ucontext.h diff --git a/sys/sys/stdarg.h b/sys/sys/stdarg.h new file mode 100644 index 000000000000..d9266d12c7e1 --- /dev/null +++ b/sys/sys/stdarg.h @@ -0,0 +1,6 @@ +#ifndef __SYS_STDARG_H__ +#define __SYS_STDARG_H__ + +#include + +#endif /* __SYS_STDARG_H__ */ From nobody Wed Jun 11 17:00:27 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHX3J2ZYQz5y9CQ; Wed, 11 Jun 2025 17:00:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHX3H6R8cz3bDN; Wed, 11 Jun 2025 17: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=1749661227; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FtXED/t3wHvXJRamXZdhEHe9RiNDpA03BtFqNHlYp64=; b=RU7n2PHNu/poCSn4jkZlSdzJItt25Plp+pwzL4gHBMJKOaHU2KwGCpgkL7cdiOAgykZ4ow W9HjpINe+U6dGsFCRKuUH3WqWjHkknnES0mExh6mUSfF9BaEErnlrEFG4L1dCxOswMnc4w aiNJpAp4YfYB72rnd6gaXN12Tx/Ybf6cGU4carhIxBVzVvKYFnCQ7pzilUjD/JTWBKJ0Lj Hmhs8DSY0hFEUikXwNaGz28sWFtb3Wa9FJMm2xzsQ/mCzfj/DeeKB8Wl/hvErIIUpfa9PU 7s9NhpKQKLJBc7+7vgFzSkVUk/pN+K4yIluY/5+lGB/S0EjOfaWS9Jq3JxeO/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749661227; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FtXED/t3wHvXJRamXZdhEHe9RiNDpA03BtFqNHlYp64=; b=rdhLNbc1xdbrH5utcT3Cr+DKKwxPrIIyuGRh/lOSbP0AkmWwK61tRj0MbwpvDsJY81zIcm xJDJEYSlKpmsk7hhl5YX59KEViqO4oaVC0CPJr/3T633/YJviCCNR/wXPvBWjDe67qJTGL ZvJsUpqyigFnb2yCDTR0j8qgVOxWMM/knohTSVtrRpTOg2NFzDQP8GlsOmKaI+4t82lepz JEJRvtXcNOvVu1ni1kljC/9qWHYb0Izqc2TcAnP6nCWTCNjEWEmli7jNhEus2GpzQYXwQC o68YLPbE/AyctwGiXUKUhSE6h7SsA9qmrcdxTfvOmuZ9Hp7E5KYCKv1zApnWAw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749661227; a=rsa-sha256; cv=none; b=AM9b89CMSVRT+euV6FPhlJMH2XUSB1rP9EfE3JPIP/4Xi/FEOvojwovgRl1+tPNouWzCg2 WhUmF1Ol0jcle5li6Yi7l2afwnIltbel/4TshGGP0HXIfuxT5kgKMldWfO7WmWhw9xQXU7 8DesZRm3/ZtQNhy0fvAJjiJFWEd3VVAXPLIHcQqGyrdgSosmcsf63Tw/DJT/oQRIqA9HVO 0FdSARk1D4yqQ/i2ZepbEYDYf6kKxMeT4EkloVP/HDQ+A8au8zJDKM4+CSQGXBdNVM1MZ8 6YzlTsbQE6ZZ3wHA55SY71m+WK/POHTJoHRnVOqPkeA1tFi5yg4PCRBHQ2iOsg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bHX3H5vTdzc02; Wed, 11 Jun 2025 17:00:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55BH0RYb042792; Wed, 11 Jun 2025 17:00:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55BH0Rct042788; Wed, 11 Jun 2025 17:00:27 GMT (envelope-from git) Date: Wed, 11 Jun 2025 17:00:27 GMT Message-Id: <202506111700.55BH0Rct042788@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: e453e498cbb8 - main - machine/stdarg.h -> sys/stdarg.h List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e453e498cbb88570a3ff7b3679de65c88707da95 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=e453e498cbb88570a3ff7b3679de65c88707da95 commit e453e498cbb88570a3ff7b3679de65c88707da95 Author: Brooks Davis AuthorDate: 2025-06-11 16:39:02 +0000 Commit: Brooks Davis CommitDate: 2025-06-11 16:39:02 +0000 machine/stdarg.h -> sys/stdarg.h Switch to using sys/stdarg.h for va_list type and va_* builtins. Make an attempt to insert the include in a sensible place. Where style(9) was followed this is easy, where it was ignored, aim for the first block of sys/*.h headers and don't get too fussy or try to fix other style bugs. Reviewed by: imp Exp-run by: antoine (PR 286274) Pull Request: https://github.com/freebsd/freebsd-src/pull/1595 --- share/man/man9/PCI_IOV_ADD_VF.9 | 2 +- share/man/man9/PCI_IOV_INIT.9 | 2 +- share/man/man9/pci_iov_schema.9 | 2 +- stand/common/dev_net.c | 3 ++- stand/common/md.c | 2 +- stand/efi/boot1/boot1.c | 4 +++- stand/efi/boot1/proto.c | 4 +++- stand/efi/gptboot/proto.c | 4 +++- stand/i386/libi386/biosacpi.c | 2 +- stand/i386/libi386/biospci.c | 2 +- stand/i386/libi386/biospnp.c | 2 +- stand/liblua/lstd.h | 2 +- stand/libofw/ofw_disk.c | 3 +-- stand/libofw/openfirm.c | 3 +-- stand/libsa/Makefile | 2 +- stand/libsa/panic.c | 2 +- stand/libsa/printf.c | 7 +------ stand/powerpc/boot1.chrp/boot1.c | 4 +++- stand/uboot/uboot_disk.c | 3 ++- sys/amd64/linux/linux_vdso_gtod.c | 2 +- sys/amd64/linux32/linux32_vdso_gtod.c | 2 +- sys/arm/ti/cpsw/if_cpsw.c | 2 +- sys/arm/xilinx/zy7_devcfg.c | 2 +- sys/arm/xilinx/zy7_ehci.c | 2 +- sys/arm/xilinx/zy7_gpio.c | 2 +- sys/arm/xilinx/zy7_qspi.c | 2 +- sys/arm/xilinx/zy7_slcr.c | 2 +- sys/arm/xilinx/zy7_spi.c | 2 +- sys/arm64/linux/linux_vdso_gtod.c | 2 +- sys/arm64/qoriq/qoriq_gpio_pic.c | 2 +- sys/cam/ata/ata_xpt.c | 2 +- sys/cam/cam_xpt.c | 2 +- sys/cam/ctl/ctl_error.c | 2 +- sys/cam/ctl/ctl_error.h | 2 +- sys/cam/mmc/mmc_xpt.c | 2 +- sys/cam/nvme/nvme_xpt.c | 2 +- sys/cam/scsi/scsi_all.h | 2 +- sys/cam/scsi/scsi_enc.c | 3 +-- sys/cam/scsi/scsi_xpt.c | 2 +- sys/cddl/compat/opensolaris/kern/opensolaris_string.c | 2 +- sys/cddl/compat/opensolaris/sys/cmn_err.h | 2 +- sys/cddl/compat/opensolaris/sys/varargs.h | 2 +- sys/cddl/dev/fbt/fbt.c | 2 +- sys/cddl/dev/profile/profile.c | 2 +- sys/cddl/dev/systrace/systrace.c | 3 +-- sys/compat/linux/linux_util.c | 3 +-- sys/compat/linuxkpi/common/include/linux/kmod.h | 2 +- sys/compat/linuxkpi/common/include/linux/kobject.h | 2 +- sys/compat/linuxkpi/common/include/linux/stdarg.h | 2 +- sys/compat/linuxkpi/common/include/stdarg.h | 2 +- sys/compat/linuxkpi/common/src/linux_compat.c | 3 +-- sys/compat/linuxkpi/common/src/linux_idr.c | 3 +-- sys/compat/linuxkpi/common/src/linux_pci.c | 2 +- sys/contrib/dev/acpica/include/platform/acfreebsd.h | 2 +- sys/contrib/libnv/bsd_nvpair.c | 3 +-- sys/contrib/libnv/cnvlist.c | 3 +-- sys/contrib/libnv/dnvlist.c | 3 +-- sys/contrib/libnv/nvlist.c | 3 +-- sys/contrib/ncsw/inc/stdarg_ext.h | 2 +- sys/contrib/ncsw/user/env/xx.c | 2 +- sys/contrib/openzfs/module/os/freebsd/spl/spl_string.c | 2 +- sys/contrib/rdma/krping/krping_dev.c | 2 +- sys/contrib/vchiq/interface/compat/vchi_bsd.c | 3 +-- sys/ddb/db_output.c | 3 +-- sys/ddb/db_pprint.c | 3 +-- sys/dev/aacraid/aacraid_debug.c | 3 +-- sys/dev/ahci/ahci.c | 2 +- sys/dev/ahci/ahci_pci.c | 2 +- sys/dev/ahci/ahciem.c | 2 +- sys/dev/ata/ata-all.c | 2 +- sys/dev/ata/ata-isa.c | 2 +- sys/dev/ata/ata-pci.c | 5 ++++- sys/dev/ata/ata-sata.c | 2 +- sys/dev/ata/chipsets/ata-acard.c | 2 +- sys/dev/ata/chipsets/ata-acerlabs.c | 2 +- sys/dev/ata/chipsets/ata-amd.c | 2 +- sys/dev/ata/chipsets/ata-ati.c | 2 +- sys/dev/ata/chipsets/ata-cenatek.c | 2 +- sys/dev/ata/chipsets/ata-cypress.c | 2 +- sys/dev/ata/chipsets/ata-cyrix.c | 2 +- sys/dev/ata/chipsets/ata-highpoint.c | 2 +- sys/dev/ata/chipsets/ata-intel.c | 2 +- sys/dev/ata/chipsets/ata-ite.c | 2 +- sys/dev/ata/chipsets/ata-jmicron.c | 2 +- sys/dev/ata/chipsets/ata-marvell.c | 2 +- sys/dev/ata/chipsets/ata-micron.c | 2 +- sys/dev/ata/chipsets/ata-national.c | 2 +- sys/dev/ata/chipsets/ata-netcell.c | 2 +- sys/dev/ata/chipsets/ata-nvidia.c | 2 +- sys/dev/ata/chipsets/ata-promise.c | 2 +- sys/dev/ata/chipsets/ata-serverworks.c | 2 +- sys/dev/ata/chipsets/ata-siliconimage.c | 2 +- sys/dev/ata/chipsets/ata-sis.c | 2 +- sys/dev/ata/chipsets/ata-via.c | 2 +- sys/dev/ath/ah_osdep.c | 3 +-- sys/dev/bhnd/nvram/bhnd_nvram_private.h | 3 +-- sys/dev/bhnd/nvram/bhnd_nvram_value.h | 2 +- sys/dev/etherswitch/e6000sw/e6000sw.c | 2 +- sys/dev/fdc/fdc.c | 2 +- sys/dev/filemon/filemon_wrapper.c | 3 +-- sys/dev/gpio/qoriq_gpio.c | 2 +- sys/dev/hpt27xx/os_bsd.h | 2 +- sys/dev/hptiop/hptiop.c | 2 +- sys/dev/hptmv/hptproc.c | 2 +- sys/dev/hptnr/os_bsd.h | 2 +- sys/dev/hptrr/os_bsd.h | 2 +- sys/dev/hyperv/vmbus/vmbus_chan.c | 2 +- sys/dev/iavf/iavf_iflib.h | 2 +- sys/dev/iavf/iavf_lib.h | 2 +- sys/dev/iavf/iavf_osdep.c | 2 +- sys/dev/ice/ice_osdep.c | 2 +- sys/dev/iicbus/controller/cadence/cdnc_i2c.c | 2 +- sys/dev/ioat/ioat.c | 2 +- sys/dev/ioat/ioat_test.c | 2 +- sys/dev/isci/isci_logger.c | 2 +- sys/dev/isp/isp_freebsd.h | 2 +- sys/dev/ixl/ixl.h | 2 +- sys/dev/mpi3mr/mpi3mr_cam.c | 3 +-- sys/dev/mpr/mpr_sas.c | 3 +-- sys/dev/mpr/mpr_sas_lsi.c | 3 +-- sys/dev/mps/mps_sas.c | 3 +-- sys/dev/mps/mps_sas_lsi.c | 3 +-- sys/dev/mpt/mpt_debug.c | 2 +- sys/dev/mpt/mpt_raid.c | 3 +-- sys/dev/mvs/mvs.c | 2 +- sys/dev/mvs/mvs_pci.c | 2 +- sys/dev/mvs/mvs_soc.c | 2 +- sys/dev/nvme/nvme_ctrlr.c | 2 +- sys/dev/nvmf/host/nvmf_ns.c | 2 +- sys/dev/ocs_fc/ocs_os.h | 2 +- sys/dev/ofw/ofw_fdt.c | 3 +-- sys/dev/ofw/ofw_standard.c | 3 +-- sys/dev/ofw/openfirm.c | 3 +-- sys/dev/pci/pci.c | 2 +- sys/dev/pci/pci_iov.c | 2 +- sys/dev/pci/pci_iov_schema.c | 3 +-- sys/dev/ppbus/ppb_msq.c | 2 +- sys/dev/proto/proto_core.c | 2 +- sys/dev/pst/pst-iop.c | 2 +- sys/dev/pst/pst-pci.c | 2 +- sys/dev/pst/pst-raid.c | 2 +- sys/dev/qat/qat_api/qat_utils/src/QatUtilsServices.c | 2 +- sys/dev/random/fenestrasX/fx_rng.c | 2 +- sys/dev/rndtest/rndtest.c | 2 +- sys/dev/sdhci/sdhci.c | 2 +- sys/dev/siis/siis.c | 2 +- sys/dev/superio/superio.c | 2 +- sys/dev/syscons/syscons.c | 2 +- sys/dev/uart/uart_core.c | 2 +- sys/dev/uart/uart_tty.c | 2 +- sys/dev/usb/usb_dev.c | 3 +-- sys/dev/virtio/scsi/virtio_scsi.c | 3 +-- sys/dev/xen/bus/xen_intr.c | 2 +- sys/dev/xen/console/xen_console.c | 3 +-- sys/dev/xen/xenpci/xenpci.c | 3 +-- sys/dev/xen/xenstore/xenstore.c | 3 +-- sys/fs/nfsclient/nfs_clsubs.c | 7 +------ sys/fs/p9fs/p9_client.h | 2 +- sys/geom/geom_ctl.c | 3 +-- sys/geom/geom_dev.c | 2 +- sys/geom/geom_dump.c | 2 +- sys/geom/geom_event.c | 3 +-- sys/geom/geom_io.c | 2 +- sys/geom/geom_slice.c | 2 +- sys/geom/geom_subr.c | 2 +- sys/i386/i386/bios.c | 2 +- sys/i386/linux/linux_vdso_gtod.c | 2 +- sys/isa/pnpparse.c | 3 +-- sys/kern/kern_boottrace.c | 3 +-- sys/kern/kern_conf.c | 2 +- sys/kern/kern_devctl.c | 2 +- sys/kern/kern_fail.c | 2 +- sys/kern/kern_intr.c | 2 +- sys/kern/kern_kthread.c | 3 +-- sys/kern/kern_shutdown.c | 7 +------ sys/kern/kern_ubsan.c | 2 +- sys/kern/subr_bus.c | 2 +- sys/kern/subr_capability.c | 2 +- sys/kern/subr_epoch.c | 2 +- sys/kern/subr_gtaskqueue.c | 2 +- sys/kern/subr_intr.c | 2 +- sys/kern/subr_msan.c | 2 +- sys/kern/subr_prf.c | 6 +----- sys/kern/subr_sbuf.c | 2 +- sys/kern/subr_scanf.c | 7 +------ sys/kern/subr_taskqueue.c | 2 +- sys/kern/subr_terminal.c | 3 +-- sys/kern/subr_witness.c | 3 +-- sys/kern/tty.c | 3 +-- sys/kern/tty_pts.c | 3 +-- sys/kern/vfs_mount.c | 3 +-- sys/kern/vfs_subr.c | 3 +-- sys/kern/vfs_syscalls.c | 3 +-- sys/libkern/asprintf.c | 3 +-- sys/net/ieee8023ad_lacp.c | 2 +- sys/net/if.c | 2 +- sys/net/if_stf.c | 3 +-- sys/net/route/fib_algo.c | 3 +-- sys/net/vnet.c | 3 +-- sys/net80211/ieee80211.c | 3 +-- sys/net80211/ieee80211_freebsd.c | 3 +-- sys/net80211/ieee80211_input.c | 2 +- sys/netgraph/ng_parse.c | 3 +-- sys/netinet/libalias/alias_db.c | 2 +- sys/netinet/libalias/alias_sctp.c | 2 +- sys/netinet/raw_ip.c | 2 +- sys/netinet6/raw_ip6.c | 3 +-- sys/netipsec/ipsec_input.c | 2 +- sys/netipsec/ipsec_offload.c | 3 +-- sys/netipsec/key.c | 2 +- sys/netipsec/keysock.c | 3 +-- sys/netlink/netlink_message_parser.c | 3 +-- sys/powerpc/mpc85xx/mpc85xx_gpio.c | 2 +- sys/powerpc/ofw/ofw_real.c | 2 +- sys/powerpc/ofw/rtas.c | 2 +- sys/powerpc/powermac/ata_dbdma.c | 2 +- sys/powerpc/powermac/ata_kauai.c | 2 +- sys/powerpc/powermac/ata_macio.c | 2 +- sys/powerpc/psim/ata_iobus.c | 2 +- sys/rpc/rpcsec_gss/rpcsec_gss_prot.c | 2 +- sys/security/audit/audit_worker.c | 3 +-- sys/security/mac_do/mac_do.c | 3 +-- sys/tests/ktest.c | 2 +- sys/x86/x86/ucode.c | 2 +- sys/xen/xenbus/xenbus.c | 3 +-- sys/xen/xenbus/xenbusb.c | 3 +-- sys/xen/xenbus/xenbusb_back.c | 3 +-- sys/xen/xenbus/xenbusb_front.c | 3 +-- sys/xen/xenbus/xenbusvar.h | 3 +-- sys/xen/xenstore/xenstorevar.h | 3 +-- tools/tools/vhba/vhba.h | 2 +- tools/uma/smrstress/smrstress.c | 3 +-- 232 files changed, 245 insertions(+), 321 deletions(-) diff --git a/share/man/man9/PCI_IOV_ADD_VF.9 b/share/man/man9/PCI_IOV_ADD_VF.9 index d13cb6e1ddc9..512b0b8668cc 100644 --- a/share/man/man9/PCI_IOV_ADD_VF.9 +++ b/share/man/man9/PCI_IOV_ADD_VF.9 @@ -31,7 +31,7 @@ .Nd inform a PF driver that a VF is being created .Sh SYNOPSIS .In sys/bus.h -.In machine/stdarg.h +.In sys/stdarg.h .In sys/nv.h .In dev/pci/pci_iov.h .Ft int diff --git a/share/man/man9/PCI_IOV_INIT.9 b/share/man/man9/PCI_IOV_INIT.9 index 66b1e693cedb..8ce94800f6d1 100644 --- a/share/man/man9/PCI_IOV_INIT.9 +++ b/share/man/man9/PCI_IOV_INIT.9 @@ -31,7 +31,7 @@ .Nd enable SR-IOV on a PF device .Sh SYNOPSIS .In sys/bus.h -.In machine/stdarg.h +.In sys/stdarg.h .In sys/nv.h .In dev/pci/pci_iov.h .Ft int diff --git a/share/man/man9/pci_iov_schema.9 b/share/man/man9/pci_iov_schema.9 index 764d357fbaee..99589b59fb91 100644 --- a/share/man/man9/pci_iov_schema.9 +++ b/share/man/man9/pci_iov_schema.9 @@ -38,7 +38,7 @@ .Nm pci_iov_schema_add_unicast_mac .Nd PCI SR-IOV config schema interface .Sh SYNOPSIS -.In machine/stdarg.h +.In sys/stdarg.h .In sys/nv.h .In sys/iov_schema.h .Ft nvlist_t * diff --git a/stand/common/dev_net.c b/stand/common/dev_net.c index 3cd78c5346ac..fc6b43ec7a40 100644 --- a/stand/common/dev_net.c +++ b/stand/common/dev_net.c @@ -47,9 +47,10 @@ * for use by the NFS open code (NFS/lookup). */ -#include #include #include +#include + #include #include #include diff --git a/stand/common/md.c b/stand/common/md.c index d12429c3c45c..2c3eb5ded19b 100644 --- a/stand/common/md.c +++ b/stand/common/md.c @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include "bootstrap.h" diff --git a/stand/efi/boot1/boot1.c b/stand/efi/boot1/boot1.c index 908baf400972..b93c6b425160 100644 --- a/stand/efi/boot1/boot1.c +++ b/stand/efi/boot1/boot1.c @@ -20,8 +20,10 @@ */ #include +#include + #include -#include + #include #include diff --git a/stand/efi/boot1/proto.c b/stand/efi/boot1/proto.c index 6660d39a921b..f81debd168b9 100644 --- a/stand/efi/boot1/proto.c +++ b/stand/efi/boot1/proto.c @@ -20,8 +20,10 @@ */ #include +#include + #include -#include + #include #include diff --git a/stand/efi/gptboot/proto.c b/stand/efi/gptboot/proto.c index e2face6c23e5..a1825d9c1c15 100644 --- a/stand/efi/gptboot/proto.c +++ b/stand/efi/gptboot/proto.c @@ -24,8 +24,10 @@ */ #include +#include + #include -#include + #include #include diff --git a/stand/i386/libi386/biosacpi.c b/stand/i386/libi386/biosacpi.c index 077b6c7e53de..8ddd322b9f99 100644 --- a/stand/i386/libi386/biosacpi.c +++ b/stand/i386/libi386/biosacpi.c @@ -25,7 +25,7 @@ */ #include -#include +#include #include #include #include "libi386.h" diff --git a/stand/i386/libi386/biospci.c b/stand/i386/libi386/biospci.c index 5b39eab1e5e5..a89a6d30a1e8 100644 --- a/stand/i386/libi386/biospci.c +++ b/stand/i386/libi386/biospci.c @@ -31,7 +31,7 @@ */ #include -#include +#include #include #include #include diff --git a/stand/i386/libi386/biospnp.c b/stand/i386/libi386/biospnp.c index 5b22f066d4ef..c01d2888a9f7 100644 --- a/stand/i386/libi386/biospnp.c +++ b/stand/i386/libi386/biospnp.c @@ -29,7 +29,7 @@ */ #include -#include +#include #include #include #include diff --git a/stand/liblua/lstd.h b/stand/liblua/lstd.h index ce3aef4bc5fc..2b601f129566 100644 --- a/stand/liblua/lstd.h +++ b/stand/liblua/lstd.h @@ -29,10 +29,10 @@ #include #include +#include #include #include #include -#include /* * Mini stdio FILE and DIR routines. These are the minimal routines needed by diff --git a/stand/libofw/ofw_disk.c b/stand/libofw/ofw_disk.c index fc4c25bd9424..d4bce64d9be5 100644 --- a/stand/libofw/ofw_disk.c +++ b/stand/libofw/ofw_disk.c @@ -28,11 +28,10 @@ */ #include +#include #include -#include - #include #include diff --git a/stand/libofw/openfirm.c b/stand/libofw/openfirm.c index 58e7d8cbe755..1df65784e47a 100644 --- a/stand/libofw/openfirm.c +++ b/stand/libofw/openfirm.c @@ -56,8 +56,7 @@ */ #include - -#include +#include #include diff --git a/stand/libsa/Makefile b/stand/libsa/Makefile index 42ef3e69c18a..f5a1acea843e 100644 --- a/stand/libsa/Makefile +++ b/stand/libsa/Makefile @@ -209,8 +209,8 @@ beforedepend: for i in ${SAFE_INCS}; do \ ln -sf ${SRCTOP}/include/$$i $$i; \ done; \ - ln -sf ${SYSDIR}/${MACHINE}/include/stdarg.h stdarg.h; \ ln -sf ${SYSDIR}/sys/errno.h errno.h; \ + ln -sf ${SYSDIR}/sys/stdarg.h stdarg.h; \ ln -sf ${SYSDIR}/sys/stdint.h stdint.h; \ ln -sf ${SRCTOP}/include/arpa/inet.h arpa/inet.h; \ ln -sf ${SRCTOP}/include/arpa/tftp.h arpa/tftp.h; \ diff --git a/stand/libsa/panic.c b/stand/libsa/panic.c index 319f08094d92..a555743f0414 100644 --- a/stand/libsa/panic.c +++ b/stand/libsa/panic.c @@ -34,7 +34,7 @@ */ #include -#include +#include /* * Boot loaders and other standalone programs that wish to have a diff --git a/stand/libsa/printf.c b/stand/libsa/printf.c index a84c5431f536..053b54d31eff 100644 --- a/stand/libsa/printf.c +++ b/stand/libsa/printf.c @@ -37,18 +37,13 @@ */ #include +#include #include #include #include #include #include "stand.h" -/* - * Note that stdarg.h and the ANSI style va_start macro is used for both - * ANSI and traditional C compilers. - */ -#include - #define MAXNBUF (sizeof(intmax_t) * CHAR_BIT + 1) typedef void (kvprintf_fn_t)(int, void *); diff --git a/stand/powerpc/boot1.chrp/boot1.c b/stand/powerpc/boot1.chrp/boot1.c index cdacb05c31ce..1a546f3473e2 100644 --- a/stand/powerpc/boot1.chrp/boot1.c +++ b/stand/powerpc/boot1.chrp/boot1.c @@ -18,9 +18,11 @@ #include #include #include +#include + #include -#include #include + #include #include "paths.h" diff --git a/stand/uboot/uboot_disk.c b/stand/uboot/uboot_disk.c index 4f7b6ba06942..1f75f0f6da3c 100644 --- a/stand/uboot/uboot_disk.c +++ b/stand/uboot/uboot_disk.c @@ -33,7 +33,8 @@ #include #include -#include +#include + #include #include "api_public.h" diff --git a/sys/amd64/linux/linux_vdso_gtod.c b/sys/amd64/linux/linux_vdso_gtod.c index 519ca2f2de93..abe42d51a3ac 100644 --- a/sys/amd64/linux/linux_vdso_gtod.c +++ b/sys/amd64/linux/linux_vdso_gtod.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #define _KERNEL #include @@ -36,7 +37,6 @@ #include #include -#include #include #include diff --git a/sys/amd64/linux32/linux32_vdso_gtod.c b/sys/amd64/linux32/linux32_vdso_gtod.c index ec5851c45c28..f32db30057d0 100644 --- a/sys/amd64/linux32/linux32_vdso_gtod.c +++ b/sys/amd64/linux32/linux32_vdso_gtod.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #define _KERNEL #include @@ -36,7 +37,6 @@ #include #include -#include #include #include diff --git a/sys/arm/ti/cpsw/if_cpsw.c b/sys/arm/ti/cpsw/if_cpsw.c index ea8f9c18490e..dc3d8b1f9023 100644 --- a/sys/arm/ti/cpsw/if_cpsw.c +++ b/sys/arm/ti/cpsw/if_cpsw.c @@ -59,11 +59,11 @@ #include #include #include +#include #include #include #include -#include #include #include diff --git a/sys/arm/xilinx/zy7_devcfg.c b/sys/arm/xilinx/zy7_devcfg.c index 6df0fba1f56a..41618225a566 100644 --- a/sys/arm/xilinx/zy7_devcfg.c +++ b/sys/arm/xilinx/zy7_devcfg.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -49,7 +50,6 @@ #include #include -#include #include #include diff --git a/sys/arm/xilinx/zy7_ehci.c b/sys/arm/xilinx/zy7_ehci.c index 545e2a9bce16..6d84ec751e08 100644 --- a/sys/arm/xilinx/zy7_ehci.c +++ b/sys/arm/xilinx/zy7_ehci.c @@ -45,10 +45,10 @@ #include #include #include +#include #include #include -#include #include #include diff --git a/sys/arm/xilinx/zy7_gpio.c b/sys/arm/xilinx/zy7_gpio.c index 091237014c6f..71b6fc3c0586 100644 --- a/sys/arm/xilinx/zy7_gpio.c +++ b/sys/arm/xilinx/zy7_gpio.c @@ -53,11 +53,11 @@ #include #include #include +#include #include #include #include -#include #include #include diff --git a/sys/arm/xilinx/zy7_qspi.c b/sys/arm/xilinx/zy7_qspi.c index 49d4cafd8d61..42091bc78619 100644 --- a/sys/arm/xilinx/zy7_qspi.c +++ b/sys/arm/xilinx/zy7_qspi.c @@ -42,11 +42,11 @@ #include #include #include +#include #include #include #include -#include #include #include diff --git a/sys/arm/xilinx/zy7_slcr.c b/sys/arm/xilinx/zy7_slcr.c index a46ccb59a07b..40bcff49162b 100644 --- a/sys/arm/xilinx/zy7_slcr.c +++ b/sys/arm/xilinx/zy7_slcr.c @@ -42,12 +42,12 @@ #include #include #include +#include #include #include #include #include -#include #include #include diff --git a/sys/arm/xilinx/zy7_spi.c b/sys/arm/xilinx/zy7_spi.c index bb5bb7f46767..636a40d729d6 100644 --- a/sys/arm/xilinx/zy7_spi.c +++ b/sys/arm/xilinx/zy7_spi.c @@ -34,11 +34,11 @@ #include #include #include +#include #include #include #include -#include #include #include diff --git a/sys/arm64/linux/linux_vdso_gtod.c b/sys/arm64/linux/linux_vdso_gtod.c index f7def68d88c4..203c76b6e3a9 100644 --- a/sys/arm64/linux/linux_vdso_gtod.c +++ b/sys/arm64/linux/linux_vdso_gtod.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #define _KERNEL #include @@ -36,7 +37,6 @@ #include #include -#include #include #include diff --git a/sys/arm64/qoriq/qoriq_gpio_pic.c b/sys/arm64/qoriq/qoriq_gpio_pic.c index ec84d2a14ae7..aca8b9daea13 100644 --- a/sys/arm64/qoriq/qoriq_gpio_pic.c +++ b/sys/arm64/qoriq/qoriq_gpio_pic.c @@ -34,11 +34,11 @@ #include #include #include +#include #include #include #include -#include #include #include diff --git a/sys/cam/ata/ata_xpt.c b/sys/cam/ata/ata_xpt.c index 61cffeda6f0c..e33e1fafa274 100644 --- a/sys/cam/ata/ata_xpt.c +++ b/sys/cam/ata/ata_xpt.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include @@ -57,7 +58,6 @@ #include #include #include -#include /* for xpt_print below */ struct ata_quirk_entry { struct scsi_inquiry_pattern inq_pat; diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index 8428125d5e99..38bc82c69aad 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -44,6 +44,7 @@ #include #include #include +#include #include #include @@ -68,7 +69,6 @@ #include #include -#include /* for xpt_print below */ /* Wild guess based on not wanting to grow the stack too much */ #define XPT_PRINT_MAXLEN 512 diff --git a/sys/cam/ctl/ctl_error.c b/sys/cam/ctl/ctl_error.c index d07541a1a986..debc6b1e29ee 100644 --- a/sys/cam/ctl/ctl_error.c +++ b/sys/cam/ctl/ctl_error.c @@ -49,8 +49,8 @@ #include #include #include +#include #include -#include #include #include diff --git a/sys/cam/ctl/ctl_error.h b/sys/cam/ctl/ctl_error.h index fb2113bef048..55fb8e30b5e8 100644 --- a/sys/cam/ctl/ctl_error.h +++ b/sys/cam/ctl/ctl_error.h @@ -39,7 +39,7 @@ * Author: Ken Merry */ -#include +#include #ifndef _CTL_ERROR_H_ #define _CTL_ERROR_H_ diff --git a/sys/cam/mmc/mmc_xpt.c b/sys/cam/mmc/mmc_xpt.c index b7f1e5bce868..138f96eaaa49 100644 --- a/sys/cam/mmc/mmc_xpt.c +++ b/sys/cam/mmc/mmc_xpt.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -58,7 +59,6 @@ #include #include -#include /* for xpt_print below */ #include /* for PRIu64 */ FEATURE(mmccam, "CAM-based MMC/SD/SDIO stack"); diff --git a/sys/cam/nvme/nvme_xpt.c b/sys/cam/nvme/nvme_xpt.c index bac9e6441040..f6667df07be0 100644 --- a/sys/cam/nvme/nvme_xpt.c +++ b/sys/cam/nvme/nvme_xpt.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -57,7 +58,6 @@ #include #include #include -#include /* for xpt_print below */ struct nvme_quirk_entry { u_int quirks; diff --git a/sys/cam/scsi/scsi_all.h b/sys/cam/scsi/scsi_all.h index 944f70e03da6..b6fb66beefcd 100644 --- a/sys/cam/scsi/scsi_all.h +++ b/sys/cam/scsi/scsi_all.h @@ -18,7 +18,7 @@ #ifdef _KERNEL #include -#include +#include #else #include #endif diff --git a/sys/cam/scsi/scsi_enc.c b/sys/cam/scsi/scsi_enc.c index 4415e940cd96..9705a0b890b4 100644 --- a/sys/cam/scsi/scsi_enc.c +++ b/sys/cam/scsi/scsi_enc.c @@ -39,14 +39,13 @@ #include #include #include +#include #include #include #include #include #include -#include - #include #include #include diff --git a/sys/cam/scsi/scsi_xpt.c b/sys/cam/scsi/scsi_xpt.c index 21cb6beaf1fb..2bb59cb2d92b 100644 --- a/sys/cam/scsi/scsi_xpt.c +++ b/sys/cam/scsi/scsi_xpt.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include @@ -59,7 +60,6 @@ #include #include #include -#include /* for xpt_print below */ struct scsi_quirk_entry { struct scsi_inquiry_pattern inq_pat; diff --git a/sys/cddl/compat/opensolaris/kern/opensolaris_string.c b/sys/cddl/compat/opensolaris/kern/opensolaris_string.c index ec088f216cb3..4c8eb533e930 100644 --- a/sys/cddl/compat/opensolaris/kern/opensolaris_string.c +++ b/sys/cddl/compat/opensolaris/kern/opensolaris_string.c @@ -26,7 +26,7 @@ #include #include #include -#include +#include #define IS_DIGIT(c) ((c) >= '0' && (c) <= '9') diff --git a/sys/cddl/compat/opensolaris/sys/cmn_err.h b/sys/cddl/compat/opensolaris/sys/cmn_err.h index 2623693ec8b7..b3ebf6414e8b 100644 --- a/sys/cddl/compat/opensolaris/sys/cmn_err.h +++ b/sys/cddl/compat/opensolaris/sys/cmn_err.h @@ -28,7 +28,7 @@ #define _OPENSOLARIS_SYS_CMN_ERR_H_ #include -#include +#include #ifdef __cplusplus extern "C" { diff --git a/sys/cddl/compat/opensolaris/sys/varargs.h b/sys/cddl/compat/opensolaris/sys/varargs.h index 9684502756cb..bede89fafa18 100644 --- a/sys/cddl/compat/opensolaris/sys/varargs.h +++ b/sys/cddl/compat/opensolaris/sys/varargs.h @@ -28,7 +28,7 @@ #define _OPENSOLARIS_SYS_VARARGS_H_ #ifdef _KERNEL -#include +#include #else #include #endif diff --git a/sys/cddl/dev/fbt/fbt.c b/sys/cddl/dev/fbt/fbt.c index 99a77ba65eb8..da9c4ee2ab76 100644 --- a/sys/cddl/dev/fbt/fbt.c +++ b/sys/cddl/dev/fbt/fbt.c @@ -49,12 +49,12 @@ #include #include #include +#include #include #include #include #include #include -#include #include #include diff --git a/sys/cddl/dev/profile/profile.c b/sys/cddl/dev/profile/profile.c index 3e106aab1c85..23a8c9256708 100644 --- a/sys/cddl/dev/profile/profile.c +++ b/sys/cddl/dev/profile/profile.c @@ -48,11 +48,11 @@ #include #include #include +#include #include #include #include #include -#include #include #include diff --git a/sys/cddl/dev/systrace/systrace.c b/sys/cddl/dev/systrace/systrace.c index c14a663d1995..d8fe1a6430c6 100644 --- a/sys/cddl/dev/systrace/systrace.c +++ b/sys/cddl/dev/systrace/systrace.c @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -54,8 +55,6 @@ *** 3126 LINES SKIPPED *** From nobody Wed Jun 11 17:05:47 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHX9h4ZQBz5yB5J for ; Wed, 11 Jun 2025 17:06:00 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHX9g6qHbz3f77 for ; Wed, 11 Jun 2025 17:05:59 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-3a507e88b0aso128219f8f.1 for ; Wed, 11 Jun 2025 10:05:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749661558; x=1750266358; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5acwD2pAooMtXbPq/ppU/UiUWcXHeAoC73xbEYn/6BY=; b=d2v9Qxb1RGXq28mpJDQI5hLcPiOF+2br1Z6wdsmSL1z6QeRHCOvWAZpOGk/7xgjHLg 0MOC+qqdWKyZj7zLM+CYZdmO45gp+vecp1gRfRNSYQss2OCkLXaBlxI+vqVKnLLwiNIN Wpgp8Cu0SC6OaV5sqosJZgLzf9UTGfSHpEmcZ+dYQInHtKQ8RO77ljei84AGzHGEPtMP tTuJ8XvhXj6kED23jVEIo4hpuYZjRKSj47CRM20m+aBpZOnp4Cb+HR/3+4Y4Brhui3kp bh7uEPdcJGE1gkN3NcjI7h+qmvMNAr4aqCQAZdM7IphjvYw4pgAOXSrciVMhSYRZo54t uUog== X-Forwarded-Encrypted: i=1; AJvYcCVeueJAG/E84dQM0CrJS8p/zjvwwb9RBnJraVtKDF6bc3Lnz2z7dHVhXPQeGrCDC5QEJcdqI4Do4p3SVqQw1PW2P1Iopg==@freebsd.org X-Gm-Message-State: AOJu0Yz10BwXZ5EBzU4H+8yyG0xwvhEoJoFDTgVGlw6vOP4EM7iIJRn1 HDmN22kqfQma/0/IXTGNYSFLZhiV2ALALbT6Qnm0BYJzIGb6vyTUlKrQn7XmWUtjvfFHSeH3LE9 3Eras X-Gm-Gg: ASbGnctAPbo6LvQKyuUk63tAzG3yZ8VxBFrdjv75OGexVD4OPLsloDrHeZteNBnRKxy TEDqHN7ZGXuG1r3iFI0jF3JVhkglVb+icOzk15efEYuO2TGXVaWgKluheRgGSLMigWk1PaKyEv6 VR+cUfvF0/peVx1L4lIhVWWI55MalwkENpufX2q18CGAZe1RzkzCBP0CNzAu1A9ocOhFmKuMU9w CNpUZeJw7uSNCIwzgMb6c6D0vbbvar6Wpiitmv+O2wwctTnbwjiKYsSTKYiC/DhyMaywQ4QW9qC i82jkp5GCcDbtXfEZmJq4FMCFpdLyQSgDf9XUzIJVUWdLxvjUYYgOAG2oSU08LueZ5justrmjIP N X-Google-Smtp-Source: AGHT+IGxtrFbUrYYjmUcYSX3FJBNE7TdYTOsE6d9v45+o6MP3MHbYUgClBItCMlI1Ie1/8nz6VnMLw== X-Received: by 2002:a05:6000:3104:b0:3a4:e75f:53f5 with SMTP id ffacd0b85a97d-3a5607c965emr132851f8f.35.1749661558005; Wed, 11 Jun 2025 10:05:58 -0700 (PDT) Received: from smtpclient.apple ([131.111.5.201]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a53244f516sm15814981f8f.74.2025.06.11.10.05.57 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Jun 2025 10:05:57 -0700 (PDT) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.600.51.1.1\)) Subject: Re: git: ab3d713e93dc - main - sys/_types.h: use builtins to for __max_align_t From: Jessica Clarke In-Reply-To: <202506111700.55BH0Ka6042574@gitrepo.freebsd.org> Date: Wed, 11 Jun 2025 18:05:47 +0100 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <37D99680-366D-4D11-BC19-B6D676FA1E22@freebsd.org> References: <202506111700.55BH0Ka6042574@gitrepo.freebsd.org> To: Brooks Davis X-Mailer: Apple Mail (2.3826.600.51.1.1) X-Rspamd-Queue-Id: 4bHX9g6qHbz3f77 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] On 11 Jun 2025, at 18:00, Brooks Davis wrote: >=20 > The branch main has been updated by brooks: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dab3d713e93dc1d322398657125071101= c08e2ce5 >=20 > commit ab3d713e93dc1d322398657125071101c08e2ce5 > Author: Brooks Davis > AuthorDate: 2025-06-11 16:39:01 +0000 > Commit: Brooks Davis > CommitDate: 2025-06-11 16:39:01 +0000 >=20 > sys/_types.h: use builtins to for __max_align_t >=20 > Use __attribute__((__aligned__(x))) and __alignof__(x) in places of = local > macros that ultimately wrap these. We don't support compilers that = don't > define these so there's little loss of generality. >=20 > This mirrors Clang's stddef.h. >=20 > Reviewed by: imp > Exp-run by: antoine (PR 286274) > Pull Request: https://github.com/freebsd/freebsd-src/pull/1595 > --- > sys/sys/_types.h | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) >=20 > diff --git a/sys/sys/_types.h b/sys/sys/_types.h > index c84b84edd2b8..f6d1f26551e0 100644 > --- a/sys/sys/_types.h > +++ b/sys/sys/_types.h > @@ -181,9 +181,11 @@ typedef __uint_least32_t __char32_t; > #endif >=20 > typedef struct { > - long long __max_align1 __aligned(_Alignof(long long)); > + long long __max_align1 > + __attribute__((__aligned__(__alignof__(long long)))); > #ifndef _STANDALONE > - long double __max_align2 __aligned(_Alignof(long double)); > + long double __max_align2 > + __attribute__((__aligned__(__alignof__(long long)))); > #endif > } __max_align_t; >=20 _Alignof is the standard C spelling of it. We should be adopting the standard names for things more, polyfilling with GNU macros when not available, not increasing our use of old GNU C equivalents that predate their additions to the standard. This should really be _Alignas(_Alignof(...)). Jess From nobody Wed Jun 11 17:08:11 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHXDT0DhMz5yBLm for ; Wed, 11 Jun 2025 17:08:25 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHXDS4QhRz3fkL for ; Wed, 11 Jun 2025 17:08:24 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-3a5257748e1so92686f8f.2 for ; Wed, 11 Jun 2025 10:08:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749661703; x=1750266503; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6BYhsnkdkOPW7JjrUxisLuMyBW8V13cf/aMmGgIX8hc=; b=ODqjPEe3EvlAHWG155joTKA8bChJvQQBG7z0hwGWHjUlv2XYkWrG+MNhHYBlCD93W2 ItAOT4evikY4gbO2du65xjoltbCRfGx8m+TfNNa0l1erIfGNxTkPSjBbo46WZQogk/sZ n8fKqiXKPtcV4snukiuY8bj4dJiGd6uWagu7AaBOea/6wWgGRDPZ9uvjVv7J5sgZ/68e KnX96WRHHdcciAd19GbaK+2Dan23THXYmN1IUU+WD3/LVNKP/O3r519uLvUXBqe9Uxxn rvUQ0o1e27bzcYi8bOhCBx/cZQymmFBvH5ptHAxa/LUxUHyZN7NSQ0mslGUdLVD/ki4c CP+g== X-Forwarded-Encrypted: i=1; AJvYcCVGgUQXHGl4vwAPffFoVERFIhiVAPBjwt1td2tmVN7bmr1q6zMrf/Yru97IiLHLnB3ZckA1g13xi3ukRXdU5ZOHfk9CQw==@freebsd.org X-Gm-Message-State: AOJu0YzFl+UcpGTG3JVFrfULX+rUOUbqIgYYwnNLX8tGJ02hOrojtBCI aHnFnIPi5vm6g8wreBxb0BBGCZ4tGc7xD70s9E+8g3Y2P8jurHuDvcvT/dHtK8ulLWw= X-Gm-Gg: ASbGncvsF1Av5i52Tuy1G/IIrPC7nsBoiYmRAabmrX4DHqjzzwUrY71OIYz00LLRF+G NI9q8WM1gcUhd4Fhw6eCsr+Huu3hYRvGeZlPCnuL53PgUodc8GFjpHeLt5tmE2eSyioAVE44XjC RlYrhKd1d6gwjyU1fUJHulfuUCCNqEcBDjvV2uAxfh4kom53I3g3obInV+Ubdk01YxbwNpqWd+o lY2zCRUGs2K3MllWz3D/ByVxBCOpq3y8uIUlgvzGo2tf/6UwYEjyHqDnR0y39CRmFWvae4B9vTU VIc2mca7euiH0Y7yV2Ktpd7eOGvBFq7yaSSpFBJIOMFjBYRuBjuLY5ZnelPIeVJq0b8WMtZNzSu lvm2FHsLhaGE= X-Google-Smtp-Source: AGHT+IEIfQAMETLePrpEEzS9QpyMFaAK8/AdrArUuHoFRViz+LYIZ3T6LqzcrG7al5ymyKl3AZqxYg== X-Received: by 2002:a05:6000:288c:b0:3a5:266f:e6fb with SMTP id ffacd0b85a97d-3a558a455acmr3766313f8f.44.1749661702748; Wed, 11 Jun 2025 10:08:22 -0700 (PDT) Received: from smtpclient.apple ([131.111.5.201]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45325215e75sm28172165e9.27.2025.06.11.10.08.22 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Jun 2025 10:08:22 -0700 (PDT) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.600.51.1.1\)) Subject: Re: git: c190cd94b7bf - main - sys/_stdarg.h: drop cdefs.h and _types.h polution From: Jessica Clarke In-Reply-To: <202506111700.55BH0PPx042716@gitrepo.freebsd.org> Date: Wed, 11 Jun 2025 18:08:11 +0100 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202506111700.55BH0PPx042716@gitrepo.freebsd.org> To: Brooks Davis X-Mailer: Apple Mail (2.3826.600.51.1.1) X-Rspamd-Queue-Id: 4bHXDS4QhRz3fkL X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] On 11 Jun 2025, at 18:00, Brooks Davis wrote: >=20 > The branch main has been updated by brooks: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dc190cd94b7bff590b06db906c5678952= 5a991ece >=20 > commit c190cd94b7bff590b06db906c56789525a991ece > Author: Brooks Davis > AuthorDate: 2025-06-11 16:39:02 +0000 > Commit: Brooks Davis > CommitDate: 2025-06-11 16:39:02 +0000 >=20 > sys/_stdarg.h: drop cdefs.h and _types.h polution >=20 > Rely in sys/_visible for visibility macros and use __buitin_va_list > instead of __va_list everywere we declare va_list. This layout seems odd. I would expect sys/sys/_stdarg.h to define __va_list, which stdio.h and wchar.h can then include and use __va_list for their va_list, like how we do things for __[u]intN_t. Jess > Reviewed by: imp > Exp-run by: antoine (PR 286274) > Pull Request: https://github.com/freebsd/freebsd-src/pull/1595 > --- > include/stdio.h | 2 +- > include/wchar.h | 2 +- > sys/sys/_stdarg.h | 7 +++---- > 3 files changed, 5 insertions(+), 6 deletions(-) >=20 > diff --git a/include/stdio.h b/include/stdio.h > index 3dedb8fd5a54..34e877b60c14 100644 > --- a/include/stdio.h > +++ b/include/stdio.h > @@ -74,7 +74,7 @@ typedef __off64_t off64_t; >=20 > #if __POSIX_VISIBLE >=3D 200112 || __XSI_VISIBLE > #ifndef _VA_LIST_DECLARED > -typedef __va_list va_list; > +typedef __builtin_va_list va_list; > #define _VA_LIST_DECLARED > #endif > #endif > diff --git a/include/wchar.h b/include/wchar.h > index e4b037c9b16f..bf07062935d5 100644 > --- a/include/wchar.h > +++ b/include/wchar.h > @@ -78,7 +78,7 @@ typedef __size_t size_t; >=20 > #if __POSIX_VISIBLE >=3D 200809 || __XSI_VISIBLE > #ifndef _VA_LIST_DECLARED > -typedef __va_list va_list; > +typedef __builtin_va_list va_list; > #define _VA_LIST_DECLARED > #endif > #endif > diff --git a/sys/sys/_stdarg.h b/sys/sys/_stdarg.h > index 063e59dc83f6..3886f4632b10 100644 > --- a/sys/sys/_stdarg.h > +++ b/sys/sys/_stdarg.h > @@ -31,12 +31,11 @@ > #ifndef _SYS__STDARG_H_ > #define _SYS__STDARG_H_ >=20 > -#include > -#include > +#include >=20 > #ifndef _VA_LIST_DECLARED > - #define _VA_LIST_DECLARED > - typedef __va_list va_list; > +#define _VA_LIST_DECLARED > +typedef __builtin_va_list va_list; > #endif >=20 > #define va_start(ap, last) __builtin_va_start((ap), (last)) From nobody Wed Jun 11 17:11:15 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHXHl6qDJz5yBHq; Wed, 11 Jun 2025 17:11:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHXHl5c9zz3g7h; Wed, 11 Jun 2025 17:11:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749661875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8Exx3SjEgwKtLZ+l8gz9AsJ2MaqzvgWkb/rVkrbpack=; b=A9WlkaCn65wL83hQS+ZiqJj/W1rmrJJH+eRiDcO12JOfpWnBg7SH6lfSD3Kq4CQeOhD4ep LAHY0Vva0nZLwE6OTg0c93fmQHhb4Js/wcPsuUeEgPmxsxLbfno/YxwKXfNlArLp9VqPc9 lk/hDqUfXOCUOpNadHtO1gvRuslBK9nuEzZf2t0j6JMXbdYP+aNklrTDfhH66Rajv0PxHE O8Zm63DlUlMDKknGkG9gfyvVIVyT4aMnf2AG5esVb2Yhl6UNIqLHv11+t4BiHewjtmKYS3 9mn/gczn0oKP7T9//5YNttf/U0p9fnE8hUKKqOS5VwyJiG9gtPA99OsSqUBmmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749661875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8Exx3SjEgwKtLZ+l8gz9AsJ2MaqzvgWkb/rVkrbpack=; b=kXihmCKKMDbqkax8gsjg1VoTbxZZsYmcAgLEZDPbkjhlicX9rvHQIv84Ioclc4s6ojHk58 bfeD45291XFuWtdogh6TLbyCbroISiu8td3onyVkZmOmV3jI0jgHKK1dCgwARP4pSq4g1U bVcE3G1SZ0TvHu3+HpLwEvDisloYM/KlCxxxgDCMI++LGE+COaZN4xR6UJ+N0RGtwf2wT+ IoEephvP/VN+tYDVICpMr8htTpXBQQCpQQLZWSYqvMf30gCzV0q2ErDzNab9Zep+D8pbCO T2OaV0Jpm+c8v5xniROC3nARR0WRjrxl8qJoldtYCOum7E5y6RCrYRch4tr7Ww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749661875; a=rsa-sha256; cv=none; b=fT8TlZ7fXBA8fK32JcSHEXkNDRYRx/l5+P85E6R0jooTgTC20yEV8Lel53AXhYXxkC0jqT XBSqGxbk8o2yLezh7sva0BCaUU33C1OWJeW6fApZgPCXgNuEHZBLU556qOwoNldVLW5Jvk ty4AsFPAw6Fih3y7Rs69VQWI+5XAfpXd1L2uhGYide3wchUjow8ECbWT2j0584P02N8Dpj HQx01r4oFmW9IDB4jyqsVfIE1Llunr1mu3IWewIQJrkkI8jT3b+S3KzEoQwU1hNA3PuSEU hcwrhem+VJdRZFrF+C3zpF/7it0WKCtx1uxSaZ8j99QHj9y+TeVYT7piZ2d2Fg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bHXHl5CrvzcQ7; Wed, 11 Jun 2025 17:11:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55BHBFqq067223; Wed, 11 Jun 2025 17:11:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55BHBF4Z067220; Wed, 11 Jun 2025 17:11:15 GMT (envelope-from git) Date: Wed, 11 Jun 2025 17:11:15 GMT Message-Id: <202506111711.55BHBF4Z067220@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 4a7b8cd7057f - main - sound: Add AFMT_FLOAT to feed_volume_info_tab List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4a7b8cd7057f0c37b4fc4b47b0ef3ec8402b0eb9 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=4a7b8cd7057f0c37b4fc4b47b0ef3ec8402b0eb9 commit 4a7b8cd7057f0c37b4fc4b47b0ef3ec8402b0eb9 Author: Christos Margiolis AuthorDate: 2025-06-11 17:10:54 +0000 Commit: Christos Margiolis CommitDate: 2025-06-11 17:10:54 +0000 sound: Add AFMT_FLOAT to feed_volume_info_tab Fixes: e1bbaa71d62c ("sound: Implement AFMT_FLOAT support") Reported by: bz Sponsored by: The FreeBSD Foundation MFC after: 1 day Reviewed by: bz Differential Revision: https://reviews.freebsd.org/D50793 --- sys/dev/sound/pcm/feeder_volume.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/sound/pcm/feeder_volume.c b/sys/dev/sound/pcm/feeder_volume.c index 2d35bb56ef8f..ddcbf29804f3 100644 --- a/sys/dev/sound/pcm/feeder_volume.c +++ b/sys/dev/sound/pcm/feeder_volume.c @@ -133,7 +133,9 @@ static const struct { FEEDVOLUME_ENTRY(U, 32, LE), FEEDVOLUME_ENTRY(U, 16, BE), FEEDVOLUME_ENTRY(U, 24, BE), - FEEDVOLUME_ENTRY(U, 32, BE) + FEEDVOLUME_ENTRY(U, 32, BE), + FEEDVOLUME_ENTRY(F, 32, LE), + FEEDVOLUME_ENTRY(F, 32, BE), #endif }; From nobody Wed Jun 11 17:23:28 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHXYs4SdLz5yCCb; Wed, 11 Jun 2025 17:23:29 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHXYs3q59z3grR; Wed, 11 Jun 2025 17:23:29 +0000 (UTC) (envelope-from brooks@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749662609; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Ezi/XwR5LpckDIaL0unkuLUtYq/XEv4KPX9khiHDv6k=; b=jdClqnv1r/U0ZIecKqRzFfwIzD0+OozlVVAVM+MowrSc3JYIaxEn0Spr+M6EJQcd4erdXj lRogt95yB2fXix0vRTyjg6KwMSxxD0jbZ/dAd0ipY67QAJp3AkPipQ17Lfu92S7yADtdEV TW8jqIfhJGES7XlQuRy9u4CLVONW8P3IIJQC2vNvdlSzx1o3U/aWn8Lmb9eeNxNzVQ4Zio kpVOA99PD78pYK0Bd6k9UKpXKnIkO/JcFQQcCHo17SF9n1U+rhmJ9VvUxn3A7Oh4pq7+Ng pcKP3tvt5EmBJ+Eclzdky+ohE1utgdyAPahrP5KgV6d2P3XkNZd6GiFaxqBN5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749662609; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Ezi/XwR5LpckDIaL0unkuLUtYq/XEv4KPX9khiHDv6k=; b=rR6emFPMCC55YYN/fXxsqmc0TKvsir1CNGe/r7nuyKsMtzTiilfQr8lPbkVd6oOGxzmHk6 slA4vX9fYnYw+toa+pT8mwjrri+sg8TPuLCuWUBSZYGh4FPs33fPZBryIW/4YtV8axVHfO a+lxPQAUztXGR7qEzTJAsaCMKME6xuzykbCzIJtU9om2SszR1FrNZw1TiNZUIdYs2fkZ6O GNjj4BHDdLHmm9X9hhl1OJaE/2LeTHrUAuJh7Ca3p4qhjQGjNl01TFKcgYl54d5pgbQdIm hPirzlvhUoLRI98TIQ3ZkL0HjGfwP6Z1KrlVE9CwN5xLgA69uUS17XhIHH7J+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749662609; a=rsa-sha256; cv=none; b=ixdpia6efmENqHrROE1+HxOiW+O1Wgp6JmNv7jfk2sHbkHSA55bEKRf8dWJf57lpVH60yw fZejEIraafMzUhRwB0X2ON+yC9sWo2jE48Iw2BAGsRaPHQWt/RkBaoyFDEfM8IcE/8xjTg MjXcj0xgdT/b8HOdA0yUGa2hxobJI1gyJyrxV4XbeuuRf5nXFNTgemaujM0B01hivDI7OV zZV0vuxroa389guzS3XlN7Iz1FwoqAy9QW3DfEy4PKlnaYrnRzDhWxMSpN0DLlm+o6jmVf LvrCE3Uh0hYuU5eAb8pxTWyvUxcao/NAooTfnA3zit0DX0VItBQxOy+VzjCuxw== 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) (Authenticated sender: brooks/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bHXYs2nDmz16DN; Wed, 11 Jun 2025 17:23:29 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 96E303C01A0; Wed, 11 Jun 2025 17:23:28 +0000 (UTC) Date: Wed, 11 Jun 2025 17:23:28 +0000 From: Brooks Davis To: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: e453e498cbb8 - main - machine/stdarg.h -> sys/stdarg.h Message-ID: References: <202506111700.55BH0Rct042788@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202506111700.55BH0Rct042788@gitrepo.freebsd.org> On Wed, Jun 11, 2025 at 05:00:27PM +0000, Brooks Davis wrote: > The branch main has been updated by brooks: > > URL: https://cgit.FreeBSD.org/src/commit/?id=e453e498cbb88570a3ff7b3679de65c88707da95 > > commit e453e498cbb88570a3ff7b3679de65c88707da95 > Author: Brooks Davis > AuthorDate: 2025-06-11 16:39:02 +0000 > Commit: Brooks Davis > CommitDate: 2025-06-11 16:39:02 +0000 > > machine/stdarg.h -> sys/stdarg.h > > Switch to using sys/stdarg.h for va_list type and va_* builtins. > > Make an attempt to insert the include in a sensible place. Where > style(9) was followed this is easy, where it was ignored, aim for the > first block of sys/*.h headers and don't get too fussy or try to fix > other style bugs. > > Reviewed by: imp > Exp-run by: antoine (PR 286274) > Pull Request: https://github.com/freebsd/freebsd-src/pull/1595 The PR contains an additional commit to add a warning to machine/stdarg.h. Based on the results on the exp-run I've chosen not to add this yet and plan to wait until all supported releases contain sys/stdarg.h. Given an MFC of sys/stdarg.h to releng/14 prior to 14.4, this should happen when 13.x and 14.3 go out of support next spring. -- Brooks From nobody Wed Jun 11 17:54:39 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHYFr33Slz5yDtF; Wed, 11 Jun 2025 17:54:40 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHYFr2ChXz3khG; Wed, 11 Jun 2025 17:54:40 +0000 (UTC) (envelope-from brooks@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749664480; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=qkgrsN+aM3km+7/0pj/dM47UE8Oe9vIEEeNge92lVsk=; b=bqYrB4OmJ0+cKfqijbdmZhzIiL4Ve4+mCxLPrVayjgxS7+Ifu6/y7EHQIz1EeCTiJybTeS esP++woQqcTmHp0T1K/JpznyYHIPH53MIrT4GDQ2mKSiFXbHY6xIcTfeGJ1bnDvY/WFtFL /ddGW8dg2GQbNuccB638RtvN74I8E3neZ/uHTqbCNS0TVhRfAeG5/4cRwuxbkD8HPiv8A3 W/nBzMDTWibzY4sFXMGOUp0IwGdtcx+ud6pt14W/bHH697/8Fp/azjECJCzsIfzsLfm/iT PZeqRbvF2ywSPFdNYU6Oo6/6n2N4SD9fnohrKdbWgiqeb8sM/x56fUzLITTXxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749664480; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=qkgrsN+aM3km+7/0pj/dM47UE8Oe9vIEEeNge92lVsk=; b=qyIhYRWfLjD6UslbxReEEwSswI9q63Bap/tIlY2YuKbeXTXsEhGU5D1/ln3EQ92MQk1kT6 W/gdMaAHdmr2p1F8MIfR6omIM+JJw4zfrtbRCgAyV+NXLpQHOkT7TH4b3UH4pNwOlzYGls gT6aAxSI6ZKTe7Yvlvlx5DGQh22O4LvgvL3yMhgYsUh20tmoPvmTuUl1YNpmGGaeNZkIl1 kWYWTcTI+vCgK0tMKks/dLCXfB39GakFRaIpRBecHVoBGK5bVzKRAVY8NTxWGUhAUCBVKu rTuwtgDcQpN3Y+MuUvE3bRaCg95WaNMx+d0qWQALXXfbU79Suy2d1E8p3bz8ig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749664480; a=rsa-sha256; cv=none; b=VJuyVo42HbTwVSInE+Ll5gIgQobaGsG+6cWo1KVR+tt8ZPxWaTqL0ownkCNkmDsd9GxVPB ncBE4hxz/eecu439T8h+FZ7+Gdd3CaSn16MnrZDobgr69J3b0zHOkPDuxx81FAx1u4YfIP wO8h+5EuhlVUZ1322nkH2bzzdD6wFvzRafjBuddHEw7bjz1zGg84L0Kvq3C+7JdqVwxmRc qVvyZYZyUxTBYrit25Pkxl6Jxs2mfd78pi8QiHxA72jZxitTOudUEeyCzRWmlIH2uqkIzS BZ9c0BV7YtwDmEezg2GxK1KEOn6FbaF92RtIojOojRpbUNbIOMLcie2TNdkDyw== 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)) (Client did not present a certificate) (Authenticated sender: brooks/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bHYFr1G8cz17Nf; Wed, 11 Jun 2025 17:54:40 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id C6A8E3C01A0; Wed, 11 Jun 2025 17:54:39 +0000 (UTC) Date: Wed, 11 Jun 2025 17:54:39 +0000 From: Brooks Davis To: Jessica Clarke Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: ab3d713e93dc - main - sys/_types.h: use builtins to for __max_align_t Message-ID: References: <202506111700.55BH0Ka6042574@gitrepo.freebsd.org> <37D99680-366D-4D11-BC19-B6D676FA1E22@freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <37D99680-366D-4D11-BC19-B6D676FA1E22@freebsd.org> On Wed, Jun 11, 2025 at 06:05:47PM +0100, Jessica Clarke wrote: > On 11 Jun 2025, at 18:00, Brooks Davis wrote: > > > > The branch main has been updated by brooks: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=ab3d713e93dc1d322398657125071101c08e2ce5 > > > > commit ab3d713e93dc1d322398657125071101c08e2ce5 > > Author: Brooks Davis > > AuthorDate: 2025-06-11 16:39:01 +0000 > > Commit: Brooks Davis > > CommitDate: 2025-06-11 16:39:01 +0000 > > > > sys/_types.h: use builtins to for __max_align_t > > > > Use __attribute__((__aligned__(x))) and __alignof__(x) in places of local > > macros that ultimately wrap these. We don't support compilers that don't > > define these so there's little loss of generality. > > > > This mirrors Clang's stddef.h. > > > > Reviewed by: imp > > Exp-run by: antoine (PR 286274) > > Pull Request: https://github.com/freebsd/freebsd-src/pull/1595 > > --- > > sys/sys/_types.h | 6 ++++-- > > 1 file changed, 4 insertions(+), 2 deletions(-) > > > > diff --git a/sys/sys/_types.h b/sys/sys/_types.h > > index c84b84edd2b8..f6d1f26551e0 100644 > > --- a/sys/sys/_types.h > > +++ b/sys/sys/_types.h > > @@ -181,9 +181,11 @@ typedef __uint_least32_t __char32_t; > > #endif > > > > typedef struct { > > - long long __max_align1 __aligned(_Alignof(long long)); > > + long long __max_align1 > > + __attribute__((__aligned__(__alignof__(long long)))); > > #ifndef _STANDALONE > > - long double __max_align2 __aligned(_Alignof(long double)); > > + long double __max_align2 > > + __attribute__((__aligned__(__alignof__(long long)))); > > #endif > > } __max_align_t; > > > > _Alignof is the standard C spelling of it. We should be adopting the > standard names for things more, polyfilling with GNU macros when not > available, not increasing our use of old GNU C equivalents that predate > their additions to the standard. This should really be > _Alignas(_Alignof(...)). Hmm, probably hoisting _Alignas and _Alignof into a sys/_stdalign.h would work well here. -- Brooks From nobody Wed Jun 11 19:05:21 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHZqP6nmNz5yKv0; Wed, 11 Jun 2025 19:05:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHZqP5s39z3tkL; Wed, 11 Jun 2025 19:05:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749668721; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EiQOmx4olhFECvT8piwLO8SwuWc5TL4L3PzU9CvyaIE=; b=oGRDOoXQ6dzhC8G8PaoKVJ9AZ7SSxhAXdt0Xgh9jPON682ieh1FdEAUhjJAQeLqs0HyAY8 NKyHBCIFSHTSVXqylG80IJKHq3qXGGpiCMdQEZ51xguWPUO7V7ZDpU1cSLEjsap4t7xgp5 F8S+lZrKYeI5EjL0H/M/8gYM7vxmoNiBYCre/oCkfZI+05BZAifTwpswI2C7jG/lWqrzdP ZjI8CBDp5uPmm+EyNcO6DfxwaQb8Qsdyhn6oU6AA642JTwHal+LFLytjyt5rKcuQudUn4q JNuAMBXtkT/ogRZ+R5C3GKg2xiRP2j3CNOspZP5PrxWnK7wmfNXws3j1GSqyVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749668721; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EiQOmx4olhFECvT8piwLO8SwuWc5TL4L3PzU9CvyaIE=; b=J2upKR+BSVr58RDL1RoX6icwzdZ80SNxzaPLIHdJ5i+FPhg3giTBJJtygZ3Jk3zUaRxKaK DT/FcxXg6GqoRAPz3+ACm7Wek3y52MYzBARBXS30z+K4igJZ9dKdT6MbmRqgW4x70rCgFS GQbBkoPZShNcXJj/DZxZx1hKacX5VFz0ff0mDMZFK8wqhYDtNjMmmpN1yfv9l5L6eCfDf0 u7d6pqhrBGfMYxdct90kKfP+03VcugFrgmfbenzGJb8HcoychlAbdQSNb0Js4/hL5ytEhK AuzLLhAFmFupjOPq1/eXk4FRX2DKqq7fF5AOR+4QL1pzwaLAsKYCjD5iziIfPg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749668721; a=rsa-sha256; cv=none; b=nuzf/NFj0SgYx1TU9RN3E9dIjGciNl+y3f6Qzk71EIA0+1bP8vIHDgYYrA3kTWrHDT64+Z XDiKfOkcZ6lfj3PjjNg83kg+7jg0XI/oFzFeUtG/dIZSLH2pVYcbwkXSXzqT/aL2jLV8bg elQLQCa7yXpVPenCB9sFog5y4JHirHTNax7lrttavxIWmU/WWIRKX6CgS1QWlnra01JWzf bEzW72ZDSHUjoZ4R0IJeQ+WVSSCPUfaPCI6Tp6WrXpjXPEl0BhSVZprd3ILCSKVhedC5B7 nlYYa1G3Ydu4ODlPwScAj6RxLVKxaXU7ml53EaELu5NOTUVQ5xF+dhgHW4KaKg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bHZqP591nzgDn; Wed, 11 Jun 2025 19:05:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55BJ5Lb6076793; Wed, 11 Jun 2025 19:05:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55BJ5L1K076790; Wed, 11 Jun 2025 19:05:21 GMT (envelope-from git) Date: Wed, 11 Jun 2025 19:05:21 GMT Message-Id: <202506111905.55BJ5L1K076790@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: e50304c2fbcd - main - vfs_syscalls.c: fix type List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e50304c2fbcd8aa58bca47b38ac0c5d02c15ae69 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=e50304c2fbcd8aa58bca47b38ac0c5d02c15ae69 commit e50304c2fbcd8aa58bca47b38ac0c5d02c15ae69 Author: Brooks Davis AuthorDate: 2025-06-11 19:03:42 +0000 Commit: Brooks Davis CommitDate: 2025-06-11 19:04:49 +0000 vfs_syscalls.c: fix type Fixes: e453e498cbb8 ("machine/stdarg.h -> sys/stdarg.h") --- sys/kern/vfs_syscalls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index b3afad55f657..0e4847e1c634 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -66,7 +66,7 @@ #include #include #include -#incluee +#include #include #include #include From nobody Wed Jun 11 19:05:10 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHZqy52vcz5yLDP; Wed, 11 Jun 2025 19:05:50 +0000 (UTC) (envelope-from freebsd@walstatt-de.de) Received: from smtp052.goneo.de (smtp5.goneo.de [IPv6:2001:1640:5::8:30]) (using TLSv1.3 with cipher TLS_AES_256_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 4bHZqy2LCnz3tv0; Wed, 11 Jun 2025 19:05:50 +0000 (UTC) (envelope-from freebsd@walstatt-de.de) Authentication-Results: mx1.freebsd.org; none Received: from hub2.goneo.de (hub2.goneo.de [IPv6:2001:1640:5::8:53]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp5.goneo.de (Postfix) with ESMTPS id 626AD240708; Wed, 11 Jun 2025 21:05:43 +0200 (CEST) Received: from hub2.goneo.de (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by hub2.goneo.de (Postfix) with ESMTPS id 6C748240269; Wed, 11 Jun 2025 21:05:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walstatt-de.de; s=DKIM001; t=1749668741; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=0od3NooD5xOJS/mp7gygU7lLmwc4yv48utBmyHbYURI=; b=ns+A6nZP90L09mI7ovoL7vIdFvStBvJPzD43TL1bQHgeLWMMszRRNB1UenxfEvJaP+3WDo YuhWhCs60oFG27OFCFcs8IAADGdvb5nBr6rj6VzASgbp0YvokzC8nQ9mVplHah7j4Vsha5 I0QAEVYBUZkNi7zdb63X3YHf5SWbLMwtDjhpvqcgj4ndYppJGDa9E+cmA0wf0DdyM2RGRy TEI+Rmmpwz5KMCF85kzxrSQ2D4fL78gfnEJ8FiLoOH+9Gan+UohCZE60Sg9/BOHbjmPxTQ KKSzGNvd1q65B3kJvEYXYwBenUQl/f8T5GoR7kkl6wFrnVGHMXypPff3+ULgqw== Received: from thor.sb211.local (dynamic-2a02-3100-25db-ed02-6d3c-d85c-852e-01a8.310.pool.telefonica.de [IPv6:2a02:3100:25db:ed02:6d3c:d85c:852e:1a8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by hub2.goneo.de (Postfix) with ESMTPSA id 78160240239; Wed, 11 Jun 2025 21:05:39 +0200 (CEST) Date: Wed, 11 Jun 2025 21:05:10 +0200 From: A FreeBSD User To: Brooks Davis Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: e453e498cbb8 - main - machine/stdarg.h -> sys/stdarg.h Message-ID: <20250611210059.74428a85@thor.sb211.local> In-Reply-To: <202506111700.55BH0Rct042788@gitrepo.freebsd.org> References: <202506111700.55BH0Rct042788@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/LeD3Bq6R0UHql.1wtAvD31C"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Rspamd-UID: 8b5111 X-Rspamd-UID: 412182 X-Rspamd-Queue-Id: 4bHZqy2LCnz3tv0 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:25394, ipnet:2001:1640::/32, country:DE] --Sig_/LeD3Bq6R0UHql.1wtAvD31C Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Am Tage des Herren Wed, 11 Jun 2025 17:00:27 GMT Brooks Davis schrieb: My apology for top posting, but there slipped in a mysterious spelling my b= ox considers an error and rejects compiling via make buildworld buildkernel ...: [...] /usr/src/sys/kern/vfs_syscalls.c:69:2: error: invalid preprocessing directi= ve 69 | #incluee Kind regards, oh > The branch main has been updated by brooks: >=20 > URL: https://cgit.FreeBSD.org/src/commit/?id=3De453e498cbb88570a3ff7b3679= de65c88707da95 >=20 > commit e453e498cbb88570a3ff7b3679de65c88707da95 > Author: Brooks Davis > AuthorDate: 2025-06-11 16:39:02 +0000 > Commit: Brooks Davis > CommitDate: 2025-06-11 16:39:02 +0000 >=20 > machine/stdarg.h -> sys/stdarg.h > =20 > Switch to using sys/stdarg.h for va_list type and va_* builtins. > =20 > Make an attempt to insert the include in a sensible place. Where > style(9) was followed this is easy, where it was ignored, aim for the > first block of sys/*.h headers and don't get too fussy or try to fix > other style bugs. > =20 > Reviewed by: imp > Exp-run by: antoine (PR 286274) > Pull Request: https://github.com/freebsd/freebsd-src/pull/1595 > --- > share/man/man9/PCI_IOV_ADD_VF.9 | 2 +- > share/man/man9/PCI_IOV_INIT.9 | 2 +- > share/man/man9/pci_iov_schema.9 | 2 +- > stand/common/dev_net.c | 3 ++- > stand/common/md.c | 2 +- > stand/efi/boot1/boot1.c | 4 +++- > stand/efi/boot1/proto.c | 4 +++- > stand/efi/gptboot/proto.c | 4 +++- > stand/i386/libi386/biosacpi.c | 2 +- > stand/i386/libi386/biospci.c | 2 +- > stand/i386/libi386/biospnp.c | 2 +- > stand/liblua/lstd.h | 2 +- > stand/libofw/ofw_disk.c | 3 +-- > stand/libofw/openfirm.c | 3 +-- > stand/libsa/Makefile | 2 +- > stand/libsa/panic.c | 2 +- > stand/libsa/printf.c | 7 +------ > stand/powerpc/boot1.chrp/boot1.c | 4 +++- > stand/uboot/uboot_disk.c | 3 ++- > sys/amd64/linux/linux_vdso_gtod.c | 2 +- > sys/amd64/linux32/linux32_vdso_gtod.c | 2 +- > sys/arm/ti/cpsw/if_cpsw.c | 2 +- > sys/arm/xilinx/zy7_devcfg.c | 2 +- > sys/arm/xilinx/zy7_ehci.c | 2 +- > sys/arm/xilinx/zy7_gpio.c | 2 +- > sys/arm/xilinx/zy7_qspi.c | 2 +- > sys/arm/xilinx/zy7_slcr.c | 2 +- > sys/arm/xilinx/zy7_spi.c | 2 +- > sys/arm64/linux/linux_vdso_gtod.c | 2 +- > sys/arm64/qoriq/qoriq_gpio_pic.c | 2 +- > sys/cam/ata/ata_xpt.c | 2 +- > sys/cam/cam_xpt.c | 2 +- > sys/cam/ctl/ctl_error.c | 2 +- > sys/cam/ctl/ctl_error.h | 2 +- > sys/cam/mmc/mmc_xpt.c | 2 +- > sys/cam/nvme/nvme_xpt.c | 2 +- > sys/cam/scsi/scsi_all.h | 2 +- > sys/cam/scsi/scsi_enc.c | 3 +-- > sys/cam/scsi/scsi_xpt.c | 2 +- > sys/cddl/compat/opensolaris/kern/opensolaris_string.c | 2 +- > sys/cddl/compat/opensolaris/sys/cmn_err.h | 2 +- > sys/cddl/compat/opensolaris/sys/varargs.h | 2 +- > sys/cddl/dev/fbt/fbt.c | 2 +- > sys/cddl/dev/profile/profile.c | 2 +- > sys/cddl/dev/systrace/systrace.c | 3 +-- > sys/compat/linux/linux_util.c | 3 +-- > sys/compat/linuxkpi/common/include/linux/kmod.h | 2 +- > sys/compat/linuxkpi/common/include/linux/kobject.h | 2 +- > sys/compat/linuxkpi/common/include/linux/stdarg.h | 2 +- > sys/compat/linuxkpi/common/include/stdarg.h | 2 +- > sys/compat/linuxkpi/common/src/linux_compat.c | 3 +-- > sys/compat/linuxkpi/common/src/linux_idr.c | 3 +-- > sys/compat/linuxkpi/common/src/linux_pci.c | 2 +- > sys/contrib/dev/acpica/include/platform/acfreebsd.h | 2 +- > sys/contrib/libnv/bsd_nvpair.c | 3 +-- > sys/contrib/libnv/cnvlist.c | 3 +-- > sys/contrib/libnv/dnvlist.c | 3 +-- > sys/contrib/libnv/nvlist.c | 3 +-- > sys/contrib/ncsw/inc/stdarg_ext.h | 2 +- > sys/contrib/ncsw/user/env/xx.c | 2 +- > sys/contrib/openzfs/module/os/freebsd/spl/spl_string.c | 2 +- > sys/contrib/rdma/krping/krping_dev.c | 2 +- > sys/contrib/vchiq/interface/compat/vchi_bsd.c | 3 +-- > sys/ddb/db_output.c | 3 +-- > sys/ddb/db_pprint.c | 3 +-- > sys/dev/aacraid/aacraid_debug.c | 3 +-- > sys/dev/ahci/ahci.c | 2 +- > sys/dev/ahci/ahci_pci.c | 2 +- > sys/dev/ahci/ahciem.c | 2 +- > sys/dev/ata/ata-all.c | 2 +- > sys/dev/ata/ata-isa.c | 2 +- > sys/dev/ata/ata-pci.c | 5 ++++- > sys/dev/ata/ata-sata.c | 2 +- > sys/dev/ata/chipsets/ata-acard.c | 2 +- > sys/dev/ata/chipsets/ata-acerlabs.c | 2 +- > sys/dev/ata/chipsets/ata-amd.c | 2 +- > sys/dev/ata/chipsets/ata-ati.c | 2 +- > sys/dev/ata/chipsets/ata-cenatek.c | 2 +- > sys/dev/ata/chipsets/ata-cypress.c | 2 +- > sys/dev/ata/chipsets/ata-cyrix.c | 2 +- > sys/dev/ata/chipsets/ata-highpoint.c | 2 +- > sys/dev/ata/chipsets/ata-intel.c | 2 +- > sys/dev/ata/chipsets/ata-ite.c | 2 +- > sys/dev/ata/chipsets/ata-jmicron.c | 2 +- > sys/dev/ata/chipsets/ata-marvell.c | 2 +- > sys/dev/ata/chipsets/ata-micron.c | 2 +- > sys/dev/ata/chipsets/ata-national.c | 2 +- > sys/dev/ata/chipsets/ata-netcell.c | 2 +- > sys/dev/ata/chipsets/ata-nvidia.c | 2 +- > sys/dev/ata/chipsets/ata-promise.c | 2 +- > sys/dev/ata/chipsets/ata-serverworks.c | 2 +- > sys/dev/ata/chipsets/ata-siliconimage.c | 2 +- > sys/dev/ata/chipsets/ata-sis.c | 2 +- > sys/dev/ata/chipsets/ata-via.c | 2 +- > sys/dev/ath/ah_osdep.c | 3 +-- > sys/dev/bhnd/nvram/bhnd_nvram_private.h | 3 +-- > sys/dev/bhnd/nvram/bhnd_nvram_value.h | 2 +- > sys/dev/etherswitch/e6000sw/e6000sw.c | 2 +- > sys/dev/fdc/fdc.c | 2 +- > sys/dev/filemon/filemon_wrapper.c | 3 +-- > sys/dev/gpio/qoriq_gpio.c | 2 +- > sys/dev/hpt27xx/os_bsd.h | 2 +- > sys/dev/hptiop/hptiop.c | 2 +- > sys/dev/hptmv/hptproc.c | 2 +- > sys/dev/hptnr/os_bsd.h | 2 +- > sys/dev/hptrr/os_bsd.h | 2 +- > sys/dev/hyperv/vmbus/vmbus_chan.c | 2 +- > sys/dev/iavf/iavf_iflib.h | 2 +- > sys/dev/iavf/iavf_lib.h | 2 +- > sys/dev/iavf/iavf_osdep.c | 2 +- > sys/dev/ice/ice_osdep.c | 2 +- > sys/dev/iicbus/controller/cadence/cdnc_i2c.c | 2 +- > sys/dev/ioat/ioat.c | 2 +- > sys/dev/ioat/ioat_test.c | 2 +- > sys/dev/isci/isci_logger.c | 2 +- > sys/dev/isp/isp_freebsd.h | 2 +- > sys/dev/ixl/ixl.h | 2 +- > sys/dev/mpi3mr/mpi3mr_cam.c | 3 +-- > sys/dev/mpr/mpr_sas.c | 3 +-- > sys/dev/mpr/mpr_sas_lsi.c | 3 +-- > sys/dev/mps/mps_sas.c | 3 +-- > sys/dev/mps/mps_sas_lsi.c | 3 +-- > sys/dev/mpt/mpt_debug.c | 2 +- > sys/dev/mpt/mpt_raid.c | 3 +-- > sys/dev/mvs/mvs.c | 2 +- > sys/dev/mvs/mvs_pci.c | 2 +- > sys/dev/mvs/mvs_soc.c | 2 +- > sys/dev/nvme/nvme_ctrlr.c | 2 +- > sys/dev/nvmf/host/nvmf_ns.c | 2 +- > sys/dev/ocs_fc/ocs_os.h | 2 +- > sys/dev/ofw/ofw_fdt.c | 3 +-- > sys/dev/ofw/ofw_standard.c | 3 +-- > sys/dev/ofw/openfirm.c | 3 +-- > sys/dev/pci/pci.c | 2 +- > sys/dev/pci/pci_iov.c | 2 +- > sys/dev/pci/pci_iov_schema.c | 3 +-- > sys/dev/ppbus/ppb_msq.c | 2 +- > sys/dev/proto/proto_core.c | 2 +- > sys/dev/pst/pst-iop.c | 2 +- > sys/dev/pst/pst-pci.c | 2 +- > sys/dev/pst/pst-raid.c | 2 +- > sys/dev/qat/qat_api/qat_utils/src/QatUtilsServices.c | 2 +- > sys/dev/random/fenestrasX/fx_rng.c | 2 +- > sys/dev/rndtest/rndtest.c | 2 +- > sys/dev/sdhci/sdhci.c | 2 +- > sys/dev/siis/siis.c | 2 +- > sys/dev/superio/superio.c | 2 +- > sys/dev/syscons/syscons.c | 2 +- > sys/dev/uart/uart_core.c | 2 +- > sys/dev/uart/uart_tty.c | 2 +- > sys/dev/usb/usb_dev.c | 3 +-- > sys/dev/virtio/scsi/virtio_scsi.c | 3 +-- > sys/dev/xen/bus/xen_intr.c | 2 +- > sys/dev/xen/console/xen_console.c | 3 +-- > sys/dev/xen/xenpci/xenpci.c | 3 +-- > sys/dev/xen/xenstore/xenstore.c | 3 +-- > sys/fs/nfsclient/nfs_clsubs.c | 7 +------ > sys/fs/p9fs/p9_client.h | 2 +- > sys/geom/geom_ctl.c | 3 +-- > sys/geom/geom_dev.c | 2 +- > sys/geom/geom_dump.c | 2 +- > sys/geom/geom_event.c | 3 +-- > sys/geom/geom_io.c | 2 +- > sys/geom/geom_slice.c | 2 +- > sys/geom/geom_subr.c | 2 +- > sys/i386/i386/bios.c | 2 +- > sys/i386/linux/linux_vdso_gtod.c | 2 +- > sys/isa/pnpparse.c | 3 +-- > sys/kern/kern_boottrace.c | 3 +-- > sys/kern/kern_conf.c | 2 +- > sys/kern/kern_devctl.c | 2 +- > sys/kern/kern_fail.c | 2 +- > sys/kern/kern_intr.c | 2 +- > sys/kern/kern_kthread.c | 3 +-- > sys/kern/kern_shutdown.c | 7 +------ > sys/kern/kern_ubsan.c | 2 +- > sys/kern/subr_bus.c | 2 +- > sys/kern/subr_capability.c | 2 +- > sys/kern/subr_epoch.c | 2 +- > sys/kern/subr_gtaskqueue.c | 2 +- > sys/kern/subr_intr.c | 2 +- > sys/kern/subr_msan.c | 2 +- > sys/kern/subr_prf.c | 6 +----- > sys/kern/subr_sbuf.c | 2 +- > sys/kern/subr_scanf.c | 7 +------ > sys/kern/subr_taskqueue.c | 2 +- > sys/kern/subr_terminal.c | 3 +-- > sys/kern/subr_witness.c | 3 +-- > sys/kern/tty.c | 3 +-- > sys/kern/tty_pts.c | 3 +-- > sys/kern/vfs_mount.c | 3 +-- > sys/kern/vfs_subr.c | 3 +-- > sys/kern/vfs_syscalls.c | 3 +-- > sys/libkern/asprintf.c | 3 +-- > sys/net/ieee8023ad_lacp.c | 2 +- > sys/net/if.c | 2 +- > sys/net/if_stf.c | 3 +-- > sys/net/route/fib_algo.c | 3 +-- > sys/net/vnet.c | 3 +-- > sys/net80211/ieee80211.c | 3 +-- > sys/net80211/ieee80211_freebsd.c | 3 +-- > sys/net80211/ieee80211_input.c | 2 +- > sys/netgraph/ng_parse.c | 3 +-- > sys/netinet/libalias/alias_db.c | 2 +- > sys/netinet/libalias/alias_sctp.c | 2 +- > sys/netinet/raw_ip.c | 2 +- > sys/netinet6/raw_ip6.c | 3 +-- > sys/netipsec/ipsec_input.c | 2 +- > sys/netipsec/ipsec_offload.c | 3 +-- > sys/netipsec/key.c | 2 +- > sys/netipsec/keysock.c | 3 +-- > sys/netlink/netlink_message_parser.c | 3 +-- > sys/powerpc/mpc85xx/mpc85xx_gpio.c | 2 +- > sys/powerpc/ofw/ofw_real.c | 2 +- > sys/powerpc/ofw/rtas.c | 2 +- > sys/powerpc/powermac/ata_dbdma.c | 2 +- > sys/powerpc/powermac/ata_kauai.c | 2 +- > sys/powerpc/powermac/ata_macio.c | 2 +- > sys/powerpc/psim/ata_iobus.c | 2 +- > sys/rpc/rpcsec_gss/rpcsec_gss_prot.c | 2 +- > sys/security/audit/audit_worker.c | 3 +-- > sys/security/mac_do/mac_do.c | 3 +-- > sys/tests/ktest.c | 2 +- > sys/x86/x86/ucode.c | 2 +- > sys/xen/xenbus/xenbus.c | 3 +-- > sys/xen/xenbus/xenbusb.c | 3 +-- > sys/xen/xenbus/xenbusb_back.c | 3 +-- > sys/xen/xenbus/xenbusb_front.c | 3 +-- > sys/xen/xenbus/xenbusvar.h | 3 +-- > sys/xen/xenstore/xenstorevar.h | 3 +-- > tools/tools/vhba/vhba.h | 2 +- > tools/uma/smrstress/smrstress.c | 3 +-- > 232 files changed, 245 insertions(+), 321 deletions(-) >=20 > diff --git a/share/man/man9/PCI_IOV_ADD_VF.9 b/share/man/man9/PCI_IOV_ADD= _VF.9 > index d13cb6e1ddc9..512b0b8668cc 100644 > --- a/share/man/man9/PCI_IOV_ADD_VF.9 > +++ b/share/man/man9/PCI_IOV_ADD_VF.9 > @@ -31,7 +31,7 @@ > .Nd inform a PF driver that a VF is being created > .Sh SYNOPSIS > .In sys/bus.h > -.In machine/stdarg.h > +.In sys/stdarg.h > .In sys/nv.h > .In dev/pci/pci_iov.h > .Ft int > diff --git a/share/man/man9/PCI_IOV_INIT.9 b/share/man/man9/PCI_IOV_INIT.9 > index 66b1e693cedb..8ce94800f6d1 100644 > --- a/share/man/man9/PCI_IOV_INIT.9 > +++ b/share/man/man9/PCI_IOV_INIT.9 > @@ -31,7 +31,7 @@ > .Nd enable SR-IOV on a PF device > .Sh SYNOPSIS > .In sys/bus.h > -.In machine/stdarg.h > +.In sys/stdarg.h > .In sys/nv.h > .In dev/pci/pci_iov.h > .Ft int > diff --git a/share/man/man9/pci_iov_schema.9 b/share/man/man9/pci_iov_sch= ema.9 > index 764d357fbaee..99589b59fb91 100644 > --- a/share/man/man9/pci_iov_schema.9 > +++ b/share/man/man9/pci_iov_schema.9 > @@ -38,7 +38,7 @@ > .Nm pci_iov_schema_add_unicast_mac > .Nd PCI SR-IOV config schema interface > .Sh SYNOPSIS > -.In machine/stdarg.h > +.In sys/stdarg.h > .In sys/nv.h > .In sys/iov_schema.h > .Ft nvlist_t * > diff --git a/stand/common/dev_net.c b/stand/common/dev_net.c > index 3cd78c5346ac..fc6b43ec7a40 100644 > --- a/stand/common/dev_net.c > +++ b/stand/common/dev_net.c > @@ -47,9 +47,10 @@ > * for use by the NFS open code (NFS/lookup). > */ > =20 > -#include > #include > #include > +#include > + > #include > #include > #include > diff --git a/stand/common/md.c b/stand/common/md.c > index d12429c3c45c..2c3eb5ded19b 100644 > --- a/stand/common/md.c > +++ b/stand/common/md.c > @@ -28,7 +28,7 @@ > #include > #include > #include > -#include > +#include > =20 > #include "bootstrap.h" > =20 > diff --git a/stand/efi/boot1/boot1.c b/stand/efi/boot1/boot1.c > index 908baf400972..b93c6b425160 100644 > --- a/stand/efi/boot1/boot1.c > +++ b/stand/efi/boot1/boot1.c > @@ -20,8 +20,10 @@ > */ > =20 > #include > +#include > + > #include > -#include > + > #include > =20 > #include > diff --git a/stand/efi/boot1/proto.c b/stand/efi/boot1/proto.c > index 6660d39a921b..f81debd168b9 100644 > --- a/stand/efi/boot1/proto.c > +++ b/stand/efi/boot1/proto.c > @@ -20,8 +20,10 @@ > */ > =20 > #include > +#include > + > #include > -#include > + > #include > =20 > #include > diff --git a/stand/efi/gptboot/proto.c b/stand/efi/gptboot/proto.c > index e2face6c23e5..a1825d9c1c15 100644 > --- a/stand/efi/gptboot/proto.c > +++ b/stand/efi/gptboot/proto.c > @@ -24,8 +24,10 @@ > */ > =20 > #include > +#include > + > #include > -#include > + > #include > =20 > #include > diff --git a/stand/i386/libi386/biosacpi.c b/stand/i386/libi386/biosacpi.c > index 077b6c7e53de..8ddd322b9f99 100644 > --- a/stand/i386/libi386/biosacpi.c > +++ b/stand/i386/libi386/biosacpi.c > @@ -25,7 +25,7 @@ > */ > =20 > #include > -#include > +#include > #include > #include > #include "libi386.h" > diff --git a/stand/i386/libi386/biospci.c b/stand/i386/libi386/biospci.c > index 5b39eab1e5e5..a89a6d30a1e8 100644 > --- a/stand/i386/libi386/biospci.c > +++ b/stand/i386/libi386/biospci.c > @@ -31,7 +31,7 @@ > */ > =20 > #include > -#include > +#include > #include > #include > #include > diff --git a/stand/i386/libi386/biospnp.c b/stand/i386/libi386/biospnp.c > index 5b22f066d4ef..c01d2888a9f7 100644 > --- a/stand/i386/libi386/biospnp.c > +++ b/stand/i386/libi386/biospnp.c > @@ -29,7 +29,7 @@ > */ > =20 > #include > -#include > +#include > #include > #include > #include > diff --git a/stand/liblua/lstd.h b/stand/liblua/lstd.h > index ce3aef4bc5fc..2b601f129566 100644 > --- a/stand/liblua/lstd.h > +++ b/stand/liblua/lstd.h > @@ -29,10 +29,10 @@ > =20 > #include > #include > +#include > #include > #include > #include > -#include > =20 > /* > * Mini stdio FILE and DIR routines. These are the minimal routines need= ed by > diff --git a/stand/libofw/ofw_disk.c b/stand/libofw/ofw_disk.c > index fc4c25bd9424..d4bce64d9be5 100644 > --- a/stand/libofw/ofw_disk.c > +++ b/stand/libofw/ofw_disk.c > @@ -28,11 +28,10 @@ > */ > =20 > #include > +#include > =20 > #include > =20 > -#include > - > #include > #include > =20 > diff --git a/stand/libofw/openfirm.c b/stand/libofw/openfirm.c > index 58e7d8cbe755..1df65784e47a 100644 > --- a/stand/libofw/openfirm.c > +++ b/stand/libofw/openfirm.c > @@ -56,8 +56,7 @@ > */ > =20 > #include > - > -#include > +#include > =20 > #include > =20 > diff --git a/stand/libsa/Makefile b/stand/libsa/Makefile > index 42ef3e69c18a..f5a1acea843e 100644 > --- a/stand/libsa/Makefile > +++ b/stand/libsa/Makefile > @@ -209,8 +209,8 @@ beforedepend: > for i in ${SAFE_INCS}; do \ > ln -sf ${SRCTOP}/include/$$i $$i; \ > done; \ > - ln -sf ${SYSDIR}/${MACHINE}/include/stdarg.h stdarg.h; \ > ln -sf ${SYSDIR}/sys/errno.h errno.h; \ > + ln -sf ${SYSDIR}/sys/stdarg.h stdarg.h; \ > ln -sf ${SYSDIR}/sys/stdint.h stdint.h; \ > ln -sf ${SRCTOP}/include/arpa/inet.h arpa/inet.h; \ > ln -sf ${SRCTOP}/include/arpa/tftp.h arpa/tftp.h; \ > diff --git a/stand/libsa/panic.c b/stand/libsa/panic.c > index 319f08094d92..a555743f0414 100644 > --- a/stand/libsa/panic.c > +++ b/stand/libsa/panic.c > @@ -34,7 +34,7 @@ > */ > =20 > #include > -#include > +#include > =20 > /* > * Boot loaders and other standalone programs that wish to have a > diff --git a/stand/libsa/printf.c b/stand/libsa/printf.c > index a84c5431f536..053b54d31eff 100644 > --- a/stand/libsa/printf.c > +++ b/stand/libsa/printf.c > @@ -37,18 +37,13 @@ > */ > =20 > #include > +#include > #include > #include > #include > #include > #include "stand.h" > =20 > -/* > - * Note that stdarg.h and the ANSI style va_start macro is used for both > - * ANSI and traditional C compilers. > - */ > -#include > - > #define MAXNBUF (sizeof(intmax_t) * CHAR_BIT + 1) > =20 > typedef void (kvprintf_fn_t)(int, void *); > diff --git a/stand/powerpc/boot1.chrp/boot1.c b/stand/powerpc/boot1.chrp/= boot1.c > index cdacb05c31ce..1a546f3473e2 100644 > --- a/stand/powerpc/boot1.chrp/boot1.c > +++ b/stand/powerpc/boot1.chrp/boot1.c > @@ -18,9 +18,11 @@ > #include > #include > #include > +#include > + > #include > -#include > #include > + > #include > =20 > #include "paths.h" > diff --git a/stand/uboot/uboot_disk.c b/stand/uboot/uboot_disk.c > index 4f7b6ba06942..1f75f0f6da3c 100644 > --- a/stand/uboot/uboot_disk.c > +++ b/stand/uboot/uboot_disk.c > @@ -33,7 +33,8 @@ > =20 > #include > #include > -#include > +#include > + > #include > =20 > #include "api_public.h" > diff --git a/sys/amd64/linux/linux_vdso_gtod.c b/sys/amd64/linux/linux_vd= so_gtod.c > index 519ca2f2de93..abe42d51a3ac 100644 > --- a/sys/amd64/linux/linux_vdso_gtod.c > +++ b/sys/amd64/linux/linux_vdso_gtod.c > @@ -28,6 +28,7 @@ > #include > #include > #include > +#include > #include > #define _KERNEL > #include > @@ -36,7 +37,6 @@ > =20 > #include > #include > -#include > =20 > #include > #include > diff --git a/sys/amd64/linux32/linux32_vdso_gtod.c b/sys/amd64/linux32/li= nux32_vdso_gtod.c > index ec5851c45c28..f32db30057d0 100644 > --- a/sys/amd64/linux32/linux32_vdso_gtod.c > +++ b/sys/amd64/linux32/linux32_vdso_gtod.c > @@ -28,6 +28,7 @@ > #include > #include > #include > +#include > #include > #define _KERNEL > #include > @@ -36,7 +37,6 @@ > =20 > #include > #include > -#include > =20 > #include > #include > diff --git a/sys/arm/ti/cpsw/if_cpsw.c b/sys/arm/ti/cpsw/if_cpsw.c > index ea8f9c18490e..dc3d8b1f9023 100644 > --- a/sys/arm/ti/cpsw/if_cpsw.c > +++ b/sys/arm/ti/cpsw/if_cpsw.c > @@ -59,11 +59,11 @@ > #include > #include > #include > +#include > #include > =20 > #include > #include > -#include > =20 > #include > #include > diff --git a/sys/arm/xilinx/zy7_devcfg.c b/sys/arm/xilinx/zy7_devcfg.c > index 6df0fba1f56a..41618225a566 100644 > --- a/sys/arm/xilinx/zy7_devcfg.c > +++ b/sys/arm/xilinx/zy7_devcfg.c > @@ -40,6 +40,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -49,7 +50,6 @@ > =20 > #include > #include > -#include > =20 > #include > #include > diff --git a/sys/arm/xilinx/zy7_ehci.c b/sys/arm/xilinx/zy7_ehci.c > index 545e2a9bce16..6d84ec751e08 100644 > --- a/sys/arm/xilinx/zy7_ehci.c > +++ b/sys/arm/xilinx/zy7_ehci.c > @@ -45,10 +45,10 @@ > #include > #include > #include > +#include > =20 > #include > #include > -#include > =20 > #include > #include > diff --git a/sys/arm/xilinx/zy7_gpio.c b/sys/arm/xilinx/zy7_gpio.c > index 091237014c6f..71b6fc3c0586 100644 > --- a/sys/arm/xilinx/zy7_gpio.c > +++ b/sys/arm/xilinx/zy7_gpio.c > @@ -53,11 +53,11 @@ > #include > #include > #include > +#include > #include > =20 > #include > #include > -#include > =20 > #include > #include > diff --git a/sys/arm/xilinx/zy7_qspi.c b/sys/arm/xilinx/zy7_qspi.c > index 49d4cafd8d61..42091bc78619 100644 > --- a/sys/arm/xilinx/zy7_qspi.c > +++ b/sys/arm/xilinx/zy7_qspi.c > @@ -42,11 +42,11 @@ > #include > #include > #include > +#include > #include > =20 > #include > #include > -#include > =20 > #include > #include > diff --git a/sys/arm/xilinx/zy7_slcr.c b/sys/arm/xilinx/zy7_slcr.c > index a46ccb59a07b..40bcff49162b 100644 > --- a/sys/arm/xilinx/zy7_slcr.c > +++ b/sys/arm/xilinx/zy7_slcr.c > @@ -42,12 +42,12 @@ > #include > #include > #include > +#include > #include > #include > =20 > #include > #include > -#include > =20 > #include > #include > diff --git a/sys/arm/xilinx/zy7_spi.c b/sys/arm/xilinx/zy7_spi.c > index bb5bb7f46767..636a40d729d6 100644 > --- a/sys/arm/xilinx/zy7_spi.c > +++ b/sys/arm/xilinx/zy7_spi.c > @@ -34,11 +34,11 @@ > #include > #include > #include > +#include > #include > =20 > #include > #include > -#include > =20 > #include > #include > diff --git a/sys/arm64/linux/linux_vdso_gtod.c b/sys/arm64/linux/linux_vd= so_gtod.c > index f7def68d88c4..203c76b6e3a9 100644 > --- a/sys/arm64/linux/linux_vdso_gtod.c > +++ b/sys/arm64/linux/linux_vdso_gtod.c > @@ -29,6 +29,7 @@ > #include > #include > #include > +#include > #include > #define _KERNEL > #include > @@ -36,7 +37,6 @@ > #include > =20 > #include > -#include > =20 > #include > #include > diff --git a/sys/arm64/qoriq/qoriq_gpio_pic.c b/sys/arm64/qoriq/qoriq_gpi= o_pic.c > index ec84d2a14ae7..aca8b9daea13 100644 > --- a/sys/arm64/qoriq/qoriq_gpio_pic.c > +++ b/sys/arm64/qoriq/qoriq_gpio_pic.c > @@ -34,11 +34,11 @@ > #include > #include > #include > +#include > #include > =20 > #include > #include > -#include > =20 > #include > #include > diff --git a/sys/cam/ata/ata_xpt.c b/sys/cam/ata/ata_xpt.c > index 61cffeda6f0c..e33e1fafa274 100644 > --- a/sys/cam/ata/ata_xpt.c > +++ b/sys/cam/ata/ata_xpt.c > @@ -37,6 +37,7 @@ > #include > #include > #include > +#include > =20 > #include > #include > @@ -57,7 +58,6 @@ > #include > #include > #include > -#include /* for xpt_print below */ > =20 > struct ata_quirk_entry { > struct scsi_inquiry_pattern inq_pat; > diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c > index 8428125d5e99..38bc82c69aad 100644 > --- a/sys/cam/cam_xpt.c > +++ b/sys/cam/cam_xpt.c > @@ -44,6 +44,7 @@ > #include > #include > #include > +#include > #include > =20 > #include > @@ -68,7 +69,6 @@ > #include > #include > =20 > -#include /* for xpt_print below */ > =20 > /* Wild guess based on not wanting to grow the stack too much */ > #define XPT_PRINT_MAXLEN 512 > diff --git a/sys/cam/ctl/ctl_error.c b/sys/cam/ctl/ctl_error.c > index d07541a1a986..debc6b1e29ee 100644 > --- a/sys/cam/ctl/ctl_error.c > +++ b/sys/cam/ctl/ctl_error.c > @@ -49,8 +49,8 @@ > #include > #include > #include > +#include > #include > -#include > =20 > #include > #include > diff --git a/sys/cam/ctl/ctl_error.h b/sys/cam/ctl/ctl_error.h > index fb2113bef048..55fb8e30b5e8 100644 > --- a/sys/cam/ctl/ctl_error.h > +++ b/sys/cam/ctl/ctl_error.h > @@ -39,7 +39,7 @@ > * Author: Ken Merry > */ > =20 > -#include > +#include > =20 > #ifndef _CTL_ERROR_H_ > #define _CTL_ERROR_H_ > diff --git a/sys/cam/mmc/mmc_xpt.c b/sys/cam/mmc/mmc_xpt.c > index b7f1e5bce868..138f96eaaa49 100644 > --- a/sys/cam/mmc/mmc_xpt.c > +++ b/sys/cam/mmc/mmc_xpt.c > @@ -38,6 +38,7 @@ > #include > #include > #include > +#include > =20 > #include > #include > @@ -58,7 +59,6 @@ > #include > #include > =20 > -#include /* for xpt_print below */ > #include /* for PRIu64 */ > =20 > FEATURE(mmccam, "CAM-based MMC/SD/SDIO stack"); > diff --git a/sys/cam/nvme/nvme_xpt.c b/sys/cam/nvme/nvme_xpt.c > index bac9e6441040..f6667df07be0 100644 > --- a/sys/cam/nvme/nvme_xpt.c > +++ b/sys/cam/nvme/nvme_xpt.c > @@ -38,6 +38,7 @@ > #include > #include > #include > +#include > =20 > #include > #include > @@ -57,7 +58,6 @@ > #include > #include > #include > -#include /* for xpt_print below */ > =20 > struct nvme_quirk_entry { > u_int quirks; > diff --git a/sys/cam/scsi/scsi_all.h b/sys/cam/scsi/scsi_all.h > index 944f70e03da6..b6fb66beefcd 100644 > --- a/sys/cam/scsi/scsi_all.h > +++ b/sys/cam/scsi/scsi_all.h > @@ -18,7 +18,7 @@ > =20 > #ifdef _KERNEL > #include > -#include > +#include > #else > #include > #endif > diff --git a/sys/cam/scsi/scsi_enc.c b/sys/cam/scsi/scsi_enc.c > index 4415e940cd96..9705a0b890b4 100644 > --- a/sys/cam/scsi/scsi_enc.c > +++ b/sys/cam/scsi/scsi_enc.c > @@ -39,14 +39,13 @@ > #include > #include > #include > +#include > #include > #include > #include > #include > #include > =20 > -#include > - > #include > #include > #include > diff --git a/sys/cam/scsi/scsi_xpt.c b/sys/cam/scsi/scsi_xpt.c > index 21cb6beaf1fb..2bb59cb2d92b 100644 > --- a/sys/cam/scsi/scsi_xpt.c > +++ b/sys/cam/scsi/scsi_xpt.c > @@ -40,6 +40,7 @@ > #include > #include > #include > +#include > =20 > #include > #include > @@ -59,7 +60,6 @@ > #include > #include > #include > -#include /* for xpt_print below */ > =20 > struct scsi_quirk_entry { > struct scsi_inquiry_pattern inq_pat; > diff --git a/sys/cddl/compat/opensolaris/kern/opensolaris_string.c > b/sys/cddl/compat/opensolaris/kern/opensolaris_string.c index ec088f216cb= 3..4c8eb533e930 > 100644 --- a/sys/cddl/compat/opensolaris/kern/opensolaris_string.c > +++ b/sys/cddl/compat/opensolaris/kern/opensolaris_string.c > @@ -26,7 +26,7 @@ > #include > #include > #include > -#include > +#include > =20 > #define IS_DIGIT(c) ((c) >=3D '0' && (c) <=3D '9') > =20 > diff --git a/sys/cddl/compat/opensolaris/sys/cmn_err.h > b/sys/cddl/compat/opensolaris/sys/cmn_err.h index 2623693ec8b7..b3ebf6414= e8b 100644 > --- a/sys/cddl/compat/opensolaris/sys/cmn_err.h > +++ b/sys/cddl/compat/opensolaris/sys/cmn_err.h > @@ -28,7 +28,7 @@ > #define _OPENSOLARIS_SYS_CMN_ERR_H_ > =20 > #include > -#include > +#include > =20 > #ifdef __cplusplus > extern "C" { > diff --git a/sys/cddl/compat/opensolaris/sys/varargs.h > b/sys/cddl/compat/opensolaris/sys/varargs.h index 9684502756cb..bede89faf= a18 100644 > --- a/sys/cddl/compat/opensolaris/sys/varargs.h > +++ b/sys/cddl/compat/opensolaris/sys/varargs.h > @@ -28,7 +28,7 @@ > #define _OPENSOLARIS_SYS_VARARGS_H_ > =20 > #ifdef _KERNEL > -#include > +#include > #else > #include > #endif > diff --git a/sys/cddl/dev/fbt/fbt.c b/sys/cddl/dev/fbt/fbt.c > index 99a77ba65eb8..da9c4ee2ab76 100644 > --- a/sys/cddl/dev/fbt/fbt.c > +++ b/sys/cddl/dev/fbt/fbt.c > @@ -49,12 +49,12 @@ > #include > #include > #include > +#include > #include > #include > #include > #include > #include > -#include > =20 > #include > #include > diff --git a/sys/cddl/dev/profile/profile.c b/sys/cddl/dev/profile/profil= e.c > index 3e106aab1c85..23a8c9256708 100644 > --- a/sys/cddl/dev/profile/profile.c > +++ b/sys/cddl/dev/profile/profile.c > @@ -48,11 +48,11 @@ > #include > #include > #include > +#include > #include > #include > #include > #include > -#include > =20 > #include > #include > diff --git a/sys/cddl/dev/systrace/systrace.c b/sys/cddl/dev/systrace/sys= trace.c > index c14a663d1995..d8fe1a6430c6 100644 > --- a/sys/cddl/dev/systrace/systrace.c > +++ b/sys/cddl/dev/systrace/systrace.c > @@ -47,6 +47,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -54,8 +55,6 @@ > *** 3126 LINES SKIPPED *** >=20 --=20 A FreeBSD user --Sig_/LeD3Bq6R0UHql.1wtAvD31C Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQRQheDybVktG5eW/1Kxzvs8OqokrwUCaEnTgQAKCRCxzvs8Oqok r2znAP9qjtERnRw2n2zwbsiKPkmGRgO13upUl1zlQWvuRduynwD5AQBtT+D1KAkx 21O3TbZIDyBOE9Ye52WNKVQjWXYzwQg= =tl32 -----END PGP SIGNATURE----- --Sig_/LeD3Bq6R0UHql.1wtAvD31C-- From nobody Wed Jun 11 19:08:08 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHZtd3gwJz5yLQh; Wed, 11 Jun 2025 19:08:09 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHZtd1HmZz3vNL; Wed, 11 Jun 2025 19:08:09 +0000 (UTC) (envelope-from brooks@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749668889; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WjlbbyhmuXWeWwvz7ewTOMKnZTUQ0VRmGJ7pihw+/HA=; b=imIDdvHVVpwtlCVPMLsE4Beb5B9LGM7WmDMbF4ISJ9nF78Kbqa0Sx04L8LTFeCYdUfoIX0 30YVWCdKSMYt9jLiRCS8S5spDG6znqkruNCjFB8FNpx9wUf71k4skyL2+m68z6gWcKI0M7 lrqF6dSLkMVGojhnIPApdgxtr/EWEuOIn828hyBtTf/juNBemt2CAQF7CjufHinE/BsSeq xo+KhwfaAYVsAusnCH6MHoRMme5/i1r9qNfiinmamibqVwaqvOlAAMp5aVkp/NIcfALxco 98Ub/neokLpvdyDo0NebkU5p9Z3K0gQAEO28SdDDRCXvfxeT9cEg2PqAIVVZLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749668889; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WjlbbyhmuXWeWwvz7ewTOMKnZTUQ0VRmGJ7pihw+/HA=; b=SuRUIqA/t/7Gh2mJGY4lU8iEfuylWqmC+XRMEPMfaZCZdFRnQa6HvoiPfsOM5QXVC1FQPq G9mx+TF7BqmDrw2guZJXGP/EHd/X/uVKrgsEud37979Ji+J7Zdo2PEatAhhN0003eFqAE5 6tlT71Skqjoz0tkc0UP4fNAA7GxhElGumVBzq/6obLkgmlMUXyVTmKZrpS7v2zwEoqLXsQ 7/m9ecI657s0BVz3gd4BLYLzA4oa90QCCq5gvTtv4rYATl2t8qnYOWdukR9WLfHc4S20ll ZTC+shth+2+fyvgnF+lQe588cm2xxqj8AyQuLH5YpQKcXVBN+Ors+5jnA4CjDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749668889; a=rsa-sha256; cv=none; b=T4fPMS2phutlLaTr/5bw4FwX8LMbOpX01Wuai3Nvnx62/0za/jcjDKjljewqqp2+eCE2ws 85nV8mGsPI9p7K3vUvmpIe9w2ROdjoWAlsLRKGPLXvJsRzG020nWooX8b8sls9PvfXX4cv RHP/rjeAQtcQbxF5I7BHJIEQffBA8lyYpi/wkEmOnJhdacMFz4CmPI1IAyqPA0dNRi53ch IR+L0yG/jbPfTrFcVdQvUdz3y7v2NaeEvzcIM6IKNr9Br+E1vw1NLVrMBC8lVlev+NlTps uFSs3p5cECGEeL+rIyAYycpTIjevpPJGqYoXGmyP8OMV31UjcArJPHx8JEWqCw== 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)) (Client did not present a certificate) (Authenticated sender: brooks/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bHZtd0GK6z18Cv; Wed, 11 Jun 2025 19:08:09 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id BB4E53C01A0; Wed, 11 Jun 2025 19:08:08 +0000 (UTC) Date: Wed, 11 Jun 2025 19:08:08 +0000 From: Brooks Davis To: A FreeBSD User Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: e453e498cbb8 - main - machine/stdarg.h -> sys/stdarg.h Message-ID: References: <202506111700.55BH0Rct042788@gitrepo.freebsd.org> <20250611210059.74428a85@thor.sb211.local> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250611210059.74428a85@thor.sb211.local> Sorry, I spotted and updated on last machine/stdarg.h instance and missed it up. Fixed now. -- Brooks On Wed, Jun 11, 2025 at 09:05:10PM +0200, A FreeBSD User wrote: > Am Tage des Herren Wed, 11 Jun 2025 17:00:27 GMT > Brooks Davis schrieb: > > My apology for top posting, but there slipped in a mysterious spelling my box considers an > error and rejects compiling via make buildworld buildkernel ...: > > [...] > /usr/src/sys/kern/vfs_syscalls.c:69:2: error: invalid preprocessing directive > 69 | #incluee > > > Kind regards, > oh > > > > The branch main has been updated by brooks: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=e453e498cbb88570a3ff7b3679de65c88707da95 > > > > commit e453e498cbb88570a3ff7b3679de65c88707da95 > > Author: Brooks Davis > > AuthorDate: 2025-06-11 16:39:02 +0000 > > Commit: Brooks Davis > > CommitDate: 2025-06-11 16:39:02 +0000 > > > > machine/stdarg.h -> sys/stdarg.h > > > > Switch to using sys/stdarg.h for va_list type and va_* builtins. > > > > Make an attempt to insert the include in a sensible place. Where > > style(9) was followed this is easy, where it was ignored, aim for the > > first block of sys/*.h headers and don't get too fussy or try to fix > > other style bugs. > > > > Reviewed by: imp > > Exp-run by: antoine (PR 286274) > > Pull Request: https://github.com/freebsd/freebsd-src/pull/1595 > > --- > > share/man/man9/PCI_IOV_ADD_VF.9 | 2 +- > > share/man/man9/PCI_IOV_INIT.9 | 2 +- > > share/man/man9/pci_iov_schema.9 | 2 +- > > stand/common/dev_net.c | 3 ++- > > stand/common/md.c | 2 +- > > stand/efi/boot1/boot1.c | 4 +++- > > stand/efi/boot1/proto.c | 4 +++- > > stand/efi/gptboot/proto.c | 4 +++- > > stand/i386/libi386/biosacpi.c | 2 +- > > stand/i386/libi386/biospci.c | 2 +- > > stand/i386/libi386/biospnp.c | 2 +- > > stand/liblua/lstd.h | 2 +- > > stand/libofw/ofw_disk.c | 3 +-- > > stand/libofw/openfirm.c | 3 +-- > > stand/libsa/Makefile | 2 +- > > stand/libsa/panic.c | 2 +- > > stand/libsa/printf.c | 7 +------ > > stand/powerpc/boot1.chrp/boot1.c | 4 +++- > > stand/uboot/uboot_disk.c | 3 ++- > > sys/amd64/linux/linux_vdso_gtod.c | 2 +- > > sys/amd64/linux32/linux32_vdso_gtod.c | 2 +- > > sys/arm/ti/cpsw/if_cpsw.c | 2 +- > > sys/arm/xilinx/zy7_devcfg.c | 2 +- > > sys/arm/xilinx/zy7_ehci.c | 2 +- > > sys/arm/xilinx/zy7_gpio.c | 2 +- > > sys/arm/xilinx/zy7_qspi.c | 2 +- > > sys/arm/xilinx/zy7_slcr.c | 2 +- > > sys/arm/xilinx/zy7_spi.c | 2 +- > > sys/arm64/linux/linux_vdso_gtod.c | 2 +- > > sys/arm64/qoriq/qoriq_gpio_pic.c | 2 +- > > sys/cam/ata/ata_xpt.c | 2 +- > > sys/cam/cam_xpt.c | 2 +- > > sys/cam/ctl/ctl_error.c | 2 +- > > sys/cam/ctl/ctl_error.h | 2 +- > > sys/cam/mmc/mmc_xpt.c | 2 +- > > sys/cam/nvme/nvme_xpt.c | 2 +- > > sys/cam/scsi/scsi_all.h | 2 +- > > sys/cam/scsi/scsi_enc.c | 3 +-- > > sys/cam/scsi/scsi_xpt.c | 2 +- > > sys/cddl/compat/opensolaris/kern/opensolaris_string.c | 2 +- > > sys/cddl/compat/opensolaris/sys/cmn_err.h | 2 +- > > sys/cddl/compat/opensolaris/sys/varargs.h | 2 +- > > sys/cddl/dev/fbt/fbt.c | 2 +- > > sys/cddl/dev/profile/profile.c | 2 +- > > sys/cddl/dev/systrace/systrace.c | 3 +-- > > sys/compat/linux/linux_util.c | 3 +-- > > sys/compat/linuxkpi/common/include/linux/kmod.h | 2 +- > > sys/compat/linuxkpi/common/include/linux/kobject.h | 2 +- > > sys/compat/linuxkpi/common/include/linux/stdarg.h | 2 +- > > sys/compat/linuxkpi/common/include/stdarg.h | 2 +- > > sys/compat/linuxkpi/common/src/linux_compat.c | 3 +-- > > sys/compat/linuxkpi/common/src/linux_idr.c | 3 +-- > > sys/compat/linuxkpi/common/src/linux_pci.c | 2 +- > > sys/contrib/dev/acpica/include/platform/acfreebsd.h | 2 +- > > sys/contrib/libnv/bsd_nvpair.c | 3 +-- > > sys/contrib/libnv/cnvlist.c | 3 +-- > > sys/contrib/libnv/dnvlist.c | 3 +-- > > sys/contrib/libnv/nvlist.c | 3 +-- > > sys/contrib/ncsw/inc/stdarg_ext.h | 2 +- > > sys/contrib/ncsw/user/env/xx.c | 2 +- > > sys/contrib/openzfs/module/os/freebsd/spl/spl_string.c | 2 +- > > sys/contrib/rdma/krping/krping_dev.c | 2 +- > > sys/contrib/vchiq/interface/compat/vchi_bsd.c | 3 +-- > > sys/ddb/db_output.c | 3 +-- > > sys/ddb/db_pprint.c | 3 +-- > > sys/dev/aacraid/aacraid_debug.c | 3 +-- > > sys/dev/ahci/ahci.c | 2 +- > > sys/dev/ahci/ahci_pci.c | 2 +- > > sys/dev/ahci/ahciem.c | 2 +- > > sys/dev/ata/ata-all.c | 2 +- > > sys/dev/ata/ata-isa.c | 2 +- > > sys/dev/ata/ata-pci.c | 5 ++++- > > sys/dev/ata/ata-sata.c | 2 +- > > sys/dev/ata/chipsets/ata-acard.c | 2 +- > > sys/dev/ata/chipsets/ata-acerlabs.c | 2 +- > > sys/dev/ata/chipsets/ata-amd.c | 2 +- > > sys/dev/ata/chipsets/ata-ati.c | 2 +- > > sys/dev/ata/chipsets/ata-cenatek.c | 2 +- > > sys/dev/ata/chipsets/ata-cypress.c | 2 +- > > sys/dev/ata/chipsets/ata-cyrix.c | 2 +- > > sys/dev/ata/chipsets/ata-highpoint.c | 2 +- > > sys/dev/ata/chipsets/ata-intel.c | 2 +- > > sys/dev/ata/chipsets/ata-ite.c | 2 +- > > sys/dev/ata/chipsets/ata-jmicron.c | 2 +- > > sys/dev/ata/chipsets/ata-marvell.c | 2 +- > > sys/dev/ata/chipsets/ata-micron.c | 2 +- > > sys/dev/ata/chipsets/ata-national.c | 2 +- > > sys/dev/ata/chipsets/ata-netcell.c | 2 +- > > sys/dev/ata/chipsets/ata-nvidia.c | 2 +- > > sys/dev/ata/chipsets/ata-promise.c | 2 +- > > sys/dev/ata/chipsets/ata-serverworks.c | 2 +- > > sys/dev/ata/chipsets/ata-siliconimage.c | 2 +- > > sys/dev/ata/chipsets/ata-sis.c | 2 +- > > sys/dev/ata/chipsets/ata-via.c | 2 +- > > sys/dev/ath/ah_osdep.c | 3 +-- > > sys/dev/bhnd/nvram/bhnd_nvram_private.h | 3 +-- > > sys/dev/bhnd/nvram/bhnd_nvram_value.h | 2 +- > > sys/dev/etherswitch/e6000sw/e6000sw.c | 2 +- > > sys/dev/fdc/fdc.c | 2 +- > > sys/dev/filemon/filemon_wrapper.c | 3 +-- > > sys/dev/gpio/qoriq_gpio.c | 2 +- > > sys/dev/hpt27xx/os_bsd.h | 2 +- > > sys/dev/hptiop/hptiop.c | 2 +- > > sys/dev/hptmv/hptproc.c | 2 +- > > sys/dev/hptnr/os_bsd.h | 2 +- > > sys/dev/hptrr/os_bsd.h | 2 +- > > sys/dev/hyperv/vmbus/vmbus_chan.c | 2 +- > > sys/dev/iavf/iavf_iflib.h | 2 +- > > sys/dev/iavf/iavf_lib.h | 2 +- > > sys/dev/iavf/iavf_osdep.c | 2 +- > > sys/dev/ice/ice_osdep.c | 2 +- > > sys/dev/iicbus/controller/cadence/cdnc_i2c.c | 2 +- > > sys/dev/ioat/ioat.c | 2 +- > > sys/dev/ioat/ioat_test.c | 2 +- > > sys/dev/isci/isci_logger.c | 2 +- > > sys/dev/isp/isp_freebsd.h | 2 +- > > sys/dev/ixl/ixl.h | 2 +- > > sys/dev/mpi3mr/mpi3mr_cam.c | 3 +-- > > sys/dev/mpr/mpr_sas.c | 3 +-- > > sys/dev/mpr/mpr_sas_lsi.c | 3 +-- > > sys/dev/mps/mps_sas.c | 3 +-- > > sys/dev/mps/mps_sas_lsi.c | 3 +-- > > sys/dev/mpt/mpt_debug.c | 2 +- > > sys/dev/mpt/mpt_raid.c | 3 +-- > > sys/dev/mvs/mvs.c | 2 +- > > sys/dev/mvs/mvs_pci.c | 2 +- > > sys/dev/mvs/mvs_soc.c | 2 +- > > sys/dev/nvme/nvme_ctrlr.c | 2 +- > > sys/dev/nvmf/host/nvmf_ns.c | 2 +- > > sys/dev/ocs_fc/ocs_os.h | 2 +- > > sys/dev/ofw/ofw_fdt.c | 3 +-- > > sys/dev/ofw/ofw_standard.c | 3 +-- > > sys/dev/ofw/openfirm.c | 3 +-- > > sys/dev/pci/pci.c | 2 +- > > sys/dev/pci/pci_iov.c | 2 +- > > sys/dev/pci/pci_iov_schema.c | 3 +-- > > sys/dev/ppbus/ppb_msq.c | 2 +- > > sys/dev/proto/proto_core.c | 2 +- > > sys/dev/pst/pst-iop.c | 2 +- > > sys/dev/pst/pst-pci.c | 2 +- > > sys/dev/pst/pst-raid.c | 2 +- > > sys/dev/qat/qat_api/qat_utils/src/QatUtilsServices.c | 2 +- > > sys/dev/random/fenestrasX/fx_rng.c | 2 +- > > sys/dev/rndtest/rndtest.c | 2 +- > > sys/dev/sdhci/sdhci.c | 2 +- > > sys/dev/siis/siis.c | 2 +- > > sys/dev/superio/superio.c | 2 +- > > sys/dev/syscons/syscons.c | 2 +- > > sys/dev/uart/uart_core.c | 2 +- > > sys/dev/uart/uart_tty.c | 2 +- > > sys/dev/usb/usb_dev.c | 3 +-- > > sys/dev/virtio/scsi/virtio_scsi.c | 3 +-- > > sys/dev/xen/bus/xen_intr.c | 2 +- > > sys/dev/xen/console/xen_console.c | 3 +-- > > sys/dev/xen/xenpci/xenpci.c | 3 +-- > > sys/dev/xen/xenstore/xenstore.c | 3 +-- > > sys/fs/nfsclient/nfs_clsubs.c | 7 +------ > > sys/fs/p9fs/p9_client.h | 2 +- > > sys/geom/geom_ctl.c | 3 +-- > > sys/geom/geom_dev.c | 2 +- > > sys/geom/geom_dump.c | 2 +- > > sys/geom/geom_event.c | 3 +-- > > sys/geom/geom_io.c | 2 +- > > sys/geom/geom_slice.c | 2 +- > > sys/geom/geom_subr.c | 2 +- > > sys/i386/i386/bios.c | 2 +- > > sys/i386/linux/linux_vdso_gtod.c | 2 +- > > sys/isa/pnpparse.c | 3 +-- > > sys/kern/kern_boottrace.c | 3 +-- > > sys/kern/kern_conf.c | 2 +- > > sys/kern/kern_devctl.c | 2 +- > > sys/kern/kern_fail.c | 2 +- > > sys/kern/kern_intr.c | 2 +- > > sys/kern/kern_kthread.c | 3 +-- > > sys/kern/kern_shutdown.c | 7 +------ > > sys/kern/kern_ubsan.c | 2 +- > > sys/kern/subr_bus.c | 2 +- > > sys/kern/subr_capability.c | 2 +- > > sys/kern/subr_epoch.c | 2 +- > > sys/kern/subr_gtaskqueue.c | 2 +- > > sys/kern/subr_intr.c | 2 +- > > sys/kern/subr_msan.c | 2 +- > > sys/kern/subr_prf.c | 6 +----- > > sys/kern/subr_sbuf.c | 2 +- > > sys/kern/subr_scanf.c | 7 +------ > > sys/kern/subr_taskqueue.c | 2 +- > > sys/kern/subr_terminal.c | 3 +-- > > sys/kern/subr_witness.c | 3 +-- > > sys/kern/tty.c | 3 +-- > > sys/kern/tty_pts.c | 3 +-- > > sys/kern/vfs_mount.c | 3 +-- > > sys/kern/vfs_subr.c | 3 +-- > > sys/kern/vfs_syscalls.c | 3 +-- > > sys/libkern/asprintf.c | 3 +-- > > sys/net/ieee8023ad_lacp.c | 2 +- > > sys/net/if.c | 2 +- > > sys/net/if_stf.c | 3 +-- > > sys/net/route/fib_algo.c | 3 +-- > > sys/net/vnet.c | 3 +-- > > sys/net80211/ieee80211.c | 3 +-- > > sys/net80211/ieee80211_freebsd.c | 3 +-- > > sys/net80211/ieee80211_input.c | 2 +- > > sys/netgraph/ng_parse.c | 3 +-- > > sys/netinet/libalias/alias_db.c | 2 +- > > sys/netinet/libalias/alias_sctp.c | 2 +- > > sys/netinet/raw_ip.c | 2 +- > > sys/netinet6/raw_ip6.c | 3 +-- > > sys/netipsec/ipsec_input.c | 2 +- > > sys/netipsec/ipsec_offload.c | 3 +-- > > sys/netipsec/key.c | 2 +- > > sys/netipsec/keysock.c | 3 +-- > > sys/netlink/netlink_message_parser.c | 3 +-- > > sys/powerpc/mpc85xx/mpc85xx_gpio.c | 2 +- > > sys/powerpc/ofw/ofw_real.c | 2 +- > > sys/powerpc/ofw/rtas.c | 2 +- > > sys/powerpc/powermac/ata_dbdma.c | 2 +- > > sys/powerpc/powermac/ata_kauai.c | 2 +- > > sys/powerpc/powermac/ata_macio.c | 2 +- > > sys/powerpc/psim/ata_iobus.c | 2 +- > > sys/rpc/rpcsec_gss/rpcsec_gss_prot.c | 2 +- > > sys/security/audit/audit_worker.c | 3 +-- > > sys/security/mac_do/mac_do.c | 3 +-- > > sys/tests/ktest.c | 2 +- > > sys/x86/x86/ucode.c | 2 +- > > sys/xen/xenbus/xenbus.c | 3 +-- > > sys/xen/xenbus/xenbusb.c | 3 +-- > > sys/xen/xenbus/xenbusb_back.c | 3 +-- > > sys/xen/xenbus/xenbusb_front.c | 3 +-- > > sys/xen/xenbus/xenbusvar.h | 3 +-- > > sys/xen/xenstore/xenstorevar.h | 3 +-- > > tools/tools/vhba/vhba.h | 2 +- > > tools/uma/smrstress/smrstress.c | 3 +-- > > 232 files changed, 245 insertions(+), 321 deletions(-) > > > > diff --git a/share/man/man9/PCI_IOV_ADD_VF.9 b/share/man/man9/PCI_IOV_ADD_VF.9 > > index d13cb6e1ddc9..512b0b8668cc 100644 > > --- a/share/man/man9/PCI_IOV_ADD_VF.9 > > +++ b/share/man/man9/PCI_IOV_ADD_VF.9 > > @@ -31,7 +31,7 @@ > > .Nd inform a PF driver that a VF is being created > > .Sh SYNOPSIS > > .In sys/bus.h > > -.In machine/stdarg.h > > +.In sys/stdarg.h > > .In sys/nv.h > > .In dev/pci/pci_iov.h > > .Ft int > > diff --git a/share/man/man9/PCI_IOV_INIT.9 b/share/man/man9/PCI_IOV_INIT.9 > > index 66b1e693cedb..8ce94800f6d1 100644 > > --- a/share/man/man9/PCI_IOV_INIT.9 > > +++ b/share/man/man9/PCI_IOV_INIT.9 > > @@ -31,7 +31,7 @@ > > .Nd enable SR-IOV on a PF device > > .Sh SYNOPSIS > > .In sys/bus.h > > -.In machine/stdarg.h > > +.In sys/stdarg.h > > .In sys/nv.h > > .In dev/pci/pci_iov.h > > .Ft int > > diff --git a/share/man/man9/pci_iov_schema.9 b/share/man/man9/pci_iov_schema.9 > > index 764d357fbaee..99589b59fb91 100644 > > --- a/share/man/man9/pci_iov_schema.9 > > +++ b/share/man/man9/pci_iov_schema.9 > > @@ -38,7 +38,7 @@ > > .Nm pci_iov_schema_add_unicast_mac > > .Nd PCI SR-IOV config schema interface > > .Sh SYNOPSIS > > -.In machine/stdarg.h > > +.In sys/stdarg.h > > .In sys/nv.h > > .In sys/iov_schema.h > > .Ft nvlist_t * > > diff --git a/stand/common/dev_net.c b/stand/common/dev_net.c > > index 3cd78c5346ac..fc6b43ec7a40 100644 > > --- a/stand/common/dev_net.c > > +++ b/stand/common/dev_net.c > > @@ -47,9 +47,10 @@ > > * for use by the NFS open code (NFS/lookup). > > */ > > > > -#include > > #include > > #include > > +#include > > + > > #include > > #include > > #include > > diff --git a/stand/common/md.c b/stand/common/md.c > > index d12429c3c45c..2c3eb5ded19b 100644 > > --- a/stand/common/md.c > > +++ b/stand/common/md.c > > @@ -28,7 +28,7 @@ > > #include > > #include > > #include > > -#include > > +#include > > > > #include "bootstrap.h" > > > > diff --git a/stand/efi/boot1/boot1.c b/stand/efi/boot1/boot1.c > > index 908baf400972..b93c6b425160 100644 > > --- a/stand/efi/boot1/boot1.c > > +++ b/stand/efi/boot1/boot1.c > > @@ -20,8 +20,10 @@ > > */ > > > > #include > > +#include > > + > > #include > > -#include > > + > > #include > > > > #include > > diff --git a/stand/efi/boot1/proto.c b/stand/efi/boot1/proto.c > > index 6660d39a921b..f81debd168b9 100644 > > --- a/stand/efi/boot1/proto.c > > +++ b/stand/efi/boot1/proto.c > > @@ -20,8 +20,10 @@ > > */ > > > > #include > > +#include > > + > > #include > > -#include > > + > > #include > > > > #include > > diff --git a/stand/efi/gptboot/proto.c b/stand/efi/gptboot/proto.c > > index e2face6c23e5..a1825d9c1c15 100644 > > --- a/stand/efi/gptboot/proto.c > > +++ b/stand/efi/gptboot/proto.c > > @@ -24,8 +24,10 @@ > > */ > > > > #include > > +#include > > + > > #include > > -#include > > + > > #include > > > > #include > > diff --git a/stand/i386/libi386/biosacpi.c b/stand/i386/libi386/biosacpi.c > > index 077b6c7e53de..8ddd322b9f99 100644 > > --- a/stand/i386/libi386/biosacpi.c > > +++ b/stand/i386/libi386/biosacpi.c > > @@ -25,7 +25,7 @@ > > */ > > > > #include > > -#include > > +#include > > #include > > #include > > #include "libi386.h" > > diff --git a/stand/i386/libi386/biospci.c b/stand/i386/libi386/biospci.c > > index 5b39eab1e5e5..a89a6d30a1e8 100644 > > --- a/stand/i386/libi386/biospci.c > > +++ b/stand/i386/libi386/biospci.c > > @@ -31,7 +31,7 @@ > > */ > > > > #include > > -#include > > +#include > > #include > > #include > > #include > > diff --git a/stand/i386/libi386/biospnp.c b/stand/i386/libi386/biospnp.c > > index 5b22f066d4ef..c01d2888a9f7 100644 > > --- a/stand/i386/libi386/biospnp.c > > +++ b/stand/i386/libi386/biospnp.c > > @@ -29,7 +29,7 @@ > > */ > > > > #include > > -#include > > +#include > > #include > > #include > > #include > > diff --git a/stand/liblua/lstd.h b/stand/liblua/lstd.h > > index ce3aef4bc5fc..2b601f129566 100644 > > --- a/stand/liblua/lstd.h > > +++ b/stand/liblua/lstd.h > > @@ -29,10 +29,10 @@ > > > > #include > > #include > > +#include > > #include > > #include > > #include > > -#include > > > > /* > > * Mini stdio FILE and DIR routines. These are the minimal routines needed by > > diff --git a/stand/libofw/ofw_disk.c b/stand/libofw/ofw_disk.c > > index fc4c25bd9424..d4bce64d9be5 100644 > > --- a/stand/libofw/ofw_disk.c > > +++ b/stand/libofw/ofw_disk.c > > @@ -28,11 +28,10 @@ > > */ > > > > #include > > +#include > > > > #include > > > > -#include > > - > > #include > > #include > > > > diff --git a/stand/libofw/openfirm.c b/stand/libofw/openfirm.c > > index 58e7d8cbe755..1df65784e47a 100644 > > --- a/stand/libofw/openfirm.c > > +++ b/stand/libofw/openfirm.c > > @@ -56,8 +56,7 @@ > > */ > > > > #include > > - > > -#include > > +#include > > > > #include > > > > diff --git a/stand/libsa/Makefile b/stand/libsa/Makefile > > index 42ef3e69c18a..f5a1acea843e 100644 > > --- a/stand/libsa/Makefile > > +++ b/stand/libsa/Makefile > > @@ -209,8 +209,8 @@ beforedepend: > > for i in ${SAFE_INCS}; do \ > > ln -sf ${SRCTOP}/include/$$i $$i; \ > > done; \ > > - ln -sf ${SYSDIR}/${MACHINE}/include/stdarg.h stdarg.h; \ > > ln -sf ${SYSDIR}/sys/errno.h errno.h; \ > > + ln -sf ${SYSDIR}/sys/stdarg.h stdarg.h; \ > > ln -sf ${SYSDIR}/sys/stdint.h stdint.h; \ > > ln -sf ${SRCTOP}/include/arpa/inet.h arpa/inet.h; \ > > ln -sf ${SRCTOP}/include/arpa/tftp.h arpa/tftp.h; \ > > diff --git a/stand/libsa/panic.c b/stand/libsa/panic.c > > index 319f08094d92..a555743f0414 100644 > > --- a/stand/libsa/panic.c > > +++ b/stand/libsa/panic.c > > @@ -34,7 +34,7 @@ > > */ > > > > #include > > -#include > > +#include > > > > /* > > * Boot loaders and other standalone programs that wish to have a > > diff --git a/stand/libsa/printf.c b/stand/libsa/printf.c > > index a84c5431f536..053b54d31eff 100644 > > --- a/stand/libsa/printf.c > > +++ b/stand/libsa/printf.c > > @@ -37,18 +37,13 @@ > > */ > > > > #include > > +#include > > #include > > #include > > #include > > #include > > #include "stand.h" > > > > -/* > > - * Note that stdarg.h and the ANSI style va_start macro is used for both > > - * ANSI and traditional C compilers. > > - */ > > -#include > > - > > #define MAXNBUF (sizeof(intmax_t) * CHAR_BIT + 1) > > > > typedef void (kvprintf_fn_t)(int, void *); > > diff --git a/stand/powerpc/boot1.chrp/boot1.c b/stand/powerpc/boot1.chrp/boot1.c > > index cdacb05c31ce..1a546f3473e2 100644 > > --- a/stand/powerpc/boot1.chrp/boot1.c > > +++ b/stand/powerpc/boot1.chrp/boot1.c > > @@ -18,9 +18,11 @@ > > #include > > #include > > #include > > +#include > > + > > #include > > -#include > > #include > > + > > #include > > > > #include "paths.h" > > diff --git a/stand/uboot/uboot_disk.c b/stand/uboot/uboot_disk.c > > index 4f7b6ba06942..1f75f0f6da3c 100644 > > --- a/stand/uboot/uboot_disk.c > > +++ b/stand/uboot/uboot_disk.c > > @@ -33,7 +33,8 @@ > > > > #include > > #include > > -#include > > +#include > > + > > #include > > > > #include "api_public.h" > > diff --git a/sys/amd64/linux/linux_vdso_gtod.c b/sys/amd64/linux/linux_vdso_gtod.c > > index 519ca2f2de93..abe42d51a3ac 100644 > > --- a/sys/amd64/linux/linux_vdso_gtod.c > > +++ b/sys/amd64/linux/linux_vdso_gtod.c > > @@ -28,6 +28,7 @@ > > #include > > #include > > #include > > +#include > > #include > > #define _KERNEL > > #include > > @@ -36,7 +37,6 @@ > > > > #include > > #include > > -#include > > > > #include > > #include > > diff --git a/sys/amd64/linux32/linux32_vdso_gtod.c b/sys/amd64/linux32/linux32_vdso_gtod.c > > index ec5851c45c28..f32db30057d0 100644 > > --- a/sys/amd64/linux32/linux32_vdso_gtod.c > > +++ b/sys/amd64/linux32/linux32_vdso_gtod.c > > @@ -28,6 +28,7 @@ > > #include > > #include > > #include > > +#include > > #include > > #define _KERNEL > > #include > > @@ -36,7 +37,6 @@ > > > > #include > > #include > > -#include > > > > #include > > #include > > diff --git a/sys/arm/ti/cpsw/if_cpsw.c b/sys/arm/ti/cpsw/if_cpsw.c > > index ea8f9c18490e..dc3d8b1f9023 100644 > > --- a/sys/arm/ti/cpsw/if_cpsw.c > > +++ b/sys/arm/ti/cpsw/if_cpsw.c > > @@ -59,11 +59,11 @@ > > #include > > #include > > #include > > +#include > > #include > > > > #include > > #include > > -#include > > > > #include > > #include > > diff --git a/sys/arm/xilinx/zy7_devcfg.c b/sys/arm/xilinx/zy7_devcfg.c > > index 6df0fba1f56a..41618225a566 100644 > > --- a/sys/arm/xilinx/zy7_devcfg.c > > +++ b/sys/arm/xilinx/zy7_devcfg.c > > @@ -40,6 +40,7 @@ > > #include > > #include > > #include > > +#include > > #include > > #include > > #include > > @@ -49,7 +50,6 @@ > > > > #include > > #include > > -#include > > > > #include > > #include > > diff --git a/sys/arm/xilinx/zy7_ehci.c b/sys/arm/xilinx/zy7_ehci.c > > index 545e2a9bce16..6d84ec751e08 100644 > > --- a/sys/arm/xilinx/zy7_ehci.c > > +++ b/sys/arm/xilinx/zy7_ehci.c > > @@ -45,10 +45,10 @@ > > #include > > #include > > #include > > +#include > > > > #include > > #include > > -#include > > > > #include > > #include > > diff --git a/sys/arm/xilinx/zy7_gpio.c b/sys/arm/xilinx/zy7_gpio.c > > index 091237014c6f..71b6fc3c0586 100644 > > --- a/sys/arm/xilinx/zy7_gpio.c > > +++ b/sys/arm/xilinx/zy7_gpio.c > > @@ -53,11 +53,11 @@ > > #include > > #include > > #include > > +#include > > #include > > > > #include > > #include > > -#include > > > > #include > > #include > > diff --git a/sys/arm/xilinx/zy7_qspi.c b/sys/arm/xilinx/zy7_qspi.c > > index 49d4cafd8d61..42091bc78619 100644 > > --- a/sys/arm/xilinx/zy7_qspi.c > > +++ b/sys/arm/xilinx/zy7_qspi.c > > @@ -42,11 +42,11 @@ > > #include > > #include > > #include > > +#include > > #include > > > > #include > > #include > > -#include > > > > #include > > #include > > diff --git a/sys/arm/xilinx/zy7_slcr.c b/sys/arm/xilinx/zy7_slcr.c > > index a46ccb59a07b..40bcff49162b 100644 > > --- a/sys/arm/xilinx/zy7_slcr.c > > +++ b/sys/arm/xilinx/zy7_slcr.c > > @@ -42,12 +42,12 @@ > > #include > > #include > > #include > > +#include > > #include > > #include > > > > #include > > #include > > -#include > > > > #include > > #include > > diff --git a/sys/arm/xilinx/zy7_spi.c b/sys/arm/xilinx/zy7_spi.c > > index bb5bb7f46767..636a40d729d6 100644 > > --- a/sys/arm/xilinx/zy7_spi.c > > +++ b/sys/arm/xilinx/zy7_spi.c > > @@ -34,11 +34,11 @@ > > #include > > #include > > #include > > +#include > > #include > > > > #include > > #include > > -#include > > > > #include > > #include > > diff --git a/sys/arm64/linux/linux_vdso_gtod.c b/sys/arm64/linux/linux_vdso_gtod.c > > index f7def68d88c4..203c76b6e3a9 100644 > > --- a/sys/arm64/linux/linux_vdso_gtod.c > > +++ b/sys/arm64/linux/linux_vdso_gtod.c > > @@ -29,6 +29,7 @@ > > #include > > #include > > #include > > +#include > > #include > > #define _KERNEL > > #include > > @@ -36,7 +37,6 @@ > > #include > > > > #include > > -#include > > > > #include > > #include > > diff --git a/sys/arm64/qoriq/qoriq_gpio_pic.c b/sys/arm64/qoriq/qoriq_gpio_pic.c > > index ec84d2a14ae7..aca8b9daea13 100644 > > --- a/sys/arm64/qoriq/qoriq_gpio_pic.c > > +++ b/sys/arm64/qoriq/qoriq_gpio_pic.c > > @@ -34,11 +34,11 @@ > > #include > > #include > > #include > > +#include > > #include > > > > #include > > #include > > -#include > > > > #include > > #include > > diff --git a/sys/cam/ata/ata_xpt.c b/sys/cam/ata/ata_xpt.c > > index 61cffeda6f0c..e33e1fafa274 100644 > > --- a/sys/cam/ata/ata_xpt.c > > +++ b/sys/cam/ata/ata_xpt.c > > @@ -37,6 +37,7 @@ > > #include > > #include > > #include > > +#include > > > > #include > > #include > > @@ -57,7 +58,6 @@ > > #include > > #include > > #include > > -#include /* for xpt_print below */ > > > > struct ata_quirk_entry { > > struct scsi_inquiry_pattern inq_pat; > > diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c > > index 8428125d5e99..38bc82c69aad 100644 > > --- a/sys/cam/cam_xpt.c > > +++ b/sys/cam/cam_xpt.c > > @@ -44,6 +44,7 @@ > > #include > > #include > > #include > > +#include > > #include > > > > #include > > @@ -68,7 +69,6 @@ > > #include > > #include > > > > -#include /* for xpt_print below */ > > > > /* Wild guess based on not wanting to grow the stack too much */ > > #define XPT_PRINT_MAXLEN 512 > > diff --git a/sys/cam/ctl/ctl_error.c b/sys/cam/ctl/ctl_error.c > > index d07541a1a986..debc6b1e29ee 100644 > > --- a/sys/cam/ctl/ctl_error.c > > +++ b/sys/cam/ctl/ctl_error.c > > @@ -49,8 +49,8 @@ > > #include > > #include > > #include > > +#include > > #include > > -#include > > > > #include > > #include > > diff --git a/sys/cam/ctl/ctl_error.h b/sys/cam/ctl/ctl_error.h > > index fb2113bef048..55fb8e30b5e8 100644 > > --- a/sys/cam/ctl/ctl_error.h > > +++ b/sys/cam/ctl/ctl_error.h > > @@ -39,7 +39,7 @@ > > * Author: Ken Merry > > */ > > > > -#include > > +#include > > > > #ifndef _CTL_ERROR_H_ > > #define _CTL_ERROR_H_ > > diff --git a/sys/cam/mmc/mmc_xpt.c b/sys/cam/mmc/mmc_xpt.c > > index b7f1e5bce868..138f96eaaa49 100644 > > --- a/sys/cam/mmc/mmc_xpt.c > > +++ b/sys/cam/mmc/mmc_xpt.c > > @@ -38,6 +38,7 @@ > > #include > > #include > > #include > > +#include > > > > #include > > #include > > @@ -58,7 +59,6 @@ > > #include > > #include > > > > -#include /* for xpt_print below */ > > #include /* for PRIu64 */ > > > > FEATURE(mmccam, "CAM-based MMC/SD/SDIO stack"); > > diff --git a/sys/cam/nvme/nvme_xpt.c b/sys/cam/nvme/nvme_xpt.c > > index bac9e6441040..f6667df07be0 100644 > > --- a/sys/cam/nvme/nvme_xpt.c > > +++ b/sys/cam/nvme/nvme_xpt.c > > @@ -38,6 +38,7 @@ > > #include > > #include > > #include > > +#include > > > > #include > > #include > > @@ -57,7 +58,6 @@ > > #include > > #include > > #include > > -#include /* for xpt_print below */ > > > > struct nvme_quirk_entry { > > u_int quirks; > > diff --git a/sys/cam/scsi/scsi_all.h b/sys/cam/scsi/scsi_all.h > > index 944f70e03da6..b6fb66beefcd 100644 > > --- a/sys/cam/scsi/scsi_all.h > > +++ b/sys/cam/scsi/scsi_all.h > > @@ -18,7 +18,7 @@ > > > > #ifdef _KERNEL > > #include > > -#include > > +#include > > #else > > #include > > #endif > > diff --git a/sys/cam/scsi/scsi_enc.c b/sys/cam/scsi/scsi_enc.c > > index 4415e940cd96..9705a0b890b4 100644 > > --- a/sys/cam/scsi/scsi_enc.c > > +++ b/sys/cam/scsi/scsi_enc.c > > @@ -39,14 +39,13 @@ > > #include > > #include > > #include > > +#include > > #include > > #include > > #include > > #include > > #include > > > > -#include > > - > > #include > > #include > > #include > > diff --git a/sys/cam/scsi/scsi_xpt.c b/sys/cam/scsi/scsi_xpt.c > > index 21cb6beaf1fb..2bb59cb2d92b 100644 > > --- a/sys/cam/scsi/scsi_xpt.c > > +++ b/sys/cam/scsi/scsi_xpt.c > > @@ -40,6 +40,7 @@ > > #include > > #include > > #include > > +#include > > > > #include > > #include > > @@ -59,7 +60,6 @@ > > #include > > #include > > #include > > -#include /* for xpt_print below */ > > > > struct scsi_quirk_entry { > > struct scsi_inquiry_pattern inq_pat; > > diff --git a/sys/cddl/compat/opensolaris/kern/opensolaris_string.c > > b/sys/cddl/compat/opensolaris/kern/opensolaris_string.c index ec088f216cb3..4c8eb533e930 > > 100644 --- a/sys/cddl/compat/opensolaris/kern/opensolaris_string.c > > +++ b/sys/cddl/compat/opensolaris/kern/opensolaris_string.c > > @@ -26,7 +26,7 @@ > > #include > > #include > > #include > > -#include > > +#include > > > > #define IS_DIGIT(c) ((c) >= '0' && (c) <= '9') > > > > diff --git a/sys/cddl/compat/opensolaris/sys/cmn_err.h > > b/sys/cddl/compat/opensolaris/sys/cmn_err.h index 2623693ec8b7..b3ebf6414e8b 100644 > > --- a/sys/cddl/compat/opensolaris/sys/cmn_err.h > > +++ b/sys/cddl/compat/opensolaris/sys/cmn_err.h > > @@ -28,7 +28,7 @@ > > #define _OPENSOLARIS_SYS_CMN_ERR_H_ > > > > #include > > -#include > > +#include > > > > #ifdef __cplusplus > > extern "C" { > > diff --git a/sys/cddl/compat/opensolaris/sys/varargs.h > > b/sys/cddl/compat/opensolaris/sys/varargs.h index 9684502756cb..bede89fafa18 100644 > > --- a/sys/cddl/compat/opensolaris/sys/varargs.h > > +++ b/sys/cddl/compat/opensolaris/sys/varargs.h > > @@ -28,7 +28,7 @@ > > #define _OPENSOLARIS_SYS_VARARGS_H_ > > > > #ifdef _KERNEL > > -#include > > +#include > > #else > > #include > > #endif > > diff --git a/sys/cddl/dev/fbt/fbt.c b/sys/cddl/dev/fbt/fbt.c > > index 99a77ba65eb8..da9c4ee2ab76 100644 > > --- a/sys/cddl/dev/fbt/fbt.c > > +++ b/sys/cddl/dev/fbt/fbt.c > > @@ -49,12 +49,12 @@ > > #include > > #include > > #include > > +#include > > #include > > #include > > #include > > #include > > #include > > -#include > > > > #include > > #include > > diff --git a/sys/cddl/dev/profile/profile.c b/sys/cddl/dev/profile/profile.c > > index 3e106aab1c85..23a8c9256708 100644 > > --- a/sys/cddl/dev/profile/profile.c > > +++ b/sys/cddl/dev/profile/profile.c > > @@ -48,11 +48,11 @@ > > #include > > #include > > #include > > +#include > > #include > > #include > > #include > > #include > > -#include > > > > #include > > #include > > diff --git a/sys/cddl/dev/systrace/systrace.c b/sys/cddl/dev/systrace/systrace.c > > index c14a663d1995..d8fe1a6430c6 100644 > > --- a/sys/cddl/dev/systrace/systrace.c > > +++ b/sys/cddl/dev/systrace/systrace.c > > @@ -47,6 +47,7 @@ > > #include > > #include > > #include > > +#include > > #include > > #include > > #include > > @@ -54,8 +55,6 @@ > > *** 3126 LINES SKIPPED *** > > > > > > -- > > A FreeBSD user From nobody Wed Jun 11 20:21:53 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHcWj3pstz5yQXT; Wed, 11 Jun 2025 20:21:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHcWj3CLZz42HH; Wed, 11 Jun 2025 20:21:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749673313; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=elzK3URtkRRKhRPC8n8N7HmwT0SWyjJbsCvA1XRAcDU=; b=azBdLB4liMAOUHyebdRGoAruuAYDDGuwFjI/tmkYFAZ6Ksf9jKmDbSlXVU+NuasBYRhRGp Vflq+ZYlth6gdwSkED3maQXACZDz/6MqjxWGsjmkOzhwGH7tCK4thfw9jhS2qs+UMvxRoZ Je5DoIQ2tGlrBmHRFahy/TKSv5aW0CeAfWlVPbhivX85LSIvIRswkI//ociXyCBgZAu1bo 3nzuj9brEnnP4CzznKLpmElJwmb06RNXfvZ/nBXQRNsWQEe1sXsLQxkPxYleE4lq6rMnwM qOdvi4aMziU7+p1Xes55Iab0nv5ikdw0tYWdGIlcIPKI4olJYWvvZ9/KqbUDOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749673313; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=elzK3URtkRRKhRPC8n8N7HmwT0SWyjJbsCvA1XRAcDU=; b=UlJC9O+/C0gjp8vTNDlXCKzEhPP+Wn8S20guBnXmcO7E6TN/jmlFWGHwnruaykzQJhXFNO kC6g3l5bqmlKgbk/2Ovno02T9OARvAjoXWknPkVU1K+qayazJlz7pz69mXQ/UqnNyogW5y Qjtd6HGyYibqyxsTGVLfTLczS5A3cdyc+fTZTWH0WSjJT2+h9Rn1DaEpoMy2ri1DVH+7gA 9vDs5NmipSB3sEWpyB0vQXPSCrTBFHWObsZN9+rfMGdTMZTK7LnaTCYAgBv6T5v68NYTXp QjU+d+pFW/KiLEJZXf26m/9YWufZfUG7s1PcnOqx1Ili8dmJLjg6WrvcnaFISg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749673313; a=rsa-sha256; cv=none; b=Ayso6vmXY+7AX/0e5R/RIUUyATTlxi53m28OenthVplAqLpkooje5nNzPtrMXmHF5eRaot 0+sS6/cBlmDZ3Ub8RDrj2icrjZsYjgZOqTxmNXJ080zPcVM7kd9CsxDR+iYLCW1dy77AEw KyJ4vAHkIJZoRtQXzAxx0hpBrqL8br9qZDsyF8x0e7QpSblCCzg4E769E9SeRoc08lQ+N6 BUzyLXWJ5Pf4ssGFC9tt5+fhmQL0awhu9vsf1eK69ZqlOjwP8qB+YJwNyziSpX7aAihaS+ TP+FhMIYJhCpskVOIqpsEjF324XddRkqY70rWPMG/TyIvRl5JsqgP3OvYwwQsQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bHcWj2pPjzjTZ; Wed, 11 Jun 2025 20:21:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55BKLrn3025440; Wed, 11 Jun 2025 20:21:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55BKLroa025437; Wed, 11 Jun 2025 20:21:53 GMT (envelope-from git) Date: Wed, 11 Jun 2025 20:21:53 GMT Message-Id: <202506112021.55BKLroa025437@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Cox Subject: git: 797020a76406 - main - vm: retire vm_page_lock() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 797020a76406a8e7a4afbd3706884b58a6e4b4ec Auto-Submitted: auto-generated The branch main has been updated by alc: URL: https://cgit.FreeBSD.org/src/commit/?id=797020a76406a8e7a4afbd3706884b58a6e4b4ec commit 797020a76406a8e7a4afbd3706884b58a6e4b4ec Author: Alan Cox AuthorDate: 2025-06-10 07:23:23 +0000 Commit: Alan Cox CommitDate: 2025-06-11 20:19:41 +0000 vm: retire vm_page_lock() vm_page_lock() and its underlying array of locks, pa_lock[], have been replaced throughout the virtual memory system by either atomics or busy-style, per-page synchronization. The Linux KPI support contained the only remaining use cases. Eliminate or update them as appropriate to each case. Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D50767 --- sys/amd64/include/vmparam.h | 4 -- sys/compat/linuxkpi/common/include/linux/highmem.h | 2 - sys/compat/linuxkpi/common/include/linux/mm.h | 4 +- sys/powerpc/aim/mmu_oea64.c | 2 +- sys/powerpc/include/vmparam.h | 6 --- sys/vm/vm_object.c | 1 - sys/vm/vm_page.c | 41 --------------------- sys/vm/vm_page.h | 43 ---------------------- sys/vm/vm_param.h | 8 ---- 9 files changed, 3 insertions(+), 108 deletions(-) diff --git a/sys/amd64/include/vmparam.h b/sys/amd64/include/vmparam.h index 026da4b460e2..0cd9bb4fa7a4 100644 --- a/sys/amd64/include/vmparam.h +++ b/sys/amd64/include/vmparam.h @@ -149,10 +149,6 @@ #define VM_LEVEL_0_ORDER 9 #endif -#ifdef SMP -#define PA_LOCK_COUNT 256 -#endif - /* * Kernel physical load address for non-UEFI boot and for legacy UEFI loader. * Newer UEFI loader loads kernel anywhere below 4G, with memory allocated diff --git a/sys/compat/linuxkpi/common/include/linux/highmem.h b/sys/compat/linuxkpi/common/include/linux/highmem.h index 8b5255c1869c..58a9cdcdf60f 100644 --- a/sys/compat/linuxkpi/common/include/linux/highmem.h +++ b/sys/compat/linuxkpi/common/include/linux/highmem.h @@ -79,9 +79,7 @@ kmap_atomic_prot(struct page *page, pgprot_t prot) vm_memattr_t attr = pgprot2cachemode(prot); if (attr != VM_MEMATTR_DEFAULT) { - vm_page_lock(page); page->flags |= PG_FICTITIOUS; - vm_page_unlock(page); pmap_page_set_memattr(page, attr); } return (kmap(page)); diff --git a/sys/compat/linuxkpi/common/include/linux/mm.h b/sys/compat/linuxkpi/common/include/linux/mm.h index 068dbb627c82..156b00a0c0f0 100644 --- a/sys/compat/linuxkpi/common/include/linux/mm.h +++ b/sys/compat/linuxkpi/common/include/linux/mm.h @@ -406,14 +406,14 @@ vmalloc_to_page(const void *addr) static inline int trylock_page(struct page *page) { - return (vm_page_trylock(page)); + return (vm_page_tryxbusy(page)); } static inline void unlock_page(struct page *page) { - vm_page_unlock(page); + vm_page_xunbusy(page); } extern int is_vmalloc_addr(const void *addr); diff --git a/sys/powerpc/aim/mmu_oea64.c b/sys/powerpc/aim/mmu_oea64.c index e24f591498dd..40dd232f47c1 100644 --- a/sys/powerpc/aim/mmu_oea64.c +++ b/sys/powerpc/aim/mmu_oea64.c @@ -122,7 +122,7 @@ uintptr_t moea64_get_unique_vsid(void); * */ -#define PV_LOCK_COUNT PA_LOCK_COUNT +#define PV_LOCK_COUNT MAXCPU static struct mtx_padalign pv_lock[PV_LOCK_COUNT]; /* diff --git a/sys/powerpc/include/vmparam.h b/sys/powerpc/include/vmparam.h index a612acbef239..67fce74ade55 100644 --- a/sys/powerpc/include/vmparam.h +++ b/sys/powerpc/include/vmparam.h @@ -216,12 +216,6 @@ extern int vm_level_0_order; #define VM_LEVEL_0_ORDER_MAX 12 #endif -#ifdef __powerpc64__ -#ifdef SMP -#define PA_LOCK_COUNT 256 -#endif -#endif - #ifndef VM_INITIAL_PAGEIN #define VM_INITIAL_PAGEIN 16 #endif diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 0e429b58aa1c..f0769102aca1 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -1005,7 +1005,6 @@ vm_object_page_clean_flush(struct pctrie_iter *pages, vm_page_t p, vm_page_t ma[vm_pageout_page_count]; int count, runlen; - vm_page_lock_assert(p, MA_NOTOWNED); vm_page_assert_xbusied(p); ma[0] = p; runlen = vm_radix_iter_lookup_range(pages, p->pindex + 1, diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 128a1ef7ca54..b00f775de6e7 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -114,8 +114,6 @@ struct vm_domain vm_dom[MAXMEMDOM]; DPCPU_DEFINE_STATIC(struct vm_batchqueue, pqbatch[MAXMEMDOM][PQ_COUNT]); -struct mtx_padalign __exclusive_cache_line pa_lock[PA_LOCK_COUNT]; - struct mtx_padalign __exclusive_cache_line vm_domainset_lock; /* The following fields are protected by the domainset lock. */ domainset_t __exclusive_cache_line vm_min_domains; @@ -586,8 +584,6 @@ vm_page_startup(vm_offset_t vaddr) * Initialize the page and queue locks. */ mtx_init(&vm_domainset_lock, "vm domainset lock", NULL, MTX_DEF); - for (i = 0; i < PA_LOCK_COUNT; i++) - mtx_init(&pa_lock[i], "vm page", NULL, MTX_DEF); for (i = 0; i < vm_ndomains; i++) vm_page_domain_init(i); @@ -5809,43 +5805,6 @@ vm_page_valid(vm_page_t m) vm_page_bits_set(m, &m->valid, VM_PAGE_BITS_ALL); } -void -vm_page_lock_KBI(vm_page_t m, const char *file, int line) -{ - - mtx_lock_flags_(vm_page_lockptr(m), 0, file, line); -} - -void -vm_page_unlock_KBI(vm_page_t m, const char *file, int line) -{ - - mtx_unlock_flags_(vm_page_lockptr(m), 0, file, line); -} - -int -vm_page_trylock_KBI(vm_page_t m, const char *file, int line) -{ - - return (mtx_trylock_flags_(vm_page_lockptr(m), 0, file, line)); -} - -#if defined(INVARIANTS) || defined(INVARIANT_SUPPORT) -void -vm_page_assert_locked_KBI(vm_page_t m, const char *file, int line) -{ - - vm_page_lock_assert_KBI(m, MA_OWNED, file, line); -} - -void -vm_page_lock_assert_KBI(vm_page_t m, int a, const char *file, int line) -{ - - mtx_assert_(vm_page_lockptr(m), a, file, line); -} -#endif - #ifdef INVARIANTS void vm_page_object_busy_assert(vm_page_t m) diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h index 4f82a69ebe25..062cf00b5b33 100644 --- a/sys/vm/vm_page.h +++ b/sys/vm/vm_page.h @@ -336,8 +336,6 @@ SLIST_HEAD(spglist, vm_page); extern vm_page_t bogus_page; #endif /* _KERNEL */ -extern struct mtx_padalign pa_lock[]; - #if defined(__arm__) #define PDRSHIFT PDR_SHIFT #elif !defined(PDRSHIFT) @@ -345,40 +343,6 @@ extern struct mtx_padalign pa_lock[]; #endif #define pa_index(pa) ((pa) >> PDRSHIFT) -#define PA_LOCKPTR(pa) ((struct mtx *)(&pa_lock[pa_index(pa) % PA_LOCK_COUNT])) -#define PA_LOCKOBJPTR(pa) ((struct lock_object *)PA_LOCKPTR((pa))) -#define PA_LOCK(pa) mtx_lock(PA_LOCKPTR(pa)) -#define PA_TRYLOCK(pa) mtx_trylock(PA_LOCKPTR(pa)) -#define PA_UNLOCK(pa) mtx_unlock(PA_LOCKPTR(pa)) -#define PA_UNLOCK_COND(pa) \ - do { \ - if ((pa) != 0) { \ - PA_UNLOCK((pa)); \ - (pa) = 0; \ - } \ - } while (0) - -#define PA_LOCK_ASSERT(pa, a) mtx_assert(PA_LOCKPTR(pa), (a)) - -#if defined(KLD_MODULE) && !defined(KLD_TIED) -#define vm_page_lock(m) vm_page_lock_KBI((m), LOCK_FILE, LOCK_LINE) -#define vm_page_unlock(m) vm_page_unlock_KBI((m), LOCK_FILE, LOCK_LINE) -#define vm_page_trylock(m) vm_page_trylock_KBI((m), LOCK_FILE, LOCK_LINE) -#else /* !KLD_MODULE */ -#define vm_page_lockptr(m) (PA_LOCKPTR(VM_PAGE_TO_PHYS((m)))) -#define vm_page_lock(m) mtx_lock(vm_page_lockptr((m))) -#define vm_page_unlock(m) mtx_unlock(vm_page_lockptr((m))) -#define vm_page_trylock(m) mtx_trylock(vm_page_lockptr((m))) -#endif -#if defined(INVARIANTS) -#define vm_page_assert_locked(m) \ - vm_page_assert_locked_KBI((m), __FILE__, __LINE__) -#define vm_page_lock_assert(m, a) \ - vm_page_lock_assert_KBI((m), (a), __FILE__, __LINE__) -#else -#define vm_page_assert_locked(m) -#define vm_page_lock_assert(m, a) -#endif /* * The vm_page's aflags are updated using atomic operations. To set or clear @@ -713,13 +677,6 @@ vm_page_bits_t vm_page_bits(int base, int size); void vm_page_zero_invalid(vm_page_t m, boolean_t setvalid); void vm_page_dirty_KBI(vm_page_t m); -void vm_page_lock_KBI(vm_page_t m, const char *file, int line); -void vm_page_unlock_KBI(vm_page_t m, const char *file, int line); -int vm_page_trylock_KBI(vm_page_t m, const char *file, int line); -#if defined(INVARIANTS) || defined(INVARIANT_SUPPORT) -void vm_page_assert_locked_KBI(vm_page_t m, const char *file, int line); -void vm_page_lock_assert_KBI(vm_page_t m, int a, const char *file, int line); -#endif #define vm_page_busy_fetch(m) atomic_load_int(&(m)->busy_lock) diff --git a/sys/vm/vm_param.h b/sys/vm/vm_param.h index c18dfef97ed4..51b7fdadbf88 100644 --- a/sys/vm/vm_param.h +++ b/sys/vm/vm_param.h @@ -112,14 +112,6 @@ struct xswdev { #define KERN_OUT_OF_BOUNDS 9 #define KERN_RESTART 10 -#ifndef PA_LOCK_COUNT -#ifdef SMP -#define PA_LOCK_COUNT 32 -#else -#define PA_LOCK_COUNT 1 -#endif /* !SMP */ -#endif /* !PA_LOCK_COUNT */ - #ifndef KSTACK_MAX_PAGES #define KSTACK_MAX_PAGES 32 #endif From nobody Wed Jun 11 23:11:18 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHhHB2wjqz5ydT8; Wed, 11 Jun 2025 23:11:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHhHB25dzz3Jdb; Wed, 11 Jun 2025 23:11:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749683478; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vSa+uHx+ilsbNvxcZyJSfms/b6267KUCDs5AQsYhELI=; b=JbdusRcmYRmky5i135PbKtbCthoXn2wtc8PwC74QDZCXNkKCfBPYkP2GuykJvGR2sPqq9K HW7JTWKmMwkvx6bF2N8egu0PguEICSiSLDovSdsMR1d1MbydNCOUH1pQlMgoBJo6W6diy7 njZE8JITL/MRRMFeaGk8rWCHlcYDebFy0RXqvIUlSrPuc+FuLjqWvLR1xVy4M0eTtXnbX+ 4vWavm3qIvw1pjow0Q8eLIWxq0BZ4HzihsHPln/OZSnvMLKl4Hkd5GUymfulQ9naoQvNMP LW9aQUNkZBFFIj7c6wDaBZxYvKpgY37OnfC+3/sB4D3rNgbS7BLP9BqCj9AYKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749683478; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vSa+uHx+ilsbNvxcZyJSfms/b6267KUCDs5AQsYhELI=; b=oFXzs5nHHzUErJqSHg2rwAFzu6knD1WGLQYQBWG6ibVdAn5GN4Ax3cUHVKtL2bYzzBUgFO TxO/n70psjOl+zdGTsD4MbmaDNOxTpvwAvzF+c7eHJtOCNgqFpkDVspV0dsAwXTfJWB/L8 IzlfHQAXzmrjYrlMkDt1/3qt049+/fvEVp0loK27UhFtfBl8RfXdlplmEugptU2mpslC8i Z5xYJoH8DbJX+vJgtCaUTt8nDbsW3UtGgyExjBMiRiDcwb+D84rhIBtULt/RhHXqnCgcuo t5FXsmMu6HK4jyStdubviVgMG8FdqE8U3WD5A2foLaCV0vJI8ho7Y32bdngQRg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749683478; a=rsa-sha256; cv=none; b=PJyAaynMfrDKFnpMBjkNYBsanTcVeSXGPMf58UJY9OA1SatUeVvW2v/v8z8PejRaET8Beb UgMxy92h2Av+8gXqD9OwsWK6o0w3aC1vIctt+/clsvWbqi6+OHXcu1NgaC2p1Z51J23Afo xR23EJ+Gh+lr4dujpEWQe1ZJ3YE8vyk5P1TuMQZRmICmxNbngrGAWTEM9gUaDNFFl3fDjy RTqIV3nZGv23qlA6XjozfxKuSdziLEJUhYa63C877FiYVbQZkd42cSHahnx0Ra+Skr8ITr Naibli87ZrwBOOlsmZGnCO5O9HVB8CZfYZMn47i4Qg82QM/qBUbF1euq38ddjA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bHhHB1Zvjzn0k; Wed, 11 Jun 2025 23:11:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55BNBILc037597; Wed, 11 Jun 2025 23:11:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55BNBIUs037594; Wed, 11 Jun 2025 23:11:18 GMT (envelope-from git) Date: Wed, 11 Jun 2025 23:11:18 GMT Message-Id: <202506112311.55BNBIUs037594@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: 94828b338033 - main - mac_do(4): Examples: Fix some descriptions and a typo List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 94828b33803314b5c8e833b233ca6894a340aa88 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=94828b33803314b5c8e833b233ca6894a340aa88 commit 94828b33803314b5c8e833b233ca6894a340aa88 Author: Olivier Certner AuthorDate: 2025-06-11 23:07:49 +0000 Commit: Olivier Certner CommitDate: 2025-06-11 23:10:37 +0000 mac_do(4): Examples: Fix some descriptions and a typo MFC after: 3 days Sponsored by: The FreeBSD Foundation --- share/man/man4/mac_do.4 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/man/man4/mac_do.4 b/share/man/man4/mac_do.4 index 4c067205225c..f64eae600436 100644 --- a/share/man/man4/mac_do.4 +++ b/share/man/man4/mac_do.4 @@ -348,12 +348,12 @@ Here are several examples of single rules matching processes having a real user ID of 10001: .Bl -tag -width indent .It Li uid=10001>uid=10002 -Allows the process to switch any of its real, effective or saved user ID to +Allows the process to switch all of its real, effective or saved user ID to 10002, but keeping the groups it is already in, and with the same primary/supplementary groups split. .It Li uid=10001>uid=10002,uid=10003 Same as the first example, but also allows to switch to UID 10003 instead of -10002. +10002, or possibly having both in different user IDs. .It Li uid=10001>uid=10002,gid=10002 Same as the first example, but the new primary groups must be set to 10002 and no supplementary groups should be set. @@ -387,7 +387,7 @@ group, allowing its members to switch to root without password. .It Li gid=10001>gid=10002 Allows the process to enter GID 10002 as a primary group, but only if giving up all its supplementary groups. -.It Li security.mac.do.rules=gid=10001>gid=10002,+gid=.\& +.It Li gid=10001>gid=10002,+gid=.\& Same as the previous example, but allows to retain any current supplementary groups. .It Li gid=10001>gid=10002,!gid=.\& From nobody Wed Jun 11 23:16:31 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHhPC5FPSz5ydXY; Wed, 11 Jun 2025 23:16:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHhPC4dzzz3Kvb; Wed, 11 Jun 2025 23:16:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749683791; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tcXKf9+XYfC/TsmfHMYYmxv78m+7+aHRI7IxODrwcAE=; b=vKfEKkTfRsCjvjxsUqGOSxsI3bvbelkkWfha/V+QkBcWSNuGxsd6QaxdtgVXvuivHe31pT M3+iAHsGAI9c7Qc7qXoZC9rJlopLsiG5KfxS7AngTyQz+M9O69JqZUj9UcgqNYsKEvoegK 0kesAkCu02LXb2TvuXqVZmbCHpJXpKwAaIlAO1bsYoX1qPoLT8dciBr3lmRkQ/U2r9hZD2 hGcGrjUdT4cdoG29tebpGqXc3Xx7Xs8ZcLPAyhKD4w0v0Yf8euD3hJmCadYc+ydhFRd8AD kOUy+7FSEMWX2gLsEBpEJl3HF7RJvclsGt/yXEoecFUQEsMGP0cyqdJ3HDrJbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749683791; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tcXKf9+XYfC/TsmfHMYYmxv78m+7+aHRI7IxODrwcAE=; b=hiaQaOR4+AqaE/O7wmpM0EMCEU+Hv0r03lZ0eiaKs+ZFAU1J2GUGorX9x6MY4Vx5xT4drI DB7k5Zi/pTJbk1IRHiG7zeWK9Bv4pW7NMmrKQMU6e8MaGqKEpMX+eyhtOfXoVXLGOhQClK 7q1fvMV0CE2nOgXdsJEUwef4wgAtCcFZNtDDZu+elZZCN4PyHwk10ke6V5jrZN12cFyDKc Ehi6WxjdeSHqus5OWyHaNSH9HrF9lIc9CZGKgqFOUIWPMc2J/sfQErFM+FwwgwejGXNSVn TuZbQWE8Ls2+SxWoyGI+IgPflBddLHndVC/limDcXrcFiqg+KnewRe/H1ubKFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749683791; a=rsa-sha256; cv=none; b=LcuR9orcwIMFx/Pf/wWUNGIfr9pqhmoVkYhIJQjHzuWTi8IVItpLLyYJnmH8AiRLSUIJsE WSbqFryGOOh+MvGqZRFpFMKIqfXpHttUU2cQnZXH4aiFDv1VFBa0tMqqvSBZh1ryFZwB6s YZAevT63w994la8CTUYaV5gFCZXK9x/bg6FPoW10sGYNFE2XRRR5w0Jvyx0zKQE/bxsd3h CviVwyvWZgzOo0muJfjlkvU0aY45UZp2dnlsfuS82tmiKfwz3OrXtGICMsfpbNWpWUrcIz 5xZ70aUliV33fYzgqsZA6UWypedbwz5/iWm9jEVWThVBscJo5o1x/C+uDs8rbA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bHhPC3z87znG1; Wed, 11 Jun 2025 23:16:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55BNGVT4045922; Wed, 11 Jun 2025 23:16:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55BNGVcb045919; Wed, 11 Jun 2025 23:16:31 GMT (envelope-from git) Date: Wed, 11 Jun 2025 23:16:31 GMT Message-Id: <202506112316.55BNGVcb045919@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 86f06e612b36 - main - Add POSIX NSIG_MAX & _SC_NSIG List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 86f06e612b368e0e25080f1967a2e014e3891035 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=86f06e612b368e0e25080f1967a2e014e3891035 commit 86f06e612b368e0e25080f1967a2e014e3891035 Author: Ricardo Branco AuthorDate: 2025-05-25 09:48:04 +0000 Commit: Warner Losh CommitDate: 2025-06-11 23:16:20 +0000 Add POSIX NSIG_MAX & _SC_NSIG Signed-off-by: Ricardo Branco Reviewed by: imp, kib Pull Request: https://github.com/freebsd/freebsd-src/pull/1710 Closes: https://github.com/freebsd/freebsd-src/pull/1710 --- include/limits.h | 1 + include/unistd.h | 4 ++++ lib/libc/gen/sysconf.c | 2 ++ 3 files changed, 7 insertions(+) diff --git a/include/limits.h b/include/limits.h index ed8844e65642..2b75b94cb513 100644 --- a/include/limits.h +++ b/include/limits.h @@ -139,6 +139,7 @@ #if __POSIX_VISIBLE >= 202405 #define GETENTROPY_MAX 256 +#define NSIG_MAX 128 /* _SIG_MAXSIG from */ #endif #include diff --git a/include/unistd.h b/include/unistd.h index 33dd983eb11a..21e3a7740607 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -295,6 +295,10 @@ typedef __useconds_t useconds_t; #define _SC_UEXTERR_MAXLEN 123 /* user */ #endif +#if __POSIX_VISIBLE >= 202405 +#define _SC_NSIG 124 +#endif + /* Extensions found in Solaris and Linux. */ #define _SC_PHYS_PAGES 121 diff --git a/lib/libc/gen/sysconf.c b/lib/libc/gen/sysconf.c index d20b70590fb6..66562d0e29f0 100644 --- a/lib/libc/gen/sysconf.c +++ b/lib/libc/gen/sysconf.c @@ -287,6 +287,8 @@ do_NAME_MAX: mib[0] = CTL_P1003_1B; mib[1] = CTL_P1003_1B_MQ_OPEN_MAX; goto yesno; + case _SC_NSIG: + return (_SIG_MAXSIG); case _SC_PAGESIZE: return (getpagesize()); case _SC_RTSIG_MAX: From nobody Wed Jun 11 23:16:32 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHhPD5vbHz5ydjs; Wed, 11 Jun 2025 23:16:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHhPD5HRkz3KgF; Wed, 11 Jun 2025 23:16:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749683792; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EAyu59Ex7OWMRIb+q3CRtlmp1xCmJToapIsYbpfQiLc=; b=ktAJasybFumijpRLcCI3utIk6pecBzdP5yPhWrMKr2YsgJsiUQWlTVdD8QRGyQyuYD2ntD F6btmqyUntCVKK/457iKcIuWwXpSMwWYGnqD2ouM7x5atx+XBBiaurU+0/xzLKzJ/iTClU Ss75DSDsYuzQug544y/tkvASjwVpicuYlgi2ZysEmLzSWwKNtZ7FMl92jhJUYIvrTcryxj EbkrT/0L6ms8ZaZO8Q8e65e2aMWPsH4IxdoZRdPrcWuR0NxUCt+pS4hIJ3axCUKKFRqJnJ DsK+nmSwvYnl30vFinwl8dlRO0yRe061OiEZUJWufWrWMZnoHjhM6Kefs2vWYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749683792; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EAyu59Ex7OWMRIb+q3CRtlmp1xCmJToapIsYbpfQiLc=; b=QCWbdJboAH2onbLmI2Py5Iw43+UD/HnL0xzbV8TbFc5RBoLlld2XjFM7N97C1E/WpElf+F 7q/8J2Zy/Ol/tyjT9mWgoPTDhha+9IybXOie1Z4yyjIyCNlVx0CnOtAMgN3nODBJcLCDkH cYNCnOYZ8XWXbppcqtPOJ5Eg+k2IMgnWOtXoQfHBJ/qL+J2j3kcQdeByC7+SSPrWogBg3+ VM0bOJK0chts2svsECmcMvRHDECCBFwXsfXGKkQwj2GH29wpf/3bEDa6V52WDRZjWhoE+8 iKImi2DAA0+gRaCBuPB9ff4EJBHyefMA1FIfTbNAVcJRHS17wbgpyaSva6Z2QA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749683792; a=rsa-sha256; cv=none; b=ejocB5G7k6ZbP9jIj8X+6EYS8KVNhozLmB5Sqq/7gy4BFBQpzMWTSGaTmdd2WgnbHPeeyN wTBZq8cTCzncLJrTp5iSbpAxk1PFvNb5UeM3zOrcTbyrNu8xY9E9qmVtSEl44GYNHugtsu I8qoex+Dloumq9kSs1fSUPpEPpfTphsdi5ICvvCafNJEjLPIAlliwa1QihrtchhVBCB0gw dA5uQX+eCXc982HgFjS2wXn6aPMfk8KG/k2SrTqLcwfJmejmMSdp2nkos/qoNeSeaV4zZT d7eGOkg7DQMrfhFQnLGhpOaqVQgVXHo0KDLZ0RFjMNC5MkWJcNjMDoh7rvRsMQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bHhPD4rM5znG2; Wed, 11 Jun 2025 23:16:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55BNGWv4045956; Wed, 11 Jun 2025 23:16:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55BNGWQs045953; Wed, 11 Jun 2025 23:16:32 GMT (envelope-from git) Date: Wed, 11 Jun 2025 23:16:32 GMT Message-Id: <202506112316.55BNGWQs045953@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 37983aef7c70 - main - Add quiet/-q option to /usr/sbin/service List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 37983aef7c70b738cf63923bcfd2c4ae03ac5779 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=37983aef7c70b738cf63923bcfd2c4ae03ac5779 commit 37983aef7c70b738cf63923bcfd2c4ae03ac5779 Author: Dan Mahoney AuthorDate: 2025-05-25 08:54:33 +0000 Commit: Warner Losh CommitDate: 2025-06-11 23:16:21 +0000 Add quiet/-q option to /usr/sbin/service Signed-off-by: Dan Mahoney Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1709 Closes: https://github.com/freebsd/freebsd-src/pull/1709 --- usr.sbin/service/service.8 | 3 +++ usr.sbin/service/service.sh | 23 +++++++++++++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/usr.sbin/service/service.8 b/usr.sbin/service/service.8 index a8f1a509885f..b8917138f478 100644 --- a/usr.sbin/service/service.8 +++ b/usr.sbin/service/service.8 @@ -45,6 +45,7 @@ .Fl r .Nm .Op Fl j Ar jail +.Op Fl q .Op Fl v .Op Fl E Ar var=value .Ar script @@ -115,6 +116,8 @@ as in above, but list all of the files, not just what is enabled. .It Fl v Be slightly more verbose. +.It Fl v +Be quiet, redirecting output to /dev/null. .El .Sh ENVIRONMENT When used to run rc.d scripts the diff --git a/usr.sbin/service/service.sh b/usr.sbin/service/service.sh index 8b7aa937967b..5f456418da49 100755 --- a/usr.sbin/service/service.sh +++ b/usr.sbin/service/service.sh @@ -44,17 +44,19 @@ usage () { echo "-R Stop and start enabled $local_startup services" echo "-l List all scripts in /etc/rc.d and $local_startup" echo '-r Show the results of boot time rcorder' + echo '-q quiet' echo '-v Verbose' echo '' } -while getopts 'j:E:ehlrRv' COMMAND_LINE_ARGUMENT ; do +while getopts 'j:E:ehlqrRv' COMMAND_LINE_ARGUMENT ; do case "${COMMAND_LINE_ARGUMENT}" in j) JAIL="${OPTARG}" ;; E) VARS="${VARS} ${OPTARG}" ;; e) ENABLED=eopt ;; h) usage ; exit 0 ;; l) LIST=lopt ;; + q) QUIET=qopt ;; r) RCORDER=ropt ;; R) RESTART=Ropt ;; v) VERBOSE=vopt ;; @@ -69,6 +71,7 @@ if [ -n "${JAIL}" ]; then args="" [ -n "${ENABLED}" ] && args="${args} -e" [ -n "${LIST}" ] && args="${args} -l" + [ -n "${QUIET}" ] && args="${args} -q" [ -n "${RCORDER}" ] && args="${args} -r" [ -n "${RESTART}" ] && args="${args} -R" [ -n "${VERBOSE}" ] && args="${args} -v" @@ -100,14 +103,22 @@ if [ -n "$RESTART" ]; then if [ -n "$rcvar" ]; then load_rc_config_var ${name} ${rcvar} fi - checkyesno $rcvar 2>/dev/null && run_rc_script ${file} stop + if [ -n "$QUIET" ]; then + checkyesno $rcvar 2>/dev/null && run_rc_script ${file} stop >/dev/null 2>&1 + else + checkyesno $rcvar 2>/dev/null && run_rc_script ${file} stop + fi fi done for file in $files; do if grep -q ^rcvar $file; then eval `grep ^name= $file` eval `grep ^rcvar $file` - checkyesno $rcvar 2>/dev/null && run_rc_script ${file} start + if [ -n "$QUIET" ]; then + checkyesno $rcvar 2>/dev/null && run_rc_script ${file} start >/dev/null 2>&1 + else + checkyesno $rcvar 2>/dev/null && run_rc_script ${file} start + fi fi done @@ -174,7 +185,11 @@ cd / for dir in /etc/rc.d $local_startup; do if [ -x "$dir/$script" ]; then [ -n "$VERBOSE" ] && echo "$script is located in $dir" - exec /usr/bin/env -i -L -/daemon HOME=/ PATH=/sbin:/bin:/usr/sbin:/usr/bin ${VARS} "$dir/$script" "$@" + if [ -n "$QUIET" ]; then + exec /usr/bin/env -i -L -/daemon HOME=/ PATH=/sbin:/bin:/usr/sbin:/usr/bin ${VARS} "$dir/$script" "$@" > /dev/null 2>&1 + else + exec /usr/bin/env -i -L -/daemon HOME=/ PATH=/sbin:/bin:/usr/sbin:/usr/bin ${VARS} "$dir/$script" "$@" + fi fi done From nobody Wed Jun 11 23:16:33 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHhPG1h12z5ydjw; Wed, 11 Jun 2025 23:16:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHhPF6RVyz3L0x; Wed, 11 Jun 2025 23:16:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749683793; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NJWw6h3s2s4e0WP2IIndweVdzD6nflx5BDAJE9BGuPA=; b=QwWnHUfCa3FNYsvPG8AmTNxL0lcQlySosq4vnHTt9BoTNucWktL+MTPbPphoi+QkEXP3Gl pO2xv0dDVX/3lGqpBzr1ankHD2H+PiNH+Kysm9XEIdAMgSDCVwGLX3MFaFxeU0Fi55awKA IcYHFwfOuneXYL7w5aQdpIqqGB5wHNpqxf3KxIVRNeoZUpoVxdkifnlOJeyJftJe2NgGgh qqJ/pPHsWikrEdgONGTAMHqXW+4SygVRd8/OKzp7C2i14wLxn+SH3LQ8HrtYZOBbKwv70U eq/PFw159Z74EsyQjSc5amrD44mde+5l5IU+i+Tx4ZCJIsCBfvSCnzGwCAHzSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749683793; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NJWw6h3s2s4e0WP2IIndweVdzD6nflx5BDAJE9BGuPA=; b=p2VhXf+vbgcKD6bm1qdw4idwg0lpG8zXhNMaSz3KP4sYa/Ul1DFkqR/oWPRSN+SUMY2PJS +0+hmGD3Yf5QGaeB9yyqMiDjGhXlWZORRPrxtwhqycC6pZ0M55kliWK+NidLQkbEW0ZLPs q9sjQ8uqJIrDPl2sF+b05ZBamaAqB6K6Uh3Rt+Gd/tajdYbgrUZo+LaduTHw94dzwB00Sb rqHfCaq5R3XPPeC5mXa1gfw2loBCVmyUpJusmqLB2n+EG+4OC6oyTPMJLZ9UOenihLkRS7 QoLnN7fixeEhS75h1qRGVHK1ZbUjyCiWG7qU+G2GdUCOSNUtSYQD8Ep3RjaBeQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749683793; a=rsa-sha256; cv=none; b=KpltVzJPOGun8RX8nmsBVzyCyx2x0H1qSHB3Ov25VtqvjtbDIafPIMefVd5WlI+CtpVzMM 4fw3/mdJeCR6JuqcS/enkISWMnQ5ntwfvgE8qWmEgwdBM2Nocw++jiCVDzzG5Gqa7pf+7J Jos9BHdDT3Y2hs9LpSfrpMytBFuVw1Vt3BmKUKsmZHKMyG9uZQfMo8ehSEIrQYhT6T3WVZ OOYic4lCsxYHG2xlv3ruE6oP2jp6r9HHaqXcpUrDBhX78hSnd1VjEjxDNN7+s16UkiuBA1 2CGCNVUhnirPvYCvCsIKa0D/y5jift8tA8VQ2EOeawOZ6XZwAfCe5ctzORC87A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bHhPF5lqPzn0v; Wed, 11 Jun 2025 23:16:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55BNGXUN045990; Wed, 11 Jun 2025 23:16:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55BNGX5N045987; Wed, 11 Jun 2025 23:16:33 GMT (envelope-from git) Date: Wed, 11 Jun 2025 23:16:33 GMT Message-Id: <202506112316.55BNGX5N045987@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: c2794499bebe - main - usb: Don't call usb_msc_auto_quirk for UQ_MSC_IGNORE devices List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c2794499bebefbd94ec109858e1b2cbbf60f6c76 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=c2794499bebefbd94ec109858e1b2cbbf60f6c76 commit c2794499bebefbd94ec109858e1b2cbbf60f6c76 Author: Jan Biedermann AuthorDate: 2025-06-06 13:38:21 +0000 Commit: Warner Losh CommitDate: 2025-06-11 23:16:21 +0000 usb: Don't call usb_msc_auto_quirk for UQ_MSC_IGNORE devices usb_msc_auto_quirk() potentially crashes usb devices with a hidden storage (see bug 287333). These devices may still operate normally if usb_msc_auto_quirk() would not be called all and the hidden storage is ignored. This patch makes sure, that usb_msc_auto_quirk() is not called when the UQ_MSC_IGNORE quirk is set for a device. It shouldn't be called anyway if the hidden storage supposed to be ignored. This gives users a chance to get their devices working by using 'usbconfig add_dev_quirk_vplh UQ_MSC_IGNORE'. Reviewed by: imp MFC After: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/1716 Closes: https://github.com/freebsd/freebsd-src/pull/1716 --- sys/dev/usb/usb_device.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/usb/usb_device.c b/sys/dev/usb/usb_device.c index 49195bd0af38..60c2d6745b3f 100644 --- a/sys/dev/usb/usb_device.c +++ b/sys/dev/usb/usb_device.c @@ -2068,7 +2068,8 @@ repeat_set_config: usb_test_quirk(&uaa, UQ_MSC_NO_SYNC_CACHE) == 0 && usb_test_quirk(&uaa, UQ_MSC_NO_TEST_UNIT_READY) == 0 && usb_test_quirk(&uaa, UQ_MSC_NO_GETMAXLUN) == 0 && - usb_test_quirk(&uaa, UQ_MSC_NO_INQUIRY) == 0) { + usb_test_quirk(&uaa, UQ_MSC_NO_INQUIRY) == 0 && + usb_test_quirk(&uaa, UQ_MSC_IGNORE) == 0) { /* * Try to figure out if there are any MSC quirks we * should apply automatically: From nobody Wed Jun 11 23:16:34 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHhPH1wcPz5yddH; Wed, 11 Jun 2025 23:16:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHhPH03gKz3KyG; Wed, 11 Jun 2025 23:16:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749683795; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZMlUqNQYmsddzEmYDTUVym5kdf3Qe2vFa/3Aa3fLONY=; b=O4oT6SR/LkFBUfNtP6GglbGNFPL29Kjlrc+rKkyP+DvIpiBZz68PMRFzXl1yEXJAfNf84k xYRDE2poVsOh6jBfcAP9hTI3BjMfNOaMKWp6qxIC0t+3H4E7W+XPwBjZaGOh9NTjm9ujyN 41HmYdStTNT6SKtq4Hvl7pUzV+0lyehd63L6NNSJEleB9s0gZZn4tox77RHkuvkGzM6dT7 eduGi5alKl0U0W7bkbne7wAGaM7D8rbqIbmZxTKZB8LpFqSNOMVnW5BfwaXEpFiCARKmk+ iUFuioo71AhZ/lZK6kQ/tgh/D+6WYusTrd01wGfroI6cknvZzVUHs4AAZTx0Mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749683795; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZMlUqNQYmsddzEmYDTUVym5kdf3Qe2vFa/3Aa3fLONY=; b=hiYC0IzCdNAZCcRPYk2z6h1y7rznGkZOVy8ExIrkLjo8Qg+2/K4/xZal05lq1mUiWM1PSm ewLDTdL3j6FmmjQx6qWR0Ba9eHlgGnCgH0INpbsSNh9VoYF1gE400cU3+uPJEVlabqHAs4 HfwWwaxYiU6YWKpUFUtZBkR69qeEwV53GCMjYcRPvGJ1g3rlgT+IiQeDxvN9WJVznf5wJF O52UyegdaZ+82cN6jIp6DgM6JckGJp4+J7/IZ42WPfOYaBL2MfIPwIX2CSgGkDG+styPcw /QVNbFyQB4EX2AT+/Sq7KZa3B3pl6WNH7fZXNclUnxQdZTIgWpVX1IkPfVjNag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749683795; a=rsa-sha256; cv=none; b=s5ewl/31ahVWvTv9YojWaxsu6q5rQbXSKEXAhvV4Mlt79hoD3F+NV9OWNxYchBykniFiNp 2eJK9GkK2CPVxxNFW9IVrPKx5cXLJZKZzfeLjenYagUVLuXxex/tPCCGk5c4EkrSmSqRDA kEPGPjHE8zFzYa7scQkKk9Dt5s6A4Uao6QMMfusIz885F1hcw5Xdc5mBuMlIw/O4D8e6Cl NAzTIBb+Ovf2qtUaEmh+frm9e316e5yS0WPOdAQj7iGoHtQuuIueWqAM3LYUu+Yf9HJDo3 xetSn97CyMD0p5w22nMB610ddQZRoaAWGUx7DzQSBJY1OHTp9eR23vFZGx/NPA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bHhPG6mC2znG3; Wed, 11 Jun 2025 23:16:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55BNGYlT046030; Wed, 11 Jun 2025 23:16:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55BNGYwg046026; Wed, 11 Jun 2025 23:16:34 GMT (envelope-from git) Date: Wed, 11 Jun 2025 23:16:34 GMT Message-Id: <202506112316.55BNGYwg046026@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 50461a68e07a - main - Add USB quirk for Creative Stage SE mini List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 50461a68e07ab23917b71a23c14fa7e6fc78e646 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=50461a68e07ab23917b71a23c14fa7e6fc78e646 commit 50461a68e07ab23917b71a23c14fa7e6fc78e646 Author: Jan Biedermann AuthorDate: 2025-06-05 23:25:22 +0000 Commit: Warner Losh CommitDate: 2025-06-11 23:16:21 +0000 Add USB quirk for Creative Stage SE mini Note: The commit in main was modified for the new macros in main. stable merge will need to use the version originally in #1715 MFC After: 2 weeks Pull Request: https://github.com/freebsd/freebsd-src/pull/1715 Closes: https://github.com/freebsd/freebsd-src/pull/1715 --- sys/dev/usb/quirk/usb_quirk.c | 1 + sys/dev/usb/usbdevs | 1 + 2 files changed, 2 insertions(+) diff --git a/sys/dev/usb/quirk/usb_quirk.c b/sys/dev/usb/quirk/usb_quirk.c index 64396918a3d7..802ea2b2ae6a 100644 --- a/sys/dev/usb/quirk/usb_quirk.c +++ b/sys/dev/usb/quirk/usb_quirk.c @@ -228,6 +228,7 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRKS_MAX] = { UQ_MSC_FORCE_SHORT_INQ, UQ_MSC_NO_START_STOP, UQ_MSC_IGNORE_RESIDUE), USB_QUIRK_REV(CREATIVE, NOMAD, 0x0001, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_READ_CAP_OFFBY1), + USB_QUIRK(CREATIVE, STAGE_SE_MINI, UQ_MSC_NO_INQUIRY), USB_QUIRK(CYPRESS, XX6830XX, UQ_MSC_NO_GETMAXLUN, UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(EMTEC, DANEELEC4GB, UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(DESKNOTE, UCR_61S2B, UQ_MSC_FORCE_WIRE_BBB, diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index d4176193d0b1..f26edcebcb9c 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -1661,6 +1661,7 @@ product CORSAIR STRAFE2 0x1b44 Corsair STRAFE Gaming keyboard product CREATIVE NOMAD_II 0x1002 Nomad II MP3 player product CREATIVE NOMAD_IIMG 0x4004 Nomad II MG product CREATIVE NOMAD 0x4106 Nomad +product CREATIVE STAGE_SE_MINI 0x3295 Stage SE mini product CREATIVE2 VOIP_BLASTER 0x0258 Voip Blaster product CREATIVE3 OPTICAL_MOUSE 0x0001 Notebook Optical Mouse From nobody Wed Jun 11 23:16:37 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHhPK4pgxz5ydbr; Wed, 11 Jun 2025 23:16:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHhPK1xJhz3KwM; Wed, 11 Jun 2025 23:16:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749683797; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SCHWS62eVvVwEIZnlofkHN6ycjqlAOY+KhB1RuEPRlo=; b=lKNMXb0Sy8SHNGqPK+9JCYtpZwj0Mo+KR7oUcXr2nopISx8/djL0px8FnX9NpzETTec1Zh l+0MyBGnDZKxXvXKOw0Vv11Q+v1K/EdKgSpHDnaHyzNdu3IPUOXGPOo/vhWHVDHNwYOyWa cQUjmSbKCVHuTHFM/d8i5qGAPnIy9QAwG3REqpayCniDUOTWqW9Xyzxb+4SfXbh4qAvUJr OQUdF61zLGcAeANKi/dq9L+40rR66IXFjuAQFpGzha7mfQYcJCWxhvGUHZ+5tH7ru1rlM6 DQWdcPagFNb1hwIq4R+4Y+hd9ikzFHbqHAN+ghZ/BgMloqocNQMFpPCPfHPw9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749683797; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SCHWS62eVvVwEIZnlofkHN6ycjqlAOY+KhB1RuEPRlo=; b=MA/Qd5FHZR0kjrtf6zfiJW7BDinhmiLhfiVbcWHGFh/Xs9lKg3Qx0Q2h9MyIrzZuartTnD 3fURM9oH+cOr7JJ9lPz8rMHLYb+jridZVyLoqRjpe6/Qi6gec/uakFaxiRS69o1nhT2zhQ wEW4iQkhivVx6tXNfsj7T1mSk3v/MAyHqw/4qptJmQ/jg+HyDMhDQ5dn5uFKBjCrwab3pu njNf35IG1HfHGzGwcT3+vIg34ZWSgD+1iYdxpByOYtf/2ZBa0Ar/qAKyWB7gdv7S7O8U4X FeWu9Xo3KwLkDe+BVgfZXCi5AaruG+aZYgfCW/Fn03tD7+SOsVyHpcX78k6ZsQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749683797; a=rsa-sha256; cv=none; b=SUzg/5bIPB6t8dmXaY865IEgt79rVsx+QuCz5dLWz/O1fPk5COxYWykjgl9ZumL6w3DYnh I0k/eiE1kUk6nnEeQzsL9uRR4s+sAE318OgwDe/uHgYeFDy7BiwXEaF0yddQO1ZuWg6oMp N6ZseRs4KsctjFdVEvZsworBkwDh8lb1Czao4P5IEsFWsDTeCr0S3chVSYfur6D7vadJtm TbQbyhSt1nXx4+lnrANheOutX1a1EGoty/bqh4vojrSBH2v/aF93QzipLtgZqM/gsjUt9k OjmTsCddSUwGWOBqmzlwADy7ZD/c3pc4Cf5plwMFS0GULej6+SruuAqon4+/xQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bHhPK1VySznWy; Wed, 11 Jun 2025 23:16:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55BNGbho046103; Wed, 11 Jun 2025 23:16:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55BNGbgF046100; Wed, 11 Jun 2025 23:16:37 GMT (envelope-from git) Date: Wed, 11 Jun 2025 23:16:37 GMT Message-Id: <202506112316.55BNGbgF046100@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: f850a9288bde - main - su.1: refer to mdo(1) and improve manual syntax List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f850a9288bde429befdfc4563288b8d71b58b308 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=f850a9288bde429befdfc4563288b8d71b58b308 commit f850a9288bde429befdfc4563288b8d71b58b308 Author: Tom Hukins AuthorDate: 2025-05-26 17:12:38 +0000 Commit: Warner Losh CommitDate: 2025-06-11 23:16:21 +0000 su.1: refer to mdo(1) and improve manual syntax Running `mandoc -Tlint usr.bin/su/su.1` spotted the syntax problem. Reviewed by: imp, ziaee Pull Request: https://github.com/freebsd/freebsd-src/pull/1712 Closes: https://github.com/freebsd/freebsd-src/pull/1712 --- usr.bin/su/su.1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/usr.bin/su/su.1 b/usr.bin/su/su.1 index ba4767ff8e1c..092757af1d1d 100644 --- a/usr.bin/su/su.1 +++ b/usr.bin/su/su.1 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd March 26, 2020 +.Dd June 11, 2025 .Dt SU 1 .Os .Sh NAME @@ -46,7 +46,7 @@ and switches to that user ID A shell is then executed. .Pp PAM is used to set the policy -.Xr su 1 +.Nm will use. In particular, by default only users in the .Dq Li wheel @@ -234,6 +234,7 @@ Simulate a login for root. .El .Sh SEE ALSO .Xr csh 1 , +.Xr mdo 1 , .Xr sh 1 , .Xr group 5 , .Xr login.conf 5 , From nobody Wed Jun 11 23:16:35 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHhPJ4DwKz5ydSt; Wed, 11 Jun 2025 23:16:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHhPJ11lcz3Kw9; Wed, 11 Jun 2025 23:16:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749683796; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pgF/kE8e9s2kTMLpKl8vL+oYaWi8yMXVHKtYRiBU37M=; b=OS+fzeq17eGITjWD95yud1NUKNgGC+UxWPjFQa491jME9DNIwPL3zTYCUPYDrEnKbqMSJv Xp0FSHNMwTSYCsGClcZb+yUbzI6JeFvcNIEqBx7qpKOv+qhqj0mFHaQVZZGZVqf2voQYM7 qb91/8w9ueqHmilZyDLVXv4mU1tPvnroVF5Dhfi+qblbUJFQiIQMcexekydx7ttWUXKrIF bteKMVmO1Tdx4KiqfAGDcErLCRstTn17hKp6jhrm0ffKCBVAsLJwjXfo9hCMjgxrfd80KS 7QB2bLDhbP6uHA6NcdrgGAHwJh0XvEmq8kGJT1Y1lCPGFHsb/up63sm+JhnvvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749683796; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pgF/kE8e9s2kTMLpKl8vL+oYaWi8yMXVHKtYRiBU37M=; b=rKHXGBi3vuBWXls6D+yeUYdpfND2whW1L5rSNgthJgbLRFulYIbTj17AErSSoxCmvnVIIY Kvu90nVws88LkEIaorQGGXPzOfZPTEtGVtQhDvJJesemBixeLlYStoPzBDc2QxwT27qjnl MK0uoEUiEa6KvyHYKM9ifsMQ3ArBk3Z+yN8SZWND4j1tzk9XF1enhbu/F+JVqXWOaYpJFt 3mW6uCmtPlRxbEHhXfGC1mbF4BxgiyopIkPYB1i+cIzfml5fDCGNV/Uj72icWGOYfasKDU EZhKIqJ8G24NHy6Vj6VhP2Cj8tEVlhqpltyEd4HrQRgZK+auOrB9nOms59A8UQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749683796; a=rsa-sha256; cv=none; b=sECUzC0vxRMGpuXgDdmizS6qX/7/DcjbdPbk8c+TvqG0hdTlGNIfSWCtTpJMUJWvZyqALV lrDh2UvANWEtt83O0lQGedvSeJWzIZ1FTnL+NDW2ELYahZLME3bPfaOGX9EV40Y8AJ2h7O d7bcAr3qxZsy5Ioq8IeSVxq8MlKkwrBMdof091UZbFjh/FjHLUBg+KAHGJRa4m1Kjv6SuS IQU2EO6EC2gMK3KEbVWfkfUIlJLOeMN2KIiJZ4EvdTveRVius221h4CxGlo9b7zAXG4TTs YVtd4tU1DH27FAvk2gr3in3S5QqnR1Wzh6c2TDYGgVpZEJ56bhkoRgK14Ci4Gw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bHhPJ0XQ2znG4; Wed, 11 Jun 2025 23:16:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55BNGZpX046068; Wed, 11 Jun 2025 23:16:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55BNGZ0I046065; Wed, 11 Jun 2025 23:16:35 GMT (envelope-from git) Date: Wed, 11 Jun 2025 23:16:35 GMT Message-Id: <202506112316.55BNGZ0I046065@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: a27c25625ddc - main - mdo.1: Describe this command's history List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a27c25625ddc7dc26185282dd6416a8f584bf55d Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=a27c25625ddc7dc26185282dd6416a8f584bf55d commit a27c25625ddc7dc26185282dd6416a8f584bf55d Author: Tom Hukins AuthorDate: 2025-05-26 17:07:18 +0000 Commit: Warner Losh CommitDate: 2025-06-11 23:16:21 +0000 mdo.1: Describe this command's history Reviewed by: imp, ziaee Pull Request: https://github.com/freebsd/freebsd-src/pull/1712 --- usr.bin/mdo/mdo.1 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/usr.bin/mdo/mdo.1 b/usr.bin/mdo/mdo.1 index ae89481ddb2b..c4586f628661 100644 --- a/usr.bin/mdo/mdo.1 +++ b/usr.bin/mdo/mdo.1 @@ -3,7 +3,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.Dd May 22, 2024 +.Dd May 26, 2025 .Dt MDO 1 .Os .Sh NAME @@ -42,3 +42,8 @@ and keep the group from the calling user. .Sh SEE ALSO .Xr su 1 , .Xr mac_do 4 +.Sh HISTORY +The +.Nm +command appeared in +.Fx 14.2 . From nobody Wed Jun 11 23:16:38 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHhPL5dKWz5ydmG; Wed, 11 Jun 2025 23:16:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHhPL2qfJz3KtF; Wed, 11 Jun 2025 23:16:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749683798; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nYRaICQP9RXgqw8F8B2qzroqpGFqjPaA2CL7aH6CNmo=; b=TVFyDQ3Ichn+yGIfBCzm81oYqfzhM5NS/hFKnYkyBKS+9ptk6XnWwGZ71S5xd9kmvoXuzX 3svNI8kq4sheU9dIvmD7UVe9N5chkJcW/wqLdHNvL4H6tQtE6PgdgMo2SXXlOXFQI2bTUT dksln6iVkpR+tLGvLtLSSdXa6uhLRd7ajuGImrN8kvyDxYruUro6LI5dlejGLZScl60Oe5 ibekZjJYIp25fU/HSBQWk3/YjTqGE2uvLrpVkEdmitOMH2rCgfFNwQ3b11Uih4cIScz7lR R3xCKsKcAUXFTVlLjqI6BQ8hOKD+YIvk8V9OCkTKl8VwI/GVQPodFGTTo+hoEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749683798; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nYRaICQP9RXgqw8F8B2qzroqpGFqjPaA2CL7aH6CNmo=; b=FPci4jQWo5LUNwZSH8v7GrMe2csG8ytG0KJqGSrFGNxsgxw0OzI92xy4xlHU8BF4ASem1O rf+ayGCNpxZkUV9KEnKR4biv+B8XG6BVDF/DmtUYmSbwQG2sKBA1ijGEVkvw7auPV/sCIv iQHGf0QmYX+ZAMRr+M/0msel23XwpE0pLu5fswumxf5TSwkHYrrJvG5uczakN1BQiqQt/T 8x91FIR6x/rZYcbiOmmEnriuqDrahNtjUu8TOsoPwB/rZW0uvtXo8voy0f2aH7DrBD53pl yPqKSJDxjoojPnNao7Jyt/8AjIZxielZsvsHBi4oTX17zcmTXf0pIumOVXXuGA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749683798; a=rsa-sha256; cv=none; b=PjNPb9iCuN9DNlHGH4c4uEVZ01Du+ABtO25zmNECEsSTSDyjvq0ICKEv/7waVe5IsOiJsu ubAXj8rdj3Lokd8peDgy+WoD5GiRFxMXGrZhnMes2ok5zPPR3AAGWXQGvfR80+4UF7AuET ZL83uTaszRQOUpggauFZ9Do4OSRjSfn4S09GawLl1YIeAsV8bR1TM06VQzPIf9xJ0eCOwo nBlCtcqG2MKD3m5V+L9i4ILj4xKLEQZKc6WNgoE5OBTjtbiH0uEVJOQT1NAEelIo3N6nlV 5Vc/hK+J9sy5iCuhVQxdMeTugTkO4JMEnQQQh+MSkDxISyo7YbAyOqWuvo37ow== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bHhPL2QC1znHY; Wed, 11 Jun 2025 23:16:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55BNGcqD046138; Wed, 11 Jun 2025 23:16:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55BNGcjA046135; Wed, 11 Jun 2025 23:16:38 GMT (envelope-from git) Date: Wed, 11 Jun 2025 23:16:38 GMT Message-Id: <202506112316.55BNGcjA046135@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 150274edd2f3 - main - Update tramp.S comment List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 150274edd2f36c505425bc9dee0ba4fbbe45391a Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=150274edd2f36c505425bc9dee0ba4fbbe45391a commit 150274edd2f36c505425bc9dee0ba4fbbe45391a Author: tropicahq AuthorDate: 2025-05-21 11:36:47 +0000 Commit: Warner Losh CommitDate: 2025-06-11 23:16:21 +0000 Update tramp.S comment Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1705 Closes: https://github.com/freebsd/freebsd-src/pull/1705 --- stand/kboot/kboot/arch/aarch64/tramp.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stand/kboot/kboot/arch/aarch64/tramp.S b/stand/kboot/kboot/arch/aarch64/tramp.S index f58a95cb8463..c0004006796d 100644 --- a/stand/kboot/kboot/arch/aarch64/tramp.S +++ b/stand/kboot/kboot/arch/aarch64/tramp.S @@ -8,7 +8,7 @@ * This is the trampoline that starts the FreeBSD kernel. Since the Linux kernel * calls this routine with no args, and has a different environment than the boot * loader provides and that the kernel expects, this code is responsible for setting - * all that up and calling the normal kernel entry point. It's analogous ot the + * all that up and calling the normal kernel entry point. It's analogous to the * "purgatory" code in the linux kernel. Details about these operations are * contained in comments below. On aarch64, the kernel will start all the APs so * we don't have to worry about them here. From nobody Wed Jun 11 23:16:39 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHhPM5lSXz5ydgX; Wed, 11 Jun 2025 23:16:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHhPM3X3sz3L1p; Wed, 11 Jun 2025 23:16:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749683799; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GmW6ZsQjLrca8cwJ3uEGzvsci+TkgNr5o/YONPnbWHQ=; b=JOhva2cSj1Ak3uvQbMLhi0eaEV0QpQ6Zkhq7U/iiJzzh0IhDjbMjk1f7GDLM02EgYy9k79 1idXr4NmoHZL8rFbonlolcKKOayxV/xNCbcuySi7zAmcrsgz6XhGgoxFx50GLJ/AhXr8HJ /+/baMLY/o9JD2RUFikvnnr3b8/dvEuFSimXEV61e0ah4q30r06sF+xiqlLwTQ2EhqwFTE HMGrWxfmh47yO7BnT7q+7Nk7v+/iIo9iZpWgD4LNa14M7inSLUlG61RN3WWA/cCQVbUVkJ DhGL+poa3nDh2E52kvRQr1wjamjVGx7utkGyjyC5f7plVwHzaPCVLV6MfN0Dog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749683799; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GmW6ZsQjLrca8cwJ3uEGzvsci+TkgNr5o/YONPnbWHQ=; b=Yjxv6WfzGlHyj9h9zUqyiuwxfw4NJ8kzUtef4ZvFXTvucVaWGrOB9Ts0uQN0ckZq6OUbl8 M/+ebjdHtG+eE8Sfavm2TSG+cKZPwtniOjamdngrlfhnQTSThfJ5Ugiq+iPBqL96/JsFBO h2m6cZEMkbshgZ3JSAqxxkZE0OTOciqSeQh2s5NetbIuO98MdA/fzySXHcR1JB4QE7b6gB xWjv46Xp5d09T4XWV3U5z3IdxlzlZw1HkY+NDC6Oxrf1KE1DbkhzpKH2w+ZKo5jVb4bCxJ JsYtwkN/L7qQPo0gjBc+3UbrfCI9/ucWN6r3rTJijQ7xJvMYThWm8AvTsEet9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749683799; a=rsa-sha256; cv=none; b=PXvCcr3+v6v04QXLDNwnSTVVluUFwD5hrltHcB3BmI5bHtw3qijGEsjEeF517b9lrXhXU9 7tnAL+8AangatPMbqA5v3HCgw4hVMKx5rXqguuvJm36Ltc/XIxxZ7Oj+4nlJRGPK77o9rc Od7KWAC5nA/tq6rXCJOumaZYrABMpBIq5HlyeW0pSfEScLX/5A2XwZ20YlyGqTRunQ32Tp MGiy+UvCicDSP0fLE+qH1gMn+vqMKK1fAKo+c9sfGk46viAR+uhOjXGYdCadmix3oSYW0T FUWQkfHt2n24DHhgFC3djKAjsMWEhDbPmSoSOQyTjNIp1yUgr6ZScI5VpMjMjw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bHhPM37t0zn6p; Wed, 11 Jun 2025 23:16:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55BNGd7U046172; Wed, 11 Jun 2025 23:16:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55BNGdSn046169; Wed, 11 Jun 2025 23:16:39 GMT (envelope-from git) Date: Wed, 11 Jun 2025 23:16:39 GMT Message-Id: <202506112316.55BNGdSn046169@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 6ff5a5bc1a7b - main - Remove definition of SIG2STR_MAX from libproc.h List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6ff5a5bc1a7bc8f669d31ae1dedd779e839c1da1 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=6ff5a5bc1a7bc8f669d31ae1dedd779e839c1da1 commit 6ff5a5bc1a7bc8f669d31ae1dedd779e839c1da1 Author: Ricardo Branco AuthorDate: 2025-05-10 21:18:23 +0000 Commit: Warner Losh CommitDate: 2025-06-11 23:16:21 +0000 Remove definition of SIG2STR_MAX from libproc.h Reviewed by: imp, kib, des, jilles Pull Request: https://github.com/freebsd/freebsd-src/pull/1696 --- lib/libproc/libproc.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/libproc/libproc.h b/lib/libproc/libproc.h index 38a4faff94d5..a77bdbb35b59 100644 --- a/lib/libproc/libproc.h +++ b/lib/libproc/libproc.h @@ -105,8 +105,6 @@ typedef enum { REG_RVAL2 } proc_reg_t; -#define SIG2STR_MAX 8 - typedef struct lwpstatus { int pr_why; #define PR_REQUESTED 1 /* not implemented */ From nobody Wed Jun 11 23:16:40 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHhPN6PGkz5ydVY; Wed, 11 Jun 2025 23:16:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHhPN4bYTz3Kqp; Wed, 11 Jun 2025 23:16:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749683800; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vxk4f7SJ5/W+nl7jEqhsVtpfoGCJcSkJ7njFPtNpwAE=; b=saOvPN09xMLjMo0aR/mcqRh/IsCWMB+K4bEDw1g+pZcy0gAo6986YFF+sMyvLsfl2wg6DS Nwxt1UDn9Oe6MrPYtAqEpxS5diLVPWmZBjoGs/BXIt3ae2EaF9uBnkDdNEiYQkyr2H1JlT AGoLIdNEb6dAuOk91fuDkTLWWSXG9xsyhf6ohBxlRTII2FgBztGmO+ub46/0RJ0iTtRgu4 uaJYQcOJN2ADrKXN8izASk5KjMivIHh4wcixa+cqrkEh41ACk9vKf3P2/vTEFDblqqdQ7a h2xAY0fgNb7VyeI1RJgULhw6tCPwPPTUIHbmtTofEexyaJBuF3p5kRa0nhV6JA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749683800; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vxk4f7SJ5/W+nl7jEqhsVtpfoGCJcSkJ7njFPtNpwAE=; b=HQv6r3a4CHuc1KM0IXcP11SGJ3dXq9Vw+UpvXg2hSKVl35mZbNY7OCp+q9wB2vqDhrNp1l B/0Vemir4isq5jyES4QpKpsOnergj8JvXQuMOYKINriKja7UnjlIQoZOaeYP9KH7QlNxT+ ML1X7LFB1ihBn39CLJjOOenKGIyQg/Wi51fsscsTEYfNDaUnu2gCTcxYRDS8+cxAzyB6rY 0ofn/qk5yH2d0ONMq6oR1HWFl7ouK1+vJ/7IhS+4KUOTKlCqVUprlzK4/o0dzw+Z+SBbmq 7WcKrvYrQELd58mbPvFz2J+wsEMbg1c5TA84gRyEhOKYF/npVV+hjltLm/aKPg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749683800; a=rsa-sha256; cv=none; b=XrFW1gvWJwh6gPnCPdhRq2YKFWhhqFx2ASc+AWcZIc6gL2pa6dTKvXUrNnBrTeSa94Tu33 UZNCj7vhonz2VTN7/lcpHELwS+DadBktL1XhZOrj9OaSeq9famMOJ5+a0UjOafw/r3V2Zk i+lpB9AN6H7pHL1fLJlC6zqJHGTZXcGPAWt9EI95IeU+q+a4eQVlS0hXrFAMA6ZlofMVGO zNfxbUlCUAz8w/RnQBvXiQHtScRp3ZxivQAcnkTMOOAz3bhkzhaw5O73yPhBbYV4TLrOYN PWCLt2VUjGB/dptcQFtHxXFzEs8z/J+0WzsgQILANv0TcBHtk31fcjwh8RpFIA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bHhPN48dDzn0w; Wed, 11 Jun 2025 23:16:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55BNGeT5046210; Wed, 11 Jun 2025 23:16:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55BNGeGh046207; Wed, 11 Jun 2025 23:16:40 GMT (envelope-from git) Date: Wed, 11 Jun 2025 23:16:40 GMT Message-Id: <202506112316.55BNGeGh046207@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 3d12567133bf - main - Add the POSIX sig2str(3) & str2sig(3) calls List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3d12567133bfb4082a5115f16a71a865ff2af7fb Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=3d12567133bfb4082a5115f16a71a865ff2af7fb commit 3d12567133bfb4082a5115f16a71a865ff2af7fb Author: Ricardo Branco AuthorDate: 2025-05-10 20:56:03 +0000 Commit: Warner Losh CommitDate: 2025-06-11 23:16:22 +0000 Add the POSIX sig2str(3) & str2sig(3) calls Signed-off-by: Ricardo Branco Reviewed by: imp, kib, des, jilles Pull Request: https://github.com/freebsd/freebsd-src/pull/1696 --- include/signal.h | 9 ++++ lib/libc/gen/Makefile.inc | 3 ++ lib/libc/gen/Symbol.map | 2 + lib/libc/gen/psignal.3 | 56 ++++++++++++++++++++++- lib/libc/gen/sig2str.c | 112 ++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 180 insertions(+), 2 deletions(-) diff --git a/include/signal.h b/include/signal.h index c1d341f317f4..22fefb63568f 100644 --- a/include/signal.h +++ b/include/signal.h @@ -40,6 +40,10 @@ #include #endif +#if __POSIX_VISIBLE >= 202405 || __BSD_VISIBLE +#define SIG2STR_MAX 32 /* size of buffer required for sig2str() */ +#endif + __NULLABILITY_PRAGMA_PUSH #if __BSD_VISIBLE @@ -119,6 +123,11 @@ void psiginfo(const siginfo_t *, const char *); void psignal(int, const char *); #endif +#if __POSIX_VISIBLE >= 202405 || __BSD_VISIBLE +int sig2str(int, char *); +int str2sig(const char * __restrict, int * __restrict); +#endif + #if __BSD_VISIBLE int sigandset(sigset_t *dest, const sigset_t *left, const sigset_t *right); int sigblock(int); diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc index 74b18b44e575..65a2b9d19bb6 100644 --- a/lib/libc/gen/Makefile.inc +++ b/lib/libc/gen/Makefile.inc @@ -134,6 +134,7 @@ SRCS+= \ setmode.c \ setproctitle.c \ setprogname.c \ + sig2str.c \ siginterrupt.c \ siglist.c \ signal.c \ @@ -473,6 +474,8 @@ MLINKS+=posix_spawn.3 posix_spawnp.3 \ posix_spawnattr_getsigmask.3 posix_spawnattr_setsigmask.3 \ posix_spawnattr_init.3 posix_spawnattr_destroy.3 MLINKS+=psignal.3 psiginfo.3 \ + psignal.3 sig2str.3 \ + psignal.3 str2sig.3 \ psignal.3 strsignal.3 \ psignal.3 sys_siglist.3 \ psignal.3 sys_signame.3 diff --git a/lib/libc/gen/Symbol.map b/lib/libc/gen/Symbol.map index afc277822787..765db07019b5 100644 --- a/lib/libc/gen/Symbol.map +++ b/lib/libc/gen/Symbol.map @@ -464,6 +464,8 @@ FBSD_1.8 { rtld_get_var; rtld_set_var; uexterr_gettext; + sig2str; + str2sig; }; FBSDprivate_1.0 { diff --git a/lib/libc/gen/psignal.3 b/lib/libc/gen/psignal.3 index 0af5a6706296..098b7b02a9b9 100644 --- a/lib/libc/gen/psignal.3 +++ b/lib/libc/gen/psignal.3 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd Apr 16, 2025 +.Dd May 10, 2025 .Dt PSIGNAL 3 .Os .Sh NAME @@ -33,7 +33,9 @@ .Nm psiginfo , .Nm strsignal , .Nm sys_siglist , -.Nm sys_signame +.Nm sys_signame , +.Nm sig2str , +.Nm str2sig .Nd system signal messages .Sh LIBRARY .Lb libc @@ -48,6 +50,10 @@ .In string.h .Ft "char *" .Fn strsignal "int sig" +.Ft int +.Fn sig2str "int signum" "char *str" +.Ft int +.Fn str2sig "char *str" "int *pnum" .Sh DESCRIPTION The .Fn psignal @@ -108,10 +114,50 @@ contains a count of the strings in .Va sys_siglist and .Va sys_signame . +.Pp +The +.Fn sig2str +function translates the signal number +.Fa signum +to the signal name, without the +.Dq SIG +prefix, and stores it at the location specified by +.Fa str , +which should be large enough to hold the name and the terminating +.Dv NUL +byte. +The symbol +.Dv SIG2STR_MAX +gives the maximum size in bytes required. +.Pp +The +.Fn str2sig +function translates the signal name +.Fa str +to a signal number and stores it in the location referenced by +.Fa pnum . +The name in +.Fa str +can be either the name of the signal, with or without the +.Dq SIG +prefix, or a decimal number. .Sh SEE ALSO .Xr sigaction 2 , .Xr perror 3 , .Xr strerror 3 +.Sh STANDARDS +The +.Fn psignal +and +.Fn psiginfo +functions are defined by +.St -p1003.1-2008 +, while the +.Fn sig2str +and +.Fn str2sig +functions are defined by +.St -p1003.1-2024 . .Sh HISTORY The .Fn psignal @@ -124,3 +170,9 @@ function appeared in .Nx 6.0 , and .Dx 4.1 . +The +.Fn sig2str +and +.Fn str2sig +functions appeared in +.Fx 15.0 . diff --git a/lib/libc/gen/sig2str.c b/lib/libc/gen/sig2str.c new file mode 100644 index 000000000000..9d0ede0f67fa --- /dev/null +++ b/lib/libc/gen/sig2str.c @@ -0,0 +1,112 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2025 Ricardo Branco . + * + * 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. + */ + +/* + * Translate between signal names and numbers + */ +#include "namespace.h" +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" + +static const char rtmin_str[] = "RTMIN"; +static const char rtmax_str[] = "RTMAX"; + +int +sig2str(int signum, char *str) +{ + if (signum <= 0 || signum > SIGRTMAX) + return (-1); + + if (signum < sys_nsig) + (void)strlcpy(str, sys_signame[signum], SIG2STR_MAX); + else if (signum < SIGRTMIN) + (void)snprintf(str, SIG2STR_MAX, "%d", signum); + else if (signum == SIGRTMIN) + (void)strlcpy(str, rtmin_str, SIG2STR_MAX); + else if (signum == SIGRTMAX) + (void)strlcpy(str, rtmax_str, SIG2STR_MAX); + else if (signum <= (SIGRTMIN + SIGRTMAX) / 2) + (void)snprintf(str, SIG2STR_MAX, "%s+%d", + rtmin_str, signum - SIGRTMIN); + else + (void)snprintf(str, SIG2STR_MAX, "%s-%d", + rtmax_str, SIGRTMAX - signum); + + return (0); +} + +int +str2sig(const char * restrict str, int * restrict pnum) +{ + const char *errstr; + long long n; + int sig; + int rtend = sizeof(rtmin_str) - 1; + + if (strncasecmp(str, "SIG", 3) == 0) + str += 3; + + if (strncasecmp(str, rtmin_str, sizeof(rtmin_str) - 1) == 0 || + strncasecmp(str, rtmax_str, sizeof(rtmax_str) - 1) == 0) { + sig = (toupper(str[4]) == 'X') ? SIGRTMAX : SIGRTMIN; + n = 0; + if (str[rtend] == '+' || str[rtend] == '-') { + n = strtonum(str + rtend, INT_MIN, INT_MAX, &errstr); + if (n == 0 || errstr != NULL) + return (-1); + } else if (str[rtend] != '\0') { + return (-1); + } + sig += (int)n; + if (sig < SIGRTMIN || sig > SIGRTMAX) + return (-1); + *pnum = sig; + return (0); + } + + if (isdigit((unsigned char)str[0])) { + n = strtonum(str, 1, SIGRTMAX, &errstr); + if (errstr == NULL) { + *pnum = (int)n; + return (0); + } + } + + for (sig = 1; sig < sys_nsig; sig++) { + if (strcasecmp(sys_signame[sig], str) == 0) { + *pnum = sig; + return (0); + } + } + + return (-1); +} From nobody Wed Jun 11 23:16:41 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHhPQ0wWVz5yddP; Wed, 11 Jun 2025 23:16:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHhPP5NJ1z3LBn; Wed, 11 Jun 2025 23:16:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749683801; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A0QECKJ2M0rRQj3e1xY2p7n8jVGfzAAuV/wFu5ZAcQw=; b=a4+uIM206cZxqOP81oKhQ3QSjjQZ6RDbFV8IEKBcq4lawQt+PGkvPFYnXpK+hDChPf6URg 7h23NrcqbsSZLoQFpH019eYFElZXOdV6rmXwzZKCarRCDZ/WvIBg4g7D2iZB8feKRVSxjd DiOq2ECCXVN/4SK226EYzuHt5FvhmeqFQLiXqAXR+kSulydJmnAoic8+upVJK1MGOs9iuK a90F8SCA8481FGqd16pPsDMJxzh/E59U7HnR2lHvZiF5CXS9vb1Ylcqf2VgS40nwiv+2uz qMoRAAbRIhWU3Zh7pAxg65ockvV5fxTVi23L+7zBEcEy6APrQJuLtOILo0Ky9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749683801; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A0QECKJ2M0rRQj3e1xY2p7n8jVGfzAAuV/wFu5ZAcQw=; b=xW3FYpIOT302K94AuU/gM0D+WGNzLbu6IAc0zh2CK0I5sdxIimk68wxVFd3HHTkMK9iimk 3Zgx10sizidu1aLlS6PunJICITDSpIld9Y8tRzEGhv75YMk8R6nw/Jrffphg8QLCkrIA4K JBNDPWDCbHHpvvkYnPbeUKLS/UPI5ji8WB3aA3osWy1IkN+99xOucJsotms0s0dzyiiHRw XFioz1is34VD37Bqq9nAD6EqXhelP7RdcntSiwUX60TrJcO0IOh4/VcRQZT1LKLzi6FZeN HVCZvM4hHCax83UmuIuRohuQKrRS9oZweiWhw+etRtoRo9rY/4Ph0xB6j9flIg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749683801; a=rsa-sha256; cv=none; b=vWbFVSR5n2xN7uI6umEjxl+DZUwN0QLonOgVxbHy9dmYxZyPdFNBnd7QQ81LwxOpCguAvx 25jhBD9MkL4ZudSOtcOG7izpE6Vli5oWrCuoB800W1GLyRqiIlrdANDnDpwVYXd470SYRR sVOkSBhf3dHd8AnTdq3vA2am+Cu80eCppSoIuBmThmXxe1QOItEuRjLa0+1+0xbX/16AA7 DFV+P21aCpLcJAFL9NLZtE01q8+kbFgvGosCr4285xsjTwG3xx4hcDni6DGcuQ7e+sNsvB UKIkYTFd6EroOMBqIT+E27seAV/i+cxiuI8DZhmffbpDTLrzh6ciIT09joGlzg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bHhPP4t5HznHZ; Wed, 11 Jun 2025 23:16:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55BNGfXn046250; Wed, 11 Jun 2025 23:16:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55BNGfcP046247; Wed, 11 Jun 2025 23:16:41 GMT (envelope-from git) Date: Wed, 11 Jun 2025 23:16:41 GMT Message-Id: <202506112316.55BNGfcP046247@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: b826e88d38c1 - main - fstat: Use POSIX str2sig(3) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b826e88d38c163528aa1b091294a6f4169f0309e Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=b826e88d38c163528aa1b091294a6f4169f0309e commit b826e88d38c163528aa1b091294a6f4169f0309e Author: Ricardo Branco AuthorDate: 2025-05-10 21:43:47 +0000 Commit: Warner Losh CommitDate: 2025-06-11 23:16:22 +0000 fstat: Use POSIX str2sig(3) Reviewed by: imp, kib, des, jilles Pull Request: https://github.com/freebsd/freebsd-src/pull/1696 --- usr.bin/fstat/fuser.c | 34 +++------------------------------- 1 file changed, 3 insertions(+), 31 deletions(-) diff --git a/usr.bin/fstat/fuser.c b/usr.bin/fstat/fuser.c index 2e2befde6392..c38a520d4ce3 100644 --- a/usr.bin/fstat/fuser.c +++ b/usr.bin/fstat/fuser.c @@ -43,7 +43,6 @@ #include #include #include -#include #include #include @@ -108,7 +107,6 @@ struct reqfile { static int flags = 0; /* Option flags. */ static void printflags(struct consumer *consumer); -static int str2sig(const char *str); static void usage(void) __dead2; static int addfile(const char *path, struct reqfile *reqfile); static void dofiles(struct procstat *procstat, struct kinfo_proc *kp, @@ -164,7 +162,7 @@ do_fuser(int argc, char *argv[]) struct kinfo_proc *procs; struct procstat *procstat; struct reqfile *reqfiles; - char *ep, *nlistf, *memf; + char *nlistf, *memf; int ch, sig; unsigned int i, cnt, nfiles; @@ -199,17 +197,8 @@ do_fuser(int argc, char *argv[]) flags |= KFLAG; break; case 's': - if (isdigit(*optarg)) { - sig = strtol(optarg, &ep, 10); - if (*ep != '\0' || sig < 0 || sig >= sys_nsig) - errx(EX_USAGE, "illegal signal number" ": %s", - optarg); - } else { - sig = str2sig(optarg); - if (sig < 0) - errx(EX_USAGE, "illegal signal name: " - "%s", optarg); - } + if (str2sig(optarg, &sig) != 0) + errx(EX_USAGE, "invalid signal: %s", optarg); break; case 'h': /* PASSTHROUGH */ @@ -348,20 +337,3 @@ dofiles(struct procstat *procstat, struct kinfo_proc *kp, } procstat_freefiles(procstat, head); } - -/* - * Returns signal number for it's string representation. - */ -static int -str2sig(const char *str) -{ - int i; - - if (!strncasecmp(str, "SIG", 3)) - str += 3; - for (i = 1; i < sys_nsig; i++) { - if (!strcasecmp(sys_signame[i], str)) - return (i); - } - return (-1); -} From nobody Wed Jun 11 23:16:42 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHhPR250Xz5ydk7; Wed, 11 Jun 2025 23:16:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHhPQ5wWDz3LFK; Wed, 11 Jun 2025 23:16:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749683802; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NBqHBdjYlwJI6ieuGYf1T1TcCbWpHqFEhaMHOA2D7oU=; b=cMLAZalF0VdcO/5G3Npa+R6b2cX3lWKwKsjoVxIaL+bIIZHgdJH7JTnUJajRoVL1UD+1az WDt85T9WOjoHXuion8tvqSRIJ+8HGgDQDkxDMe+b+zBoTWUuyq4+BNTBvXPdMFG81T2nZ/ iuDeNmEgkmZ5makL7lujeGd7eg7owuHuVfNfWvAQf+Zok/Em5ieQecdAqR33p/KXDrVEuf +x+ELpb4SvRdv+pOEtHr4FQVHNeYO8YoD32iWi7FVShUBWZyY4dIRzW2m6mGVjccSswUEd DtF64hDI4pIw3GB+Onv+BK8MOx2B3RCmO7MPHEPZ/0PJ6uS5tiDjWsCWlmvjXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749683802; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NBqHBdjYlwJI6ieuGYf1T1TcCbWpHqFEhaMHOA2D7oU=; b=UFTUN5XPo7fJsXcYp9X0p2+CaFPhOd0WLm+N4q1E8ARMvzMUTDjS/ikXwcCtLSlQtX1mzX kr/JS2c4uTYo6S3tWP+TNvMJI1ghmGivXDWQDZRwtZwNQeX7L5zWRUzjXdxrSg8VF6sCER +kRCRmXmDdepUyMQPgcwuJg49AJz+5AeDlE928zkNyeEAb2Pu7CjA2+gR1C5hpU+00MuOX krhYI1kom+my3Basd40N9j48zgWTP+FKwtcaCtib2oP8EzP9b/+YI2bBbAB+0n/F2hme+s vT7vJsT8f0wrG9H+4tgxljP4KRQ95nqJkcOhnHjfuj8FYjbJWIiM21iBX8T4kQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749683802; a=rsa-sha256; cv=none; b=VLKv6oE1T5N8yPoGgYXQ4IelBatiGNyG3+Wm1STSqw+1yavZqZzFBlMryKnUdgZ40i52mw QZU1R+l+P+/ISPh+zi3UwW4TvT9BkyANJE8iKp3NLI58PrdrFCi1Q1cas+mjmwTDLBvTNt 5o3RxuSsVwwD04xwg1gWPhVpFwey6O2AR6FQbnVdSLKEv1tTOSo0YySF24ZA1SRGG4Nk+v Zf0WZVPdy1xQhRbJbNPgJvjxs4yZaP1Vl9Tar9kxTN8wm1gc4DiiI0C5NVf0kslmWoNwYz f/7hHXwnJcvh2Lb4uVMVRCw/Lb1iLf6DQAdDwke7LSyByDRk9uyPZIbxpboptw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bHhPQ5VmDznHb; Wed, 11 Jun 2025 23:16:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55BNGgHp046284; Wed, 11 Jun 2025 23:16:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55BNGgxX046281; Wed, 11 Jun 2025 23:16:42 GMT (envelope-from git) Date: Wed, 11 Jun 2025 23:16:42 GMT Message-Id: <202506112316.55BNGgxX046281@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: f942680e8e28 - main - Fix proc_signame() to use sig2str() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f942680e8e282f2347e14c4760583c97ff346adc Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=f942680e8e282f2347e14c4760583c97ff346adc commit f942680e8e282f2347e14c4760583c97ff346adc Author: Ricardo Branco AuthorDate: 2025-05-15 13:52:27 +0000 Commit: Warner Losh CommitDate: 2025-06-11 23:16:22 +0000 Fix proc_signame() to use sig2str() Reviewed by: imp, kib, des, jilles Pull Request: https://github.com/freebsd/freebsd-src/pull/1696 --- lib/libproc/proc_util.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/libproc/proc_util.c b/lib/libproc/proc_util.c index bea50fb01098..a062b9a1f461 100644 --- a/lib/libproc/proc_util.c +++ b/lib/libproc/proc_util.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include @@ -180,8 +181,12 @@ proc_getwstat(struct proc_handle *phdl) char * proc_signame(int sig, char *name, size_t namesz) { + char buf[SIG2STR_MAX]; - strlcpy(name, strsignal(sig), namesz); + if (sig2str(sig, buf) == 0) + (void)snprintf(name, namesz, "SIG%s", buf); + else + (void)snprintf(name, namesz, "SIG#%d", sig); return (name); } From nobody Wed Jun 11 23:16:43 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHhPS342Nz5ydgj; Wed, 11 Jun 2025 23:16:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHhPR6vmtz3L4J; Wed, 11 Jun 2025 23:16:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749683804; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D/HCKm61WOOoHLOWN45z0H5BmqmD20RftFfMV3MYtM8=; b=LBiQa/Bd8cn8bUWp4dRbUoAkDfdJinbCy4/ua/GXEU984ZtR//pjbd2CahPPal4z4rMDWM FRiqEq3C7/4kdbLRvxlTqpgwcPA15z0SMJPlFun1TrbDwHrZLnZnr4E3qme3bpoDU+x8fS Sf7NEkZ1EqIyE03i8RlQ/LvlrFtQ09taH5allQ4pDlzouEK+2RADSsOg2+Q/8xDxIdKZrt E+1Ty2VoDnQTBnq0PctOo/BUgNNaovMfQnKN6NkSokeOOTZa02mAbHoH68GVGFRpJHLH9N SbeUAhDbBa3e3bhiafzeDp0EgYP/aQEqF256ObRpcnORIndWR5BXYSnJFtMqZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749683804; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D/HCKm61WOOoHLOWN45z0H5BmqmD20RftFfMV3MYtM8=; b=qkusr8RHeqFVwMuBhu1UgppZ7g/zjGAIk49xzgbbv8vb7OJv5YDeLrjtVbNdyL1SiFLGNN FT0q3+EmiZhWgntgS2zmp8uq9ycDTebWvTn4PEdX8E6o/iWP36dMucSJCdZtQUp8LfEY9u A6gpKgjb0owtBdwEjdYfxxdk+EbtNjhFbnI3CPxnxWIq+m5oMbOzrsFhufCbLWIzq5g3JH L9ywan6qY71bRdO5kqhFt81dAXFT3fw7v7uO9oCOfyIPbTxd5hs9vAwEpcvCAazK5BBwRT ASu3RPCoLQV20GJfn3D4KlLhQzPFfyUkgUjQBRglI1y6KUIX8pyyCHjgHhpaQg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749683804; a=rsa-sha256; cv=none; b=DqIkJ+QaiVpEWuYisQzoMqmDjmFW19wF7oZzgpRbYpCiv4bRvGrNZKIzbdTV8fuyorc2IS A4MXOoifof3AqzM6LcWVpuv7Muc3V7C0PNSD/7FgJaebRrobM+Yew0FKek2EEHTjDsHvyk +Znj+3PkhPygVc5RnXdAEyBu97nAUr0sIEm4dbhoNvrkWDD+z8Xc66J1IXbOk4bxZZUaBW dVBAt3TnDIiYlfJnDci5pf2hUn0ZDEbzNc1n+MRN/m4mDDVBIqhbcD62OxlM+Fs88B6ARh PV3fDBr1Jvu9AEOo3L8g5id6yn+gS6BJFckZE3bzX2bSBaZGEqVHJcj3YEY1Dg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bHhPR6W9sznHc; Wed, 11 Jun 2025 23:16:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55BNGhbI046317; Wed, 11 Jun 2025 23:16:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55BNGhxp046314; Wed, 11 Jun 2025 23:16:43 GMT (envelope-from git) Date: Wed, 11 Jun 2025 23:16:43 GMT Message-Id: <202506112316.55BNGhxp046314@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 36679f7d7b56 - main - kill: Use POSIX str2sig() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 36679f7d7b56094744dbad80d5163b9ed9d4c006 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=36679f7d7b56094744dbad80d5163b9ed9d4c006 commit 36679f7d7b56094744dbad80d5163b9ed9d4c006 Author: Ricardo Branco AuthorDate: 2025-05-15 16:21:54 +0000 Commit: Warner Losh CommitDate: 2025-06-11 23:16:22 +0000 kill: Use POSIX str2sig() Reviewed by: imp, kib, des, jilles Pull Request: https://github.com/freebsd/freebsd-src/pull/1696 --- bin/kill/kill.c | 40 ++++++++-------------------------------- 1 file changed, 8 insertions(+), 32 deletions(-) diff --git a/bin/kill/kill.c b/bin/kill/kill.c index f3d323a1ff49..ca9d557c5883 100644 --- a/bin/kill/kill.c +++ b/bin/kill/kill.c @@ -48,12 +48,12 @@ static void nosig(const char *); static void printsignals(FILE *); -static int signame_to_signum(const char *); static void usage(void) __dead2; int main(int argc, char *argv[]) { + char signame[SIG2STR_MAX]; long pidl; pid_t pid; int errors, numsig, ret; @@ -74,12 +74,12 @@ main(int argc, char *argv[]) usage(); numsig = strtol(*argv, &ep, 10); if (!**argv || *ep) - errx(2, "illegal signal number: %s", *argv); + errx(2, "invalid signal number: %s", *argv); if (numsig >= 128) numsig -= 128; - if (numsig <= 0 || numsig >= sys_nsig) + if (sig2str(numsig, signame) < 0) nosig(*argv); - printf("%s\n", sys_signame[numsig]); + printf("%s\n", signame); return (0); } printsignals(stdout); @@ -92,24 +92,14 @@ main(int argc, char *argv[]) warnx("option requires an argument -- s"); usage(); } - if (strcmp(*argv, "0")) { - if ((numsig = signame_to_signum(*argv)) < 0) - nosig(*argv); - } else + if (strcmp(*argv, "0") == 0) numsig = 0; + else if (str2sig(*argv, &numsig) < 0) + nosig(*argv); argc--, argv++; } else if (**argv == '-' && *(*argv + 1) != '-') { ++*argv; - if (isalpha(**argv)) { - if ((numsig = signame_to_signum(*argv)) < 0) - nosig(*argv); - } else if (isdigit(**argv)) { - numsig = strtol(*argv, &ep, 10); - if (!**argv || *ep) - errx(2, "illegal signal number: %s", *argv); - if (numsig < 0) - nosig(*argv); - } else + if (str2sig(*argv, &numsig) < 0) nosig(*argv); argc--, argv++; } @@ -143,20 +133,6 @@ main(int argc, char *argv[]) return (errors); } -static int -signame_to_signum(const char *sig) -{ - int n; - - if (strncasecmp(sig, "SIG", 3) == 0) - sig += 3; - for (n = 1; n < sys_nsig; n++) { - if (!strcasecmp(sys_signame[n], sig)) - return (n); - } - return (-1); -} - static void nosig(const char *name) { From nobody Wed Jun 11 23:16:44 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHhPT67z6z5ydpk; Wed, 11 Jun 2025 23:16:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHhPT18Vpz3L4R; Wed, 11 Jun 2025 23:16:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749683805; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ODe8UkZv9DIEcsH3F21Mk6jcjLyLrtOYelPKvE152ow=; b=xjXjXTk9CfUx+sLF3pZbEtleFOAbNaJ2s7s3mpqQWySva+NJApAR80ZuZNFkvh6KwdQ94y xENpjrtOQDztZTwXu6rXnfw6TPFhDNTIFgGkDV1Xigpnx+OT9lN82Rm3dlmHl2OZV7DWtE 8y5/08ELNAWUe4afaWfICuC5GH16v+5Ki01umilb2YuRuBS1QMWDQ/L2YwmSv5g85cu1/U +z1k/jhkQ3fjAKyTEh5R+mbTUCB3JfWyPsOptOMM2oBy/Ipjmn6h+8o37DGAdxW6f6GzNm trKyn27vdNt6z+BpMHj+ukXTu9nLL6yWk7/ybzVLh3vQFaqNNCD/iaXQdn0f1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749683805; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ODe8UkZv9DIEcsH3F21Mk6jcjLyLrtOYelPKvE152ow=; b=w76RG812yAmgLv5Ag3P9VuEGGYvsL+nmFIXnnfcbsAxGpGRL02+fSH15SBAc3rTTXuoPRa Mt+H+49+aEgu3d+BO/eDt5o13hay25Xiv5wNIirsmVGQ57xxbOJ9LSny9yDHEPPIbIr10O yzBxs3t4J/qGK9YSa8bzHEyqGfBRKdG1gTIO8jW1C48uvojrNVlVwJll40mbQYnBJXkvak gaBY2la313yODvhEG8SOqaAxH5vIuQaSwUnrwbgqtGHMdbn/FpcXoZynxTyOilPfpa/FoD jEqA5FHNrBVYt7EMbQeYka+2qjvQfpeylrEc447KeOkmllkkeo9CWS48uUWiwQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749683805; a=rsa-sha256; cv=none; b=tN/NvViuzvP379BFQhfbFIZLgqlYExCO1L3YAx/kIJsVhRNah8LJyzRgL4PhRaY7SBf4Bg f6kh1xARLX+ch0mMMz9a0LSxZP7C4JQRsTxJcA8DcX2Y9jklM0cZsWaBeU7Bvq4rYr2s6Q /yP1l1xD/Zws3DClf+UCAAWDFWlQezf+cc2wpNnU6G9VsfdU/9NUIZXS2Ll5CH/TWbGyDr WjwerVpBoTeCyjoGcxZ63W9Zc1N1TMPAV8hq0J5BqMmSWWqyjfa4SHEF69oytb1XGr+tXG jF15VhcbmHzdmq4WBdFtn05PgiwevejIjKgkM7u7XjFSkYfrVOT2gaFUivCrrw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bHhPT0lzmzmZX; Wed, 11 Jun 2025 23:16:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55BNGjK1046353; Wed, 11 Jun 2025 23:16:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55BNGiOb046350; Wed, 11 Jun 2025 23:16:44 GMT (envelope-from git) Date: Wed, 11 Jun 2025 23:16:44 GMT Message-Id: <202506112316.55BNGiOb046350@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: d580567dfbce - main - Add tests for sig2str() / str2sig() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d580567dfbce288907c5b526927385c0db24fa00 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d580567dfbce288907c5b526927385c0db24fa00 commit d580567dfbce288907c5b526927385c0db24fa00 Author: Ricardo Branco AuthorDate: 2025-05-15 17:50:18 +0000 Commit: Warner Losh CommitDate: 2025-06-11 23:16:22 +0000 Add tests for sig2str() / str2sig() Reviewed by: imp, kib, des, jilles Pull Request: https://github.com/freebsd/freebsd-src/pull/1696 --- lib/libc/tests/gen/Makefile | 1 + lib/libc/tests/gen/sig2str_test.c | 213 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 214 insertions(+) diff --git a/lib/libc/tests/gen/Makefile b/lib/libc/tests/gen/Makefile index 006512d30dc4..4776dc4c774d 100644 --- a/lib/libc/tests/gen/Makefile +++ b/lib/libc/tests/gen/Makefile @@ -22,6 +22,7 @@ ATF_TESTS_C+= makecontext_test ATF_TESTS_C+= popen_test ATF_TESTS_C+= posix_spawn_test ATF_TESTS_C+= realpath2_test +ATF_TESTS_C+= sig2str_test ATF_TESTS_C+= sigsetops_test ATF_TESTS_C+= wordexp_test diff --git a/lib/libc/tests/gen/sig2str_test.c b/lib/libc/tests/gen/sig2str_test.c new file mode 100644 index 000000000000..00b6ebb2349a --- /dev/null +++ b/lib/libc/tests/gen/sig2str_test.c @@ -0,0 +1,213 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2025 Ricardo Branco + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include + +#include + +static void +test_roundtrip(int signum) +{ + char str[SIG2STR_MAX]; + int sig; + + ATF_REQUIRE_EQ_MSG(sig2str(signum, str), 0, + "sig2str(%d) failed", signum); + ATF_REQUIRE_EQ_MSG(str2sig(str, &sig), 0, + "str2sig(\"%s\") failed", str); + ATF_REQUIRE_INTEQ_MSG(sig, signum, + "Mismatch: roundtrip conversion gave %d instead of %d", + sig, signum); +} + +ATF_TC_WITHOUT_HEAD(sig2str_valid); +ATF_TC_BODY(sig2str_valid, tc) +{ + int sig; + + for (sig = 1; sig < sys_nsig; sig++) { + test_roundtrip(sig); + } +} + +ATF_TC_WITHOUT_HEAD(sig2str_invalid); +ATF_TC_BODY(sig2str_invalid, tc) +{ + char buf[SIG2STR_MAX]; + + ATF_CHECK(sig2str(0, buf) != 0); + ATF_CHECK(sig2str(-1, buf) != 0); + ATF_CHECK(sig2str(SIGRTMAX + 1, buf) != 0); +} + +ATF_TC_WITHOUT_HEAD(str2sig_rtmin_rtmax); +ATF_TC_BODY(str2sig_rtmin_rtmax, tc) +{ + int sig; + + ATF_CHECK_MSG(str2sig("RTMIN", &sig) == 0, + "str2sig(\"RTMIN\") failed"); + ATF_CHECK_INTEQ_MSG(sig, SIGRTMIN, + "RTMIN mapped to %d, expected %d", sig, SIGRTMIN); + + ATF_CHECK_MSG(str2sig("RTMAX", &sig) == 0, + "str2sig(\"RTMAX\") failed"); + ATF_CHECK_INTEQ_MSG(sig, SIGRTMAX, + "RTMAX mapped to %d, expected %d", sig, SIGRTMAX); + + ATF_CHECK_MSG(str2sig("RTMIN+1", &sig) == 0, + "str2sig(\"RTMIN+1\") failed"); + ATF_CHECK_INTEQ_MSG(sig, SIGRTMIN + 1, + "RTMIN+1 mapped to %d, expected %d", sig, SIGRTMIN + 1); + + ATF_CHECK_MSG(str2sig("RTMAX-1", &sig) == 0, + "str2sig(\"RTMAX-1\") failed"); + ATF_CHECK_INTEQ_MSG(sig, SIGRTMAX - 1, + "RTMAX-1 mapped to %d, expected %d", sig, SIGRTMAX - 1); +} + +ATF_TC_WITHOUT_HEAD(str2sig_invalid_rt); +ATF_TC_BODY(str2sig_invalid_rt, tc) +{ + int i, sig; + + const char *invalid[] = { + "RTMIN+0", + "RTMAX-0", + "RTMIN-777", + "RTMIN+777", + "RTMAX-777", + "RTMAX+777", + "RTMIN-", + "RTMAX-", + "RTMIN0", + "RTMAX1", + "RTMIN+abc", + "RTMIN-abc", + NULL + }; + + for (i = 0; invalid[i] != NULL; i++) { + ATF_CHECK_MSG(str2sig(invalid[i], &sig) != 0, + "str2sig(\"%s\") unexpectedly succeeded", invalid[i]); + } +} + +ATF_TC_WITHOUT_HEAD(str2sig_fullname); +ATF_TC_BODY(str2sig_fullname, tc) +{ + char fullname[SIG2STR_MAX + 3]; + int n, sig; + + for (sig = 1; sig < sys_nsig; sig++) { + snprintf(fullname, sizeof(fullname), "SIG%s", sys_signame[sig]); + + ATF_CHECK_MSG(str2sig(fullname, &n) == 0, + "str2sig(\"%s\") failed with errno %d (%s)", + fullname, errno, strerror(errno)); + + ATF_CHECK_INTEQ_MSG(n, sig, + "Mismatch: %s = %d, str2sig(\"%s\") = %d", + sys_signame[sig], sig, fullname, n); + } +} + +ATF_TC_WITHOUT_HEAD(str2sig_lowercase); +ATF_TC_BODY(str2sig_lowercase, tc) +{ + char fullname[SIG2STR_MAX + 3]; + int n, sig; + + for (sig = 1; sig < sys_nsig; sig++) { + snprintf(fullname, sizeof(fullname), "sig%s", sys_signame[sig]); + for (size_t i = 3; i < strlen(fullname); i++) + fullname[i] = toupper((unsigned char)fullname[i]); + + ATF_CHECK_MSG(str2sig(fullname, &n) == 0, + "str2sig(\"%s\") failed with errno %d (%s)", + fullname, errno, strerror(errno)); + + ATF_CHECK_INTEQ_MSG(n, sig, + "Mismatch: %s = %d, str2sig(\"%s\") = %d", + sys_signame[sig], sig, fullname, n); + } +} + +ATF_TC_WITHOUT_HEAD(str2sig_numeric); +ATF_TC_BODY(str2sig_numeric, tc) +{ + char buf[16]; + int n, sig; + + for (sig = NSIG; sig < SIGRTMIN; sig++) { + snprintf(buf, sizeof(buf), "%d", sig); + ATF_CHECK_MSG(str2sig(buf, &n) == 0, + "str2sig(\"%s\") failed", buf); + ATF_CHECK_INTEQ_MSG(n, sig, + "Mismatch: str2sig(\"%s\") = %d, expected %d", + buf, n, sig); + } +} + +ATF_TC_WITHOUT_HEAD(str2sig_invalid); +ATF_TC_BODY(str2sig_invalid, tc) +{ + const char *invalid[] = { + "SIGDOESNOTEXIST", + "DOESNOTEXIST", + "INTERRUPT", + "", + "SIG", + "123abc", + "sig1extra", + NULL + }; + int i, sig; + + for (i = 0; invalid[i] != NULL; i++) { + ATF_CHECK_MSG(str2sig(invalid[i], &sig) != 0, + "str2sig(\"%s\") unexpectedly succeeded", invalid[i]); + } +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, sig2str_valid); + ATF_TP_ADD_TC(tp, sig2str_invalid); + ATF_TP_ADD_TC(tp, str2sig_rtmin_rtmax); + ATF_TP_ADD_TC(tp, str2sig_invalid_rt); + ATF_TP_ADD_TC(tp, str2sig_fullname); + ATF_TP_ADD_TC(tp, str2sig_lowercase); + ATF_TP_ADD_TC(tp, str2sig_numeric); + ATF_TP_ADD_TC(tp, str2sig_invalid); + return (atf_no_error()); +} From nobody Wed Jun 11 23:16:46 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHhPV4LrKz5ydVk; Wed, 11 Jun 2025 23:16:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHhPV2DPsz3L4g; Wed, 11 Jun 2025 23:16:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749683806; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RGzqYrm+z+gXk5eJAoelOaInM9FNxFRqYtTpt242eF4=; b=UK43taRZJUO9w3kLEpok3Bf341txKAnV34DBWeb5ZhxnZ8s1cMAvEdutgNicKqubPhCis+ raa9419inF3kVUrhZYcnyaPdAJfcF5sB6HpnLGz503EIzJGmrFNx7rfCt6VRIiwmK0h7lV QlEQDjdUwlqua4/8hNUaDuCuuFUPy4giPA6BHhYFSn8N/qp9Hv50pyvPfdQolx5uUwoRp/ +j6zJFdelOWctTHhBklaZVJlsN8Yy9H9TYwLnnJ1SpUWgPSSXbX7fiJFqDqTEv8xzwO7Nv 0k0XZCmqZymBs9lPA/UnQst87sdIBKTMh+uJkNnNaLlLDLgtH6oD9ye5zGIdXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749683806; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RGzqYrm+z+gXk5eJAoelOaInM9FNxFRqYtTpt242eF4=; b=ME+8QsaymyEP9mQ2W8biEU+KRuEueURq5Kn0d27OziOqmDtN7uhIIcYauSmKQ3c+HpmNmS dtyQuwiccNIMdwiusP0qRvCbRfAJmg7/GFtQie11lzA9I5lMIKzFRsgyynZ2b7dD+HN7jQ /+HJaCIkdDjW/6HloHmTbIw1a5+sW/eyFZUqjqjXwR9DOv4VbaTUZtaJtww9wJ7hC0SSYg 3xF6xyuP4tiGbmtqf5PcHO5DgIebHDUDaPuxqpPrk2LrNErQ8DlZ7Mrfg45HLmFOOrn24x xzm6keBMEZZVNssdevoxS8aZQGkC90kf0f1QulXBTToZIxZxCoczh4dyo54PDw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749683806; a=rsa-sha256; cv=none; b=cMiLYAQjCZBzS98O4L1IPJu9ixRdeJF4GWmKLL/KpmiPwnJKcDfX3jEwdgv4QAYl7AvOHh 98gWwrPL3iXfAeNCG7q/V/66Amh9uFDTAcE+gudRLnoA0DSZmbJrp5FgFh2xdpJX3nL3hO uSBEJuB/Bvh2eJbUs55we8bJcveSXP9yH0YqqS7jOFLF33qXF0cleq+tSNHQ1arXwpVBmq xN/Z/wMfO2At5lULmOqwR2p7b3L+hjIY2CW7p+96vW+2s+wxpme9gkBkn9NSWa7r0wFcOb 1GuiSSv0Cik3KusVHnpPk+QSXxNLHfH6buwPjMPpZbM0XXZAwIj3XqkxFwho4Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bHhPV1n7Kzn6q; Wed, 11 Jun 2025 23:16:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55BNGkOn046389; Wed, 11 Jun 2025 23:16:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55BNGk9H046386; Wed, 11 Jun 2025 23:16:46 GMT (envelope-from git) Date: Wed, 11 Jun 2025 23:16:46 GMT Message-Id: <202506112316.55BNGk9H046386@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: b0334450aa52 - main - include: ssp: fortify List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b0334450aa527ccbac7a3c37d1ba75ef96c7be91 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=b0334450aa527ccbac7a3c37d1ba75ef96c7be91 commit b0334450aa527ccbac7a3c37d1ba75ef96c7be91 Author: Ricardo Branco AuthorDate: 2025-05-18 17:55:23 +0000 Commit: Warner Losh CommitDate: 2025-06-11 23:16:22 +0000 include: ssp: fortify sig2str(3) Reviewed by: imp, kib, des, jilles Pull Request: https://github.com/freebsd/freebsd-src/pull/1696 Closes: https://github.com/freebsd/freebsd-src/pull/1696 --- include/signal.h | 4 + include/ssp/Makefile | 2 +- include/ssp/signal.h | 50 ++++ lib/libc/gen/sig2str.c | 3 +- lib/libc/tests/secure/Makefile | 1 + lib/libc/tests/secure/fortify_signal_test.c | 316 +++++++++++++++++++++++ lib/libc/tests/secure/generate-fortify-tests.lua | 12 + 7 files changed, 386 insertions(+), 2 deletions(-) diff --git a/include/signal.h b/include/signal.h index 22fefb63568f..9247aff56879 100644 --- a/include/signal.h +++ b/include/signal.h @@ -72,6 +72,10 @@ typedef __pthread_t pthread_t; #endif #endif /* __POSIX_VISIBLE || __XSI_VISIBLE */ +#if !defined(_STANDALONE) && defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 +#include +#endif + __BEGIN_DECLS int raise(int); diff --git a/include/ssp/Makefile b/include/ssp/Makefile index ff622aeecfe9..92e24dd4750a 100644 --- a/include/ssp/Makefile +++ b/include/ssp/Makefile @@ -1,4 +1,4 @@ -INCS= poll.h random.h socket.h ssp.h stdio.h stdlib.h string.h strings.h +INCS= poll.h random.h socket.h ssp.h signal.h stdio.h stdlib.h string.h strings.h INCS+= uio.h unistd.h wchar.h INCSDIR= ${INCLUDEDIR}/ssp diff --git a/include/ssp/signal.h b/include/ssp/signal.h new file mode 100644 index 000000000000..9f1a926b9db6 --- /dev/null +++ b/include/ssp/signal.h @@ -0,0 +1,50 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2025, Ricardo Branco + * + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _SSP_SIGNAL_H_ +#define _SSP_SIGNAL_H_ + +#include + +#if __SSP_FORTIFY_LEVEL > 0 + +#include + +__BEGIN_DECLS + +__ssp_redirect_raw_impl(int, sig2str, sig2str, + (int signum, char *__restrict str)) +{ + if (__ssp_bos(str) < SIG2STR_MAX) + __chk_fail(); + + return (__ssp_real(sig2str)(signum, str)); +} + +__END_DECLS + +#endif /* __SSP_FORTIFY_LEVEL > 0 */ +#endif /* _SSP_SIGNAL_H_ */ diff --git a/lib/libc/gen/sig2str.c b/lib/libc/gen/sig2str.c index 9d0ede0f67fa..869a09ab9db4 100644 --- a/lib/libc/gen/sig2str.c +++ b/lib/libc/gen/sig2str.c @@ -35,13 +35,14 @@ #include #include #include +#include #include "un-namespace.h" static const char rtmin_str[] = "RTMIN"; static const char rtmax_str[] = "RTMAX"; int -sig2str(int signum, char *str) +__ssp_real(sig2str)(int signum, char *str) { if (signum <= 0 || signum > SIGRTMAX) return (-1); diff --git a/lib/libc/tests/secure/Makefile b/lib/libc/tests/secure/Makefile index beaa01457cfe..515f8f53a43e 100644 --- a/lib/libc/tests/secure/Makefile +++ b/lib/libc/tests/secure/Makefile @@ -10,6 +10,7 @@ FORTIFY_TCATS+= uio # non-sys/ headers FORTIFY_TCATS+= poll +FORTIFY_TCATS+= signal FORTIFY_TCATS+= stdlib FORTIFY_TCATS+= stdio FORTIFY_TCATS+= string diff --git a/lib/libc/tests/secure/fortify_signal_test.c b/lib/libc/tests/secure/fortify_signal_test.c new file mode 100644 index 000000000000..03cfb9a9a13a --- /dev/null +++ b/lib/libc/tests/secure/fortify_signal_test.c @@ -0,0 +1,316 @@ +/* @generated by `generate-fortify-tests.lua "signal"` */ + +#define _FORTIFY_SOURCE 2 +#define TMPFILE_SIZE (1024 * 32) + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static FILE * __unused +new_fp(size_t __len) +{ + static char fpbuf[LINE_MAX]; + FILE *fp; + + ATF_REQUIRE(__len <= sizeof(fpbuf)); + + memset(fpbuf, 'A', sizeof(fpbuf) - 1); + fpbuf[sizeof(fpbuf) - 1] = '\0'; + + fp = fmemopen(fpbuf, sizeof(fpbuf), "rb"); + ATF_REQUIRE(fp != NULL); + + return (fp); +} + +/* + * Create a new symlink to use for readlink(2) style tests, we'll just use a + * random target name to have something interesting to look at. + */ +static const char * __unused +new_symlink(size_t __len) +{ + static const char linkname[] = "link"; + char target[MAXNAMLEN]; + int error; + + ATF_REQUIRE(__len <= sizeof(target)); + + arc4random_buf(target, sizeof(target)); + + error = unlink(linkname); + ATF_REQUIRE(error == 0 || errno == ENOENT); + + error = symlink(target, linkname); + ATF_REQUIRE(error == 0); + + return (linkname); +} + +/* + * For our purposes, first descriptor will be the reader; we'll send both + * raw data and a control message over it so that the result can be used for + * any of our recv*() tests. + */ +static void __unused +new_socket(int sock[2]) +{ + unsigned char ctrl[CMSG_SPACE(sizeof(int))] = { 0 }; + static char sockbuf[256]; + ssize_t rv; + size_t total = 0; + struct msghdr hdr = { 0 }; + struct cmsghdr *cmsg; + int error, fd; + + error = socketpair(AF_UNIX, SOCK_STREAM, 0, sock); + ATF_REQUIRE(error == 0); + + while (total != sizeof(sockbuf)) { + rv = send(sock[1], &sockbuf[total], sizeof(sockbuf) - total, 0); + + ATF_REQUIRE_MSG(rv > 0, + "expected bytes sent, got %zd with %zu left (size %zu, total %zu)", + rv, sizeof(sockbuf) - total, sizeof(sockbuf), total); + ATF_REQUIRE_MSG(total + (size_t)rv <= sizeof(sockbuf), + "%zd exceeds total %zu", rv, sizeof(sockbuf)); + total += rv; + } + + hdr.msg_control = ctrl; + hdr.msg_controllen = sizeof(ctrl); + + cmsg = CMSG_FIRSTHDR(&hdr); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SCM_RIGHTS; + cmsg->cmsg_len = CMSG_LEN(sizeof(fd)); + fd = STDIN_FILENO; + memcpy(CMSG_DATA(cmsg), &fd, sizeof(fd)); + + error = sendmsg(sock[1], &hdr, 0); + ATF_REQUIRE(error != -1); +} + +/* + * Constructs a tmpfile that we can use for testing read(2) and friends. + */ +static int __unused +new_tmpfile(void) +{ + char buf[1024]; + ssize_t rv; + size_t written; + int fd; + + fd = open("tmpfile", O_RDWR | O_CREAT | O_TRUNC, 0644); + ATF_REQUIRE(fd >= 0); + + written = 0; + while (written < TMPFILE_SIZE) { + rv = write(fd, buf, sizeof(buf)); + ATF_REQUIRE(rv > 0); + + written += rv; + } + + ATF_REQUIRE_EQ(0, lseek(fd, 0, SEEK_SET)); + return (fd); +} + +static void +disable_coredumps(void) +{ + struct rlimit rl = { 0 }; + + if (setrlimit(RLIMIT_CORE, &rl) == -1) + _exit(EX_OSERR); +} + +/* + * Replaces stdin with a file that we can actually read from, for tests where + * we want a FILE * or fd that we can get data from. + */ +static void __unused +replace_stdin(void) +{ + int fd; + + fd = new_tmpfile(); + + (void)dup2(fd, STDIN_FILENO); + if (fd != STDIN_FILENO) + close(fd); +} + +ATF_TC(sig2str_before_end); +ATF_TC_HEAD(sig2str_before_end, tc) +{ +} +ATF_TC_BODY(sig2str_before_end, tc) +{ +#define BUF &__stack.__buf + struct { + uint8_t padding_l; + unsigned char __buf[SIG2STR_MAX + 1]; + uint8_t padding_r; + } __stack; + const size_t __bufsz __unused = sizeof(__stack.__buf); + const size_t __len = SIG2STR_MAX + 1; + const size_t __idx __unused = __len - 1; + + sig2str(1, __stack.__buf); +#undef BUF + +} + +ATF_TC(sig2str_end); +ATF_TC_HEAD(sig2str_end, tc) +{ +} +ATF_TC_BODY(sig2str_end, tc) +{ +#define BUF &__stack.__buf + struct { + uint8_t padding_l; + unsigned char __buf[SIG2STR_MAX]; + uint8_t padding_r; + } __stack; + const size_t __bufsz __unused = sizeof(__stack.__buf); + const size_t __len = SIG2STR_MAX; + const size_t __idx __unused = __len - 1; + + sig2str(1, __stack.__buf); +#undef BUF + +} + +ATF_TC(sig2str_heap_before_end); +ATF_TC_HEAD(sig2str_heap_before_end, tc) +{ +} +ATF_TC_BODY(sig2str_heap_before_end, tc) +{ +#define BUF __stack.__buf + struct { + uint8_t padding_l; + unsigned char * __buf; + uint8_t padding_r; + } __stack; + const size_t __bufsz __unused = sizeof(*__stack.__buf) * (SIG2STR_MAX + 1); + const size_t __len = SIG2STR_MAX + 1; + const size_t __idx __unused = __len - 1; + + __stack.__buf = malloc(__bufsz); + + sig2str(1, __stack.__buf); +#undef BUF + +} + +ATF_TC(sig2str_heap_end); +ATF_TC_HEAD(sig2str_heap_end, tc) +{ +} +ATF_TC_BODY(sig2str_heap_end, tc) +{ +#define BUF __stack.__buf + struct { + uint8_t padding_l; + unsigned char * __buf; + uint8_t padding_r; + } __stack; + const size_t __bufsz __unused = sizeof(*__stack.__buf) * (SIG2STR_MAX); + const size_t __len = SIG2STR_MAX; + const size_t __idx __unused = __len - 1; + + __stack.__buf = malloc(__bufsz); + + sig2str(1, __stack.__buf); +#undef BUF + +} + +ATF_TC(sig2str_heap_after_end); +ATF_TC_HEAD(sig2str_heap_after_end, tc) +{ +} +ATF_TC_BODY(sig2str_heap_after_end, tc) +{ +#define BUF __stack.__buf + struct { + uint8_t padding_l; + unsigned char * __buf; + uint8_t padding_r; + } __stack; + const size_t __bufsz __unused = sizeof(*__stack.__buf) * (SIG2STR_MAX - 1); + const size_t __len = SIG2STR_MAX - 1; + const size_t __idx __unused = __len - 1; + pid_t __child; + int __status; + + __child = fork(); + ATF_REQUIRE(__child >= 0); + if (__child > 0) + goto monitor; + + /* Child */ + disable_coredumps(); + __stack.__buf = malloc(__bufsz); + + sig2str(1, __stack.__buf); + _exit(EX_SOFTWARE); /* Should have aborted. */ + +monitor: + while (waitpid(__child, &__status, 0) != __child) { + ATF_REQUIRE_EQ(EINTR, errno); + } + + if (!WIFSIGNALED(__status)) { + switch (WEXITSTATUS(__status)) { + case EX_SOFTWARE: + atf_tc_fail("FORTIFY_SOURCE failed to abort"); + break; + case EX_OSERR: + atf_tc_fail("setrlimit(2) failed"); + break; + default: + atf_tc_fail("child exited with status %d", + WEXITSTATUS(__status)); + } + } else { + ATF_REQUIRE_EQ(SIGABRT, WTERMSIG(__status)); + } +#undef BUF + +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, sig2str_before_end); + ATF_TP_ADD_TC(tp, sig2str_end); + ATF_TP_ADD_TC(tp, sig2str_heap_before_end); + ATF_TP_ADD_TC(tp, sig2str_heap_end); + ATF_TP_ADD_TC(tp, sig2str_heap_after_end); + return (atf_no_error()); +} diff --git a/lib/libc/tests/secure/generate-fortify-tests.lua b/lib/libc/tests/secure/generate-fortify-tests.lua index 6c2a80b20609..c9cd9353a869 100755 --- a/lib/libc/tests/secure/generate-fortify-tests.lua +++ b/lib/libc/tests/secure/generate-fortify-tests.lua @@ -478,6 +478,18 @@ local all_tests = { init = poll_init, }, }, + signal = { + -- + { + func = "sig2str", + bufsize = "SIG2STR_MAX", + arguments = { + "1", + "__buf", + }, + exclude = excludes_stack_overflow, + }, + }, stdio = { -- { From nobody Wed Jun 11 23:37:31 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHhsR6NQyz5yfxm; Wed, 11 Jun 2025 23:37:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHhsR4mLPz3RNq; Wed, 11 Jun 2025 23:37:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749685051; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wZ9cg1z/7ztujJWq0JPKrWYbPPAZbxNqO/AFziuqp5E=; b=CRVnWIyF0D3HEfn5VRNCIeSHlt0DZ7dka+YcTIqCkFrWBwDkHm/vdPbcPwOZINkiA4y0n+ 6ZN22CSc4i/bhlYktZtSonEPkZMoPUKaTpXeS1gC2xioFQL79cO5nsKV+DIgQYb/YtpA2V 8V55gbZXt5khJxoqF53IpKcoOvFN4N9omSN59R7geimpSObvC51m033Z/z5pPmqgCIao85 E3F4ym5q+iYcQWk7tV5qQFDc2p6kT4gFGgeM6qNe5kmWgxtlEh8PMTkcghpt1MrPTipkte DI+ooepGbhJnWDZsEoTtevpCDTQEaanPZ/8P2ExeXQqkfVjFakHtyqgfJVpwpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749685051; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wZ9cg1z/7ztujJWq0JPKrWYbPPAZbxNqO/AFziuqp5E=; b=p12DDt1fZy1M0Hk7aNRgtdwd9RyV/fiXvOtPVZAJiVeqVyQH0rpDivT9nfEeU/69M6DAlK 9HSYI/QqQkRk6/Nfzp/xmd46QlFJn3DdRfWiRbv4lDXhu4vV8LONETtWkNHj38epLb6TaR iCsjumt2cezRTJsZbsw71SzuUqhkZynDRABdGs78mA8iffDhlJ56MMXNuXw7yyusJcGj/H OfwotlaOW9+x/8jHHDp2cO3bKaBKNu3Y7fjdGhEWK3+aZ15HvFeSScqlVN2F7ysnxrCi/p HRlnuoE/E1J2XupnVOE17gClJoMdG05nVwGF32VeKVNPgHcyILTZbcUS0TyWjw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749685051; a=rsa-sha256; cv=none; b=RB1w7TqUx4ZJO7RT6AjF90joKu/+VqMDpJ3NEk9z7odAX1A/86I8hotW1b5gTbfnT9bAnT UAeeSB5EFS/Cy12sG6fzct3EYctVJVINJ2uN171U/06bV6u6Hrv22b6eCZ9IjVKDQN51zb Ym9niiAPH2hgwqMY37C1mLID0CZaU+i7U6GBW+KZSfpPpfTDMTvRl9hpGsPGRIyO6Jmgw1 vFAuDMYDpi0J5cnGC80OqLZWtHZZbWJWDltsbQSqbbYRZKVWxHa4ykDTxFGfnvIB46KwRo GwO87HBBY9PEzphRVuCNWUPdfvBjryB3+dcNJgHcNhtk/exex4qk6x5UBtOUhQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bHhsR3p7Vznl8; Wed, 11 Jun 2025 23:37:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55BNbVuP083866; Wed, 11 Jun 2025 23:37:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55BNbVTF083863; Wed, 11 Jun 2025 23:37:31 GMT (envelope-from git) Date: Wed, 11 Jun 2025 23:37:31 GMT Message-Id: <202506112337.55BNbVTF083863@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 342e9f2f305d - main - puc.4: Cleanup List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 342e9f2f305ddccbb7e7a58ddf1f428d8ab00ba1 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=342e9f2f305ddccbb7e7a58ddf1f428d8ab00ba1 commit 342e9f2f305ddccbb7e7a58ddf1f428d8ab00ba1 Author: Alexander Ziaee AuthorDate: 2025-05-05 18:30:29 +0000 Commit: Warner Losh CommitDate: 2025-06-11 23:37:01 +0000 puc.4: Cleanup + Alphabetize and condense supported hardware. + Mention PCI/PCIe where applicable. + Move hardware support file to FILES + Tag spdx MFC after: 3 days Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1692 Closes: https://github.com/freebsd/freebsd-src/pull/1692 --- share/man/man4/puc.4 | 321 +++++++++++++++------------------------------------ 1 file changed, 90 insertions(+), 231 deletions(-) diff --git a/share/man/man4/puc.4 b/share/man/man4/puc.4 index 6fde07548e18..a29376d3f2d5 100644 --- a/share/man/man4/puc.4 +++ b/share/man/man4/puc.4 @@ -1,3 +1,6 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2002 John Hay. .\" All rights reserved. .\" @@ -22,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 5, 2025 +.Dd June 11, 2025 .Dt PUC 4 .Os .Sh NAME @@ -44,159 +47,112 @@ PCI multi-port serial and parallel adapters to the and .Xr ppc 4 driver. -.Pp -The list of supported devices is in -.Pa sys/dev/puc/pucdata.c . -Support for new cards should be added there. .Sh HARDWARE The .Nm driver supports the following -PCI multi-port serial and parallel adapters: +PCI/PCIe multi-port serial and parallel adapters: .Pp .Bl -bullet -compact .It -Sunix SUN1889 -.It -HP Diva Serial [GSP] Multiport UART: -.Bl -dash -compact +Advantech 2-port PCI PCI-1602/1603 Rev A/B1 .It -Tosca Console -.It -Tosca Secondary -.It -Maestro SP2 +Applied Micro Circuits PCI 8 Port UART .It -Superdome Console +Avlab Technology PCI IO 2S .It -Keystone SP2 +Avlab Low Profile PCI 4 Serial .It -Everest SP2 -.El +Boca Research PCI Turbo Serial 658/654 .It -VScom: +Brainboxes: .Bl -dash -compact .It -PCI-200, PCI-400, and PCI-800 -.El +Instashield PCIe IX-400, IX-200, IX-100 .It -Boca Research Turbo Serial: -.Bl -dash -compact +Instashield PCI IS-400, IS-200 .It -654 and 658 -.El +PX Series PCIe RS232/RS422/RS485/LPT .It -Dolphin Peripherals: -.Bl -dash -compact +UC Series Universal PCI RS232/RS422/RS485/LPT .It -4014 and 4035 +UP Series PCI Dual RS232 .El .It -Applied Micro Circuits 8 Port UART -.It -Digi Neo: -.Bl -dash -compact +Comtrol RocketPort 550 PCI 16/8/4 port .It -PCI 4 and 8 Port +Decision Computer PCCOM PCI 8/4/2 port .It -PCIe 4 and 8 Port (with and without RJ45) -.El +Digi Neo PCIe 4 and 8 Port (with and without RJ45) .It -Comtrol RocketPort: -.Bl -dash -compact -550/4 Normal and RJ45 +Digi Neo PCI 4 and 8 Port .It -550/8 Normal, RJ11 and Octa +Dolphin Peripherals PCI 4035/4014 .It -550/16 -.El -.It -IBM SurePOS 300 Series (481033H) serial ports -.It -SIIG Cyber Series of UART and parallel port boars: +Exar: .Bl -dash -compact .It -Cyber 2S and 2SP1 PCI 16550 -.It -Cyber 4 PCI 16550 -.It -Cyber 4S PCI 16C650 (20x family) -.It -Cyber I/O PCI (10x family and 20x family): +XR17C/D152 .It -Cyber Parallel Dual PCI (10x family and 20x family): +XR17C154 .It -Cyber Serial Dual PCI (10x family and 20x family): +XR17C158 .It -Cyber 2S1P PCI (10x family and 20x family): +XR17V258IV .It -Cyber 4S PCI (10x family and 20x family): +XR17V352 .It -PS8000 8S PCI 16C650 (20x family) +XR17V354 .It -Quartet Serial 850 +XR17V358 .El .It -Brainboxes: -.Bl -dash -compact +Feasso PCI FPP-02 2S1P .It -PX-101 +HP Diva Serial [GSP] Multiport UART: +.Bl -dash -compact .It -PX-246, PX-257, PX-260, PX-279 +Tosca Console .It -PX-310, PX-313, PX-320, PX-346, PX-368 +Tosca Secondary .It -PX-420, PX-431, PX-475 +Maestro SP2 .It -PX-803, PX-820, PX-831, PX-846, PX-857 +Superdome Console .It -UC-101 +Keystone SP2 .It -UC-203, UC-253, UC-257, UC-260, UC-268, UC-279 +Everest SP2 +.El .It -UC-302, UC-310, UC-313, UC-346, UC-357, UC-368 +I-O DATA RSA-PCI2/R .It -UC-414, UC-420, UC-431, UC-475 +IBM SurePOS 300 Series (481033H) serial ports .It -UC-607 +IC Book Labs: +.Bl -dash -compact .It -UC-836 +Dreadnought x16 Pro/Lite .It -UP-189 +Ironclad x8 Pro .It -UP-200 +Gunboat x4 Pro/Lite/Low Profile .It -UP-869, UP-880 +Gunboat x2 Low Profile .El .It -Intashield: -.Bl -dash -compact -.It -IS-200, IS-400 -.It -IX-100, IX-200, IX-400 -.El +Kuroutoshikou SERIAL4P-LPPCI2 .It -Quatech: +Lava Computers: .Bl -dash -compact .It -DSC-100 -.It -DSC-200/300 -.It -DSCLP-100 -.It -DSCLP-200/300 -.It -ESC-100D +Dual Serial PCI .It -ESC-100M +Quattro-PCIe .It -QSC-100 -.It -QSC-200/300 +Quattro-PCI .It -QSCLP-100 +Octopus-550 PCI .El .It Moxa Technologies: @@ -216,7 +172,7 @@ Smartio CP-104EL/PCIe .It Smartio CP-104EL-A/PCIe .It -CP-112UL +CP-112UL PCI .It Industio CP-114 .It @@ -233,47 +189,13 @@ CP-168EL/PCIe Smartio CP-168EL-A/PCIe .El .It -Exar: -.Bl -dash -compact -.It -XR17C/D152 -.It -XR17C154 -.It -XR17C158 -.It -XR17V258IV -.It -XR17V352 -.It -XR17V354 -.It -XR17V358 -.El -.It -Advantech -.Bl -dash -compact -.It -PCI-1602 Rev A -.It -2-port PCI (PCI-1602 Rev B1/PCI-1603) -.El -.It -Lava Computers: -.Bl -dash -compact -.It -Dual Serial -.It -Quattro -.It -Quattro-PCI +NetMos NM9815 Dual 1284 Printer port PCI .It -Octopus-550 -.El +NetMos NM9835 2/1 port UART + 1284 Printer PCI .It -I-O DATA RSA-PCI2/R +NetMos NM9845 4/6 port UART + 1284 Printer PCI .It -Kuroutoshikou SERIAL4P-LPPCI2 +NetMos NM9865 4/3/2 port UART + 1/2 port 1284 Printer PCI .It Oxford Semiconductor based boards: .Bl -dash -compact @@ -287,137 +209,74 @@ OX9160/OX16PCI954 UARTs OX16PCI958 UART .El .It -Perle: -.Bl -dash -compact -.It -Ultraport4 Express -.It -Speed2 LE +Perle Ultraport4 Express PCIe Serial .It -Speed4 LE +Perle Speed8/Speed4/Speed2 LE PCI Serial .It -Speed8 LE -.El -.It -VScom: +Quatech: .Bl -dash -compact .It -PCI-100L +DSC-300/200/100 PCI .It -PCI-200L +DSCLP-300/200/100 PCI .It -200Li -.El +ESC-100/100D/100M PCI .It -Titan: -.Bl -dash -compact -.It -PCI-800H -.It -PCI-800H +QSC-300/200/100 PCI .It -PCI-200H +QSCLP-100 PCI .El .It -Titan VScom: +SIIG Cyber Series of UART and parallel port boards: .Bl -dash -compact .It -PCI-800L -.It -PCI-200HV2 -.It -PCIex-800H -.It -PCIex-800H -.El +Cyber 2S and 2SP1 PCI 16550 .It -Avlab Technology PCI IO 2S +Cyber 4 and 4S PCI 16C650 (10x family and 20x family) .It -Avlab Low Profile PCI 4 Serial +Cyber I/O PCI (10x family and 20x family) .It -Syba Tech Ltd PCI-4S2P-550-ECP +Cyber Parallel Dual PCI (10x family and 20x family) .It -Sunix SUN1888 +Cyber Serial Dual PCI (10x family and 20x family) .It -Sunix SER5xxxx -.Bl -dash -compact +Cyber 2S1P PCI (10x family and 20x family) .It -2, 4 and 8 port serial -.El -.It -Sunix MIO5xxxx (1284 Printer port): -.Bl -dash -compact +PS8000 8S PCI 16C650 (20x family) .It -1, 2 and 4 port serial +Quartet Serial 850 PCI .El .It -Feasso PCI FPP-02 2S1P -.It Sun 1040 PCI Quad Serial .It -Decision Computer Inc PCCOM: -.Bl -dash -compact -.It -4-port serial -.It -8-port serial -.El -.It -PCCOM dual port RS232/422/485 +Sunix MIO5xxxx 4/2/1 port UART and 1284 Printer .It -NetMos NM9815 Dual 1284 Printer port +Sunix SUN1889/1888 PCI dual port serial .It -NetMos NM9835: -.Bl -dash -compact -.It -based 1 and 2 port serial +Sunix SER5xxxx 8/4/2 port serial .It -Dual UART and 1284 Printer port -.El -.It -NetMos NM9845: -.Bl -dash -compact -.It -6 Port UART +Syba Tech Ltd PCI-4S2P-550-ECP .It -Quad UART and 1284 Printer port -.El +Titan PCI-800H/PCI-200H .It -NetMos NM9865: +VScom: .Bl -dash -compact .It -Dual UART -.It -Triple UART +PCIex-800H .It -Quad UART +PCI-200HV2 .It -Single UART and 1284 Printer port +200Li uPCI .It -Dual UART and 1284 Printer port +PCI-800L, PCI-200L, and PCI-100L .It -Dual 1284 Printer port +PCI-800, PCI-400, and PCI-200 .El -.It -IC Book Labs: -.Bl -dash -compact -.It -Gunboat x4 Lite -.It -Gunboat x4 Pro -.It -Ironclad x8 Lite -.It -Ironclad x8 Pro -.It -Dreadnought x16 Pro -.It -Dreadnought x16 Lite -.It -Gunboat x2 Low Profile -.It -Gunboat x4 Low Profile .El +.Sh FILES +.Bl -tag -width "sys/dev/puc/pucdata.c" +.It Pa sys/dev/puc/pucdata.c +list of supported devices .El .Sh SEE ALSO .Xr ppc 4 , From nobody Thu Jun 12 00:29:02 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHk0t5PhRz5yk05; Thu, 12 Jun 2025 00:29:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHk0t4YFQz3X51; Thu, 12 Jun 2025 00:29:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749688142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xt8twvttFehyJnL3Cx201448z15d2a66N46j8ahFJKg=; b=MXUvNABY3m93ZM08ogbMR3bRr3+luw+0NdwcPDXL0+K8WYnRJsQaAJZ3cawk3MbT0mRLfh BmdTRLgCYyAV49+hZ04e5ZTWwuEiq4k0GucAfjtaZixh9msMEC1h+a3eOFtz2nH62D4Mhx QIqIUG3g/YlQbuWa/uxlD/qSorUlV8oYAArgvklQvkgzArDBUmRlpCp+kvYdhW4qPGBwP6 Xw3Ef42o/JJyzSgO7H9h0vQTTUHhoFowcy0QgZoRBA4Z2GrQsSgp71JGzox9Spu55I8ujI EqfTvUJTcm7dmbVvvC9Ar7PeggbyQ8Ohuajx6iNv05KLok1/oEOdoLtJkpdHCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749688142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xt8twvttFehyJnL3Cx201448z15d2a66N46j8ahFJKg=; b=hb6tCRUCb8Kd9DI6qabB+SSlNu0K4agMAO9E1E7DN1ZQUJEn8gfNbjS9azmyUElxpT/mg3 LkJc0ztAJvP46mwuJ5Uu8ekNdVNQRkYtKN2GXvqKsCJs32JCOHIjh2UVexqyNnlutGFxg1 /bQRWfN9xY+0zlwddDAkTYaX8mjgKLFI5iEbdufY8TcTiAPL6AQBbUVnU/R/H4tC982EZ7 +oPn23teFd48o7KUTLedBtrX5Kaq4Ml0ht5qvPv+P7Wq1MSoN1qoKhr25Cz2PHBCRDFdQa 00IDzCmL5fAgnu02tiFNTZBcB6zMnuuZE9PcOP3ZS3CPe4VqZ9rGGEHhjsuzVw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749688142; a=rsa-sha256; cv=none; b=OtJLu4rK4zR71xK9FiMNyQCYPYJ2IKbSOHGqvcwRQlY60/ip0QzuZgryJyNM/BR2Ja6+No An4z18iMdqbjzvczY1CTBfd9DhYEboLojzoBVbmz1ymR9xER8IFHQ57doCtOgJ4qnynjs6 /D9atY3wo8GkZ35ItLCcpIQNJEiaiWcLXhfe57Yp8gou37wRONtCgKAJLqc6q4Nq0mfynY SxB659S+VFyMzUu2GzeOwTpYO0nfs7wKHMkbHuztAC8tQc+X93KvMXXzS3yuFchVGE6Rnq bUt1yu2puHTsCG6kFAfx5SZtUA1RyE4nGuKZGM3GDxq8elJGIAsw3dp7XKfIpg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bHk0t40QDzq69; Thu, 12 Jun 2025 00:29:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55C0T2ln076928; Thu, 12 Jun 2025 00:29:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55C0T2SQ076925; Thu, 12 Jun 2025 00:29:02 GMT (envelope-from git) Date: Thu, 12 Jun 2025 00:29:02 GMT Message-Id: <202506120029.55C0T2SQ076925@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 1ae6faf16455 - main - LoongArch: elftoolchain: add support List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1ae6faf1645516bbb97eaf2a43d867b59b22309b Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=1ae6faf1645516bbb97eaf2a43d867b59b22309b commit 1ae6faf1645516bbb97eaf2a43d867b59b22309b Author: yu shan wei AuthorDate: 2025-04-29 02:08:12 +0000 Commit: Warner Losh CommitDate: 2025-06-12 00:21:30 +0000 LoongArch: elftoolchain: add support According to the latest elftoolchain r4191, add support for Loongarch Co-authored-by: haowuge Co-authored-by: xiaoqiang zhao Signed-off-by: yu shan wei Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1682 Closes: https://github.com/freebsd/freebsd-src/pull/1682 --- contrib/elftoolchain/libdwarf/libdwarf.h | 1 + contrib/elftoolchain/libdwarf/libdwarf_reloc.c | 8 ++ contrib/elftoolchain/libelf/_libelf_config.h | 6 ++ .../elftoolchain/libelftc/elftc_reloc_type_str.c | 119 +++++++++++++++++++++ contrib/elftoolchain/libelftc/libelftc_bfdtarget.c | 31 ++++++ contrib/elftoolchain/libpe/pe.h | 2 + 6 files changed, 167 insertions(+) diff --git a/contrib/elftoolchain/libdwarf/libdwarf.h b/contrib/elftoolchain/libdwarf/libdwarf.h index 0aa1857e3285..e8419620755d 100644 --- a/contrib/elftoolchain/libdwarf/libdwarf.h +++ b/contrib/elftoolchain/libdwarf/libdwarf.h @@ -442,6 +442,7 @@ enum Dwarf_ISA { DW_ISA_X86_64, DW_ISA_AARCH64, DW_ISA_RISCV, + DW_ISA_LOONGARCH, DW_ISA_MAX }; diff --git a/contrib/elftoolchain/libdwarf/libdwarf_reloc.c b/contrib/elftoolchain/libdwarf/libdwarf_reloc.c index e76675838e41..d8ea4e36d29d 100644 --- a/contrib/elftoolchain/libdwarf/libdwarf_reloc.c +++ b/contrib/elftoolchain/libdwarf/libdwarf_reloc.c @@ -51,6 +51,8 @@ _dwarf_get_reloc_type(Dwarf_P_Debug dbg, int is64) return (is64 ? R_MIPS_64 : R_MIPS_32); case DW_ISA_RISCV: return (is64 ? R_RISCV_64 : R_RISCV_32); + case DW_ISA_LOONGARCH: + return (is64 ? R_LARCH_64 : R_LARCH_32); case DW_ISA_IA64: return (is64 ? R_IA_64_DIR64LSB : R_IA_64_DIR32LSB); default: @@ -115,6 +117,12 @@ _dwarf_get_reloc_size(Dwarf_Debug dbg, Dwarf_Unsigned rel_type) else if (rel_type == R_RISCV_64) return (8); break; + case EM_LOONGARCH: + if (rel_type == R_LARCH_32) + return (4); + else if (rel_type == R_LARCH_64) + return (8); + break; case EM_IA_64: if (rel_type == R_IA_64_SECREL32LSB) return (4); diff --git a/contrib/elftoolchain/libelf/_libelf_config.h b/contrib/elftoolchain/libelf/_libelf_config.h index 0f16f3aefde5..df33e974a94b 100644 --- a/contrib/elftoolchain/libelf/_libelf_config.h +++ b/contrib/elftoolchain/libelf/_libelf_config.h @@ -105,6 +105,12 @@ #define LIBELF_BYTEORDER ELFDATA2LSB #define LIBELF_CLASS ELFCLASS64 +#elif defined(__loongarch64) + +#define LIBELF_ARCH EM_LOONGARCH +#define LIBELF_BYTEORDER ELFDATA2LSB +#define LIBELF_CLASS ELFCLASS64 + #elif defined(__sparc__) #define LIBELF_ARCH EM_SPARCV9 diff --git a/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c b/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c index bc8ff6c0d2c6..48970714c7d4 100644 --- a/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c +++ b/contrib/elftoolchain/libelftc/elftc_reloc_type_str.c @@ -670,6 +670,125 @@ elftc_reloc_type_str(unsigned int mach, unsigned int type) case 58: return "R_RISCV_IRELATIVE"; } break; + case EM_LOONGARCH: + switch (type) { + case 0: return "R_LARCH_NONE"; + case 1: return "R_LARCH_32"; + case 2: return "R_LARCH_64"; + case 3: return "R_LARCH_RELATIVE"; + case 4: return "R_LARCH_COPY"; + case 5: return "R_LARCH_JUMP_SLOT"; + case 6: return "R_LARCH_TLS_DTPMOD32"; + case 7: return "R_LARCH_TLS_DTPMOD64"; + case 8: return "R_LARCH_TLS_DTPREL32"; + case 9: return "R_LARCH_TLS_DTPREL64"; + case 10: return "R_LARCH_TLS_TPREL32"; + case 11: return "R_LARCH_TLS_TPREL64"; + case 12: return "R_LARCH_IRELATIVE"; + case 13: return "R_LARCH_TLS_DESC32"; + case 14: return "R_LARCH_TLS_DESC64"; + case 20: return "R_LARCH_MARK_LA"; + case 21: return "R_LARCH_MARK_PCREL"; + case 22: return "R_LARCH_SOP_PUSH_PCREL"; + case 23: return "R_LARCH_SOP_PUSH_ABSOLUTE"; + case 24: return "R_LARCH_SOP_PUSH_DUP"; + case 25: return "R_LARCH_SOP_PUSH_GPREL"; + case 26: return "R_LARCH_SOP_PUSH_TLS_TPREL"; + case 27: return "R_LARCH_SOP_PUSH_TLS_GOT"; + case 28: return "R_LARCH_SOP_PUSH_TLS_GD"; + case 29: return "R_LARCH_SOP_PUSH_PLT_PCREL"; + case 30: return "R_LARCH_SOP_ASSERT"; + case 31: return "R_LARCH_SOP_NOT"; + case 32: return "R_LARCH_SOP_SUB"; + case 33: return "R_LARCH_SOP_SL"; + case 34: return "R_LARCH_SOP_SR"; + case 35: return "R_LARCH_SOP_ADD"; + case 36: return "R_LARCH_SOP_AND"; + case 37: return "R_LARCH_SOP_IF_ELSE"; + case 38: return "R_LARCH_SOP_POP_32_S_10_5"; + case 39: return "R_LARCH_SOP_POP_32_U_10_12"; + case 40: return "R_LARCH_SOP_POP_32_S_10_12"; + case 41: return "R_LARCH_SOP_POP_32_S_10_16"; + case 42: return "R_LARCH_SOP_POP_32_S_10_16_S2"; + case 43: return "R_LARCH_SOP_POP_32_S_5_20"; + case 44: return "R_LARCH_SOP_POP_32_S_0_5_10_16_S2"; + case 45: return "R_LARCH_SOP_POP_32_S_0_10_10_16_S2"; + case 46: return "R_LARCH_SOP_POP_32_U"; + case 47: return "R_LARCH_ADD8"; + case 48: return "R_LARCH_ADD16"; + case 49: return "R_LARCH_ADD24"; + case 50: return "R_LARCH_ADD32"; + case 51: return "R_LARCH_ADD64"; + case 52: return "R_LARCH_SUB8"; + case 53: return "R_LARCH_SUB16"; + case 54: return "R_LARCH_SUB24"; + case 55: return "R_LARCH_SUB32"; + case 56: return "R_LARCH_SUB64"; + case 57: return "R_LARCH_GNU_VTINHERIT"; + case 58: return "R_LARCH_GNU_VTENTRY"; + case 64: return "R_LARCH_B16"; + case 65: return "R_LARCH_B21"; + case 66: return "R_LARCH_B26"; + case 67: return "R_LARCH_ABS_HI20"; + case 68: return "R_LARCH_ABS_LO12"; + case 69: return "R_LARCH_ABS64_LO20"; + case 70: return "R_LARCH_ABS64_HI12"; + case 71: return "R_LARCH_PCALA_HI20"; + case 72: return "R_LARCH_PCALA_LO12"; + case 73: return "R_LARCH_PCALA64_LO20"; + case 74: return "R_LARCH_PCALA64_HI12"; + case 75: return "R_LARCH_GOT_PC_HI20"; + case 76: return "R_LARCH_GOT_PC_LO12"; + case 77: return "R_LARCH_GOT64_PC_LO20"; + case 78: return "R_LARCH_GOT64_PC_HI12"; + case 79: return "R_LARCH_GOT_HI20"; + case 80: return "R_LARCH_GOT_LO12"; + case 81: return "R_LARCH_GOT64_LO20"; + case 82: return "R_LARCH_GOT64_HI12"; + case 83: return "R_LARCH_TLS_LE_HI20"; + case 84: return "R_LARCH_TLS_LE_LO12"; + case 85: return "R_LARCH_TLS_LE64_LO20"; + case 86: return "R_LARCH_TLS_LE64_HI12"; + case 87: return "R_LARCH_TLS_IE_PC_HI20"; + case 88: return "R_LARCH_TLS_IE_PC_LO12"; + case 89: return "R_LARCH_TLS_IE64_PC_LO20"; + case 90: return "R_LARCH_TLS_IE64_PC_HI12"; + case 91: return "R_LARCH_TLS_IE_HI20"; + case 92: return "R_LARCH_TLS_IE_LO12"; + case 93: return "R_LARCH_TLS_IE64_LO20"; + case 94: return "R_LARCH_TLS_IE64_HI12"; + case 95: return "R_LARCH_TLS_LD_PC_HI20"; + case 96: return "R_LARCH_TLS_LD_HI20"; + case 97: return "R_LARCH_TLS_GD_PC_HI20"; + case 98: return "R_LARCH_TLS_GD_HI20"; + case 99: return "R_LARCH_32_PCREL"; + case 100: return "R_LARCH_RELAX"; + case 102: return "R_LARCH_ALIGN"; + case 103: return "R_LARCH_PCREL20_S2"; + case 105: return "R_LARCH_ADD6"; + case 106: return "R_LARCH_SUB6"; + case 107: return "R_LARCH_ADD_ULEB128"; + case 108: return "R_LARCH_SUB_ULEB128"; + case 109: return "R_LARCH_64_PCREL"; + case 110: return "R_LARCH_CALL36"; + case 111: return "R_LARCH_TLS_DESC_PC_HI20"; + case 112: return "R_LARCH_TLS_DESC_PC_LO12"; + case 113: return "R_LARCH_TLS_DESC64_PC_LO20"; + case 114: return "R_LARCH_TLS_DESC64_PC_HI12"; + case 115: return "R_LARCH_TLS_DESC_HI20"; + case 116: return "R_LARCH_TLS_DESC_LO12"; + case 117: return "R_LARCH_TLS_DESC64_LO20"; + case 118: return "R_LARCH_TLS_DESC64_HI12"; + case 119: return "R_LARCH_TLS_DESC_LD"; + case 120: return "R_LARCH_TLS_DESC_CALL"; + case 121: return "R_LARCH_TLS_LE_HI20_R"; + case 122: return "R_LARCH_TLS_LE_ADD_R"; + case 123: return "R_LARCH_TLS_LE_LO12_R"; + case 124: return "R_LARCH_TLS_LD_PCREL20_S2"; + case 125: return "R_LARCH_TLS_GD_PCREL20_S2"; + case 126: return "R_LARCH_TLS_DESC_PCREL20_S2"; + } + break; case EM_S390: switch (type) { case 0: return "R_390_NONE"; diff --git a/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c b/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c index 3f2c23708549..8aa9e1f90f44 100644 --- a/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c +++ b/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c @@ -340,6 +340,31 @@ struct _Elftc_Bfd_Target _libelftc_targets[] = { .bt_osabi = ELFOSABI_FREEBSD, }, + { + .bt_name = "elf32-loongarch", + .bt_type = ETF_ELF, + .bt_byteorder = ELFDATA2LSB, + .bt_elfclass = ELFCLASS32, + .bt_machine = EM_LOONGARCH, + }, + + { + .bt_name = "elf64-loongarch", + .bt_type = ETF_ELF, + .bt_byteorder = ELFDATA2LSB, + .bt_elfclass = ELFCLASS64, + .bt_machine = EM_LOONGARCH, + }, + + { + .bt_name = "elf64-loongarch-freebsd", + .bt_type = ETF_ELF, + .bt_byteorder = ELFDATA2LSB, + .bt_elfclass = ELFCLASS64, + .bt_machine = EM_LOONGARCH, + .bt_osabi = ELFOSABI_FREEBSD, + }, + { .bt_name = "elf64-sh64", .bt_type = ETF_ELF, @@ -469,6 +494,12 @@ struct _Elftc_Bfd_Target _libelftc_targets[] = { .bt_machine = EM_X86_64, }, + { + .bt_name = "efi-app-loongarch64", + .bt_type = ETF_EFI, + .bt_machine = EM_LOONGARCH, + }, + { .bt_name = "pei-i386", .bt_type = ETF_PE, diff --git a/contrib/elftoolchain/libpe/pe.h b/contrib/elftoolchain/libpe/pe.h index 33969ed8a3e1..b2719d403518 100644 --- a/contrib/elftoolchain/libpe/pe.h +++ b/contrib/elftoolchain/libpe/pe.h @@ -81,6 +81,8 @@ typedef struct _PE_RichHdr { #define IMAGE_FILE_MACHINE_EBC 0xebc /* EFI byte code */ #define IMAGE_FILE_MACHINE_I386 0x14c /* x86 */ #define IMAGE_FILE_MACHINE_IA64 0x200 /* IA64 */ +#define IMAGE_FILE_MACHINE_LOONGARCH32 0x6232 /* LoongArch 32-bit */ +#define IMAGE_FILE_MACHINE_LOONGARCH64 0x6264 /* LoongArch 64-bit */ #define IMAGE_FILE_MACHINE_M32R 0x9041 /* Mitsubishi M32R LE */ #define IMAGE_FILE_MACHINE_MIPS16 0x266 /* MIPS16 */ #define IMAGE_FILE_MACHINE_MIPSFPU 0x366 /* MIPS with FPU */ From nobody Thu Jun 12 00:29:03 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHk0v6wz0z5ykCS; Thu, 12 Jun 2025 00:29:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHk0v5hM4z3XGB; Thu, 12 Jun 2025 00:29:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749688143; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jrT2Snf72hl9R/9KAhfa/DEQlhKNoJPLA0Y9whc7+zk=; b=q0JwszuJDlYj0wcE0tMotzMFGN6o09Nk39+U8O6rzfPy0z6WeW3ryqMmZ0EfnU4/u0CZEs IkVtgPf74BxdL/lo4tXbIOrImfcXeamtn00B+zZMNF6B1MfEBoOgeKd6PzUeQYe1VDYp5q c8YfiUvMAHmGeA8cmS4vAyCRT0iNIb6M0xQdg4Pp/VHX6LbNckzS4/rMQOK2VfPkVyNgcJ iq84ZuYLdNInyL6L48j9HnaQhZusYAu9vXvPDhbCtVSzvXTDOG9zqoww2w8ByA+noD/xom zXhvLxXuL4QZcPIRnm0AmNGUmhjkJQ6Unq2/yWNOginY/JXjp2cbKL94QLIQtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749688143; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jrT2Snf72hl9R/9KAhfa/DEQlhKNoJPLA0Y9whc7+zk=; b=cGZiEcPhdIH+A0/yRzRZsFzRugfrLQm5pjrk8OaZYjf4rnXuAfZm9T/7SMaI1ZqsBrPxZz 5ghnmRsUmRxoF7dmNGuA+eSiK0RS1TO+xxAiTDDUC1lJT0oTodaCYtX6fOKSVepr7DpxUd FZF95VeX4aVF1pMjUkb7p6AOjQPShUuHprJ1++TTUiabqzAhqUVaIWd8Hn6MGFxuZ1oBov 83PVHsU+PcqqV9rA/q7t5fNKnG9k8Y5YKYKftyFHpIGOAmHogEzKwphrbiENpLI6a+NYYy ykSvsd1i/u8K/TXw82OaAymSVMeP/uGCJ+RhfxZtVzi1um7pGp+I9Gpn3VQ3UA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749688143; a=rsa-sha256; cv=none; b=f69c5tKJTWwkVv0MEp4JY+PuwRQGhIvwFle9lU7bWD0ScvuQrWg1FUg8/lN4TAgKZVLEMf 90Zge0Q8Kc0c/wAK9gcopUaY3IHb7Fzw4/XWt9y0iQzgwrjnvsC0hVmqtLc9RuYSEDsy8A V7m8muG13cKaNLzbVs1SDHmH5nGp83ggvjyuCfYkLCL6hgNmjvY4+c9iQevI6OnSFJAPWs IFhQ9rw+I2Ki0iRWM7b/ymew65AWK1gRhJe8YfQfNp6ULLOtLdVoE4ZkN8gexMR104+IYl tJrNRk6SXg4wxD/aujvyyD1cx/Kp4IyMKJ6IFYYV9g56vbjE08tvz/wHOTM8eQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bHk0v4wkYzq6B; Thu, 12 Jun 2025 00:29:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55C0T3di076962; Thu, 12 Jun 2025 00:29:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55C0T39B076960; Thu, 12 Jun 2025 00:29:03 GMT (envelope-from git) Date: Thu, 12 Jun 2025 00:29:03 GMT Message-Id: <202506120029.55C0T39B076960@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: daf47b9ec9ed - main - style.9: relax "return (value)" requirement for C++ List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: daf47b9ec9ed360dfdff6769ae4d0c2c16972552 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=daf47b9ec9ed360dfdff6769ae4d0c2c16972552 commit daf47b9ec9ed360dfdff6769ae4d0c2c16972552 Author: Lexi Winter AuthorDate: 2025-03-27 14:23:13 +0000 Commit: Warner Losh CommitDate: 2025-06-12 00:21:44 +0000 style.9: relax "return (value)" requirement for C++ consider the following C++ code: struct S { int a, b; }; S f() { return {1, 2}; } according to style(9), the return statement should be formatted as: return ({1, 2}); however, this is not valid C++ code and will not compile. add an exception to style(9) to cover this case. Reviewed by: imp, emaste Pull Request: https://github.com/freebsd/freebsd-src/pull/1623 Closes: https://github.com/freebsd/freebsd-src/pull/1623 --- share/man/man9/style.9 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/share/man/man9/style.9 b/share/man/man9/style.9 index 5542a9685c46..484b4f144b2e 100644 --- a/share/man/man9/style.9 +++ b/share/man/man9/style.9 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd February 18, 2025 +.Dd March 27, 2025 .Dt STYLE 9 .Os .Sh NAME @@ -766,7 +766,8 @@ to any pointer type. .Pp Values in .Ic return -statements should be enclosed in parentheses. +statements should be enclosed in parentheses where possible. +For example, parentheses cannot be used if the value is a C++ braced-init-list. .Pp Use .Xr err 3 From nobody Thu Jun 12 00:39:06 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHkDV3byKz5ykj3; Thu, 12 Jun 2025 00:39:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHkDV2lyYz3YC7; Thu, 12 Jun 2025 00:39:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749688746; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uZldIEgzb4S2Re4iB7PU+0bGYx2Kx6xM6+7cf06dvG8=; b=MQS/40DSWSVRt1eDOQNLHYKBUc+QNsqYxa05Yg9XXV5jk1SY+b8mCsCp34eq6i/WRXCmmp sq0ot/bKbWamAuiS8cfa94VAHxOPYEhSX19478v6qc2cd9dpnPM8NWeRorM0RVVbPLKuNz QcRndizDdi1MGeGlY6R16mf3UQEM71zGGz0MSPNFd7FHnzx28w3gWE2bj28WhRicQ/6V3x 65iCXbR6k4f8jUmvGwBBFaxoQs/3V/DAGvRgkg8C+5ly0+FmBT9mO5qEpFyxBbkEzZVLct yWa2x3SxtpC3M/DboYQxWrCtfPrMaTqTAJizv9uTEYBH0usMFx+3tdy5fq0DOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749688746; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uZldIEgzb4S2Re4iB7PU+0bGYx2Kx6xM6+7cf06dvG8=; b=U7/aGMfleHMILQOLxC6kHwN5jhKgXBv4EpPBbmLNVpv+uCqvhWaD7bpSu13wrcs6pBc0+X 4XDB3Z52F8MBEjAo95MS6uZJ5AJcEcLZ72MFtMqm+rXjdhkcH93hZ/oYwIisUp+hhLzpuk JXa5bXpnwdDdMzYUwYCDzsQyydgOru7FrZxwkwgdrJ+r38dvgE+Ik5BSKLgLW2a2c+sMUy ca49qiJiNTDD8VVBAEOvnD/WbztTDawV/iAjWmJIGfdVACEcq9W217CO6SKuJsEGN1ogYZ g6jMf+LxtTSBArzaP2jWSQxEg0zTGfoWxwT8VziSrCFOi9UHA6GxzdinVwQo9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749688746; a=rsa-sha256; cv=none; b=mTcAQgjmgIhMsJkaa4+RwRu56x7uKgVF/NIONd11y/jCgOQWrMPzndHMVHjesD2gmUj9Ao YEj+BmtuYLRrV3ABUeEd6CfitkCNNAZavqHC9FJY7KTILIk2kbrBfXrkkdKJ4WouhgsqpB hq2ic3zuATicYRS5yPHj6BM7+EesDleNqCEJ3c+lzQD2X3HuhJtbNyNPMJ0+GHJ502wDfJ BufG12fgV5HvA0LaIIWOVyYN68RaBYf6tNBPjrHGYjWN8fjrXu3JANoR2+zNPXPiFCQiiK /piuBdmjuMgfPf1aV0VJMrljxoWyBjaHkkUyE+kD3M/l/KXkS7ivCLc1Gj2LmA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bHkDV2GY4zqRb; Thu, 12 Jun 2025 00:39:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55C0d61D095677; Thu, 12 Jun 2025 00:39:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55C0d6tp095674; Thu, 12 Jun 2025 00:39:06 GMT (envelope-from git) Date: Thu, 12 Jun 2025 00:39:06 GMT Message-Id: <202506120039.55C0d6tp095674@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 4f4c465b45d4 - main - arm: fix build after _types.h changes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4f4c465b45d42ed8d2b65c8b4c909246987ac877 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=4f4c465b45d42ed8d2b65c8b4c909246987ac877 commit 4f4c465b45d42ed8d2b65c8b4c909246987ac877 Author: Brooks Davis AuthorDate: 2025-06-12 00:34:55 +0000 Commit: Brooks Davis CommitDate: 2025-06-12 00:38:00 +0000 arm: fix build after _types.h changes Reported by: alc Fixes: b01e971fd39d ("Don't rely on sys/_types.h including sys/cdefs.h") --- lib/msun/aarch64/fenv.h | 1 + lib/msun/arm/fenv.h | 1 + sys/arm/include/sysarch.h | 2 ++ sys/arm64/include/sysarch.h | 2 ++ 4 files changed, 6 insertions(+) diff --git a/lib/msun/aarch64/fenv.h b/lib/msun/aarch64/fenv.h index 2148a68b053b..a435a9de5223 100644 --- a/lib/msun/aarch64/fenv.h +++ b/lib/msun/aarch64/fenv.h @@ -31,6 +31,7 @@ #ifndef _FENV_H_ #define _FENV_H_ +#include #include #ifndef __fenv_static diff --git a/lib/msun/arm/fenv.h b/lib/msun/arm/fenv.h index 5dded5d744fd..e8a30fcf496f 100644 --- a/lib/msun/arm/fenv.h +++ b/lib/msun/arm/fenv.h @@ -29,6 +29,7 @@ #ifndef _FENV_H_ #define _FENV_H_ +#include #include #ifndef __fenv_static diff --git a/sys/arm/include/sysarch.h b/sys/arm/include/sysarch.h index 907a84f39e58..e0a8e0039b99 100644 --- a/sys/arm/include/sysarch.h +++ b/sys/arm/include/sysarch.h @@ -38,6 +38,8 @@ #ifndef _ARM_SYSARCH_H_ #define _ARM_SYSARCH_H_ +#include + #include #ifndef LOCORE diff --git a/sys/arm64/include/sysarch.h b/sys/arm64/include/sysarch.h index b7846651c031..498e26f6d47e 100644 --- a/sys/arm64/include/sysarch.h +++ b/sys/arm64/include/sysarch.h @@ -39,6 +39,8 @@ #ifndef _MACHINE_SYSARCH_H_ #define _MACHINE_SYSARCH_H_ +#include + #define ARM64_GUARD_PAGE 0x100 struct arm64_guard_page_args { From nobody Thu Jun 12 02:41:19 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHmxW4qD2z5xwLL; Thu, 12 Jun 2025 02:41:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHmxW47dhz3q8G; Thu, 12 Jun 2025 02:41:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749696079; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ouG8EtX8Yrw6NxrNg7HQIn0dJCl20hhnY1QzGSHVdh8=; b=hzk/Pj3Vxdmhb5qrnB49avvIlo9Ek1k4mnUqeJOiTejcVB5E7fOOYXjvsUQIsSWto4o44l uk24M/lAhoR3HsCdwlXVg8OtwspMrVuY/zh4pEbzBioPBywBK84JETv9XdIljQa7EyIVHJ S/cpp7DwW8j8jU62P/EOOi7E2ixP1cLCAamJOInJgcPpO6ItGehtlZlMGzmVUXIWo1LvPs GXABEuZ4DCzZhiJyX0CfDHfUj9rI8K8ECCmcTsU8xOWG/0AVTFggzTKQm4xiFCCA1u43wl ooOv/ZVmFETUSglBjGpyIattC3k4qBHfUbVq08urGhpqyBdGvEBwvUXm+6POIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749696079; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ouG8EtX8Yrw6NxrNg7HQIn0dJCl20hhnY1QzGSHVdh8=; b=S/DAKDEAuOQqmA3BqOI30JuQQZTb5SGyY2N9ZwIsdt0xiGeqAW7YzJBnYU2gDal7MHDxuI cppTUhGArajcQAdhqUpPlY1NI86Fd1PfnkbAqFDaQV5ISpbJnHisjmwM4MVesh3/a7Uzyj aeaJoJnbVRLU6YFD9xkEiwi4VKHGdBrEOGksZmlP1jWKBdwp8W9z5hlBU3Y3wlY4UE9x4d ZOk/yj5bNBZ6ECzCTT87A8ST9co9r/H+d4yuEhr8qqQGtnQy5AEevWc6/E3H2KxISGVQE2 oo8IYgEGD19Dk4VZd7HRjRQS2FRK0KBf5G0t+mcX3ikckZ9Ex4dD1hX8CHtAzg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749696079; a=rsa-sha256; cv=none; b=a08Kspgbbw6fZK6nxXNL3erqDKkGgKORsQ1KAExoVo7HBRn7pe2N0Y+NStook9gsTp9ptB Uhns8YknR2oyhwWryvWztK80V+de+n8iQDH8cLXJQNEXJlO15+M5TkW34v0cHuS0voPSZP BccvHYoUFc45WqKC7XFUTO04L4Z+9X68N/PSGPCICykpnEkf+6En4s/waWewTDBcRonefs 25gvPS629L7hDEOwgo6z//JokFZ3qSK5u+lWzaMGwCG7I4+ogLzw5kSt5/PqaY5P+lQWWR KZ21j0unCApSQISdBMKKz04zVhhNOavlW41V3IWPjOtn3gwOeFRx/c6cNu3WXg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bHmxW3fNGztPr; Thu, 12 Jun 2025 02:41:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55C2fJSA034451; Thu, 12 Jun 2025 02:41:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55C2fJW6034448; Thu, 12 Jun 2025 02:41:19 GMT (envelope-from git) Date: Thu, 12 Jun 2025 02:41:19 GMT Message-Id: <202506120241.55C2fJW6034448@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 86c3a22b6e7d - main - nanobsd: Fix kernel build List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 86c3a22b6e7d415c81ff5e5b4f794334723c4a8a Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=86c3a22b6e7d415c81ff5e5b4f794334723c4a8a commit 86c3a22b6e7d415c81ff5e5b4f794334723c4a8a Author: Warner Losh AuthorDate: 2025-06-12 02:40:24 +0000 Commit: Warner Losh CommitDate: 2025-06-12 02:40:57 +0000 nanobsd: Fix kernel build 'device crypto' is now required for 'device pf' so add it. Sponsored by: Netflix --- tools/tools/nanobsd/pcengines/ALIX_DSK | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/tools/nanobsd/pcengines/ALIX_DSK b/tools/tools/nanobsd/pcengines/ALIX_DSK index 9ab9d79c574c..31365834d20f 100644 --- a/tools/tools/nanobsd/pcengines/ALIX_DSK +++ b/tools/tools/nanobsd/pcengines/ALIX_DSK @@ -97,6 +97,7 @@ device pflog device pfsync device carp device if_bridge +device crypto # core crypto support options DEVICE_POLLING From nobody Thu Jun 12 02:56:21 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHnGx5tS8z5xx27 for ; Thu, 12 Jun 2025 02:56:25 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-io1-xd2a.google.com (mail-io1-xd2a.google.com [IPv6:2607:f8b0:4864:20::d2a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHnGx419pz3qxL for ; Thu, 12 Jun 2025 02:56:25 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Authentication-Results: mx1.freebsd.org; none Received: by mail-io1-xd2a.google.com with SMTP id ca18e2360f4ac-86a55400875so49009339f.3 for ; Wed, 11 Jun 2025 19:56:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; t=1749696984; x=1750301784; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=n5NmaaLdeO4IDTIoj49lnCkYAOOlLX1hI2yyAzhsmAo=; b=Fz0MbmAGS7sNqobYm1vlUEWQCCAkkJTR2qdnGRF1USiR0+W6hpgahYzwwOjChRvcs/ EA6vusufcrlNNsoIugv0+XdYAtIIdDgNHuwahBb39VxTQkIsxPmRj/w+cmXV2+CjzrmY ksEWpfy4ple+lVwNl/MU0ivp6IVcXn0mxArZ9/1brzbbdHBq2jeSOV0pUIJztG2l5cfV BA1kVunuhrT7vikRS2M6Ue+zqt7t54efKTGXJ0cZSj2IqYcdCKh+3A+v+GIqDTICim0r COoIHfbISXrJPMZUOrxq5iBJrLXFeLWW8p3OWsTk0ln+Kiw6gGv+6X/EQJcgg+lNZw5V jI9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749696984; x=1750301784; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=n5NmaaLdeO4IDTIoj49lnCkYAOOlLX1hI2yyAzhsmAo=; b=Wv9vxNJoWJ36jGMOo83JNVj5esv+JGMkZScGJ41dsLkxFFcbQlHKCJg1ql40pMYov3 OQVLLdo6mG7YV/GXoSDOvpK3MwCyF8zXGXMaWgaCyKY4a0hRsnXeEU8SRZ+8OOuEwSaM nCDaeNTF07DSIqpNAelluoLsDA5L9hiyv5l087omt2KO5hM/AxBAaDd7kBtn/hUtsXaF HY2erpbIXJFLJCMqMBI7hn70AzBOxC7fZ1x+QlYUChI4QbpV6RDfP2+76N4v2yQhiCzl GSxopRkzY+JyQs/f5JHa9LLMdw1DCZCYb6gzSChdGm0PYF2QrkLZZyO8j6A7MYYG5tz8 +DSg== X-Forwarded-Encrypted: i=1; AJvYcCVvEjD0+ReRhpTdgLtAnQ30bn/OdTQXT0Gm6U4yykrbt/7Ai6b5OwgG6w4SEedR6DkLslQPXk8IBi7XGJ0Vk3rBOerhkg==@freebsd.org X-Gm-Message-State: AOJu0YzFuSy2pnhzQuIiQ6t8R9qcszUxKAJ838cQT7c4ZCvTfcWDoQG2 mS9xxLzpbuha07AArZboz+thbxG8nOjpEFC3yJ03avj8ff/pJ9vlSctXFJD5Lep1+MU= X-Gm-Gg: ASbGncvPvJK29dGiDFWaUHb7DvUhEQq0xpG6CK9PquPN9FKBprBCdmjZDxnlyNanBG+ XN0oMWMTs1cLD2aa9qH4HpniDZ1Pk6AFX5+N2nEOJ3KSNhDBd4kzae5ZvDUrOF+mGYvD7Phkdof Jop8xTKBOW9PVbY0Ls2VPzH/kuAqyXtoCTaCqRmLhRRH9GUpNwM2PVi8hMN9f7gq2+I+T2vegJK LOvDg8/hUIxcWyBvIt56usynYixSajCq3KVx4WoM2sQGVH4hfoHeueLeCPj2t9tbg4MutXHKVcX bg9RgTdNEUEK7kG5/U7+YytxBi2guc+Ze4Xj95lzUzOB X-Google-Smtp-Source: AGHT+IH7Spsen2S26fOb73rAfbM2jqZYYrzHHLSWEl9iJlwNLjlT0/hFeSdKezi7OjDjms+TtPASIQ== X-Received: by 2002:a05:6e02:17c5:b0:3dd:ce9b:aa17 with SMTP id e9e14a558f8ab-3ddf4315263mr63584395ab.20.1749696983591; Wed, 11 Jun 2025 19:56:23 -0700 (PDT) Received: from mutt-hbsd ([2001:470:4001:1::95]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-5013b7ca57esm111524173.59.2025.06.11.19.56.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Jun 2025 19:56:22 -0700 (PDT) Date: Thu, 12 Jun 2025 02:56:21 +0000 From: Shawn Webb To: Warner Losh , Ricardo Branco Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 3d12567133bf - main - Add the POSIX sig2str(3) & str2sig(3) calls Message-ID: X-Operating-System: FreeBSD mutt-hbsd 14.2-STABLE-HBSD FreeBSD 14.2-STABLE-HBSD HARDENEDBSD-14-STABLE amd64 X-PGP-Key: https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/blob/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc References: <202506112316.55BNGeGh046207@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="hpe22asn2yxz7nsz" Content-Disposition: inline In-Reply-To: <202506112316.55BNGeGh046207@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4bHnGx419pz3qxL X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] --hpe22asn2yxz7nsz Content-Type: text/plain; protected-headers=v1; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: Re: git: 3d12567133bf - main - Add the POSIX sig2str(3) & str2sig(3) calls MIME-Version: 1.0 On Wed, Jun 11, 2025 at 11:16:40PM +0000, Warner Losh wrote: > The branch main has been updated by imp: >=20 > URL: https://cgit.FreeBSD.org/src/commit/?id=3D3d12567133bfb4082a5115f16a= 71a865ff2af7fb >=20 > commit 3d12567133bfb4082a5115f16a71a865ff2af7fb > Author: Ricardo Branco > AuthorDate: 2025-05-10 20:56:03 +0000 > Commit: Warner Losh > CommitDate: 2025-06-11 23:16:22 +0000 >=20 > Add the POSIX sig2str(3) & str2sig(3) calls > =20 > Signed-off-by: Ricardo Branco > Reviewed by: imp, kib, des, jilles > Pull Request: https://github.com/freebsd/freebsd-src/pull/1696 > --- > include/signal.h | 9 ++++ > lib/libc/gen/Makefile.inc | 3 ++ > lib/libc/gen/Symbol.map | 2 + > lib/libc/gen/psignal.3 | 56 ++++++++++++++++++++++- > lib/libc/gen/sig2str.c | 112 ++++++++++++++++++++++++++++++++++++++++= ++++++ > 5 files changed, 180 insertions(+), 2 deletions(-) >=20 > diff --git a/include/signal.h b/include/signal.h > index c1d341f317f4..22fefb63568f 100644 > --- a/include/signal.h > +++ b/include/signal.h > @@ -40,6 +40,10 @@ > #include > #endif > =20 > +#if __POSIX_VISIBLE >=3D 202405 || __BSD_VISIBLE > +#define SIG2STR_MAX 32 /* size of buffer required for sig2str() */ > +#endif Hey Warner and Ricardo, The above breaks building world when _FORTIFY_SOURCE=3D2. I've committed in HardenedBSD a fix: https://git.hardenedbsd.org/hardenedbsd/HardenedBSD/-/commit/0572db282c5a54= 2fe0de52739932e91eade537ed I suppose that the !defined gate might not actually be desired, since doing it the way I did might cause issues if third-party code defines the macro to a value smaller than what libc was built with. I might remove that gate. Thanks, --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD Signal Username: shawn_webb.74 Tor-ified Signal: +1 303-901-1600 / shawn_webb_opsec.50 https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A= 4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc --hpe22asn2yxz7nsz Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmhKQcMACgkQ/y5nonf4 4frPTxAAhubTBLXKz3JzOES74yOFCKtyfGx1oyslx50HVYiYJzIlfiEV8vJ8t7dH opd9gI0ENndtm8PMduEtabQArMIAGobpSux1zsfifIydGerOgZpFx1fZUj5/f5yQ V5t0E0s0ekcsQhmes6rw0jQ3NDbdQFQHNoa5zZD/ggaUeuvLked3vYC9aX2P1QDr 1PGUW0h3CrrURLp+JD+hemQKsceE9uZBnAx3cZpjVzeorbc5rULyqEbuxecJ2/Il 1b/JwyUSX9/pmuRZUhSrtit3AzuLbHxgcJoB0JdMlym5qhbuTUexRbxLDInYwN16 x/bgpVAD4N8un6Mx8yM8VMv4lX+Z6T1dmkGoxR1s+bto6/ZVxBrr2N2UXSaozzDf c90V+2lLs8eLZFsDJPJMjcWSNhkFHQtcsHd4q8PBuYIaisI/EKPakyeSj7obtTwo WS3Oqwp/FDy9i2ft4hqRdcUCPn/CoQGDwVgLjrERQBkmqcXHgq7w5CHX+SOENwt6 G5dLDb41BbeFGnxFwAV56TPv0SzYsli4f22gOtxoAu16789HIuE83j6LUFvCBa89 Gpr6g0AvJb1/A8n7atwpi3uxB2OCZ43Gq+YLnOSE2KbBHk+opsIR9Tlnry/Ylm6X MJeQy76nw1zs9L9/VR4lHt1CRrclRKzv43DQmXfcEbjvv5sn/24= =cvQ6 -----END PGP SIGNATURE----- --hpe22asn2yxz7nsz-- From nobody Thu Jun 12 02:59:19 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHnLc496Qz5xxns for ; Thu, 12 Jun 2025 02:59:36 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHnLc2KtXz3rjv for ; Thu, 12 Jun 2025 02:59:36 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pj1-x1036.google.com with SMTP id 98e67ed59e1d1-3134c67a173so640730a91.1 for ; Wed, 11 Jun 2025 19:59:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1749697170; x=1750301970; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=pCIfoyLE/5nPJnTlPoa6+dGZS7HdXxr8PP6Pn+bLIVE=; b=ZBSmvK4sLt5R6oLv3bY8QrOIMAM9AvU8NQFbqhk1iaU+6l3s0Eore6F52p3TKRxjy5 PhuN9uEKgIjBBeM6bGEwbQxf2CAYQP3Z08jxJ/hOSTNAQWufa8tUTvhqa1XqXSmdRZ/T 5yeJTC8dkJPlMig3118ZcMQIYTA2ecvd3kbmKR1MJTzFifJRYqgQ80s/O3Rr+la3+KbX QqJJF21RP6A/T4maGwl/8peL0U++TjLI4IlNJ/2/CngQN/N95R9b8XiLrSIKRTBeLdnq 7lS88OCnlTYpmzySVIto3LHI25VN/PKcpAe2q7YTzdWmcVyJgOIA4QCDHPCGaSzzWViQ P14A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749697170; x=1750301970; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pCIfoyLE/5nPJnTlPoa6+dGZS7HdXxr8PP6Pn+bLIVE=; b=mzSwHe1gmpCvHLuqPrNBFg+lIQyxTDv2T4PalRCyzJrWdLPmuiCNmCTnWFgWmwn/xn kurHHR9wPkFGQbw/na1TlOzguyNK6HR8t0SKuhiPTbazOOrJ3QI93SGFU3tFCKXjfCRx DVkPMMRDHYbPnAF3iIOhXY9pOK5oSdGzpx5SACtM9/V4n+hb58PNaLutlhXUM58pn+Vs FypLHO827cyXIIY2lJXcnOqDJAX/YYALXJRMoCD8piyUEDQclqP2cmpX+N8KbQcWfXTY 1rCWFfIFCH8UDxFRWRCrw/+w7qcTDLXTyUpbDjBOogEim9x3zpd3D5SEMQo++F6Nl4Ru Yenw== X-Forwarded-Encrypted: i=1; AJvYcCX3fcnE0KPk5uMdcbIUV70ClKUg+sHAvXTNRBstEW/Hmp9BJ48EG1n/vwIKEjAWRJN+mCE9/Hv+xwhRdM+AbYBVRZ7owA==@freebsd.org X-Gm-Message-State: AOJu0YzfkCbXVzOQZczrzmw7/Xzxa68jMAHrUXn/tZcYOiVhCLlchCZk fB8kNPKyvlVRNIX2WxmlchJT5/8P5sUxlUcZQW5t5cltO+hVlUNM1so5TMh5PuRTgNzhkyZ4fM1 bzP/I8sts6L66nMYi5G7az9giPomjFZBc20BPpaLgzQ== X-Gm-Gg: ASbGncsn4PgXog1jVulRfxe9ohUUH7EeE/NL7pe/gnbMF9qdttOpRpll4T71XxTtkH4 qUFGt2BL3i4rRcAQyyHPf8uCcJAmhBrRqhNa2Qjyuay/+bqR54b7b1QiZywBGKdr8ocwHiGQNht w8rZuUrQL8QrMahIxE1D7nCBHaFoV5Kq/3j2yyXSbF2WgqgayiewT7Dg== X-Google-Smtp-Source: AGHT+IFWxrxzNjdu3zTMYX9GrjYlqFtBVyA3x+WbHaJeDW5SahKICdzDZSHFxwflXqntHTVXeWgp0aAaayNMrZwFuAM= X-Received: by 2002:a17:90b:4cc1:b0:312:959:dc4d with SMTP id 98e67ed59e1d1-313bfb9fe6amr2917607a91.7.1749697169950; Wed, 11 Jun 2025 19:59:29 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202506112316.55BNGeGh046207@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Wed, 11 Jun 2025 22:59:19 -0400 X-Gm-Features: AX0GCFsjl0G1Z3pYxZEuDb81OPo7R5kADs_0qk42emtXKvM8skBdsMdjDIe4SNA Message-ID: Subject: Re: git: 3d12567133bf - main - Add the POSIX sig2str(3) & str2sig(3) calls To: Shawn Webb Cc: Warner Losh , Ricardo Branco , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4bHnLc2KtXz3rjv X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] On Wed, Jun 11, 2025 at 10:56=E2=80=AFPM Shawn Webb wrote: > > On Wed, Jun 11, 2025 at 11:16:40PM +0000, Warner Losh wrote: > > The branch main has been updated by imp: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D3d12567133bfb4082a5115f1= 6a71a865ff2af7fb > > > > commit 3d12567133bfb4082a5115f16a71a865ff2af7fb > > Author: Ricardo Branco > > AuthorDate: 2025-05-10 20:56:03 +0000 > > Commit: Warner Losh > > CommitDate: 2025-06-11 23:16:22 +0000 > > > > Add the POSIX sig2str(3) & str2sig(3) calls > > > > Signed-off-by: Ricardo Branco > > Reviewed by: imp, kib, des, jilles > > Pull Request: https://github.com/freebsd/freebsd-src/pull/1696 > > --- > > include/signal.h | 9 ++++ > > lib/libc/gen/Makefile.inc | 3 ++ > > lib/libc/gen/Symbol.map | 2 + > > lib/libc/gen/psignal.3 | 56 ++++++++++++++++++++++- > > lib/libc/gen/sig2str.c | 112 ++++++++++++++++++++++++++++++++++++++= ++++++++ > > 5 files changed, 180 insertions(+), 2 deletions(-) > > > > diff --git a/include/signal.h b/include/signal.h > > index c1d341f317f4..22fefb63568f 100644 > > --- a/include/signal.h > > +++ b/include/signal.h > > @@ -40,6 +40,10 @@ > > #include > > #endif > > > > +#if __POSIX_VISIBLE >=3D 202405 || __BSD_VISIBLE > > +#define SIG2STR_MAX 32 /* size of buffer required for sig2str() = */ > > +#endif > > Hey Warner and Ricardo, > > The above breaks building world when _FORTIFY_SOURCE=3D2. I've committed > in HardenedBSD a fix: > https://git.hardenedbsd.org/hardenedbsd/HardenedBSD/-/commit/0572db282c5a= 542fe0de52739932e91eade537ed > > I suppose that the !defined gate might not actually be desired, since > doing it the way I did might cause issues if third-party code defines > the macro to a value smaller than what libc was built with. I might > remove that gate. I don't think we need the !defined part of it... But what software is breaking? What's the error message? Maybe the fact it's undefined is pointing at a different bug... Warner From nobody Thu Jun 12 03:05:05 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHnT54fl6z5xyNL for ; Thu, 12 Jun 2025 03:05:13 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHnT530MZz3sK0 for ; Thu, 12 Jun 2025 03:05:13 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-442f4a3a4d6so2237815e9.0 for ; Wed, 11 Jun 2025 20:05:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749697507; x=1750302307; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KlYn7TpvpUXL4FGxihQJIYoM/Xx0FFT578Pno3uRIyk=; b=vjsN4okuOTUD9h7Cm2ehD5tte82imE31kYVxfbafRgwqNwYuJ+1uOCN4ZCVneOvBhy F+qF6k8Xx17iSMet1oMSjLqCuDOSKCP+D9K2r+NcfD3scYqENfpH+oiWSmHsdI2tzgUP sWid7g409ZkNUaLEbB5NgPZ1zKzlEe5C5piq20lYmp6WutY/xME51kyqjU9ywt/kaNj+ p4971Zuw+1QqretmJfG/PyJX45fKQohCYBiQ5yD+a6xVU98HwV7u/JaofV/vvwJNerXn o9ur9QmMHRHWujFzdQ0LMJGuqQ1vyA8Dt0X+ysPKlK/hCpDdRGKhS551rfyjA33YEzWe Z0dA== X-Forwarded-Encrypted: i=1; AJvYcCV9s7gLbfTtjlCVEQagPVMviyfA6oZYCxK80XYe4JRwgf5i46iIf6uCaM59Hl7nmMdQvbXf12RTtjO8dNNvqRXi3EFEUw==@freebsd.org X-Gm-Message-State: AOJu0YxE93rJydqoyx9Ll5f6kdbxEaCkYnto5zLilDouTDbbFJADVtZ2 Nlhr3BFHoYYOkUg1iRqYiSR+ML0JkPMf5LOtzMkWJTt95GJWYmiQGx1OLEixgeXLRzo= X-Gm-Gg: ASbGncu+c3rq8QkSXCDUz6hCRQFqA73/Pp7XSeaIdW1ro1UBKbgu1mmkpWBKBIiBId7 mAWFmRUpp4aErUTlE3COdZ2Kf4B1EPM1ZrxSTq52NI5/HuwTfrwMK90b4r6Xwxati8h5+ATvbEk gjbhiGrTvtHT5rmRWW7zPIJmSNAMiZeuyxOFTv2K3k9UW4jmrL1rEr6lAde3wBAYgHQehkiiBMS TEUy4/EvR9NkSWmYDPJdeTd0yvHe5MIVEr23Nz212oQv0wQcGzn4l0RgsySLUCGVlwrFctPbWgD PtgVoOFMT0lG1TGnkDo9kuZhWkMEhhn+dZ+xqlcgwstEQ+pDqr1boGAuu/WDspCK/jqFCNMrWtV n X-Google-Smtp-Source: AGHT+IG0D+mJG14K/TlskcmW5Mq3zm1jPSntDTVVq63AOvmHO7otvD8xr81XueEcv2RCOf1WCNJ4Yw== X-Received: by 2002:a05:600c:4f0f:b0:453:10c1:cb21 with SMTP id 5b1f17b1804b1-4532c28ca76mr14237475e9.8.1749697506161; Wed, 11 Jun 2025 20:05:06 -0700 (PDT) Received: from smtpclient.apple ([131.111.5.201]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45320580af6sm52833435e9.1.2025.06.11.20.05.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Jun 2025 20:05:05 -0700 (PDT) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.600.51.1.1\)) Subject: Re: git: 3d12567133bf - main - Add the POSIX sig2str(3) & str2sig(3) calls From: Jessica Clarke In-Reply-To: Date: Thu, 12 Jun 2025 04:05:05 +0100 Cc: Shawn Webb , Warner Losh , Ricardo Branco , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <86507548-1B8C-4CD1-BB18-C884D38EA489@freebsd.org> References: <202506112316.55BNGeGh046207@gitrepo.freebsd.org> To: Warner Losh X-Mailer: Apple Mail (2.3826.600.51.1.1) X-Rspamd-Queue-Id: 4bHnT530MZz3sK0 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] On 12 Jun 2025, at 03:59, Warner Losh wrote: >=20 > On Wed, Jun 11, 2025 at 10:56=E2=80=AFPM Shawn Webb = wrote: >>=20 >> On Wed, Jun 11, 2025 at 11:16:40PM +0000, Warner Losh wrote: >>> The branch main has been updated by imp: >>>=20 >>> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D3d12567133bfb4082a5115f16a71a865= ff2af7fb >>>=20 >>> commit 3d12567133bfb4082a5115f16a71a865ff2af7fb >>> Author: Ricardo Branco >>> AuthorDate: 2025-05-10 20:56:03 +0000 >>> Commit: Warner Losh >>> CommitDate: 2025-06-11 23:16:22 +0000 >>>=20 >>> Add the POSIX sig2str(3) & str2sig(3) calls >>>=20 >>> Signed-off-by: Ricardo Branco >>> Reviewed by: imp, kib, des, jilles >>> Pull Request: https://github.com/freebsd/freebsd-src/pull/1696 >>> --- >>> include/signal.h | 9 ++++ >>> lib/libc/gen/Makefile.inc | 3 ++ >>> lib/libc/gen/Symbol.map | 2 + >>> lib/libc/gen/psignal.3 | 56 ++++++++++++++++++++++- >>> lib/libc/gen/sig2str.c | 112 = ++++++++++++++++++++++++++++++++++++++++++++++ >>> 5 files changed, 180 insertions(+), 2 deletions(-) >>>=20 >>> diff --git a/include/signal.h b/include/signal.h >>> index c1d341f317f4..22fefb63568f 100644 >>> --- a/include/signal.h >>> +++ b/include/signal.h >>> @@ -40,6 +40,10 @@ >>> #include >>> #endif >>>=20 >>> +#if __POSIX_VISIBLE >=3D 202405 || __BSD_VISIBLE >>> +#define SIG2STR_MAX 32 /* size of buffer required for = sig2str() */ >>> +#endif >>=20 >> Hey Warner and Ricardo, >>=20 >> The above breaks building world when _FORTIFY_SOURCE=3D2. I've = committed >> in HardenedBSD a fix: >> = https://git.hardenedbsd.org/hardenedbsd/HardenedBSD/-/commit/0572db282c5a5= 42fe0de52739932e91eade537ed >>=20 >> I suppose that the !defined gate might not actually be desired, since >> doing it the way I did might cause issues if third-party code defines >> the macro to a value smaller than what libc was built with. I might >> remove that gate. >=20 > I don't think we need the !defined part of it... >=20 > But what software is breaking? What's the error message? Maybe the > fact it's undefined is pointing at a different bug=E2=80=A6 Probably include/ssp/signal.h unconditionally defining the wrapper? Presumably gating that with the same condition as sig2str itself would fix things properly rather than such bogus hacks. But yes, including the actual error message when reporting a build failure would have been helpful. Jess From nobody Thu Jun 12 03:14:55 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHnhR2Nmnz5xyj4 for ; Thu, 12 Jun 2025 03:15:03 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-io1-xd34.google.com (mail-io1-xd34.google.com [IPv6:2607:f8b0:4864:20::d34]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHnhR0Yj9z3tXF for ; Thu, 12 Jun 2025 03:15:03 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Authentication-Results: mx1.freebsd.org; none Received: by mail-io1-xd34.google.com with SMTP id ca18e2360f4ac-8647e143f28so42910539f.1 for ; Wed, 11 Jun 2025 20:15:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; t=1749698097; x=1750302897; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=8s9HKt/lEf3aRSdMLdj5Erqy0Ht0Xyrxkg91M/V5TuI=; b=cc1fU9IAzIAX2/RD8vjM9RYlaUr6vbgRNAd/QIYXLrHqJ+dRTTERo5hRz+zQ7H25TA alM/JIi2iDtFR53gCRF3WNsbXAWqCsR6kH1BBnsTQHMqWKCWWkxUMA/xFBzUYgPdvarn vUwP9c04LjARNAJ17fAJR66Jf+f7uW3LHnXdvYuLL/fY+NkJqTd2h8KnAd5USSuPCDBh nxnavYS/eft35exsdDk4gfMwrNxQ2F8pkRcp2FhrRiScuwq+x6g+u1IffNuvx0DsDrr+ 7fwN3lHTEMqYD9+fvIttH2ycPvm3Zt8Z8TaIvxif+n+PqPEV0/IRRc+EoIRGZI7771CT LkGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749698097; x=1750302897; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=8s9HKt/lEf3aRSdMLdj5Erqy0Ht0Xyrxkg91M/V5TuI=; b=Dz/GrHlqWF09KweaDMhvt99rWCupBuewhrXml5aGoAqgkYw/gEGtLQQHOdJ1aSht1K LfljIcRwmR8kK/LL1Qs2EX4CrRwuxPaLDQXnQEcpBfQIwKWhMXDnX+sQN+gQ3SW/rbeh KW7CbjuLnvQeFIf5FJQ+HmhE4pJnk89yxBhNvoyzGWHwDD/Ee98Qkk1VL0366BwaRTr8 7kP0Nb0wnkLd03gkZyTj308u4osrkz8YDMHytlgxiCBTFD18nmxMoWWSWcyB9EvJRsNo ZvqJxyssSDPCl37SwnCSsPLl+kkJ47UWiCAG/otKRP22+IcmjbEvBsFJjoiYADdW1TWD IWBA== X-Forwarded-Encrypted: i=1; AJvYcCVDjvep8w78nbmexu2yGOgrE1LrMjD9BHahOw8P3UeAsgZ7oXa8bCReM9ac2JHSUyGPph+9P/0/JMHMunbAVJI0ZN8vVA==@freebsd.org X-Gm-Message-State: AOJu0YyEtlksvzK5GGwgDqCS5WMkRmNLZ8orDpqUZkVpviuNBEDGNWeJ 0E8kPxpr5fa2jRbUgmGgG5SK6M26aliQ0RLJ+LKFVYL8jveFGLNxN/GYkflf/1xvhTs= X-Gm-Gg: ASbGncspT81Z6ZdjB86mxQ7uSTMZzmGh8px8R9NBCe+OoabPpCjUO6Vgp5Ah0j67fZW m9pInVZMI30PptcIlzKgz4cLBhRikTk/82VlW2ywib0mBw3iBeGwZa8AyGLu4FHgxoJ9XsFXo1S 5iVY3+LE3OAlHELBV50a2QT0NT6ho5Fn0HuX5KV0z4399JBYuJC+04ktEw/CTRX9zDvwK6Ld2l8 ooOSLJZnkGmkvzOlwhzIUIA5JGcGyaOaM7nCvEwkAaywaO2aKc8GVi9TKaqVGUcH+bL1whpX6RF mDGCcIQkcBXPbyLkUfDYJc4uC5YAf/5o/774IMjYTnnF X-Google-Smtp-Source: AGHT+IHN7ulVM4DNtygJqVQDmAxTKja4oXAW4xXKDSsXKrljSdeG/GucQy4B0+aTI2bCCJS/MY+rcg== X-Received: by 2002:a05:6e02:4518:20b0:3dd:f4ea:109f with SMTP id e9e14a558f8ab-3ddf4ea10bdmr32231895ab.0.1749698096857; Wed, 11 Jun 2025 20:14:56 -0700 (PDT) Received: from mutt-hbsd ([2001:470:4001:1::95]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-3ddfbade69csm1592235ab.52.2025.06.11.20.14.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Jun 2025 20:14:56 -0700 (PDT) Date: Thu, 12 Jun 2025 03:14:55 +0000 From: Shawn Webb To: Jessica Clarke Cc: Warner Losh , Warner Losh , Ricardo Branco , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 3d12567133bf - main - Add the POSIX sig2str(3) & str2sig(3) calls Message-ID: X-Operating-System: FreeBSD mutt-hbsd 14.2-STABLE-HBSD FreeBSD 14.2-STABLE-HBSD HARDENEDBSD-14-STABLE amd64 X-PGP-Key: https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/blob/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc References: <202506112316.55BNGeGh046207@gitrepo.freebsd.org> <86507548-1B8C-4CD1-BB18-C884D38EA489@freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ogq5fvkdxf2poib2" Content-Disposition: inline In-Reply-To: <86507548-1B8C-4CD1-BB18-C884D38EA489@freebsd.org> X-Rspamd-Queue-Id: 4bHnhR0Yj9z3tXF X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] --ogq5fvkdxf2poib2 Content-Type: text/plain; protected-headers=v1; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: Re: git: 3d12567133bf - main - Add the POSIX sig2str(3) & str2sig(3) calls MIME-Version: 1.0 On Thu, Jun 12, 2025 at 04:05:05AM +0100, Jessica Clarke wrote: > On 12 Jun 2025, at 03:59, Warner Losh wrote: > >=20 > > On Wed, Jun 11, 2025 at 10:56=E2=80=AFPM Shawn Webb wrote: > >>=20 > >> On Wed, Jun 11, 2025 at 11:16:40PM +0000, Warner Losh wrote: > >>> The branch main has been updated by imp: > >>>=20 > >>> URL: https://cgit.FreeBSD.org/src/commit/?id=3D3d12567133bfb4082a5115= f16a71a865ff2af7fb > >>>=20 > >>> commit 3d12567133bfb4082a5115f16a71a865ff2af7fb > >>> Author: Ricardo Branco > >>> AuthorDate: 2025-05-10 20:56:03 +0000 > >>> Commit: Warner Losh > >>> CommitDate: 2025-06-11 23:16:22 +0000 > >>>=20 > >>> Add the POSIX sig2str(3) & str2sig(3) calls > >>>=20 > >>> Signed-off-by: Ricardo Branco > >>> Reviewed by: imp, kib, des, jilles > >>> Pull Request: https://github.com/freebsd/freebsd-src/pull/1696 > >>> --- > >>> include/signal.h | 9 ++++ > >>> lib/libc/gen/Makefile.inc | 3 ++ > >>> lib/libc/gen/Symbol.map | 2 + > >>> lib/libc/gen/psignal.3 | 56 ++++++++++++++++++++++- > >>> lib/libc/gen/sig2str.c | 112 +++++++++++++++++++++++++++++++++++++= +++++++++ > >>> 5 files changed, 180 insertions(+), 2 deletions(-) > >>>=20 > >>> diff --git a/include/signal.h b/include/signal.h > >>> index c1d341f317f4..22fefb63568f 100644 > >>> --- a/include/signal.h > >>> +++ b/include/signal.h > >>> @@ -40,6 +40,10 @@ > >>> #include > >>> #endif > >>>=20 > >>> +#if __POSIX_VISIBLE >=3D 202405 || __BSD_VISIBLE > >>> +#define SIG2STR_MAX 32 /* size of buffer required for sig2str(= ) */ > >>> +#endif > >>=20 > >> Hey Warner and Ricardo, > >>=20 > >> The above breaks building world when _FORTIFY_SOURCE=3D2. I've committ= ed > >> in HardenedBSD a fix: > >> https://git.hardenedbsd.org/hardenedbsd/HardenedBSD/-/commit/0572db282= c5a542fe0de52739932e91eade537ed > >>=20 > >> I suppose that the !defined gate might not actually be desired, since > >> doing it the way I did might cause issues if third-party code defines > >> the macro to a value smaller than what libc was built with. I might > >> remove that gate. > >=20 > > I don't think we need the !defined part of it... > >=20 > > But what software is breaking? What's the error message? Maybe the > > fact it's undefined is pointing at a different bug=E2=80=A6 >=20 > Probably include/ssp/signal.h unconditionally defining the wrapper? > Presumably gating that with the same condition as sig2str itself would > fix things properly rather than such bogus hacks. >=20 > But yes, including the actual error message when reporting a build > failure would have been helpful. I apologize. I indeed should have included the error message. It's included below. =3D=3D=3D=3D BEGIN LOG =3D=3D=3D=3D =3D=3D=3D> lib/liblua (all) cc -target x86_64-unknown-freebsd15.0 --sysroot=3D/usr/obj/usr/src/amd64.am= d64/tmp -B/usr/obj/usr/src/amd64.amd64/tmp/usr/bin -O2 -pipe -fno-common -= DHARDENEDBSD -I/usr/src/lib/liblua -I/usr/src/lib/liblua/modules -I/usr/src= /contrib/lua/src -DLUA_PROGNAME=3D"\"\"" -g -gz=3Dzlib -mretpoline -fPIC = -flto -fzero-call-used-regs=3Dused -MD -MF.depend.lapi.o -MTlapi.o -std=3D= gnu17 -Wno-format-zero-length -fstack-protector-strong -D_FORTIFY_SOURCE=3D= 2 -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-po= inter-sign -Wdate-time -Wno-empty-body -Wno-string-plus-int -Wno-unused-con= st-variable -Wno-error=3Dunused-but-set-parameter -Wno-error=3Dcast-functio= n-type-mismatch -Wno-tautological-compare -Wno-unused-value -Wno-parenthese= s-equality -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-type= def -Wno-address-of-packed-member -Wno-switch -Wno-switch-enum -Wno-knr-pro= moted-parameter -Qunused-arguments -c /usr/src/contrib/lua/src/lapi.c = -o lapi.o In file included from /usr/src/contrib/lua/src/lapi.c:19: In file included from /usr/src/contrib/lua/src/lapi.h:12: In file included from /usr/src/contrib/lua/src/lstate.h:130: In file included from /usr/obj/usr/src/amd64.amd64/tmp/usr/include/signal.h= :76: /usr/obj/usr/src/amd64.amd64/tmp/usr/include/ssp/signal.h:41:23: error: use= of undeclared identifier 'SIG2STR_MAX' 41 | if (__ssp_bos(str) < SIG2STR_MAX) | ^ 1 error generated. *** Error code 1 Stop. make[5]: stopped making "all" in /usr/src/lib/liblua =3D=3D=3D=3D END LOG =3D=3D=3D=3D --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD Signal Username: shawn_webb.74 Tor-ified Signal: +1 303-901-1600 / shawn_webb_opsec.50 https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A= 4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc --ogq5fvkdxf2poib2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmhKRh8ACgkQ/y5nonf4 4foEAA/+OqFmcGA8qgv7T+HrQ6jMDwjXfV0p6sxeAtyUii5CxW5oQ1ZS6/eRnF9j eXW3Cc6hSL98HpeZ34sHarWd2oCCYX8pYiD3Uhlo3xI4I+tSTWTeuyIhX+SAJxqP XYIDfTzn82uHpx9D50KlyBK6bGF6x3tMZnAJIAKfHZX6l6wfyq2Ja+VkjBRCHnft YbzbXaPB8cAId9HDSbce7wOtoNeyJESDsPvvG06CVaolAg2aak5YZ0HjjfgfJwK8 hJUi+XJjR1+wLu7CXyaRwU+Y7R7xzKrpF1SsEZq3IDpEUMlY/wq7evQ5t1lis1nu rXAtv9Kkp4kbQhicw3GWML1wXCayjWa++kJ2V+TQ/3GIFI8CRGX4aGNaVDI/xP0s SZpk5DqmcPxKyttKR1YcbWIHyiQqCcmRpVuuQs0YqkvGfsmedc5y+nhm/EO4If6E Pcr0oH6OZBGZtTdNNj+VwVyR3GA+JrxqBVDqgFO4AVKOTEOwEUnfRdTs0y/yvhlg +lGLKwKjetDsSNqIdYURzgTZzCcnt4YIT8+kkXr7M+8/rx08ukKRLB9zVqbemRAT 9gH7cCDOKkn1CZklQseO2wvVkIF5KUH5PZZXgZPwUFclq9lY6JD7pozQEKMbYLrW RpXjiEBjsEVtew9b0qUfLAYIRBL0orqaL5vImuPz8j053muDZmY= =SMcD -----END PGP SIGNATURE----- --ogq5fvkdxf2poib2-- From nobody Thu Jun 12 03:22:02 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHnrn6X2gz5y0f8 for ; Thu, 12 Jun 2025 03:22:17 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHnrm6nh9z3vCt for ; Thu, 12 Jun 2025 03:22:16 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-2351227b098so3907045ad.2 for ; Wed, 11 Jun 2025 20:22:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1749698534; x=1750303334; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=7CEJYqHcq0j8xwhF0EQNwbZHX7W74nFlTtNAgWF/PBU=; b=CMHqwDbOqKJXF6DglAXQkdmYBD4AK9sTIEt9wdwFUzaMDwY9hGdLX68unsfSDZKH2S Cd2PDNxZocXGfZQQy/w1U5stx+y0/FZDEDGkqZ5iwf88NHPhf7HrUoGshFhQbRxEBCZN k2kkqFTuxeWMGavEUEKck/m07uVvm2BAyOf4gRSVNRnl9fZjguf9IW/NSIvIzZqa28E4 fXgpkGwfPrVmoZQKMNDihJs2aL5qvu2xsF2krK6qHngsklaOtnCg7Rp+/4kqbmCZd85K jztGiD5VEC2MRDwaA6IG241QNXHLOgwsWIiEJcmgEL2eXvyw+jqBi1bSgTGyA9W6S1Um vqpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749698534; x=1750303334; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7CEJYqHcq0j8xwhF0EQNwbZHX7W74nFlTtNAgWF/PBU=; b=iC4ggXgoLpjSCti7ZeCOfZCr+3APfJGEL9O8Bmik2F2t3J/PNXBahCchvOSKiJJQ0h 9eItHZbgP3cp9HwOJvQxL95PBC9sMGaZpRIjJG3g3r8kbuvfos+R0bm0JOGXxugA6909 05RrHDyUVXGGkhf9fQAMRyHkAMiAmhut4lsjScA9ujZCfAbPXxWNv2VjGAUuquKAmo+4 h2cOW4DSmI/EYe/YmUxMnb3hNZ2i7p38tWwJPAEWLq5lfbv4DW/NirlRLseOBwBQ1LLi W0fF9C3KdAcoOj//PFszrgTgwrGnTfY5F5x6FsVTC0xq8y7XA9Zweu2kYgPQtm8QVtFW Jkbw== X-Forwarded-Encrypted: i=1; AJvYcCVJpGQO+tUOt2N6qxRZVMhjjAwmPEX6QxSVsngTgxkTd8/iYv/faRBDCVDXkK42lFUxpzQN6fK+0lqsABJquCsmrgxbmQ==@freebsd.org X-Gm-Message-State: AOJu0YwP3qwPK2xSfb/EUHVlhwSG8IsIydoM2npcYFBOG4cVtqqOtA7h Fox2+uVjhhvTm1gqxNr5f8qDFDrgZYIGp4PfLD4MaNcSToGIBmMdDqkMuO2945m+hjaGwnDynh6 N6iimmaSNnDEurjHVrYObXTAjZWoE+EQMErmn4PjIIdIol/GgDrApQnoEOwB0 X-Gm-Gg: ASbGnctT2G2VhG1HaJg6I/4ue7gXR9AYmdHUGTFcoOrj0KHt8ykgXLwwQ92qL44Y9DT XZ1aGpKDfBt7msemuEuE31BhqO+PPwXuntD2URKOZSnR3verHKYwmlXd6npPrTAGqESBZg+1KQA 0d0z+zvFhCq+iOR/AKzVzw3puiWz5c7+NeW7tXe4VAdNl2JYZVHLNHEw== X-Google-Smtp-Source: AGHT+IFE0L3hhsC6lMmRejCfBKHNdiXuv/nT5a2g7g4XvMp6V1s0dwMWRczaDok3il16tLt0yP4agNm3/IivYU30OgQ= X-Received: by 2002:a17:903:288:b0:234:f182:a735 with SMTP id d9443c01a7336-2364d8c01f0mr22990255ad.34.1749698533777; Wed, 11 Jun 2025 20:22:13 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202506112316.55BNGeGh046207@gitrepo.freebsd.org> <86507548-1B8C-4CD1-BB18-C884D38EA489@freebsd.org> In-Reply-To: From: Warner Losh Date: Wed, 11 Jun 2025 23:22:02 -0400 X-Gm-Features: AX0GCFtENSsExUTdb8oikCRLeravyKvadW4m7FGcZ3ui-ihxo_jBYLbf4c8YUGc Message-ID: Subject: Re: git: 3d12567133bf - main - Add the POSIX sig2str(3) & str2sig(3) calls To: Shawn Webb Cc: Jessica Clarke , Warner Losh , Ricardo Branco , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4bHnrm6nh9z3vCt X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] commit d8b51259caee09a4080e524ac254e1f5aecc46cc (HEAD -> main) Author: Warner Losh Date: Wed Jun 11 21:14:16 2025 -0600 ssp: Protect sig2str with proper visibility markers We only define SIG2STR_MAX with careful visibility, but define the fortified version unconditionally. It needs to have the same visibility both places. Fixes: 3d12567133bf Reviewed by: jrtc27, kevans Sponsored by: Netflix diff --git a/include/ssp/signal.h b/include/ssp/signal.h index 9f1a926b9db6..fb1da0db90d1 100644 --- a/include/ssp/signal.h +++ b/include/ssp/signal.h @@ -35,6 +35,7 @@ __BEGIN_DECLS +#if __POSIX_VISIBLE >=3D 202405 || __BSD_VISIBLE __ssp_redirect_raw_impl(int, sig2str, sig2str, (int signum, char *__restrict str)) { @@ -43,6 +44,7 @@ __ssp_redirect_raw_impl(int, sig2str, sig2str, return (__ssp_real(sig2str)(signum, str)); } +#endif __END_DECLS should fix it. I'm testing a build before pushing... does that work for yo= u? Warner Warner On Wed, Jun 11, 2025 at 11:14=E2=80=AFPM Shawn Webb wrote: > > On Thu, Jun 12, 2025 at 04:05:05AM +0100, Jessica Clarke wrote: > > On 12 Jun 2025, at 03:59, Warner Losh wrote: > > > > > > On Wed, Jun 11, 2025 at 10:56=E2=80=AFPM Shawn Webb wrote: > > >> > > >> On Wed, Jun 11, 2025 at 11:16:40PM +0000, Warner Losh wrote: > > >>> The branch main has been updated by imp: > > >>> > > >>> URL: https://cgit.FreeBSD.org/src/commit/?id=3D3d12567133bfb4082a51= 15f16a71a865ff2af7fb > > >>> > > >>> commit 3d12567133bfb4082a5115f16a71a865ff2af7fb > > >>> Author: Ricardo Branco > > >>> AuthorDate: 2025-05-10 20:56:03 +0000 > > >>> Commit: Warner Losh > > >>> CommitDate: 2025-06-11 23:16:22 +0000 > > >>> > > >>> Add the POSIX sig2str(3) & str2sig(3) calls > > >>> > > >>> Signed-off-by: Ricardo Branco > > >>> Reviewed by: imp, kib, des, jilles > > >>> Pull Request: https://github.com/freebsd/freebsd-src/pull/1696 > > >>> --- > > >>> include/signal.h | 9 ++++ > > >>> lib/libc/gen/Makefile.inc | 3 ++ > > >>> lib/libc/gen/Symbol.map | 2 + > > >>> lib/libc/gen/psignal.3 | 56 ++++++++++++++++++++++- > > >>> lib/libc/gen/sig2str.c | 112 +++++++++++++++++++++++++++++++++++= +++++++++++ > > >>> 5 files changed, 180 insertions(+), 2 deletions(-) > > >>> > > >>> diff --git a/include/signal.h b/include/signal.h > > >>> index c1d341f317f4..22fefb63568f 100644 > > >>> --- a/include/signal.h > > >>> +++ b/include/signal.h > > >>> @@ -40,6 +40,10 @@ > > >>> #include > > >>> #endif > > >>> > > >>> +#if __POSIX_VISIBLE >=3D 202405 || __BSD_VISIBLE > > >>> +#define SIG2STR_MAX 32 /* size of buffer required for sig2st= r() */ > > >>> +#endif > > >> > > >> Hey Warner and Ricardo, > > >> > > >> The above breaks building world when _FORTIFY_SOURCE=3D2. I've commi= tted > > >> in HardenedBSD a fix: > > >> https://git.hardenedbsd.org/hardenedbsd/HardenedBSD/-/commit/0572db2= 82c5a542fe0de52739932e91eade537ed > > >> > > >> I suppose that the !defined gate might not actually be desired, sinc= e > > >> doing it the way I did might cause issues if third-party code define= s > > >> the macro to a value smaller than what libc was built with. I might > > >> remove that gate. > > > > > > I don't think we need the !defined part of it... > > > > > > But what software is breaking? What's the error message? Maybe the > > > fact it's undefined is pointing at a different bug=E2=80=A6 > > > > Probably include/ssp/signal.h unconditionally defining the wrapper? > > Presumably gating that with the same condition as sig2str itself would > > fix things properly rather than such bogus hacks. > > > > But yes, including the actual error message when reporting a build > > failure would have been helpful. > > I apologize. I indeed should have included the error message. It's > included below. > > =3D=3D=3D=3D BEGIN LOG =3D=3D=3D=3D > =3D=3D=3D> lib/liblua (all) > cc -target x86_64-unknown-freebsd15.0 --sysroot=3D/usr/obj/usr/src/amd64.= amd64/tmp -B/usr/obj/usr/src/amd64.amd64/tmp/usr/bin -O2 -pipe -fno-common= -DHARDENEDBSD -I/usr/src/lib/liblua -I/usr/src/lib/liblua/modules -I/usr/s= rc/contrib/lua/src -DLUA_PROGNAME=3D"\"\"" -g -gz=3Dzlib -mretpoline -fPI= C -flto -fzero-call-used-regs=3Dused -MD -MF.depend.lapi.o -MTlapi.o -std= =3Dgnu17 -Wno-format-zero-length -fstack-protector-strong -D_FORTIFY_SOURCE= =3D2 -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno= -pointer-sign -Wdate-time -Wno-empty-body -Wno-string-plus-int -Wno-unused-= const-variable -Wno-error=3Dunused-but-set-parameter -Wno-error=3Dcast-func= tion-type-mismatch -Wno-tautological-compare -Wno-unused-value -Wno-parenth= eses-equality -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-t= ypedef -Wno-address-of-packed-member -Wno-switch -Wno-switch-enum -Wno-knr-= promoted-parameter -Qunused-arguments -c /usr/src/contrib/lua/src/lapi= .c -o lapi.o > In file included from /usr/src/contrib/lua/src/lapi.c:19: > In file included from /usr/src/contrib/lua/src/lapi.h:12: > In file included from /usr/src/contrib/lua/src/lstate.h:130: > In file included from /usr/obj/usr/src/amd64.amd64/tmp/usr/include/signal= .h:76: > /usr/obj/usr/src/amd64.amd64/tmp/usr/include/ssp/signal.h:41:23: error: u= se of undeclared identifier 'SIG2STR_MAX' > 41 | if (__ssp_bos(str) < SIG2STR_MAX) > | ^ > 1 error generated. > *** Error code 1 > > Stop. > make[5]: stopped making "all" in /usr/src/lib/liblua > =3D=3D=3D=3D END LOG =3D=3D=3D=3D > > -- > Shawn Webb > Cofounder / Security Engineer > HardenedBSD > > Signal Username: shawn_webb.74 > Tor-ified Signal: +1 303-901-1600 / shawn_webb_opsec.50 > https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/0= 3A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc From nobody Thu Jun 12 03:35:26 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHp7y5HD4z5y1Xy; Thu, 12 Jun 2025 03:35:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHp7y4nvSz3wKr; Thu, 12 Jun 2025 03:35:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749699326; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OgwngNXqL2cwGgDzLmRRjt0TaXRGyXTrcKXuMEpQ43k=; b=c7qZaIYMS+OO6VUiXRsDJGjW4x9AyA4jXLIiNw0oAx+ilqt2G6EqlgEEmEYOafSclhxADC 47tYcTDIXgWxjE+mTZ+wxuEFv2rWLJ01cz/ddu1wuYIXYGLf9eom/SzwyR9ZLjZ8m7MyRU T9euSoMJX/OATxdZJeJIniScql2sydvKPE9YBCqSUNcfy7C0AMLP67ZYbcthred5GjNBuW 43Qj16OsefsPgD8w8ePG+cIeZrDFkAMoxe9O1HIwP+hQ1fE/ybja6W76THMyFi8Cp9reXB vPrpD4OPgacP86V22qCMIJVE0CNLzIeh5VUPREnGiTKB8/AVwNIxsQ2VEQ9GSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749699326; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OgwngNXqL2cwGgDzLmRRjt0TaXRGyXTrcKXuMEpQ43k=; b=iCPTaBBVzQC+5LGdaiq0J358LU/ElD378W6n5RR/T1KtHWncRO8i/RYqFTLlUM3FQUx2yE wR6zPwbOSJKaVe+up6gW1wjQpq+MkhvcPklWAYTXr2tJv1+/gMFtkfZ05L52WH6ZtlfW4y vBM4aGo5/FhDEWFi3BU5p92fMkvSAKrOL1rvhtBpymS7QU3+191gF5ivoN/udUkA0lZD14 /O9dU90iNYcllb9qmsB/FFCHhimbs2iJm9cNoGze65AUg+Ub3PguUKMGXVJ7zYOLld6VYW /l0xGzbi49PzIJ2PlmvoAF/eUnkbpKwmdjeIr2pRa5ihjrLLub47qyepkK22mw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749699326; a=rsa-sha256; cv=none; b=EYa+FIicV1nykns3cAKpsRWiuTW4QBPxoojeSWJ0hjbQExPSYvw2YhT7qqZDgQdM9hObIM vvvFh8S+wsYe7E18+ecUmAhBnjnguQi3ISuiwX1s9ZaDVaieiLyatXn1NnSpgDqAvnIXZM R0nrXw8lqMYBxl8x2B4CMh/C6RlY6QBm+VDEU0ODaZIeOolr9xTGsnLjbsMimIYs/DXQcV ptGwxvFN5fuYSLLlHLNwW/CUgqX10rdSgywAnLMzXwhL60/ebAmg9UugIsMlvUuYZlF3Iz waCMcjaQ7biSd7QTxi9Fzmh8qwnAYUdxyz6G4i5mNQkXGJwf3OeD6iYstaiukA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bHp7y4N89zvj5; Thu, 12 Jun 2025 03:35:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55C3ZQmM034480; Thu, 12 Jun 2025 03:35:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55C3ZQIV034477; Thu, 12 Jun 2025 03:35:26 GMT (envelope-from git) Date: Thu, 12 Jun 2025 03:35:26 GMT Message-Id: <202506120335.55C3ZQIV034477@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: d8b51259caee - main - ssp: Protect sig2str with proper visibility markers List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d8b51259caee09a4080e524ac254e1f5aecc46cc Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d8b51259caee09a4080e524ac254e1f5aecc46cc commit d8b51259caee09a4080e524ac254e1f5aecc46cc Author: Warner Losh AuthorDate: 2025-06-12 03:14:16 +0000 Commit: Warner Losh CommitDate: 2025-06-12 03:19:05 +0000 ssp: Protect sig2str with proper visibility markers We only define SIG2STR_MAX with careful visibility, but define the fortified version unconditionally. It needs to have the same visibility both places. Fixes: 3d12567133bf Reviewed by: jrtc27, kevans Sponsored by: Netflix --- include/ssp/signal.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/ssp/signal.h b/include/ssp/signal.h index 9f1a926b9db6..fb1da0db90d1 100644 --- a/include/ssp/signal.h +++ b/include/ssp/signal.h @@ -35,6 +35,7 @@ __BEGIN_DECLS +#if __POSIX_VISIBLE >= 202405 || __BSD_VISIBLE __ssp_redirect_raw_impl(int, sig2str, sig2str, (int signum, char *__restrict str)) { @@ -43,6 +44,7 @@ __ssp_redirect_raw_impl(int, sig2str, sig2str, return (__ssp_real(sig2str)(signum, str)); } +#endif __END_DECLS From nobody Thu Jun 12 06:19:52 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHsnl5nS3z5yDR7; Thu, 12 Jun 2025 06:19:55 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHsnl559Bz48TV; Thu, 12 Jun 2025 06:19:55 +0000 (UTC) (envelope-from glebius@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749709195; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=CSj60OH6YzufIGogPQywt2O4ulNv5OuYCZcA4/Lef9A=; b=LwrSNyDNeXf852Myc52r/df64c4gm7eXc8Ujjvu3lhcfTF0P4rJifP6+sGjbybL20oH+0a kEKgU4fBPqhagkCGiYpOV5Z5vfVM0/Wvs2t0DdBhDC73ZnfOaz3NupQcvnGq8KeUHK96cX Q8w4tyQfq2mV+sFJMoUgFE1VaiVXPOSI9PbN4ENFNXjBgYaz/8msax1th7eTK1mc1F8mgy C7/wzUJ8cgsMOMjWenRDBfE/lS7BET9mRcm8bAUavnyOpPZcmZzxcCA1VgnYmm3GRkwVbt eRWP8zm5QaAk4MPKdt+KpO/zzzwrO5kZPGs8UO0EeeQgpA6t04t4CUKTs5VvDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749709195; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=CSj60OH6YzufIGogPQywt2O4ulNv5OuYCZcA4/Lef9A=; b=jSWpON2n/Kmbq9fh0hadbuNe/SZEtSIF02ZSihR6ncV5N37YGHiXQsy0dEQcMsqna8R3hw ksdUmGrtDNkEtMxX6ELgj6xbiJWl7+meF4Ivr/WfmDRQLO6XcyOCW//E3SHStxHIXk0cMd Njr1J45dOCjGb61WpUG9QJ1iDaGwh4nZ+LqO9st2E1sc2r5ivRDruEZ2C7pf1lK5uXi+mM 1Scshb0RfmnHStwzjY8NgRjrsAYkUq4egvYite3iE8YZBSiu/4/kCzDUihXvoUbOUuYrqq xgUM5HXvjTwQFAZtMl0hp73EPUat7b3BzakQ4hONtbhlhpJJ2QoB8wlp+IQrVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749709195; a=rsa-sha256; cv=none; b=cB+n9eEgfMw7itxCgRFHVre82f/cdSPeOymCEj+4QTVWV+2isXoKhtMQo1LhsVypFEJknF G0uoYouGQH0iE2b03tNqjm1SpXRbQ6gsA3G1mUnyNDVC/BJ8pVLg0qUlBtvHLrSYiXuCCF va9C++KzG+Cj7P0DQVKnAzzzwP/iF3g/3QzKHTVM6nhQh6C/LBnCh/bEHPGd5qzWFCogfk CSNehbGct7oSPUKG/l7zFs4NMPbfPrRrJu0FX8PczbpB6Y7wHxXRC8gdF1z5IvpUWBE4Et TFs/lCsjBr8aPQEWfluEAYbpkxzpiWy594QyhhX3c82ef8qzR/AxHrj+SFxzzQ== Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: glebius) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bHsnk6Yq4z9LJ; Thu, 12 Jun 2025 06:19:54 +0000 (UTC) (envelope-from glebius@freebsd.org) Date: Wed, 11 Jun 2025 23:19:52 -0700 From: Gleb Smirnoff To: Konstantin Belousov Cc: Rick Macklem , Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 79d0f4474653 - main - rpcbind: Ensure krpc is present. Message-ID: References: List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Wed, Jun 11, 2025 at 07:05:45AM +0300, Konstantin Belousov wrote: K> On Tue, Jun 10, 2025 at 08:41:44AM -0700, Gleb Smirnoff wrote: K> > On Tue, Jun 10, 2025 at 12:11:18PM +0300, Konstantin Belousov wrote: K> > K> Apparently we already have the feature called 'warmstart', where rpcbind K> > K> can be restarted and existing registrations are reloaded. So it is in K> > K> fact already solved, assuming admin is careful enough to use -w. K> > K> > Ok, then all that needs to be done is revert this: K> > K> > --- a/usr.sbin/rpcbind/rpcbind.c K> > +++ b/usr.sbin/rpcbind/rpcbind.c K> > @@ -159,10 +159,6 @@ main(int argc, char *argv[]) K> > K> > update_bound_sa(); K> > K> > - /* Ensure krpc is loaded */ K> > - if (modfind("krpc") < 0 && kldload("krpc") < 0) K> > - err(1, "krpc"); K> > - K> > /* Check that another rpcbind isn't already running. */ K> > if ((rpcbindlockfd = open(RPCBINDDLOCK, O_RDONLY|O_CREAT, 0444)) < 0) K> > err(1, "%s", RPCBINDDLOCK); K> Well, absolutely minimal fix would be to change err() to warn(). Kostik, please just commit this. Just one suggestion: make the warn() message more verbose: warn("failed to load krpc module, RPC services for kernel disabled"); -- Gleb Smirnoff From nobody Thu Jun 12 08:19:06 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHwRG6cKgz5yNcN; Thu, 12 Jun 2025 08:19:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHwRG5rmxz40pG; Thu, 12 Jun 2025 08:19:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749716346; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Yj7+0HoK3Az+tktuSUxuUK2PJ+gfg2mxgaxUNqgqXsw=; b=sx3kLMPBfaJv2+S+10A8UVzyB/UC0ePzJbALAI/ibMHr9/WgOg0xkPmHfaCpO2xh9aRCXM W1CWAVusrmvQlEyQm8bEzkNq3wddxrDZGu1ggbe6/N+xqZbCifiD6crCeBmqNQcHc7Ks7g SWzyQWNKXvhzjxDAVMREImURRsb3Pk3l7dCmJum1ngcYFCgxW13AMw9n84fNIQtltux6Db /6wrUcxNrRyLlZGqTqfbEHBVGvGShRCguz63xyPiA6mmrE6QAw1uGVAfwo+yYxNaxmRp2n JZBfSVucXE+cZO3II8PvEJ77/rpymvgSWSCLHXsG74/52rpa+T7h8qlSRg/y3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749716346; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Yj7+0HoK3Az+tktuSUxuUK2PJ+gfg2mxgaxUNqgqXsw=; b=ds7A4sFDDuMT1lkTcTRBYytvLwcyL2KbdJQIxMt8B/cjw1KEsZ2SCQwXtaJL9dY+uGruG+ jbF+GoPKkX7Aj1eY0LUhg0HMiAFdvCRaTxtcINsyHBAg1AOpEvW2F3pqwRY0rH6KfAPWlo rSYKieMnfoqly2KFd/IgQzszipz74cmDZ3pdlZavnPc5DJ+qxyBF/L5wZWnbN1q4mtGi+l NIJZgyPXHJPiPHmdOCSnQxy5hgkptFyUA1vN5TEpvx5nVqjqXDcP67eVAx2YS9xg3orf0Z aj8GXZ+zHJmQfwlcoquTStqpgiOuO8lIx6eSxaQPDqWkqcvM1sJGx2C6UzjWdQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749716346; a=rsa-sha256; cv=none; b=BkcyaeXZ6CIa/skbsCTSk4O/WxiVT7SqXn6qZQfX76lSxDkcz1cIrG02itlPFjOLEDRIAI 8tOV9jhAQDFiNZNRjUpcNlb1pMbjGYXfYKUCYUrXP8pueL3CC2lEWNmizBLii5nTcSNNd+ PgplI4lhGuIt6JilwtcNEAZvKFDOHM4qek9pCtfhLY+J3oZZNq7X+GJXwzaK8JK3RbB/3E /7zy1k8zQX0nbVKeONF10qSSAaB2oxlEkZBGJzOoW+hK1vNeLNkwpITA3AedSWT2Hu9MrG lfbq+J1DV4xJftOqFGwS866QMo22vJUQa7eNJLm9m2RG1XoScdMqXhnqjvDKqQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bHwRG4qDwz13dw; Thu, 12 Jun 2025 08:19:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55C8J6u3060843; Thu, 12 Jun 2025 08:19:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55C8J6AJ060840; Thu, 12 Jun 2025 08:19:06 GMT (envelope-from git) Date: Thu, 12 Jun 2025 08:19:06 GMT Message-Id: <202506120819.55C8J6AJ060840@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Stefan =?utf-8?Q?E=C3=9Fer?= Subject: git: dab9ef544868 - main - snd_hda: fix attaching to some AMD Radeon GPUs List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dab9ef5448682c3c35e34d857b17ac1c23445321 Auto-Submitted: auto-generated The branch main has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=dab9ef5448682c3c35e34d857b17ac1c23445321 commit dab9ef5448682c3c35e34d857b17ac1c23445321 Author: Stefan Eßer AuthorDate: 2025-06-12 07:47:57 +0000 Commit: Stefan Eßer CommitDate: 2025-06-12 08:15:59 +0000 snd_hda: fix attaching to some AMD Radeon GPUs HDMI audio did not work on my older Radeon GPU, the error message during attach was: hdac0: hdac_get_capabilities: Invalid corb size (0) This is fixed by calling hdac_reset() before the HDA device capabilities are retrieved. This solution was proposed by Andriy Gapon in 2010, but apparently did not solve the problem reported at the time. Approved by: christos Differential Revision: https://reviews.freebsd.org/D50737 --- sys/dev/sound/pci/hda/hdac.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/sound/pci/hda/hdac.c b/sys/dev/sound/pci/hda/hdac.c index 8714f615f846..900578b73de4 100644 --- a/sys/dev/sound/pci/hda/hdac.c +++ b/sys/dev/sound/pci/hda/hdac.c @@ -1278,6 +1278,7 @@ hdac_attach(device_t dev) goto hdac_attach_fail; /* Get Capabilities */ + hdac_reset(sc, 1); result = hdac_get_capabilities(sc); if (result != 0) goto hdac_attach_fail; From nobody Thu Jun 12 09:05:17 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHxTC3JRDz5yS5d; Thu, 12 Jun 2025 09:05:51 +0000 (UTC) (envelope-from garyj@gmx.de) Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (3072 bits) client-digest SHA256) (Client CN "mout.gmx.net", Issuer "Telekom Security ServerID OV Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHxTB3z3Hz3KQC; Thu, 12 Jun 2025 09:05:50 +0000 (UTC) (envelope-from garyj@gmx.de) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1749719148; x=1750323948; i=garyj@gmx.de; bh=Yv9m3SBrVvCNV4p+Y/MJKeGHCbccG+uriilpTH2pa7A=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:Message-ID:In-Reply-To: References:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=WPkThKOfypiilgsclOCkHHDJuS5jbpjx+nE37mqSsGFbWt1gpJE2qH8pYvJ2nGgj Yrj1JoYHsq0l6ZTOZ54Ubjavo3OsCYiMB8xc8nuy3M3vl5p/qVOg6TXLvbyqTNu0G zQkRjtCd3cJXTb1vF7ta7YqAE3EIoMgMdkSx+6GtwHsOlHqV0/w9ymc9Qe5g/r2Y1 iDAy061nr80wuSZ6ZCK5nFX8RgYz8BO+CcSc/JmLsAmTuQyAAPHjqDbHVbPFUFl+K zHC9wNryhxKptZp4i70rSgVC1ZqAKNa+5w91+Xhdtf+GwZWKkU8ZAkfBIZmKtXoZ9 sA/AANd63CRJLhFtnw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from ernst.home ([91.59.228.125]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MeCtj-1uzXGF1MkJ-00irLj; Thu, 12 Jun 2025 11:05:48 +0200 Date: Thu, 12 Jun 2025 09:05:17 +0000 From: Gary Jennejohn To: Warner Losh Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 37983aef7c70 - main - Add quiet/-q option to /usr/sbin/service Message-ID: <20250612110517.6f159a02@ernst.home> In-Reply-To: <202506112316.55BNGWQs045953@gitrepo.freebsd.org> References: <202506112316.55BNGWQs045953@gitrepo.freebsd.org> Reply-To: garyj@gmx.de X-Mailer: Claws Mail 3.20.0 (GTK+ 2.24.33; amd64-portbld-freebsd15.0) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:ZGOi+ZtjYq2EgXurKgcDdjHyYayyqg+MfW7AgtUF6jlQhcKHCk8 RMZmUGGhs9r8CaSYG+J0UTRrl6rSiQnTNWpNVfeDb4YVXvF3XR/aabpayU7flMTTLpsuw1C FYaplA3SHEh1JTHBTe4ROEtVwM/etgHmjPp1pGQt0KIOknhFppABi7viQWJwTSJzAqz1XBu qpw3B3dR1g631Lza6oWgQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:WQ5vOet0brA=;6fKiZ0FsM/8SKEJZ3p9XtncDNU4 xaSnsKBtUaqWuHBQT00LULEH4d4ZwFIWcuuGLa3ireAfSSdsU5TFtRRwyzncOlbqLlGCUYV50 XpDltfMfMW9fcAgj5dk1WIZ2WJ7+kz+sLaNeLeb5X08T3aQVHXRQPszL+tKFTPDPl1Z3cjn4k 7rCRGH7eFdc8mlMggz9jlacApC1BFWGIxzRO/UXGDLmgcxIkzNCgecvKNcFIfi2Y/cZYZDr0J +qynLQqNQJyT6oLnuVsQoEEGFhio+aQT/tlTnKwEdcXfsCug63lp2/kZXPVRyD9Jppa6ay6fn 52qDdoNrnyRXOO7MVpij8vexjgpC/7sbx4X4rtJJFq48Ce8m22br6sOJVt3rDDEsEM+S3L00x YkOmVxwNxW6Pcuc5/P8HyBfGU7DOk2OsICPCq0Y4wP4UONzqcpuzUgE9dbYnHyM4zZAFBJZot rftoimp2gQfk5tqlDDxzytoGVQK56TO0Fl1AKWsqISLDwaHRtC0RkrFB+5UpgYzSW6+xGOryT d4sAjuHK5Bcj9DtOJNKQRYzp2Z5BfouOtNNxnrXbyA4cnLbLRq/tIQpXvX1Oo9ugJOo3joM/z +pkupF/YzUYNmsZY8wa2trSmsWN/CEVxPpMfmDvtyrd2uRhWRkZdXav+byOfBJje0S78xVXul 6Xjrsct8pXrz9IieMmRmEd0fqpveZUmpHCvxDH2Q7PlDotN0udu0GM7/YcHcgeKpfJK0FyJGe uhaBPaY6IDzZcoKwnzeU/aHRSvYtZyez3vHgygzxLzhigijyPhmKJflIe/+lI0OQvYsejj/6U Xfy8FICv5btMWEEikyqKZwG90N3zSxIjbdhUgpkwaqdTKduiklpZf9jwaxOSEDaK6gXNPHiVp fV5Qjuh2I6tlTT5M/Lo44CoMsRry0c0VaBR8SM7wUs3FOKexIHh/fjfGY8iXNkWahIHRBDlZO UlRlc9f0T8r7Au3f2jhl5mZ3CfACv/SYKWQqGy86oBExi4iw45L1wo3CE3kzF1+XnOpUS/4+z E8Bn0jg1LZSMub9SKJGzxsERLsqyXUWP5yFsZclZCfzSR3UHGjUpjGi3lkqBkLRuKEFwVkqn7 YVIFUJxwoCLjBy843tTslT/I5PJ4IjrE9KOYsWm7XzJtCfws/Gz1X1aUbUdv61qxGHJa8nTkl Lbj00xIPiLfh4ekPMKjNgAAkbguVJG2vVkAN7AqmNDeKhf5QPpvDirg3AXBf6szJuS829TIrt EMAmS0R5c8KdfAKzMQt728QnFRsaIAOpJJ4elHemKFXYYYdB3KkUJcjwjzKH7zflmhrZqRWwR Bz/C59B9E2hoDO6cBisN6dEIJsSQIJKngfmTdyktYayRp1mMYxrI3Si70dOP8tLenvf6VYx+t rp0AYnDUtcPo2spT8XGEVwx4dWwdkbXyy8iDqZx8YM0lPsaZj3Zcwk0iOOMI75B978BROzw88 aM6x5ol1gUBVfDEatLtx184SAnDj7+ofxz8y/mR22ghX6Pw3DvEO8p7AOyeJmhl36Gl1sv5Ur RoIjJM2uG9K/dCBZOx3gXpWk8MdKoVUt88ZigzoeIlJokOpl4XWToVe+KDtb3tLcvzfRlQn6p nSXn3Hgakn7wtkwuD9Tn0N/VgMI8DVbEh/7Wt+JdQFGH4BbktyEh61y5dci65TvmO0F7lTKyq EG06WnbcCHGxF1YV1ifQOkQCY2Mc4ozakm3jMAkhr4dgE2Wcx/7Dw2Bk45sm3es4zEk60SlI/ wVrlPh0hKO6Ko0tIq5R9CCAy3tkBrpxgtWwSAvBzfy5cq6PLAeorX/d515dkH80T5uBn0cPQt kBwiPoeA8zvs3Vf8Rp97an88EIgc2HswfCmfaETWHUASek1IkGGsAKInMuwgfTAWhJiP1bxjU U5z0VmHFpCWzViYHqTEqaTbmKwF2/nT67iH6+csPAUDwCjOiODCmF+w2nHNBn6cHPWeSM1AJB bksE8asLP5VPjiyTqtYIVndVVWWAeDkDERwxkEmOLtJYhIHyvcGmzARGilehmZ6HX7RITm/Qt SHzQ3EOkMCtX8/kC29afwQHjX5jVoaphr9uewGHkdRK8o1QxGSplvDcpvgp6hNtxuy5oYyo25 pfNMRjwIQMy5jrEgLsvtl/8sAJ2/Tbd1ZAYOWD7NAVoB5TZEUhXSKXF5iMJmK8Mt6WeCjqBZs ENsigNuGba2YmZhVuAE+fs4liGuFRt1GYWV2AW0BXKj8A1x1OcHvnRR+Y/+gRmj81zabsd9Cp U6irJxHrvHnUB8nLI6QDRhk6TZ9Q1rpZ7VQjCEq6UjEbghJNIghHzflbWr754mzg2cdzcv6tz IZ1W/46+GPEM+qkMuwgpNczYolqzMoteGvXnZ76F2p49q+Si1eB7RJ5k3XBAIB6lwGeAHvGIC P1rMEmoFPMwF+cI4Dxh1Hm4YBaOT5+taWaU0/IurldRssT91NxPdFZsx3TMViY3pFhB0Nahty Emp8FMEPwR05iIETFtoqIJ+oFlghkAoPZBQf4OM7pHS7dnQgU9hZB2Zr334MIGOKQ+HWF7Jbm QOiUc/O8VxOC8ivU+chYZULenhO/wzZjuH53RPxYx2zUOsKCFkIKeugN/WFZ8ZOA5bLlhQrDN bX5oF8gJFy+8crlooX9TLnzqpj7DbBsSnVraImQKsx16wsbD38mzGjhiGAGqd9M5b31G3fT19 4Sxp4SEDytWOPIsVoFbU/aDK6EayHNev7jkvk6EXcgNucJKmFVsyIdp2k5MreSnCaTl2tbz2r FDnQdkU/fF8ix/94jmiWWmnpUeyGZPOcfvQWI4qcj+2xfBu15CkWqN4bqXipIqAX8HGfd609R NIDsOsSJZzDTaLFNEspi2R5zw5P4WX993/LvccdOvZ+vg9GtgPBOrx4V5HvX7OeciJqLd3rk6 7ScVa0EGbcCZQ8jQLLgqc25IHUBn647PQmfdswvulomphE/+uCP3H1g3pjO/l4mHqPmDVI+Rq DqPWX92kTbSANyaoUe7f5sEwQh0xHlWW7sdZ17Q64TS0NNMAdxBT0YAZTIqp2apukQ5QVwVxd 9sv7bIW4Bxg2gXp+Yy9L5JgZF9TsOK8aitjrunmiUM88EMFX+8W8G2VVi5pOOdUAk5gX29WDY JQd0fs1vAyAtUfGKcUVLxUq9ODxT6GG+eO98FR6lsEv5N1oqLeRf3Iw0Mzt3+Uq7LkTI/gGVj GkEpXyUM/2U93l4NueIBdCn5B7fayzT9QpRJlputYwMyGAyeQW3XvGaGHzgXLkZq3YMrVxUj6 kgH5yebPZY2Rub8JyBXMHmV9KgfccQ7xNQed/TL57mq871Bw+l7i+lQLKlgraVD/OqRif+zPo 7SWj20u X-Rspamd-Queue-Id: 4bHxTB3z3Hz3KQC X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:8560, ipnet:212.227.0.0/16, country:DE] On Wed, 11 Jun 2025 23:16:32 GMT Warner Losh wrote: > The branch main has been updated by imp: >=20 > URL: https://cgit.FreeBSD.org/src/commit/?id=3D37983aef7c70b738cf63923bc= fd2c4ae03ac5779 >=20 > commit 37983aef7c70b738cf63923bcfd2c4ae03ac5779 > Author: Dan Mahoney > AuthorDate: 2025-05-25 08:54:33 +0000 > Commit: Warner Losh > CommitDate: 2025-06-11 23:16:21 +0000 >=20 > Add quiet/-q option to /usr/sbin/service > =20 > Signed-off-by: Dan Mahoney > Reviewed by: imp > Pull Request: https://github.com/freebsd/freebsd-src/pull/1709 > Closes: https://github.com/freebsd/freebsd-src/pull/1709 > --- > usr.sbin/service/service.8 | 3 +++ > usr.sbin/service/service.sh | 23 +++++++++++++++++++---- > 2 files changed, 22 insertions(+), 4 deletions(-) >=20 > diff --git a/usr.sbin/service/service.8 b/usr.sbin/service/service.8 > index a8f1a509885f..b8917138f478 100644 > --- a/usr.sbin/service/service.8 > +++ b/usr.sbin/service/service.8 > @@ -45,6 +45,7 @@ > .Fl r > .Nm > .Op Fl j Ar jail > +.Op Fl q > .Op Fl v > .Op Fl E Ar var=3Dvalue > .Ar script > @@ -115,6 +116,8 @@ as in > above, but list all of the files, not just what is enabled. > .It Fl v > Be slightly more verbose. > +.It Fl v > +Be quiet, redirecting output to /dev/null. So, Warner, you have -v twice in service.8. The second -v should be -q. =2D-=20 Gary Jennejohn From nobody Thu Jun 12 09:49:35 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHyRg5bvvz5yVX4; Thu, 12 Jun 2025 09:49:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHyRg4w3lz3cbT; Thu, 12 Jun 2025 09:49:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749721775; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=udAYq2TZuqMIgCq8sOz8s0IatBiGTd2cOUwVQC7oy2c=; b=LNqRm+6p5ffKIaVcHnMPxbmJbN3robe9a8XDNfXRSrqGBkJaiR8wjzfNcDz/aqDcewsby0 amO7bMQjmq4RYgpZyDThKcCKFHYBCgR0ZG9A9ig1qmXTQSfwuRl9FREPstUseXTsOlwX0P 4uWy4IlT7TZHN352LiwoNszXXqYHOFdDfnrErjxDRbmw8UNP6avhyuEQp5/suFqPjHMqPL JDEsgtfKqjOmkhW4veYAuRuGtOkJGRUXHL/vV3pdynSIvxo2UlOlLh7HArg7qzP/Dx9TtL cjyRBjNVDcxtyLKakXtkupjbDSTZEY1dlDTdy5WALOHo2kpf1yEg6am5snLPZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749721775; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=udAYq2TZuqMIgCq8sOz8s0IatBiGTd2cOUwVQC7oy2c=; b=X0fBKL3+l3NzEskQCrv6IiZZ4LQqg0V2vwPX5lcW5qvo29T/CrbPApgDbI9n38gr71nGks j0SSiJQB85V24mjGdyyz2PbgUpAKqSl4CHZCbUxuqbGZ4/iByhGpsL8i9fGevOXPPOzYMz n38ztjuxIIx2nXgFh0xH/Da1DFEct4G+NSGZX2tp9MptasyPu9GwEEy80o13D5ZAdHHRsd rdoSHfmbyUi1E+MiQRkRj/VXx2dxCmEUa5AD5i6/tBOEdZYgy2+eJCH3Q2CuFY/YdJEluv ZrMlupoHibpOYCwkMXNB3TRLKVLUy94JgJuPD6gLJCTw7Uuc4zMd1c6wupF5aw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749721775; a=rsa-sha256; cv=none; b=YJI1s7rBlOugqx8M8S1MgRALSc49PxC8O41yUad4nOpudyga2RG5IwEpg03bX1V9kYgM/H oW3babD1NwvCIaqDbkH3RF5jxzKXvPx1Q1UJa03W6zj85f5wO57XhS1G0EbfTY1BHA8OvZ 4nz4lb+tNgAtQuwwtYcpb1ZLKrINijgrKdtPh9+7WvW/mK6Dn9DDJv/RsqH6HFoeF/nIf3 UC+CjELTvvKx+n5lMjJwIYRcNDAM0jGK5eoLvPmjMM3rX8p441MQBWQ3VHCh2Wktyc0Jzx TSXVzIrRCrZxwGi8DKWS5BDdKXn5A6bKdnTehuQumR/oqGHBvjDdMbudZppAJA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bHyRg4W55z1668; Thu, 12 Jun 2025 09:49:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55C9nZI7029554; Thu, 12 Jun 2025 09:49:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55C9nZF9029551; Thu, 12 Jun 2025 09:49:35 GMT (envelope-from git) Date: Thu, 12 Jun 2025 09:49:35 GMT Message-Id: <202506120949.55C9nZF9029551@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 95059bef2437 - main - arm64: Use tables to find early page tables List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 95059bef24378248a1d22830c998924b2313f03f Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=95059bef24378248a1d22830c998924b2313f03f commit 95059bef24378248a1d22830c998924b2313f03f Author: Andrew Turner AuthorDate: 2025-06-12 09:32:16 +0000 Commit: Andrew Turner CommitDate: 2025-06-12 09:48:57 +0000 arm64: Use tables to find early page tables Use the existing lables to find the early page tables. This allows us to change the size and layout of these as needed, e.g. adding a new level. Reviewed by: alc Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D45062 --- sys/arm64/arm64/locore.S | 52 +++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index 9cf23fcf13a1..1268d0d79193 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -84,7 +84,6 @@ ENTRY(_start) /* * At this point: * x27 = TTBR0 table - * x26 = Kernel L1 table * x24 = TTBR1 table * x22 = PTE shareability attributes * x21 = BTI guarded page attribute if supported @@ -481,7 +480,6 @@ LENTRY(create_pagetables) /* Clean the page table */ adrp x6, pagetable add x6, x6, :lo12:pagetable - mov x26, x6 adrp x27, pagetable_end add x27, x27, :lo12:pagetable_end 1: @@ -591,9 +589,11 @@ common: * with 2M alignment. */ #define PTE_SHIFT L3_SHIFT +#define LL_PAGE_TABLE pagetable_l3_ttbr1 #define BUILD_PTE_FUNC build_l3_page_pagetable #else #define PTE_SHIFT L2_SHIFT +#define LL_PAGE_TABLE pagetable_l2_ttbr1 #define BUILD_PTE_FUNC build_l2_block_pagetable #endif @@ -601,50 +601,48 @@ common: lsr x10, x8, #(PTE_SHIFT) /* Create the kernel space PTE table */ - mov x6, x26 + adrp x6, LL_PAGE_TABLE + add x6, x6, :lo12:LL_PAGE_TABLE mov x7, #(ATTR_S1_IDX(VM_MEMATTR_WRITE_BACK)) mov x8, #(KERNBASE) mov x9, x28 bl BUILD_PTE_FUNC #undef PTE_SHIFT +#undef LL_PAGE_TABLE #undef BUILD_PTE_FUNC #if PAGE_SIZE != PAGE_SIZE_4K - /* Move to the l2 table */ - ldr x9, =(PAGE_SIZE * L3_PAGE_COUNT) - add x26, x26, x9 - /* Link the l2 -> l3 table */ mov x9, x6 - mov x6, x26 + adrp x6, pagetable_l2_ttbr1 + add x6, x6, :lo12:pagetable_l2_ttbr1 bl link_l2_pagetable #endif - /* Move to the l1 table */ - add x26, x26, #PAGE_SIZE - /* Link the l1 -> l2 table */ mov x9, x6 - mov x6, x26 + adrp x6, pagetable_l1_ttbr1 + add x6, x6, :lo12:pagetable_l1_ttbr1 bl link_l1_pagetable - /* Move to the l0 table */ - add x24, x26, #PAGE_SIZE - /* Link the l0 -> l1 table */ mov x9, x6 - mov x6, x24 + adrp x6, pagetable_l0_ttbr1 + add x6, x6, :lo12:pagetable_l0_ttbr1 mov x10, #1 bl link_l0_pagetable + /* Save the TTBR1 table physical address */ + mov x24, x6 + /* * Build the TTBR0 maps. As TTBR0 maps, they must specify ATTR_S1_nG. * They are only needed early on, so the VA = PA map is uncached. */ - add x27, x24, #PAGE_SIZE - mov x6, x27 /* The initial page table */ + adrp x6, pagetable_l2_ttbr0_bootstrap + add x6, x6, :lo12:pagetable_l2_ttbr0_bootstrap /* Create the VA = PA map */ mov x7, #(ATTR_S1_nG | ATTR_S1_IDX(VM_MEMATTR_WRITE_BACK)) @@ -692,23 +690,22 @@ common: 1: #endif - /* Move to the l1 table */ - add x27, x27, #PAGE_SIZE - /* Link the l1 -> l2 table */ mov x9, x6 - mov x6, x27 + adrp x6, pagetable_l1_ttbr0_bootstrap + add x6, x6, :lo12:pagetable_l1_ttbr0_bootstrap bl link_l1_pagetable - /* Move to the l0 table */ - add x27, x27, #PAGE_SIZE - /* Link the l0 -> l1 table */ mov x9, x6 - mov x6, x27 + adrp x6, pagetable_l0_ttbr0_bootstrap + add x6, x6, :lo12:pagetable_l0_ttbr0_bootstrap mov x10, #1 bl link_l0_pagetable + /* Save the TTBR0 table physical address */ + mov x27, x6 + /* Restore the Link register */ mov x30, x5 ret @@ -1041,9 +1038,10 @@ initstack_end: .globl pagetable_l0_ttbr1 pagetable: #if PAGE_SIZE != PAGE_SIZE_4K +pagetable_l3_ttbr1: .space (PAGE_SIZE * L3_PAGE_COUNT) -pagetable_l2_ttbr1: #endif +pagetable_l2_ttbr1: .space PAGE_SIZE pagetable_l1_ttbr1: .space PAGE_SIZE From nobody Thu Jun 12 09:49:36 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bHyRj1kkSz5yVl7; Thu, 12 Jun 2025 09:49:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHyRh603dz3cdg; Thu, 12 Jun 2025 09:49:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749721776; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2EBfwyZyd8vd0yKfO4q8e+X+ApMpBqZjMJ897hb3AAc=; b=RjTVcV2I1mGbmdWehRUJyhwe0h67CK5E68XzqCqcRfK7T1NOI5onBp3OQlwP+7TsG4O7zs uqUb0gjhoRsD6KYUXNMb0dye4GbqIdLueYDmcEMKReMk0SycS3MRHALuQwkHzMkSDDQyh+ Qb8XvHZFP6g3U3IF/1lmMFXObvPCmM94Wx1zpJqBQqwBTZicuvCBZwS4UT9bEeoShN3Luw HNvqHqeZwTZL8mB67AVxcggAU2NoMiS+NtyBiNJ71ZnJF8LzgYHcNJSlk7sgUOoKnvZK8D dHHH8L3mLnNics+inV+UPP84f9A6NUbtKOB8AVIioc2Bi+rlvuiszOSIwFcXFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749721776; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2EBfwyZyd8vd0yKfO4q8e+X+ApMpBqZjMJ897hb3AAc=; b=kO1dP+vZKarlvlL3AOyAPiHGyhkgcGVCsfHBgWVKyPQJr/L0G1zCDYbnfJJrg74ld/aTNf Td9S7+9Dw9hFMyqN29Se79uYtlZhHOFyQWCjIaI2tMj2ES4pqIcEgG/nFp13siWJQBTrwo h5dre8c1hVWxGJYpkY15bG9Q07D945i2eHX74k+NID3TShVc3f/kpMADkdoWfNlT61LLpm eqGcNbxfse2xCxjPWugR16yBx4cBQ2oX4qYgnybtxbPSF3btxqI8428LW85YqfOnWqFMvW HoOaUACGvWz7CDhmSn6co+Zm4vNLqLn3QeqZJ0TiZVuqteI7KU6jpoIXfA6CSA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749721776; a=rsa-sha256; cv=none; b=EbTtkuwLCBBVsD00RTZfvtt/o/Vv9UIBX6Z32UBT8UNPlA4kjqmyS1nqPdWAmtkUXBrEWn MfOhphNeLY7hbNf0eVi/BDlTnj7fpa+9oo+4MImXbhYIpOmCaBcLhuCA5/79zKPSzPGaM9 9CyilL3beIm8dM1q1rv4t1GdSr4oc4+gHze9c6w8n6EJgG9AEwvtwWXlnj40/fAWS2Ojv7 gbtgWk4NT68g1jRhh68cbDH/aj6zr6j+fhs+a7NJXeBTZJBXTY23pOKm2crgQ9Gui9V/2i RIVw2ZkHi7h9KX9ibrlZ/l+sPnTQWqvKf/HbC3Odl0L+f7KV2CtJFp0b0AVtoA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bHyRh5Hsyz15YR; Thu, 12 Jun 2025 09:49:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55C9naWo029593; Thu, 12 Jun 2025 09:49:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55C9naJ9029590; Thu, 12 Jun 2025 09:49:36 GMT (envelope-from git) Date: Thu, 12 Jun 2025 09:49:36 GMT Message-Id: <202506120949.55C9naJ9029590@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: e6928c33f60c - main - arm64: Reduce the kernel executable pages List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e6928c33f60c0a29a5e280840b038dfcbbbbce72 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=e6928c33f60c0a29a5e280840b038dfcbbbbce72 commit e6928c33f60c0a29a5e280840b038dfcbbbbce72 Author: Andrew Turner AuthorDate: 2025-06-12 09:37:27 +0000 Commit: Andrew Turner CommitDate: 2025-06-12 09:48:57 +0000 arm64: Reduce the kernel executable pages When creating the kernel page tables we create them all executable to allow the kernel to boot. We can reduce the number of l2 blocks or l3 pages created as executable by looking where the end of the .text section is and only marking memory up to this as executable (rounded up to the block/page size). Memory after the .text is marked as execute never as it will be data. Reviewed by: alc Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D45063 --- sys/arm64/arm64/locore.S | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index 1268d0d79193..fcc3f948f00c 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -598,7 +598,14 @@ common: #endif /* Get the number of blocks/pages to allocate, rounded down */ - lsr x10, x8, #(PTE_SHIFT) + lsr x14, x8, #(PTE_SHIFT) + + ldr x25, =etext + ldr x8, =((1 << PTE_SHIFT) - 1) + add x25, x25, x8 + mov x8, #(KERNBASE) + sub x25, x25, x8 + lsr x25, x25, #(PTE_SHIFT) /* Create the kernel space PTE table */ adrp x6, LL_PAGE_TABLE @@ -606,6 +613,16 @@ common: mov x7, #(ATTR_S1_IDX(VM_MEMATTR_WRITE_BACK)) mov x8, #(KERNBASE) mov x9, x28 + mov x10, x25 + bl BUILD_PTE_FUNC + + /* Create the kernel space XN PTE table */ + lsl x10, x25, #(PTE_SHIFT) + ldr x7, =(ATTR_S1_IDX(VM_MEMATTR_WRITE_BACK) | ATTR_S1_XN) + ldr x8, =(KERNBASE) + add x8, x8, x10 + add x9, x28, x10 + sub x10, x14, x25 bl BUILD_PTE_FUNC #undef PTE_SHIFT From nobody Thu Jun 12 13:23:06 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJ3B30qYHz5ymHr; Thu, 12 Jun 2025 13:23:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJ3B25slyz3mTM; Thu, 12 Jun 2025 13:23:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749734586; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z975MycFOayQGlOGGO4q044j4e9/7UdrApVA7U2/zMM=; b=PPtwlZv+ycZPElJWcMOr2ntUqE8qyShpktGGHBpT7wiWrtMrTzISVQ9qN0kGrhlaAHXihk 77zrUNkLBXmeWfxtLnCkMOcZktRudB6TBmWInyTJYLkQOi+X9xeS8NLB9z1OTxZysDE88i vnF5rH8Kdrll10mOb/3eZELqboT0ddhwXcl8owTFEVP8x8B+dDDLB8mfNMhsYAJQUrFHbP CGY9UeXciWm2cpLFGeSbyZcPxUG3e9clCvPoqFpF9bRjfPrganY2fH4cyze6VEUP++LfZY 9TyjRc5f00G5LFGSBekV15mIGQDAZlCGiJE+QCzxY2jQVRkIXN2FArpRjxcb0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749734586; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z975MycFOayQGlOGGO4q044j4e9/7UdrApVA7U2/zMM=; b=c2AQzDsDZiTorlGLLI43uW0Pf50Nafvtra5g8LB9NR5KuKWnnEAxQJqOu5DHc/07juUhqy ZYdSiDuYhOCljODPHZaCwI68TJ8wVcKQpEAdVgVPoydp8ZeC8e2jlg0jLMlP2egTaljMO2 hiL97/vByH+yNU7tRsudy8WRgsA6H7M11G1oVTtl2jgYM4e7A8PcyuRJC4zB1ndP7E74HU PpJXyEMZc4UOBMRq94t5MoqYlc/ntRHdSXF0AzPja5rr3ctoIdaSZf2StZ+bc7UJhCgXb8 4JH3qwcrn70tVJwBT7/zfP2rZS+hrv8ME1+CXWw5EOQmV9PW5Q/BVbP9+hbniA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749734586; a=rsa-sha256; cv=none; b=bFXT0MrrVZWTliJSxp2L218pvmmDqwCo9Dp7NvTWWHb4+QpJLtlQyJsxxcnSMRUizSz1lL nc2Py4JfDN4EYrsKbomTfyMVw44egJyKlaUZEQ6SKvSOjmtVI+WiAa+sTdmPtSLuhalyRv ZVjANRomZgCN19YAdiToglC9s4rFLJa5wSHcLyAGPToNLAVZDkxjXQTNbfnPI5QfTAdfPi ROEZ97z2TF77PU27GAfdfxF1bpmHZwsjTbFuDQnksCP+Asdc3KSKPjpgYUvPCrmfrCoZLb PpxnUbQu/7WvaXJ21RK06EoMDWnJoru7YgSDvprmmlCwGUb5HTb7t+Bnfwlw1A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJ3B25SB0z7g; Thu, 12 Jun 2025 13:23:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55CDN6EP040857; Thu, 12 Jun 2025 13:23:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55CDN6as040854; Thu, 12 Jun 2025 13:23:06 GMT (envelope-from git) Date: Thu, 12 Jun 2025 13:23:06 GMT Message-Id: <202506121323.55CDN6as040854@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 12913e4ddf71 - main - fix build after _types.h changes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 12913e4ddf710e517f3ae00b7b420b783cca9b37 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=12913e4ddf710e517f3ae00b7b420b783cca9b37 commit 12913e4ddf710e517f3ae00b7b420b783cca9b37 Author: Brooks Davis AuthorDate: 2025-06-12 13:21:35 +0000 Commit: Brooks Davis CommitDate: 2025-06-12 13:22:17 +0000 fix build after _types.h changes Reported by: imp, Jenkins CI Fixes: b01e971fd39d ("Don't rely on sys/_types.h including sys/cdefs.h") --- lib/msun/riscv/fenv.h | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/msun/riscv/fenv.h b/lib/msun/riscv/fenv.h index cc50f0659248..fd50463d479e 100644 --- a/lib/msun/riscv/fenv.h +++ b/lib/msun/riscv/fenv.h @@ -36,6 +36,7 @@ #ifndef _FENV_H_ #define _FENV_H_ +#include #include #ifndef __fenv_static From nobody Thu Jun 12 13:29:21 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJ3KG5Ljlz5ymxv; Thu, 12 Jun 2025 13:29:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJ3KG18rTz3qvv; Thu, 12 Jun 2025 13:29:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749734962; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JJthnCnFFjUZXiqJp4VcQUml0efnSGQGB2jQx5sn2hs=; b=mg2F0RMsoLangL8eNpPB8PKFbPMPKINMGEaxNY22Jo98s7ZluYbECQx8FkTy5VVFUEit6d tP7GEHBkvwMc2qGNnrWA8/W3Q53igDMa19N6z+obO2AE4Zq0QCcqZarOEMma4YaEh40aOy fq8RPc2E5odo9Z8R1zPVINOh7OgnL0w+LyzaNkDx1ZQRYVHy+CiOR2SL3kKZ2sB3/Mo1Km 3Zgd69JXVuj9rgrmmoqBMYFTJZTqowVJIeKIyp0en9xtYtU5tqijbviZdhtYNLD3b7gpkw KhFaqVt2tFBTXcUSb1W1E4RIReOzlAmk/xSC7V4jtb93dy6nUI45M+tFwPwQ1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749734962; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JJthnCnFFjUZXiqJp4VcQUml0efnSGQGB2jQx5sn2hs=; b=EhU2VunoHDIqv7V70v5OGIHMm04r58BiDu3K2zpmeWwObiYEnigjkaTEuMkC6aKaoXrsC8 rW94xlUQQA1LW6O70FGTtVLY7NHYskQ/iJ89oVSNQojDeKHfJV35+S8dtAZPDrk46NjIzO pIqTP6scWPyaSv0Gfl7YkEXDJgzY6OnrsCNtYKe0idvTvizYXBEfwKzNyl9NDNsltQlr3/ ucWE85/ztQd5if1zdd4JFICy+E144rbvecVUvC9tu3zUUIWAtnc0L6szXo2r7JXJwglqTi sTcFbE73spWB4MDatRwm0vcFeUsjK+DBBNfEOF183KRWnZfXDwEergUZ2UMkmA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749734962; a=rsa-sha256; cv=none; b=kJNA6kMZetx7DaLyKiJ3T2ISI+2JDS+qfLSUa6iktxD8pt9dGx1qHopxqDvccyPggrpPnv xB7ogNmf5WdiMyB5zW0AtjaDNOo6R8V1GJhNmhtTAdbvr2lWmFVRyxFqZpjX5Gj2v7hQ6N vNWeJo3NmGFMnl2IEy0YyPT1S1wDnEoysjyv+xOnp9/K35aVBysWn9QJ9vDmIcTqCDzWE6 Ajx5kZevsxfrRXpcI+xbkig5Q3iYSqFe0ip60JK0M7rqrHwYuKEWoCeeItKDGyihKn4sMc gwq01c2qXZOXiup4kEvSZowCdZ4JYl1mcX3RNirVtBIq8IVCTp564UqiTUWgQg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJ3KF5rbJz1CTG; Thu, 12 Jun 2025 13:29:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55CDTLZs042770; Thu, 12 Jun 2025 13:29:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55CDTLED042767; Thu, 12 Jun 2025 13:29:21 GMT (envelope-from git) Date: Thu, 12 Jun 2025 13:29:21 GMT Message-Id: <202506121329.55CDTLED042767@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 8fa4a4eb705c - main - service: Fix repeated -v in man page List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8fa4a4eb705ccaece5aac4ae1201034001f21313 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=8fa4a4eb705ccaece5aac4ae1201034001f21313 commit 8fa4a4eb705ccaece5aac4ae1201034001f21313 Author: Warner Losh AuthorDate: 2025-06-12 13:25:44 +0000 Commit: Warner Losh CommitDate: 2025-06-12 13:28:37 +0000 service: Fix repeated -v in man page Fix accidental repeated -v for -q. Fixes: 37983aef7c70 Noticed by: Gary Jennejohn --- usr.sbin/service/service.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/service/service.8 b/usr.sbin/service/service.8 index b8917138f478..06f8cd989bfc 100644 --- a/usr.sbin/service/service.8 +++ b/usr.sbin/service/service.8 @@ -116,7 +116,7 @@ as in above, but list all of the files, not just what is enabled. .It Fl v Be slightly more verbose. -.It Fl v +.It Fl q Be quiet, redirecting output to /dev/null. .El .Sh ENVIRONMENT From nobody Thu Jun 12 13:31:32 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJ3N84DGbz5ymq2; Thu, 12 Jun 2025 13:31:52 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJ3N82PSpz3sQT; Thu, 12 Jun 2025 13:31:52 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-addcea380eeso177174466b.0; Thu, 12 Jun 2025 06:31:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1749735106; x=1750339906; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Fb3QocDVA6JxSX3tmvktvU/mhfd8rstuwOmmhKks9/w=; b=a+AS44dV9XMlfQjZWPyMssP5bab89umUEdGKFpXKqXAxm86IlTPZ0tJ30Wok4MPD/V 7oiFr3JcfIfMJ/5K+Q/InPltLPrzLDyBGr0x695Mq2QwK9LKv/ZhZy24yGi1qHjAy1jS iaHdCWLfXl4wqKWtxMvFZsCveHaBoklN8YjG/olkZUq7ycF0sdOgOkZxsRPDUCXlR6kf KAgdfkoHZGueWN08RVJowVl7GcPuEUJfaG+UXRdMMpo6NtnVwttrgu3QQHjuIsbpAbZR BgNm8bF+0IS6zfCjUqTuFrJXfcSDWhgpaaPf0xFg2U2I38OfhDdrCZs0g+2IBRHGO6oR TD0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749735106; x=1750339906; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Fb3QocDVA6JxSX3tmvktvU/mhfd8rstuwOmmhKks9/w=; b=VkbvRC4uIra+fKs4mLuWEk8X44gywL23+WSJC0Z7TJFPh1721g7BfiHkbROHlNoNS2 ED1iAX+tdTFlweLuz8Stxm5yM/edRYS0rUDGuzLKfmafyaT0xSYCzdW11fr0HUuSzBiD PWK1lS44/HeERf51/09NKD5dbsWayqgQAdaZJXotxZAWOmsz4tfxSQmDEK5lryrkjkE+ 9k9l7qlWHgHvw98DNnHbL2CsLM/NDGzrrCH4o0dJ5NnCxu8HBFwNtgeW9KUWFLXU3aT2 oDDy8B5dyL3gmovtDkhQhevL5RGcErLzI7WYlwxptPoLkSqUbIOCYDcqSjkU5SLEUyuz HVgA== X-Forwarded-Encrypted: i=1; AJvYcCU8lnQMjtOK0KScccSJsqZFK59Ohnz1j/zjGaCdjIfzFIwUnrXsoMhQKKS2SuOj7CdYQJo6NSSOTQCeNLS9E2potdB57A==@freebsd.org, AJvYcCUzwssdbPVr2LM3/OZZ6+d0d2HcMHqiNrtgKQ2gm579AXiiU+ln/98pIUlc2HxXTkXZRek=@freebsd.org, AJvYcCVhaJslthdtr9oOSzWF5LWSEhRCnoGCOfgxayihPopi7Q4w1gmom/HH49dO1Q1zvy7EOXxTaMhWwt9doALg9DThUehCxTQ=@freebsd.org, AJvYcCXpkK/yh6f87kQxS4WArbnuOm6NGE9jabgy0aQT/eBrSjQVzuSU1caUY6sBXDFTHPDTM5sMLkPObmdp4LAF7cw=@freebsd.org X-Gm-Message-State: AOJu0Yz6LDi8/rJXc7tEJDGycdoPXIJAhIZnasRKwbmEei18EkPtnN7k QTKWuPRYkror57fYwmReYRU3cYp1dlZ2GT/nKgFc12djlbuVtj7q4mpaaT4U34wsQGFUJ17iPsz JKAcEvxIRo7nQhF8BJrP96SrV/TW7Sak60HfP/A== X-Gm-Gg: ASbGncvvOTrdy9Kq/yx3avqKGMrOa14iMPYWzENfFC4lvecCGt1SnJ/zWfSMC+tmOzt DRkNW+ueKdXGevO/Gbh61wv801Jgi3AUFjWoNRGgzek2h9FdeAYA4nVFI1FEDjpjyw49UjaBRxB M0Ruh89hxEdteqoS6faVX1a/cS0riVz2CYmL8WEVAYeW+A1x1T769SzUPJrtKCKLsG9FZtbyr7e V+6US5HDFyF/A== X-Google-Smtp-Source: AGHT+IEer0eHegnTNLkeX1Og6Qltrlze1uw7UqFwNgaJa1DGuFIXRqIf8lOxlzje6gLz7trfFR0vD2NlN/ULDHnWrh0= X-Received: by 2002:a17:907:3e26:b0:ade:3bec:ea30 with SMTP id a640c23a62f3a-adea8d3fc34mr350333966b.1.1749735105094; Thu, 12 Jun 2025 06:31:45 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: In-Reply-To: From: Rick Macklem Date: Thu, 12 Jun 2025 06:31:32 -0700 X-Gm-Features: AX0GCFtAnWZUwpHx-hmUdNq1luCBqidHkrk4WC8MqHHfLhzwtsEg1yYNQAwjR50 Message-ID: Subject: Re: git: 79d0f4474653 - main - rpcbind: Ensure krpc is present. To: Gleb Smirnoff Cc: Konstantin Belousov , =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4bJ3N82PSpz3sQT X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] On Wed, Jun 11, 2025 at 11:19=E2=80=AFPM Gleb Smirnoff wrote: > > On Wed, Jun 11, 2025 at 07:05:45AM +0300, Konstantin Belousov wrote: > K> On Tue, Jun 10, 2025 at 08:41:44AM -0700, Gleb Smirnoff wrote: > K> > On Tue, Jun 10, 2025 at 12:11:18PM +0300, Konstantin Belousov wrote: > K> > K> Apparently we already have the feature called 'warmstart', where = rpcbind > K> > K> can be restarted and existing registrations are reloaded. So it = is in > K> > K> fact already solved, assuming admin is careful enough to use -w. > K> > > K> > Ok, then all that needs to be done is revert this: > K> > > K> > --- a/usr.sbin/rpcbind/rpcbind.c > K> > +++ b/usr.sbin/rpcbind/rpcbind.c > K> > @@ -159,10 +159,6 @@ main(int argc, char *argv[]) > K> > > K> > update_bound_sa(); > K> > > K> > - /* Ensure krpc is loaded */ > K> > - if (modfind("krpc") < 0 && kldload("krpc") < 0) > K> > - err(1, "krpc"); > K> > - > K> > /* Check that another rpcbind isn't already running. */ > K> > if ((rpcbindlockfd =3D open(RPCBINDDLOCK, O_RDONLY|O_CREAT, = 0444)) < 0) > K> > err(1, "%s", RPCBINDDLOCK); > K> Well, absolutely minimal fix would be to change err() to warn(). > > Kostik, please just commit this. Just one suggestion: make the warn() mes= sage > more verbose: > > warn("failed to load krpc module, RPC services for kernel disabled"); Yes, this sounds reasonable to me, too. rick > > -- > Gleb Smirnoff From nobody Thu Jun 12 13:35:15 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJ3S34N8hz5ynGQ; Thu, 12 Jun 2025 13:35:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJ3S32b7qz3vp4; Thu, 12 Jun 2025 13:35:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749735315; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nXVUcRzN8gV382O2FTSgJsrLSuHuTIHhg4PXJ5A5WiA=; b=NZmBmjwJ2AVTr4fXnczLmsXXfjdY8l+WFQWADE8Fp0e2swBxufDQd2G5sKq5k6KSvKPqee 6bfdozUsApitLnUwypkmSbpmDFl36tZi/KHylMQsgD3kNgG0dsB0i5SCDdOH4Mt2p0/w2J set0yQIogiDLKqEfiZpwhsugAyzCdjkPTn2/aNUr5D1z67ZEk66apWtda38WBirPwo/EVN /RbCg7+H7DWLCNhJ0jtXxBkdo3fyUGOR6257DksDUoSxVNb7n58Jr0aiRyc8KaupITcElm s+7Dn/5v6HLZfm66muL5+DnQQFRM/O5waQ9bdFljSR/S73m6kOuv6shF9zIQQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749735315; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nXVUcRzN8gV382O2FTSgJsrLSuHuTIHhg4PXJ5A5WiA=; b=xDSy6fK/INqGsavO+gTCpjnERWd9K2SYqpQR0KKAIUMPmgVCnFABv1yyLcMMwtjjw3+h87 cu5dd7wpyPQnouW7DRoY1ilOJxTkt84WnI26Y20syI7PF8eaovcH2M39vVCA4RAWb0NH9H D7voyouDQPsw3WYONHgWfHoap8QARBaN/Nn71/dcSEpmZ+Nmq8tEL++vn3H22VNg5UJjZj 2V3z8lsgNQtBFxbTFYV613FfaAwXXhxCV5WsqRV794tEdXeZ2hY5+EH1eYSkdmG/XmfPhh BmbXhSjGeXsYEqbGIXntGTPqN/oH8nmsSuRdr3ZQkUImekUgNqoXPPsMz7Doqg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749735315; a=rsa-sha256; cv=none; b=DHjIezj8q34TJU9veG01ixYg/hj/gmkT0moBi8hcniX5NiKuBlxvEPDdt4EyN+6gMxXjZD yGxaP3kqWV6dD0eOlV56Z3wV82YOJ37IU+K82Y4XGYqJCa6vwLT9Ydy824dil7y3RDQ5jw YmMOdywMrou/SiXQ9+sdps2Mr2+a4NSN1v/1qXTGusgvK/s36gJHEy3iQ4ZrY99Pey89Zr Iz1Or01gA/I+2FDlkSofn4nvE2yf+GqKProv5A8gjW/TTJKE7f3YFy6WMl1d2ppq9oMmRR eJNef1y+f1c1uvbyqLJZ1ZgiW988nKXCZEnzUXCrU71wkfFDVUb7PqFwmF2qRw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJ3S322SQzLT; Thu, 12 Jun 2025 13:35:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55CDZFnx059974; Thu, 12 Jun 2025 13:35:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55CDZFbv059971; Thu, 12 Jun 2025 13:35:15 GMT (envelope-from git) Date: Thu, 12 Jun 2025 13:35:15 GMT Message-Id: <202506121335.55CDZFbv059971@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 6d0a335aaa81 - main - fcntl.h: warn that bits for O_* flags are scarce List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6d0a335aaa81d3ddce95de8d862a23c97bb038a6 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=6d0a335aaa81d3ddce95de8d862a23c97bb038a6 commit 6d0a335aaa81d3ddce95de8d862a23c97bb038a6 Author: Brooks Davis AuthorDate: 2025-06-12 13:33:35 +0000 Commit: Brooks Davis CommitDate: 2025-06-12 13:34:05 +0000 fcntl.h: warn that bits for O_* flags are scarce Running out of O_* flag bits will end out ability to make additions that are source compatible with other operating systems. Add a warning to coordinate all additions with srcmgr@. Reviewed by: markj, emaste Differential Revision: https://reviews.freebsd.org/D50703 --- sys/sys/fcntl.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/sys/fcntl.h b/sys/sys/fcntl.h index 08aa26fbce02..c23c7eba0544 100644 --- a/sys/sys/fcntl.h +++ b/sys/sys/fcntl.h @@ -143,6 +143,16 @@ typedef __pid_t pid_t; #define O_NAMEDATTR 0x04000000 /* NFSv4 named attributes */ #endif +/* + * !!! DANGER !!! + * + * There are very few bits left for O_* flags. Every bit we consume for + * local features is one bit we can't use for future source compatibility + * with other operating systems. + * + * All additions should be coordinated with srcmgr@. + */ + /* * XXX missing O_RSYNC. */ From nobody Thu Jun 12 14:09:16 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJ4CK0hHGz5xr7j; Thu, 12 Jun 2025 14:09:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJ4CJ71wPz3GMY; Thu, 12 Jun 2025 14:09:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749737357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NwhiKD8k5yDq8jxJpFibmtHb1WVJjXUG28IsYRpHYEA=; b=QY9WbMwLmDD0mWJ+H9NuzIl6aZJeylx6ASJKT4W3B3lFHAbw9x0TQ5zS0VnSWj2E3hZSgk 8eOElLbqDpIjyjRR7WwCdMmwtRVaoidMfviYA69qljj6TwzOg5KdKP4IS3Gh0I7iJdBJT1 B1f1VYGburI3o/QX9+SsrkNX4wQreET2EJM1UfZGkTE2/9Mc7k+YE0248GAg7UXC1dXahP L9kfLIK9Mg9tOZhPUHWL5m+6gF+g7kuiDJFpU1NttZvqRlgKEkHXPmVJONTElzyvgh3yiP fmbSkyjDTZjiC9NLOrxWiqytqt6OPuGNxbJAeJTgc0ANks8lkmqF1KPJSvB5Ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749737357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NwhiKD8k5yDq8jxJpFibmtHb1WVJjXUG28IsYRpHYEA=; b=QcFHAAj9ljf1kkhr0E3dhlFDoSCy5+hFbcCa884zVTvfCtOQ3R4W+RtM04tZILX3nppXLd 5HLkf9a922EJiPqijU7hABYwJYX43tAZV2GVz3RC1fcP+PLbTVGNIspYyeAKZBROcQgTeR ALBsuBBVghsDeUDS7BOCfJ7JJTR0bgxUsmmhKiniGFavrXWBCuzwo/WqvrqjrT+lntiQkn Oee1e1bthRwFWaCKUZol58Q9MSgPy1YUP3yPiiLi9J7POt05LDUt7vlj6fMPAg7vYyfjuh jasZ/3NHoQlJwZlZSDKB0NURsVw813zjMaVDCsE79tfqJp7Hqtr6is21Hdtb0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749737357; a=rsa-sha256; cv=none; b=p9kmOLlKRAJmcE758fUTxyQ/r4vOfejM1wc0LwGr76dMsMplc5/thOnES9NxQzRMfReVux M8+KgZpXG4lGzGsHA8wg+fw9jzTOO3NF9JojzSZNj8Y8OznqBU+XOl/zXeni/7ynvRO+zj fvoovRIN7wQ/Gw5ji6fvRKW/DSV6JdtB8LBHNaz1TY3OLhaDSm/QRM1MDeiY7Me82regoX w+HOH+OFQdujEvzt6nd+Kisx08kT/umWP3v2Tnjl1PBu5cQAWsr1gawxX5iXzefbMh5dBP w0nbEvrosASVULJ2Q/DT31aCV/EA5EoRSDYneVNYBq9pHR1Go3PQOQhmUFQZ0g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJ4CJ6NRXzh6; Thu, 12 Jun 2025 14:09:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55CE9Glw018187; Thu, 12 Jun 2025 14:09:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55CE9GYf018184; Thu, 12 Jun 2025 14:09:16 GMT (envelope-from git) Date: Thu, 12 Jun 2025 14:09:16 GMT Message-Id: <202506121409.55CE9GYf018184@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: cd7af78e1241 - main - rpcbind: do not exit abruptly if krpc.ko is not available List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cd7af78e1241f23d140e343889d3a2f95c2b54f4 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=cd7af78e1241f23d140e343889d3a2f95c2b54f4 commit cd7af78e1241f23d140e343889d3a2f95c2b54f4 Author: Konstantin Belousov AuthorDate: 2025-06-12 13:14:37 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-12 14:09:01 +0000 rpcbind: do not exit abruptly if krpc.ko is not available Reviewed by: glebius, rmacklem Sponsored by: The FreeBSD Foundation --- usr.sbin/rpcbind/rpcbind.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/usr.sbin/rpcbind/rpcbind.c b/usr.sbin/rpcbind/rpcbind.c index d165bcd9fbfc..182dbff7dbed 100644 --- a/usr.sbin/rpcbind/rpcbind.c +++ b/usr.sbin/rpcbind/rpcbind.c @@ -160,8 +160,10 @@ main(int argc, char *argv[]) update_bound_sa(); /* Ensure krpc is loaded */ - if (modfind("krpc") < 0 && kldload("krpc") < 0) - err(1, "krpc"); + if (modfind("krpc") < 0 && kldload("krpc") < 0) { + warn("failed to load krpc module, " + "rpcbind services for kernel disabled"); + } /* Check that another rpcbind isn't already running. */ if ((rpcbindlockfd = open(RPCBINDDLOCK, O_RDONLY|O_CREAT, 0444)) < 0) From nobody Thu Jun 12 15:35:25 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJ66j3Qs4z5y03K; Thu, 12 Jun 2025 15:35:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJ66j21Vrz3vdJ; Thu, 12 Jun 2025 15:35:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749742525; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Mf/8bFjRXvnav7sK38RrqXQ4BVkQQ1L6GPtNW4SlloY=; b=Pl5oQLSCvWAjSDJvq70Yj5Gk2E51QWpXdDgY5tvSPNCCE4YZTEyHPWQZuCgzgpCBGS/aWS wgviuh95wUjOI6w/SmAUlD02V8yyEZjwA1IL9hBAB6SoXAwarH6xfkqi7gPcxZzkJvZONp yMwvurwW5ca18kNmnIdoXWSfSLyzifq6SaKDKLx3pUFz3NMgXnUHTb1ZZb+Uriq3+Oh8ch JY3VivV2C48I4mzCqPmAUQxVSaau+eeCVp5pxY0T4dcMKWqW6gfj+Zba1mcjtw1PT22QLQ Ic2JnOYJvXpw7WcyhdHRtOW3u4aSvr9TLDcbP5VTBlDnj8TMVUHZ77GFDWGcYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749742525; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Mf/8bFjRXvnav7sK38RrqXQ4BVkQQ1L6GPtNW4SlloY=; b=ZMFBChzjlQ+TMSwxkdPbXMcKTsri6ksCme7+AIf9AkJbxH/QClOd+vn2buHqoRZg/KMg/B cfblCzuYxT5mwG+grd4MVcFKde4cPFLph9kbYR7y8na/7kZPgd7NGlRGcRFGXrcnXvnqlg G5yda1QGW6LW1tpesOqt7vJdQTmSu9jCICjNcJNPRM0LAjg3vF21ONjyEzjq/Wv95NYGnb yh5i4RFwhrkDhgGKqv27dvyDLov9+5UX89FvFzWwIIv3ngmzdGBp2iKNOVNGUHA6Yvwulg 8cuqggqE+SISFZFFt1aEsrdgiwf81jB6F2T6zMWKdH/h1YF2kl0lGa+PBWJEUw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749742525; a=rsa-sha256; cv=none; b=p2HgEIbgx6Rv+wOW+Rtr6UIifbFLzrTE5NpNONym5X0btdPN6mhRCyxIuxuFAHTLj5Gz42 1fHC3eFQsXErC2/LtIwYYUVvcHcp4OktvUpZLMxGPpweYfV6aTf1nTQqWaHRywyWsZyZrL TbB+VwX9zOXz9PIKrvQ/EiZifhPCYaawB22Jf2PiEpCmeaaNaPrVN6eYwuoticyPU3o1rK xwH3tammEw4LbO3DLEsZOOlRLV9RLXjYNZKciimP2Xlrjg4uyIacuAGU2ai7r1/3XFIC9A SL7jgQ0avVcKQF/FkihJyqO2aOErMcuE8EesfyHFxdCkJLakQMO4LJZTg4AkLQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJ66j1c36z3X0; Thu, 12 Jun 2025 15:35:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55CFZPcR086369; Thu, 12 Jun 2025 15:35:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55CFZPxh086366; Thu, 12 Jun 2025 15:35:25 GMT (envelope-from git) Date: Thu, 12 Jun 2025 15:35:25 GMT Message-Id: <202506121535.55CFZPxh086366@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 55efb3bf2b6e - main - loader.conf: add LinuxKPI based wireless drivers to module_blacklist List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 55efb3bf2b6edb8e1b888dc7ed52046f5b9b6591 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=55efb3bf2b6edb8e1b888dc7ed52046f5b9b6591 commit 55efb3bf2b6edb8e1b888dc7ed52046f5b9b6591 Author: Bjoern A. Zeeb AuthorDate: 2025-06-12 15:06:04 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-12 15:34:07 +0000 loader.conf: add LinuxKPI based wireless drivers to module_blacklist Despite being discouraged in the man page people are trying to load the driver from loader. In that case firmware is missing and the root file system is not there yet and the LinuxKPI based drivers will panic the system on boot. Simply avoid any further support trouble by disallowing them to be loaded from loader. If someone still wants to do it, they will need to figure out how to remove them from the blocklst and how to loader the firmware file(s) in advance themselves. Sponsored by: The FreeBSD Foundation MFC after: 3 days PR: 287480 Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D50817 --- stand/defaults/loader.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stand/defaults/loader.conf b/stand/defaults/loader.conf index 5d66708d30ef..1834e3ba3b34 100644 --- a/stand/defaults/loader.conf +++ b/stand/defaults/loader.conf @@ -111,7 +111,7 @@ kernels_autodetect="YES" # Auto-detect kernel directories in /boot #console="vidconsole" # A comma separated list of console(s) #currdev="disk1s1a" # Set the current device module_path="/boot/modules;/boot/firmware;/boot/dtb;/boot/dtb/overlays" # Set the module search path -module_blacklist="drm drm2 radeonkms i915kms amdgpu" # Loader module blacklist +module_blacklist="drm drm2 radeonkms i915kms amdgpu if_iwlwifi if_rtw88 if_rtw89" # Loader module blacklist #prompt="\\${interpret}" # Set the command prompt #root_disk_unit="0" # Force the root disk unit number #rootdev="disk1s1a" # Set the root filesystem From nobody Thu Jun 12 16:56:50 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJ7wg2H5bz5y5DL; Thu, 12 Jun 2025 16:56:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJ7wg1FKNz3bmw; Thu, 12 Jun 2025 16:56:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749747411; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jCOr9cc2E43OMtFykINokOFFIt6YxUZI3bi7q5j5HyQ=; b=inbIpeFf2emKVJeSoQDousokAzNCtyaYCADovImW1j+4E+x5fPtVVDOww8wWLKWETFgW1w K4BrO//mFsisZrE43UNpZhzZm7F8K7nUdfErwaIVB5RoRKXci1YGPLExnw5rAF/M6m9bsv sP6jZvoyaXQ0+aJ0HEr9rYiYaBHagi0O0ZkGWOFkskh+GRfIvI1+LvNrjTRuusuXiw9jcF AE/EeNx2edi8KeH7uNF8IVy6Hm4L6C0PVGlPUzvNQotCVBtkmzf/4gG6cvufDXw7mKI4G9 kEn1t+T7YXafbXswqZiDACb/VsKgoDImt7FSEXdTTZB5la3fomG+aIOm3dHp7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749747411; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jCOr9cc2E43OMtFykINokOFFIt6YxUZI3bi7q5j5HyQ=; b=ERkjOR5kcVS0m8NLssKkghH5izpH8Tsz72akG2FQAvlO2sPY6ufoYhL8pJVD3JNM6P8U1T nkfmS7w+fmyVno00oWQ50ogqnmnymPhfD9O5gSBS8jaazoxbyFIz6hO55uHfxH8oENZZmF Mz1BUL8bojMqXwoWA7FqbBFQINgQv0vg6e23xfVKVEHWPM7kGufw2ZIMuSbGfYNy6FHOhg jHdRXx+L9WsTkoyl0EY9/mwy4W5QsSpNCK0K6/IsLpYX9PC1bsomiTbhTGyTaPYv7OSXsL csdv+h/Y9W1kBUmXxNU0MP4GV6XIclizMm+yZeCfXyEUiG6wkWwA/q4G7SNizQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749747411; a=rsa-sha256; cv=none; b=rML3Cpb3BylPW3AlGml6WOJvS+j2kRSCnSCTlAt0Lsd0jrfE53fQ59Vpd4Q739Mw/GqjbG cmrJaeXjeGhCZOZp83k8GLcsr75fzu5wtsoBtlmwKf+5PoeeSmC3ujiLZTEQLpFrokiow9 oDEw1OTBrBfqKb8j4tQMGhTOtuKAdsn4Z110elnL10ZNGaMZHDhj3upPCuGeOksdSYDeoR isNwZ+M8SxvcDVrURpZCv28LExT2UjcRVIewn+syb6lH/Qjr9J9rr6W5lDBk9P/KxE8slx m0EfyPIi3kRMlKU8Lskm63pcohbbQDAuGyRIoUiiK7Y4dJkbP25GRI6GYzKuIQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJ7wg0YVtz5QD; Thu, 12 Jun 2025 16:56:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55CGuoDY036564; Thu, 12 Jun 2025 16:56:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55CGuoa9036561; Thu, 12 Jun 2025 16:56:50 GMT (envelope-from git) Date: Thu, 12 Jun 2025 16:56:50 GMT Message-Id: <202506121656.55CGuoa9036561@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 4c556a4e8d14 - main - libusb: implement `libusb_get_parent` List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4c556a4e8d149169a7d8e029aee7f3d017fd4e7f Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=4c556a4e8d149169a7d8e029aee7f3d017fd4e7f commit 4c556a4e8d149169a7d8e029aee7f3d017fd4e7f Author: Aymeric Wibo AuthorDate: 2025-06-12 16:54:13 +0000 Commit: Kyle Evans CommitDate: 2025-06-12 16:56:31 +0000 libusb: implement `libusb_get_parent` Newer versions of drivers such as libwacom (graphics tablets) or libfprint (fingerprint scanners) call g_usb_device_get_parent. This in turn calls libusb_get_parent on platforms which implement it, and returns NULL on platforms that don't. This patch implements this function on FreeBSD. Reviewed by: bapt, kevans Differential Revision: https://reviews.freebsd.org/D46992 --- lib/libusb/libusb.3 | 9 +++++++-- lib/libusb/libusb.h | 1 + lib/libusb/libusb10.c | 34 ++++++++++++++++++++++++++++++++-- lib/libusb/libusb10.h | 1 + 4 files changed, 41 insertions(+), 4 deletions(-) diff --git a/lib/libusb/libusb.3 b/lib/libusb/libusb.3 index 1ca0e677d96f..a9a99f307a86 100644 --- a/lib/libusb/libusb.3 +++ b/lib/libusb/libusb.3 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 16, 2025 +.Dd June 12, 2025 .Dt LIBUSB 3 .Os .Sh NAME @@ -117,7 +117,7 @@ This function does not return NULL. .Fn libusb_set_debug "libusb_context *ctx" "int level" Set the debug level to .Fa level . -.Pp +.Sh DEVICE HANDLING AND ENUMERATION .Ft ssize_t .Fn libusb_get_device_list "libusb_context *ctx" "libusb_device ***list" Populate @@ -220,6 +220,11 @@ Close a device handle. Get the device contained by devh. Returns NULL on error. .Pp +.Ft libusb_device * +.Fn libusb_get_parent "libusb_device *dev" +Get dev's parent device. +Returns NULL if the device has no parent (i.e. is a root device). +.Pp .Ft int .Fn libusb_get_configuration "libusb_device_handle *devh" "int *config" Returns the value of the current configuration. diff --git a/lib/libusb/libusb.h b/lib/libusb/libusb.h index cdac94b17c64..0aad29aa4ecc 100644 --- a/lib/libusb/libusb.h +++ b/lib/libusb/libusb.h @@ -503,6 +503,7 @@ int libusb_open(libusb_device * dev, libusb_device_handle ** devh); libusb_device_handle *libusb_open_device_with_vid_pid(libusb_context * ctx, uint16_t vendor_id, uint16_t product_id); void libusb_close(libusb_device_handle * devh); libusb_device *libusb_get_device(libusb_device_handle * devh); +libusb_device *libusb_get_parent(libusb_device * dev); int libusb_get_configuration(libusb_device_handle * devh, int *config); int libusb_set_configuration(libusb_device_handle * devh, int configuration); int libusb_claim_interface(libusb_device_handle * devh, int interface_number); diff --git a/lib/libusb/libusb10.c b/lib/libusb/libusb10.c index b442a1f489a0..3e81f234a735 100644 --- a/lib/libusb/libusb10.c +++ b/lib/libusb/libusb10.c @@ -3,6 +3,7 @@ * * Copyright (c) 2009 Sylvestre Gallon. All rights reserved. * Copyright (c) 2009-2023 Hans Petter Selasky + * Copyright (c) 2024 Aymeric Wibo * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -311,9 +312,9 @@ ssize_t libusb_get_device_list(libusb_context *ctx, libusb_device ***list) { struct libusb20_backend *usb_backend; - struct libusb20_device *pdev; + struct libusb20_device *pdev, *parent_dev; struct libusb_device *dev; - int i; + int i, j, k; ctx = GET_CONTEXT(ctx); @@ -365,6 +366,9 @@ libusb_get_device_list(libusb_context *ctx, libusb_device ***list) /* set context we belong to */ dev->ctx = ctx; + /* assume we have no parent by default */ + dev->parent_dev = NULL; + /* link together the two structures */ dev->os_priv = pdev; pdev->privLuData = dev; @@ -374,6 +378,25 @@ libusb_get_device_list(libusb_context *ctx, libusb_device ***list) } (*list)[i] = NULL; + /* for each device, find its parent */ + for (j = 0; j < i; j++) { + pdev = (*list)[j]->os_priv; + + for (k = 0; k < i; k++) { + if (k == j) + continue; + + parent_dev = (*list)[k]->os_priv; + + if (parent_dev->bus_number != pdev->bus_number) + continue; + if (parent_dev->device_address == pdev->parent_address) { + (*list)[j]->parent_dev = libusb_ref_device((*list)[k]); + break; + } + } + } + libusb20_be_free(usb_backend); return (i); } @@ -540,6 +563,7 @@ libusb_unref_device(libusb_device *dev) CTX_UNLOCK(dev->ctx); if (dev->refcnt == 0) { + libusb_unref_device(dev->parent_dev); libusb20_dev_free(dev->os_priv); free(dev); } @@ -816,6 +840,12 @@ libusb_set_interface_alt_setting(struct libusb20_device *pdev, return (err ? LIBUSB_ERROR_OTHER : 0); } +libusb_device * +libusb_get_parent(libusb_device *dev) +{ + return (dev->parent_dev); +} + static struct libusb20_transfer * libusb10_get_transfer(struct libusb20_device *pdev, uint8_t endpoint, uint8_t xfer_index) diff --git a/lib/libusb/libusb10.h b/lib/libusb/libusb10.h index f34ea25740d6..70b5525df537 100644 --- a/lib/libusb/libusb10.h +++ b/lib/libusb/libusb10.h @@ -142,6 +142,7 @@ struct libusb_device { struct libusb_super_pollfd dev_poll; struct libusb_context *ctx; + struct libusb_device *parent_dev; TAILQ_ENTRY(libusb_device) hotplug_entry; From nobody Thu Jun 12 18:17:24 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJ9jc5Mg1z5yBsD; Thu, 12 Jun 2025 18:17:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJ9jc4L4Dz3RW3; Thu, 12 Jun 2025 18:17:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749752244; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0KK0H61LS5WEEkeNcwXbKRw6KVuPxDPsk8OJshjjxv8=; b=Pj+t0mgvaNfQB67D4H2cAgfCbL8xt28s7q0Nt6IaCDOh/NLAhno50J/Sy2Nvzi9xti1kN/ 1KNZtk3lTaBwqQbz3j2k7fmovxaKc7QqQGVUypImeqmKNH0nGO/Yt9Qz8hx5N2YQTFRaN+ gZmF4cOJJPu/7fcdl8Si74HkYJgQ9xL+xSNc21hCOTDJsWHjEnztRfMfEmJW8ITEmumYNp DgR0+/TnNeP9d6AKC5jO4eMpVaiLxREtlsh0ud3GmAZrdkDsDnlGpER3jOI+IUHWjm4XOR RqGvN81ZJ3y7cZIYiZI3wskkqoUBeJ6CJM/EQ0Wh+WqPj/bmIFUjB97AYh8v8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749752244; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0KK0H61LS5WEEkeNcwXbKRw6KVuPxDPsk8OJshjjxv8=; b=CDeOdxwdJEoJ/+BsnDwS6LMX7+P4SzPlVpsl+eBhh+dm32s0tEko5FqDusbbE6ySAKT4b2 8oDnlwKIS5756DYnR2SysjbDSGXXZosWUWK9nJGweFNKwr9sjqQRL/Z5AK7bvXSWKEMvzT t5+xYw+XM7ct7tR1f6H9MEP/1SD2ITROWydIbmJJvyyHJQPPvDcCGc0kYmkXer0ZsgoPHN s8lPlD6npJfuz5Bd+SYe/lhndrXsfxHVCGE2GA7YhFUmgmkwANqKjpiyxpjyHhGMpY1Xfa Qc2FdTgVqA7f8H6vAdf7HZ2KaRLqzVNnmfxfaMSmIhoid8nnMpZsC9UpXKMOPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749752244; a=rsa-sha256; cv=none; b=Ro8vu5DV8qB8gBw3RNpRJ3DqDOAbzQhQvhgSWksuvlwz1KdVYeggkbIh83pgAvxU0YGxky X8S/7SYlPl5G3QMIEhDT/L0kvCIT9AuCbBRWMbft43e6l9Sk8rW+MmUyjDJEhF8gRyqVmw 78MUn3Iy6orO68qOR4XMJ4oC25v5V17+E7Lc/3WJaqnz+Nb3pvmmOH8g4nqCP1u3lzkV9M SdOvf+QiRTm2Q8UYNljOqkElRq2PTG9J+egvoKMjbV3tMqUiXl9IW7NAZpyI8TBWlOoloj TcFakHZXooAUttcyX0udBkg+GoxyQBwg20H5CvngCW5KN2EufivwhxYVdZ+1tg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJ9jc3Q3Zz6yD; Thu, 12 Jun 2025 18:17:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55CIHOFh087677; Thu, 12 Jun 2025 18:17:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55CIHO5l087674; Thu, 12 Jun 2025 18:17:24 GMT (envelope-from git) Date: Thu, 12 Jun 2025 18:17:24 GMT Message-Id: <202506121817.55CIHO5l087674@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hiroki Sato Subject: git: 6501b68ffba7 - main - libcasper: Use __VA_ARGS__ for function-like macros List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hrs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6501b68ffba7f4414b3818fcc3ee945e70918772 Auto-Submitted: auto-generated The branch main has been updated by hrs: URL: https://cgit.FreeBSD.org/src/commit/?id=6501b68ffba7f4414b3818fcc3ee945e70918772 commit 6501b68ffba7f4414b3818fcc3ee945e70918772 Author: Hiroki Sato AuthorDate: 2025-06-12 18:04:21 +0000 Commit: Hiroki Sato CommitDate: 2025-06-12 18:04:21 +0000 libcasper: Use __VA_ARGS__ for function-like macros cap_net.h uses "#define cap_f(chan, a) f(a)" to call the conventional service function with the first argument of cap_f() dropped for compatibility with the environment where the casper service is unavailable. However, this function-like macro does not work when the arguments contains C99 compound literals, such as f(chan, (int[]){1,2,3}). The following is a typical example: error = cap_getaddrinfo(capnet, "192.168.0.1", "100", &(struct addrinfo){ .ai_family = AF_INET, .ai_flags = AI_NUMERICHOST }, &res); Using cap_f(chan, ...) and __VA_ARGS__ in C99 seems a reasonable solution for this problem. While there is a workaround using parenthesis around the compound literal like f(chan, ((int[]){1,2,3})), it is not intuitive and the above example works when the cap_net is available and f() is defined as a function. A possible moot point is that __VA_ARGS__ cannot control how many arguments are passed at the macro level, and "chan" is not protected. However, "chan" is less likely to be written in compound literal, and the function prototype should check the remaining arguments. Reviewed by: oshogbo Differential Revision: https://reviews.freebsd.org/D45858 --- lib/libcasper/services/cap_net/cap_net.h | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/lib/libcasper/services/cap_net/cap_net.h b/lib/libcasper/services/cap_net/cap_net.h index 1e9a6021d240..75f936954199 100644 --- a/lib/libcasper/services/cap_net/cap_net.h +++ b/lib/libcasper/services/cap_net/cap_net.h @@ -93,18 +93,14 @@ struct hostent *cap_gethostbyaddr(cap_channel_t *chan, const void *addr, socklen_t len, int af); #else /* Capability functions. */ -#define cap_bind(chan, s, addr, addrlen) \ - bind(s, addr, addrlen) -#define cap_connect(chan, s, name, namelen) \ - connect(s, name, namelen) -#define cap_getaddrinfo(chan, hostname, servname, hints, res) \ - getaddrinfo(hostname, servname, hints, res) -#define cap_getnameinfo(chan, sa, salen, host, hostlen, serv, servlen, flags) \ - getnameinfo(sa, salen, host, hostlen, serv, servlen, flags) +#define cap_bind(chan, ...) bind(__VA_ARGS__) +#define cap_connect(chan, ...) connect(__VA_ARGS__) +#define cap_getaddrinfo(chan, ...) getaddrinfo(__VA_ARGS__) +#define cap_getnameinfo(chan, ...) getnameinfo(__VA_ARGS__) /* Limit functions. */ -#define cap_net_limit_init(chan, mode) ((cap_net_limit_t *)malloc(8)) -#define cap_net_free(limit) free(limit) +#define cap_net_limit_init(chan, ...) ((cap_net_limit_t *)malloc(8)) +#define cap_net_free(...) free(__VA_ARGS__) static inline int cap_net_limit(cap_net_limit_t *limit) { @@ -155,9 +151,9 @@ cap_net_limit_bind(cap_net_limit_t *limit, } /* Deprecated functions. */ -#define cap_gethostbyname(chan, name) gethostbyname(name) -#define cap_gethostbyname2(chan, name, type) gethostbyname2(name, type) -#define cap_gethostbyaddr(chan, addr, len, type) gethostbyaddr(addr, len, type) +#define cap_gethostbyname(chan, ...) gethostbyname(__VA_ARGS__) +#define cap_gethostbyname2(chan, ...) gethostbyname2(__VA_ARGS__) +#define cap_gethostbyaddr(chan, ...) gethostbyaddr(__VA_ARGS__) #endif #endif /* !_CAP_NETWORK_H_ */ From nobody Thu Jun 12 18:17:25 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJ9jd5dkSz5yC3w; Thu, 12 Jun 2025 18:17:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJ9jd4706z3RR8; Thu, 12 Jun 2025 18:17:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749752245; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LoMJfA4duxOR81L22lSzDh8DtFpA7m7BtsXUCqtD4EM=; b=ZAsxMA6qJXendxeZP5KRVKJIoLPg1VJz/VG5cf97i88D8zfCsu6RHT4Zj7WNgZIPJRMmJI ZTcLyVbpZ9ie0sc7r+FRUAZKgQAmvVvwFbBoDJ+pofw4h2bG+e2USsEbRv7r/3LjC9yQSX wc2ZkVOi/KVCM3ib2B70mUOPoEBNAOVaAdhB2BJBI+dFPNo6MMLTbgfXOCQG9q0FwwHgiB g5wBr/oqwUvyKLmvajgDmmJTFWdArTq9/khV77mzzb4Gh6mhZoZpZzIOUVPuyQMNUHi99r ePxs+5COv6bk5lRIDni8Xc1A3I1YIr0HX4Pl+4i3dCnZOTCYxMx8E4K/KRLSfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749752245; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LoMJfA4duxOR81L22lSzDh8DtFpA7m7BtsXUCqtD4EM=; b=YTV1GIhgkVmYSGzVBLlBeamkSfLfF43LjoLGHOBofwBh4Or/bThc26CJUl+qhbtUQK1oic be7XpWknplbF1pUZLQE9W0L3s1EXH2xAtCiqDkBbefjwonShC6dt/R3J69Iq4ad5fcL5yr o/JlbAOSLwRu4UTibPHjWIKdzYGAhFM/6Dt2BnhTlyAQWX/SfYpbuiD37Azz6Pd3h/XgX4 EcqHjhtjojtWzbZePQGtLYtNK3qVeBffUBoKYCAFOx2DTOXWAEcldxbgqQ6gUcOBJAc10c gQouJ2CtSzGT+r/iqVMBbmQQdLU5r0jOYrcTseIGPVBbb38HHreFMFVkCKgpoQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749752245; a=rsa-sha256; cv=none; b=VxgArfhZotirhqQZJYjAGJgvRE7WQm6jbYyX8iMIeyU8Mh9onM7Fdo5pHk0MgGoPYckv6q bqRzkxsIg8UYGT4jAQ0C+Ng24PA1lESyiJV7xFHwYTwo5EBSmyS6XaokZxeAENqO7ZA51A 9QOvusnZ2cjV4/pa8G6+s8k/P/WLd+CnodWsyt9Lm4hNHXM/QJyeTFsI4vg/BKOL4hSQ2w e5qD69eq78DWUvAJS8ADTSjuDEGF1ONalAQyHyY/81Lf2ISbIEVAzCMUW8jfOrRsAvfKQN t/3R35osqcq3pu2tF+aDCwIfT5ckm/vczJZOjD7WQI3L/gwZNdSdjcNi/NYaSQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJ9jd3hJhz7gf; Thu, 12 Jun 2025 18:17:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55CIHPnA087710; Thu, 12 Jun 2025 18:17:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55CIHPIB087707; Thu, 12 Jun 2025 18:17:25 GMT (envelope-from git) Date: Thu, 12 Jun 2025 18:17:25 GMT Message-Id: <202506121817.55CIHPIB087707@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hiroki Sato Subject: git: b60053fde172 - main - libcasper: Fix inconsistent error codes of cap_get{addr,name}info() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hrs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b60053fde1726ea047aadfbc0354b79e99d4a668 Auto-Submitted: auto-generated The branch main has been updated by hrs: URL: https://cgit.FreeBSD.org/src/commit/?id=b60053fde1726ea047aadfbc0354b79e99d4a668 commit b60053fde1726ea047aadfbc0354b79e99d4a668 Author: Hiroki Sato AuthorDate: 2025-06-12 18:16:18 +0000 Commit: Hiroki Sato CommitDate: 2025-06-12 18:16:49 +0000 libcasper: Fix inconsistent error codes of cap_get{addr,name}info() The get{addr,name}info(3) API is designed to return an API-specific error code that is independent of errno. The cap_get{addr,name}info() functions returned either an errno or API-specific error code inconsistently. This change fixes this mismatch. When the API returns an errno, the return value itself is set to EAI_SYSTEM and errno is set depending on the actual error. So, usually this API is called in the following form: error = getnameinfo(...); if (error == EAI_SYSTEM) perror("getnameinfo"); else if (error) errx(1, "getnameinfo: %s", gai_strerror(error); If the above getnameinfo() call is replaced with cap_getnameinfo(), it breaks the error handling. For example, the cap_get{addr,name}info() functions can return ENOTCAPABLE. This change simply adds "errno", in addition to "error", to the nvlout and cap_get{addr,name}info() restores the errno if the error code is EAI_SYSTEM. Reviewed by: oshogbo Differential Revision: https://reviews.freebsd.org/D45859 --- lib/libcasper/services/cap_net/cap_net.c | 55 ++++++++++++++++++++++---------- 1 file changed, 39 insertions(+), 16 deletions(-) diff --git a/lib/libcasper/services/cap_net/cap_net.c b/lib/libcasper/services/cap_net/cap_net.c index 40d18319ae28..5887fe3c407e 100644 --- a/lib/libcasper/services/cap_net/cap_net.c +++ b/lib/libcasper/services/cap_net/cap_net.c @@ -288,7 +288,7 @@ cap_getaddrinfo(cap_channel_t *chan, const char *hostname, const char *servname, const nvlist_t *nvlai; char nvlname[64]; nvlist_t *nvl; - int error, n; + int error, serrno, n; nvl = nvlist_create(0); nvlist_add_string(nvl, "cmd", "getaddrinfo"); @@ -311,7 +311,9 @@ cap_getaddrinfo(cap_channel_t *chan, const char *hostname, const char *servname, return (EAI_MEMORY); if (nvlist_get_number(nvl, "error") != 0) { error = (int)nvlist_get_number(nvl, "error"); + serrno = dnvlist_get_number(nvl, "errno", 0); nvlist_destroy(nvl); + errno = (error == EAI_SYSTEM) ? serrno : 0; return (error); } @@ -350,7 +352,7 @@ cap_getnameinfo(cap_channel_t *chan, const struct sockaddr *sa, socklen_t salen, char *host, size_t hostlen, char *serv, size_t servlen, int flags) { nvlist_t *nvl; - int error; + int error, serrno; nvl = nvlist_create(0); nvlist_add_string(nvl, "cmd", "getnameinfo"); @@ -363,7 +365,9 @@ cap_getnameinfo(cap_channel_t *chan, const struct sockaddr *sa, socklen_t salen, return (EAI_MEMORY); if (nvlist_get_number(nvl, "error") != 0) { error = (int)nvlist_get_number(nvl, "error"); + serrno = dnvlist_get_number(nvl, "errno", 0); nvlist_destroy(nvl); + errno = (error == EAI_SYSTEM) ? serrno : 0; return (error); } @@ -858,19 +862,21 @@ net_getnameinfo(const nvlist_t *limits, const nvlist_t *nvlin, nvlist_t *nvlout) char *host, *serv; size_t sabinsize, hostlen, servlen; socklen_t salen; - int error, flags; + int error, serrno, flags; const nvlist_t *funclimit; - if (!net_allowed_mode(limits, CAPNET_ADDR2NAME)) - return (ENOTCAPABLE); + host = serv = NULL; + if (!net_allowed_mode(limits, CAPNET_ADDR2NAME)) { + serrno = ENOTCAPABLE; + error = EAI_SYSTEM; + goto out; + } funclimit = NULL; if (limits != NULL) { funclimit = dnvlist_get_nvlist(limits, LIMIT_NV_ADDR2NAME, NULL); } - error = 0; - host = serv = NULL; memset(&sast, 0, sizeof(sast)); hostlen = (size_t)nvlist_get_number(nvlin, "hostlen"); @@ -897,7 +903,8 @@ net_getnameinfo(const nvlist_t *limits, const nvlist_t *nvlin, nvlist_t *nvlout) goto out; } if (!net_allowed_bsaddr(funclimit, sabin, sabinsize)) { - error = ENOTCAPABLE; + serrno = ENOTCAPABLE; + error = EAI_SYSTEM; goto out; } @@ -913,7 +920,8 @@ net_getnameinfo(const nvlist_t *limits, const nvlist_t *nvlin, nvlist_t *nvlout) } if (!net_allowed_family(funclimit, (int)sast.ss_family)) { - error = ENOTCAPABLE; + serrno = ENOTCAPABLE; + error = EAI_SYSTEM; goto out; } @@ -921,6 +929,7 @@ net_getnameinfo(const nvlist_t *limits, const nvlist_t *nvlin, nvlist_t *nvlout) error = getnameinfo((struct sockaddr *)&sast, salen, host, hostlen, serv, servlen, flags); + serrno = errno; if (error != 0) goto out; @@ -932,6 +941,8 @@ out: if (error != 0) { free(host); free(serv); + if (error == EAI_SYSTEM) + nvlist_add_number(nvlout, "errno", serrno); } return (error); } @@ -961,12 +972,15 @@ net_getaddrinfo(const nvlist_t *limits, const nvlist_t *nvlin, nvlist_t *nvlout) char nvlname[64]; nvlist_t *elem; unsigned int ii; - int error, family, n; + int error, serrno, family, n; const nvlist_t *funclimit; bool dnscache; - if (!net_allowed_mode(limits, CAPNET_NAME2ADDR)) - return (ENOTCAPABLE); + if (!net_allowed_mode(limits, CAPNET_NAME2ADDR)) { + serrno = ENOTCAPABLE; + error = EAI_SYSTEM; + goto out; + } dnscache = net_allowed_mode(limits, CAPNET_CONNECTDNS); funclimit = NULL; if (limits != NULL) { @@ -996,11 +1010,18 @@ net_getaddrinfo(const nvlist_t *limits, const nvlist_t *nvlin, nvlist_t *nvlout) family = AF_UNSPEC; } - if (!net_allowed_family(funclimit, family)) - return (ENOTCAPABLE); - if (!net_allowed_hosts(funclimit, hostname, servname)) - return (ENOTCAPABLE); + if (!net_allowed_family(funclimit, family)) { + errno = ENOTCAPABLE; + error = EAI_SYSTEM; + goto out; + } + if (!net_allowed_hosts(funclimit, hostname, servname)) { + errno = ENOTCAPABLE; + error = EAI_SYSTEM; + goto out; + } error = getaddrinfo(hostname, servname, hintsp, &res); + serrno = errno; if (error != 0) { goto out; } @@ -1019,6 +1040,8 @@ net_getaddrinfo(const nvlist_t *limits, const nvlist_t *nvlin, nvlist_t *nvlout) freeaddrinfo(res); error = 0; out: + if (error == EAI_SYSTEM) + nvlist_add_number(nvlout, "errno", serrno); return (error); } From nobody Thu Jun 12 18:20:26 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJ9n64vC0z5yC71; Thu, 12 Jun 2025 18:20:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJ9n63fdMz3TnF; Thu, 12 Jun 2025 18:20:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749752426; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Jn+JdyEtB1R7MCsf9RyGOcy5W9EW/8L5x2ExHI5vEbs=; b=TFNoMkr0Smwcm/ZYoSO15BJ6qjnSDoySGqm2RMPVn+DpykHZ73TH8lJocSvKhOTkGQxHic hvm7FHcZKV7LL7LmYKkTyJzna928TsnVJGHSNuaNK/s4Zu8WF3MpaWHunjwIMUs8jBlwOJ yyMuoLNWsGnVsxMHiweTtRqlgEDVTdo/iPfl2jhbn80rXfMM2+kqlYknxEvLo8A52KXNT6 FGeYHBwSHezvo8gDzCtzM2Uo+ZGsfdbYXXhZsJB3XDM617NIc3REzY3cEwEZ0p1/Gc/6z7 Hh1zPfK7L1RZqd6s5zMg2DugxM3qiLBNssvMlTHaho4yO/BaoNbZI+pHWa5M1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749752426; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Jn+JdyEtB1R7MCsf9RyGOcy5W9EW/8L5x2ExHI5vEbs=; b=FUg2ewbuOHSNbi8uV1JAd42UBKlBv7MoNOjzX0jCtqwjpJ+/aGMJo/mq0HVSG/3o1c76cs ux6kkyN5E8wiXruyXUQEZ9XCK62WwmO4fIJ9mkTrD139T7YyROQLHipdVggWvrFRhjQldl JDh01D6ueac6Wp05VtpB4XVgewdAYQDn3+p1aK3txp6LYplFVkm18ixaHMbYrSb9D32xA1 k/onFv1V4vEcEqIRTalFY5LnTWI5ikL0xHWV5GyOhvHFkF5o8kmMUxFESmqxVbHYww/adJ gghfvtWKPRJjlHuDXEU2gP2hlx/g3APVj9Lw41uiqf+PqAQX2I7I0A/4yO0Rmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749752426; a=rsa-sha256; cv=none; b=LYSlC87eIMiIRJ9tyi4RP8v+Q4/Nx7xkEdbyJqTERPDKNVi+RxsDyvtas71UK6LTqbyhsb 2EjIi9BukGHZLE26sDKsbUj48hfK6W5eG/XB/NrZYXjMrlXjqtNJ9xScPg2jgN6xcDL59P DWSSQqLc6ljAdXy6s28karQ6QLXuGp0c/a/dggO+sYmej0sx9JBF/MLbO2+NWH5B+AoTKO SpJqFhokZhfSYdPG5VNkeOXkGOWpjOjT8XkIvoT7fXvy9/aA1CZx8RUMOuZsG7LefUOwkW meaplr2C2oOnMaZYO/og7wYK8luQqptMEPM/zAAMEZsyOOQtFN8LjeYIIgGC2w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJ9n62Wnzz7Xq; Thu, 12 Jun 2025 18:20:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55CIKQ8h097368; Thu, 12 Jun 2025 18:20:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55CIKQTQ097365; Thu, 12 Jun 2025 18:20:26 GMT (envelope-from git) Date: Thu, 12 Jun 2025 18:20:26 GMT Message-Id: <202506121820.55CIKQTQ097365@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hiroki Sato Subject: git: 4deb9760a9d8 - main - rc: Disable pathname expansion when calling run_rc_command() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hrs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4deb9760a9d84d5861ee45162ffebe83f13503b8 Auto-Submitted: auto-generated The branch main has been updated by hrs: URL: https://cgit.FreeBSD.org/src/commit/?id=4deb9760a9d84d5861ee45162ffebe83f13503b8 commit 4deb9760a9d84d5861ee45162ffebe83f13503b8 Author: Hiroki Sato AuthorDate: 2025-06-12 18:19:32 +0000 Commit: Hiroki Sato CommitDate: 2025-06-12 18:19:32 +0000 rc: Disable pathname expansion when calling run_rc_command() Variables for command-line options like $foo_flags can contain characters that perform pathname expansions, such as '[', ']', and '*'. They were passed without escaping, and the matched entries in the working directory affected the command-line options. This change turns off the expansion when run_rc_command() is called. While this changes the current behavior, an invocation of a service program should not depend on entries in the working directory. Differential Revision: https://reviews.freebsd.org/D45855 --- libexec/rc/rc.subr | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libexec/rc/rc.subr b/libexec/rc/rc.subr index 2eaf336b5220..359eebd1d342 100644 --- a/libexec/rc/rc.subr +++ b/libexec/rc/rc.subr @@ -1788,7 +1788,11 @@ _run_rc_doit() debug "run_rc_command: doit: $*" _m=$(umask) ${_umask:+umask ${_umask}} + + # Disable pathname expansion temporarily for run_rc_command. + set -o noglob eval "$@" + set +o noglob _return=$? umask ${_m} From nobody Thu Jun 12 18:25:40 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJ9v84CVQz5yCXt; Thu, 12 Jun 2025 18:25:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJ9v83zzqz3Xt9; Thu, 12 Jun 2025 18:25:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749752740; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xFY+y3WVcfh+ipc7lh9T6G5EZey4PxFAH0TwMcohJV0=; b=BNb8I81ndTissNH+qJ60g0eEHRetlBlPqu14MicTA1JlNx38g0FmB3HDMaR8AFjAi3KVOk RJrGKLKNJEtAFwr5AHgNVLNyqpnehl9CJWKPqu8JdDUiosKxBEi8g0tx/RY8EFfBjqXDSh H4LTfMFgZw5tDQpYFHlEiehe7JKYmbpRgnufphv5vnJYKErvCwHhMbZvLjQbrpCa3XWblk eew9KpEHTgKifhJG/feRt+oI3EfUm36DP6ph/JMHOBRffDmS/nICbUUlGIkHPLwZbAo9m3 HWbg9lpur+kDsbrU8CN/po0hp6GUzxnv8YWfuFzEpHba0JMK90bUwNWYxlZyIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749752740; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xFY+y3WVcfh+ipc7lh9T6G5EZey4PxFAH0TwMcohJV0=; b=FM3FmhJgGO7X1dTlnSFwNgbEc2Pudon41cjsz6z0iqTPnGZvxkS0AlBHC4t68Evic9kGo+ c8tNK7uB1ReMTgDpgwqQRaaHqKURyRLDAegDPW3hQBsAd/MGmUTX20Aq0W4+9kwy6/1Dj0 Moxg80/qojcbK+ztmk+CRjMobrs24PdrAoXtKgG4C4ReAjeoh2/jM+OFjPfAEqj9mq3am/ 3iSXi4Pm+UkVxRk1+4fzVNB68KkhquPI75MNtYv7w60P0yRgpY7o97BLW1hPq5EScK7dw/ SjVMI6KRR6eEvJ4Okr3vmXNzLq/1NrpipWpkJBoIBZ3KJk4FOviGhQOGF6gc4Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749752740; a=rsa-sha256; cv=none; b=wlCTSV0q5V5lb1JyzZGZZYq93fwHmj6cWaEJ646oLiac6yCMRHAcTTIfsAXpDmUFyT0MEO 7yJmW4oGBBTTzbTTUwlb+c7kfXv+OClp2qztzoU8m6tWMBsK23yt0yTxQzVpy77yp0nBbA J4IrO+c31tSlWz/clrPsFtkHvbOQwRTHwXd80UjI7Hi/FIq00TfbFHCnvkzbs5uI1szVjM E2F+iwlbEt4Dot4Cd32iEEhdljtxdxZVAPS1hj54+68Zuhf2dPEMCAqZCcV4/jLa0HtPnJ r/lRXLo0Wiaf9zlJTfe9RMawR3t7BI2nn9mkZtHTtr2JGCKgV1e+r1SURnx53g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJ9v83ZPmz848; Thu, 12 Jun 2025 18:25:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55CIPe5e006359; Thu, 12 Jun 2025 18:25:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55CIPemP006355; Thu, 12 Jun 2025 18:25:40 GMT (envelope-from git) Date: Thu, 12 Jun 2025 18:25:40 GMT Message-Id: <202506121825.55CIPemP006355@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 7b7ba7857ce8 - main - Implement CLOCK_TAI List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7b7ba7857ce8be0bf6ab905d936d8ba1363e4ec2 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=7b7ba7857ce8be0bf6ab905d936d8ba1363e4ec2 commit 7b7ba7857ce8be0bf6ab905d936d8ba1363e4ec2 Author: Nathan Whitehorn AuthorDate: 2025-06-12 17:52:30 +0000 Commit: Warner Losh CommitDate: 2025-06-12 18:25:31 +0000 Implement CLOCK_TAI Provide a clock through clock_gettime() that returns the current TAI time (UTC without leap seconds) as a complement to CLOCK_REALTIME. This provides compatibility with Linux, which also provides a CLOCK_TAI since kernel 2.6.26, and this seems to be becoming the standard way to acquire TAI time. Unlike Linux, this code will return EINVAL if the TAI offset (set by ntpd, ptpd, etc.) is not known since it seems pathological for CLOCK_TAI to silently give the wrong (UTC) time if the offset is not known as it does on Linux. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D46268 --- lib/libsys/_umtx_op.2 | 2 ++ lib/libsys/clock_gettime.2 | 14 ++++++++++-- lib/libsys/nanosleep.2 | 4 +++- lib/libsys/timer_create.2 | 3 ++- lib/libthr/thread/thr_condattr.c | 1 + share/man/man3/pthread_condattr.3 | 3 ++- sys/kern/kern_ntptime.c | 3 ++- sys/kern/kern_tc.c | 10 ++++++++- sys/kern/kern_time.c | 46 ++++++++++++++++++++++++++------------- sys/kern/kern_umtx.c | 7 ++++-- sys/sys/_clock_id.h | 4 ++++ sys/sys/timeffc.h | 4 +++- sys/sys/timex.h | 2 +- 13 files changed, 77 insertions(+), 26 deletions(-) diff --git a/lib/libsys/_umtx_op.2 b/lib/libsys/_umtx_op.2 index 974850fb8425..c590f8e8e0c8 100644 --- a/lib/libsys/_umtx_op.2 +++ b/lib/libsys/_umtx_op.2 @@ -210,6 +210,8 @@ Valid clock identifiers are a subset of those for .It .Dv CLOCK_SECOND .It +.Dv CLOCK_TAI +.It .Dv CLOCK_UPTIME .It .Dv CLOCK_UPTIME_FAST diff --git a/lib/libsys/clock_gettime.2 b/lib/libsys/clock_gettime.2 index fcdc5be498f2..1dcfd9d1faf7 100644 --- a/lib/libsys/clock_gettime.2 +++ b/lib/libsys/clock_gettime.2 @@ -27,7 +27,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 28, 2024 +.Dd August 10, 2024 .Dt CLOCK_GETTIME 2 .Os .Sh NAME @@ -99,11 +99,20 @@ query, using an in-kernel cached value of the current second. Returns the execution time of the calling process. .It Dv CLOCK_THREAD_CPUTIME_ID Returns the execution time of the calling thread. +.It Dv CLOCK_TAI +Increments in SI seconds like a wall clock. +It uses a 1970 epoch and implements the TAI timescale. +Similar to CLOCK_REALTIME, but without leap seconds. +It will increase monotonically during a leap second. +Will return EINVAL if the current offset between TAI and UTC is not known, +which may be the case early in boot before NTP or other time daemon has +synchronized. .El .Pp The clock IDs .Dv CLOCK_BOOTTIME , .Dv CLOCK_REALTIME , +.Dv CLOCK_TAI , .Dv CLOCK_MONOTONIC , and .Dv CLOCK_UPTIME @@ -202,7 +211,8 @@ The clock IDs .Dv CLOCK_MONOTONIC_PRECISE , .Dv CLOCK_REALTIME_FAST , .Dv CLOCK_REALTIME_PRECISE , -.Dv CLOCK_SECOND +.Dv CLOCK_SECOND , +.Dv CLOCK_TAI , .Dv CLOCK_UPTIME , .Dv CLOCK_UPTIME_FAST , and diff --git a/lib/libsys/nanosleep.2 b/lib/libsys/nanosleep.2 index ba9aae1edf57..290565dbd6e1 100644 --- a/lib/libsys/nanosleep.2 +++ b/lib/libsys/nanosleep.2 @@ -27,7 +27,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 29, 2025 +.Dd May 3, 2025 .Dt NANOSLEEP 2 .Os .Sh NAME @@ -116,6 +116,8 @@ CLOCK_REALTIME_PRECISE .It CLOCK_SECOND .It +CLOCK_TAI +.It CLOCK_UPTIME .It CLOCK_UPTIME_FAST diff --git a/lib/libsys/timer_create.2 b/lib/libsys/timer_create.2 index e8489b390845..8f6ff2e27c51 100644 --- a/lib/libsys/timer_create.2 +++ b/lib/libsys/timer_create.2 @@ -126,7 +126,8 @@ the value of the timer ID. This implementation supports a .Fa clock_id of -.Dv CLOCK_REALTIME +.Dv CLOCK_REALTIME , +.Dv CLOCK_TAI , or .Dv CLOCK_MONOTONIC . .Pp diff --git a/lib/libthr/thread/thr_condattr.c b/lib/libthr/thread/thr_condattr.c index 0dc3e52bab5e..dc56363fc084 100644 --- a/lib/libthr/thread/thr_condattr.c +++ b/lib/libthr/thread/thr_condattr.c @@ -94,6 +94,7 @@ _pthread_condattr_setclock(pthread_condattr_t *attr, clockid_t clock_id) if (attr == NULL || *attr == NULL) return (EINVAL); if (clock_id != CLOCK_REALTIME && + clock_id != CLOCK_TAI && clock_id != CLOCK_VIRTUAL && clock_id != CLOCK_PROF && clock_id != CLOCK_MONOTONIC) { diff --git a/share/man/man3/pthread_condattr.3 b/share/man/man3/pthread_condattr.3 index 96d30263d7f2..33ad904f9a3d 100644 --- a/share/man/man3/pthread_condattr.3 +++ b/share/man/man3/pthread_condattr.3 @@ -85,7 +85,8 @@ in .Xr pthread_cond_timedwait 3 and may be set to .Dv CLOCK_REALTIME -(default) +(default), +.Dv CLOCK_TAI , or .Dv CLOCK_MONOTONIC . .Pp diff --git a/sys/kern/kern_ntptime.c b/sys/kern/kern_ntptime.c index 65746021028b..892a6798ab1f 100644 --- a/sys/kern/kern_ntptime.c +++ b/sys/kern/kern_ntptime.c @@ -504,7 +504,7 @@ sys_ntp_adjtime(struct thread *td, struct ntp_adjtime_args *uap) * simulation. */ void -ntp_update_second(int64_t *adjustment, time_t *newsec) +ntp_update_second(int64_t *adjustment, time_t *newsec, long *tai_off) { int tickrate; l_fp ftemp; /* 32/64-bit temporary */ @@ -624,6 +624,7 @@ ntp_update_second(int64_t *adjustment, time_t *newsec) L_ADD(time_adj, ftemp); } *adjustment = time_adj; + *tai_off = time_tai; #ifdef PPS_SYNC if (pps_valid > 0) diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c index a797a101bf6f..e85812e415c7 100644 --- a/sys/kern/kern_tc.c +++ b/sys/kern/kern_tc.c @@ -72,6 +72,7 @@ struct timehands { uint64_t th_scale; u_int th_large_delta; u_int th_offset_count; + long th_tai_offset; struct bintime th_offset; struct bintime th_bintime; struct timeval th_microtime; @@ -1066,6 +1067,7 @@ sysclock_getsnapshot(struct sysclock_snap *clock_snap, int fast) th = timehands; gen = atomic_load_acq_int(&th->th_generation); fbi->th_scale = th->th_scale; + fbi->th_tai_offset = th->th_tai_offset; fbi->tick_time = th->th_offset; #ifdef FFCLOCK ffth = fftimehands; @@ -1139,6 +1141,11 @@ sysclock_snap2bintime(struct sysclock_snap *cs, struct bintime *bt, getboottimebin(&boottimebin); bintime_add(bt, &boottimebin); } + if (!(flags & FBCLOCK_LEAPSEC)) { + if (cs->fb_info.th_tai_offset == 0) + return (EINVAL); + bt->sec += cs->fb_info.th_tai_offset; + } break; #ifdef FFCLOCK case SYSCLOCK_FFWD: @@ -1433,7 +1440,8 @@ tc_windup(struct bintime *new_boottimebin) do { t = bt.sec; - ntp_update_second(&th->th_adjustment, &bt.sec); + ntp_update_second(&th->th_adjustment, &bt.sec, + &th->th_tai_offset); if (bt.sec != t) th->th_boottime.sec += bt.sec - t; --i; diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index 0c31c1563d99..5960136eb515 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -49,6 +49,7 @@ #include #include #include +#include #include #include #include @@ -60,7 +61,7 @@ #include #include -#define MAX_CLOCKS (CLOCK_MONOTONIC+1) +#define MAX_CLOCKS (CLOCK_TAI+1) #define CPUCLOCK_BIT 0x80000000 #define CPUCLOCK_PROCESS_BIT 0x40000000 #define CPUCLOCK_ID_MASK (~(CPUCLOCK_BIT|CPUCLOCK_PROCESS_BIT)) @@ -101,7 +102,6 @@ static int realtimer_gettime(struct itimer *, struct itimerspec *); static int realtimer_settime(struct itimer *, int, struct itimerspec *, struct itimerspec *); static int realtimer_delete(struct itimer *); -static void realtimer_clocktime(clockid_t, struct timespec *); static void realtimer_expire(void *); static void realtimer_expire_l(struct itimer *it, bool proc_locked); @@ -318,7 +318,10 @@ int kern_clock_gettime(struct thread *td, clockid_t clock_id, struct timespec *ats) { struct timeval sys, user; + struct sysclock_snap clk; + struct bintime bt; struct proc *p; + int err; p = td->td_proc; switch (clock_id) { @@ -329,6 +332,14 @@ kern_clock_gettime(struct thread *td, clockid_t clock_id, struct timespec *ats) case CLOCK_REALTIME_FAST: getnanotime(ats); break; + case CLOCK_TAI: + sysclock_getsnapshot(&clk, 0); + err = sysclock_snap2bintime(&clk, &bt, clk.sysclock_active, + (clk.sysclock_active == SYSCLOCK_FFWD) ? FFCLOCK_LERP : 0); + if (err) + return (err); + bintime2timespec(&bt, ats); + break; case CLOCK_VIRTUAL: PROC_LOCK(p); PROC_STATLOCK(p); @@ -451,6 +462,7 @@ kern_clock_getres(struct thread *td, clockid_t clock_id, struct timespec *ts) case CLOCK_REALTIME: case CLOCK_REALTIME_FAST: case CLOCK_REALTIME_PRECISE: + case CLOCK_TAI: case CLOCK_MONOTONIC: case CLOCK_MONOTONIC_FAST: case CLOCK_MONOTONIC_PRECISE: @@ -516,6 +528,7 @@ kern_clock_nanosleep(struct thread *td, clockid_t clock_id, int flags, return (EINVAL); switch (clock_id) { case CLOCK_REALTIME: + case CLOCK_TAI: precise = nanosleep_precise; is_abs_real = (flags & TIMER_ABSTIME) != 0; break; @@ -1167,6 +1180,7 @@ itimer_start(void) NULL, NULL, itimer_init, itimer_fini, UMA_ALIGN_PTR, 0); register_posix_clock(CLOCK_REALTIME, &rt_clock); register_posix_clock(CLOCK_MONOTONIC, &rt_clock); + register_posix_clock(CLOCK_TAI, &rt_clock); p31b_setcfg(CTL_P1003_1B_TIMERS, 200112L); p31b_setcfg(CTL_P1003_1B_DELAYTIMER_MAX, INT_MAX); p31b_setcfg(CTL_P1003_1B_TIMER_MAX, TIMER_MAX); @@ -1327,6 +1341,7 @@ kern_ktimer_create(struct thread *td, clockid_t clock_id, struct sigevent *evp, switch (clock_id) { default: case CLOCK_REALTIME: + case CLOCK_TAI: it->it_sigev.sigev_signo = SIGALRM; break; case CLOCK_VIRTUAL: @@ -1570,10 +1585,14 @@ static int realtimer_gettime(struct itimer *it, struct itimerspec *ovalue) { struct timespec cts; + int err; mtx_assert(&it->it_mtx, MA_OWNED); - realtimer_clocktime(it->it_clockid, &cts); + err = kern_clock_gettime(curthread, it->it_clockid, &cts); + if (err) + return (err); + *ovalue = it->it_time; if (ovalue->it_value.tv_sec != 0 || ovalue->it_value.tv_nsec != 0) { timespecsub(&ovalue->it_value, &cts, &ovalue->it_value); @@ -1594,6 +1613,7 @@ realtimer_settime(struct itimer *it, int flags, struct itimerspec *value, struct timespec cts, ts; struct timeval tv; struct itimerspec val; + int err; mtx_assert(&it->it_mtx, MA_OWNED); @@ -1613,7 +1633,10 @@ realtimer_settime(struct itimer *it, int flags, struct itimerspec *value, it->it_time = val; if (timespecisset(&val.it_value)) { - realtimer_clocktime(it->it_clockid, &cts); + err = kern_clock_gettime(curthread, it->it_clockid, &cts); + if (err) + return (err); + ts = val.it_value; if ((flags & TIMER_ABSTIME) == 0) { /* Convert to absolute time. */ @@ -1636,15 +1659,6 @@ realtimer_settime(struct itimer *it, int flags, struct itimerspec *value, return (0); } -static void -realtimer_clocktime(clockid_t id, struct timespec *ts) -{ - if (id == CLOCK_REALTIME) - getnanotime(ts); - else /* CLOCK_MONOTONIC */ - getnanouptime(ts); -} - int itimer_accept(struct proc *p, int timerid, ksiginfo_t *ksi) { @@ -1689,10 +1703,12 @@ realtimer_expire_l(struct itimer *it, bool proc_locked) struct timeval tv; struct proc *p; uint64_t interval, now, overruns, value; + int err; + + err = kern_clock_gettime(curthread, it->it_clockid, &cts); - realtimer_clocktime(it->it_clockid, &cts); /* Only fire if time is reached. */ - if (timespeccmp(&cts, &it->it_time.it_value, >=)) { + if (err == 0 && timespeccmp(&cts, &it->it_time.it_value, >=)) { if (timespecisset(&it->it_time.it_interval)) { timespecadd(&it->it_time.it_value, &it->it_time.it_interval, diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index dc6fee1f8f38..905ebd4f98ac 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -693,6 +693,7 @@ umtx_abs_timeout_init(struct umtx_abs_timeout *timo, int clockid, timo->is_abs_real = clockid == CLOCK_REALTIME || clockid == CLOCK_REALTIME_FAST || clockid == CLOCK_REALTIME_PRECISE || + clockid == CLOCK_TAI || clockid == CLOCK_SECOND; } } @@ -787,6 +788,7 @@ umtx_abs_timeout_getsbt(struct umtx_abs_timeout *timo, sbintime_t *sbt, case CLOCK_PROF: case CLOCK_THREAD_CPUTIME_ID: case CLOCK_PROCESS_CPUTIME_ID: + case CLOCK_TAI: /* Boot time is not necessarily stable in TAI */ default: kern_clock_gettime(curthread, timo->clockid, &timo->cur); if (timespeccmp(&timo->end, &timo->cur, <=)) @@ -2953,8 +2955,9 @@ do_cv_wait(struct thread *td, struct ucond *cv, struct umutex *m, umtx_key_release(&uq->uq_key); return (EFAULT); } - if (clockid < CLOCK_REALTIME || - clockid >= CLOCK_THREAD_CPUTIME_ID) { + if ((clockid < CLOCK_REALTIME || + clockid >= CLOCK_THREAD_CPUTIME_ID) && + clockid != CLOCK_TAI) { /* hmm, only HW clock id will work. */ umtx_key_release(&uq->uq_key); return (EINVAL); diff --git a/sys/sys/_clock_id.h b/sys/sys/_clock_id.h index 728346a0f0ab..83130d1f8a16 100644 --- a/sys/sys/_clock_id.h +++ b/sys/sys/_clock_id.h @@ -74,6 +74,10 @@ #define CLOCK_PROCESS_CPUTIME_ID 15 #endif /* __POSIX_VISIBLE >= 199309 */ +#ifdef __BSD_VISIBLE +#define CLOCK_TAI 16 +#endif + /* * Linux compatible names. */ diff --git a/sys/sys/timeffc.h b/sys/sys/timeffc.h index a83b62b1672c..8bec73ed48a4 100644 --- a/sys/sys/timeffc.h +++ b/sys/sys/timeffc.h @@ -89,7 +89,7 @@ extern int sysclock_active; * of the kernel tick timer (1/hz [s]). * FFCLOCK_LERP: Linear interpolation of ffclock time to guarantee * monotonic time. - * FFCLOCK_LEAPSEC: Include leap seconds. + * {FB|FF}CLOCK_LEAPSEC: Include leap seconds. * {FB|FF}CLOCK_UPTIME: Time stamp should be relative to system boot, not epoch. */ #define FFCLOCK_FAST 0x00000001 @@ -100,6 +100,7 @@ extern int sysclock_active; #define FBCLOCK_FAST 0x00010000 /* Currently unused. */ #define FBCLOCK_UPTIME 0x00020000 +#define FBCLOCK_LEAPSEC 0x00040000 #define FBCLOCK_MASK 0xffff0000 /* @@ -111,6 +112,7 @@ struct fbclock_info { struct bintime error; struct bintime tick_time; uint64_t th_scale; + long th_tai_offset; int status; }; diff --git a/sys/sys/timex.h b/sys/sys/timex.h index 072297375792..03632bdb119c 100644 --- a/sys/sys/timex.h +++ b/sys/sys/timex.h @@ -154,7 +154,7 @@ struct timex { #ifdef __FreeBSD__ #ifdef _KERNEL -void ntp_update_second(int64_t *adjustment, time_t *newsec); +void ntp_update_second(int64_t *adjustment, time_t *newsec, long *tai_off); #else /* !_KERNEL */ #include From nobody Thu Jun 12 18:47:47 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJBNg2HJsz5yF6C; Thu, 12 Jun 2025 18:47:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJBNg1Zr7z3ml5; Thu, 12 Jun 2025 18:47:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749754067; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JJv6XJI6jufcTw9qVkyI0lQbvgOnN2rtIv7S9ew2/hg=; b=IMgfU2oRMaxeWMQe50ddJpH2IibUWxIerj8K/mQdH8PpLR4Bq3giw2lFwBcNjkf05tNhxc 50bAS+C1vH7fV8nLLGBPtNQy6fomRllWscQBN7gzXYXxZE2N8/2uxiLhDMHVB8QDW6EuP6 vl3l6SKglBymPS6Kz2D8T0ja5P/nbdnGaNPOq1LNGTZPl1xLOkg824mpDjvm6XLj5ZDWdn 684+uWpCq7k8jA+MXf+NgztqoMxtsahYWnhocuQ67lg6nnZQp+xTBHOwfV/MIoVe3nhVin DgsXBtpjXqsMF/OJxq9UHFaegLStbOJTlTqWx1npAnCVw1mYOLjgdmtJdvrA6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749754067; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JJv6XJI6jufcTw9qVkyI0lQbvgOnN2rtIv7S9ew2/hg=; b=rE84zZTwbnDV5YPOR90yTEF8Y80e7XSeFzmCzvHnsAHl24Intr7IoN0x7KXwAA+QXv0t+u C/TAwU+iMcHHW6RXeGEzQ18fbdqI0CB9j6M6f2QNY1fz66kgXB9NPIliDx6RAqke3M8HxP 7qNfSwyYZfWPQKt86hUjQ/CJm4Oymcw0ZSQj22xXp8IYhmT1SeMAl8ZDK7uPfh++v0t0LK Fm5mEYNGVh5ZwZBm96Ez5FeNdzlTxHVlXs2ev/lWDOo5Y9kb0tkWhXUKNmhWb4pf7KQTJ7 OOf9yDdGJkO34uWhs5BAys3WKxB9eyNq3X8Y6EEbqsl0UTv7UvfpQlDLoPMaxw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749754067; a=rsa-sha256; cv=none; b=rCTIL2wx58nvNRmRdTUxQNtKTTaUsrHlygUWHOXaj55BwxWNl5LOppy26oEvknluM03zbD lc57wXVzG/wTnwRTJ8EKa9MkGFFMFLG/+lfGFUpXgy0A9VR3qc6c9Mpw7Jw7ojnWE6+tl1 TCdhwtkq7Lbpd6s65kxilcvpuodv18TSaP1BGp5viNqN9pSvS23hrMvuSxR8Bn5WreXMxc fel7L+9SVWve22U6MQV/sxZnn7h/SXsXNfTuU1Sw23aIMpU+XQjhCKlkdSm9HtKJ3TQnCG tgcthaJ7LNam7PCFZ/mTFhRp8uvVfUKE9Mz9Oy4AOr+HEy+q0IxbcXw+oM5duQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJBNg19rPz8Qs; Thu, 12 Jun 2025 18:47:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55CIllnX043489; Thu, 12 Jun 2025 18:47:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55CIllvW043486; Thu, 12 Jun 2025 18:47:47 GMT (envelope-from git) Date: Thu, 12 Jun 2025 18:47:47 GMT Message-Id: <202506121847.55CIllvW043486@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hiroki Sato Subject: git: 0c891822310c - main - netinet6: Remove ndpr_raf_ra_derived flag List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hrs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0c891822310cebd11c22bb59391f85bc53c94fa3 Auto-Submitted: auto-generated The branch main has been updated by hrs: URL: https://cgit.FreeBSD.org/src/commit/?id=0c891822310cebd11c22bb59391f85bc53c94fa3 commit 0c891822310cebd11c22bb59391f85bc53c94fa3 Author: Hiroki Sato AuthorDate: 2025-06-12 18:46:46 +0000 Commit: Hiroki Sato CommitDate: 2025-06-12 18:47:06 +0000 netinet6: Remove ndpr_raf_ra_derived flag This flag was introduced at 8036234c72c9361711e867cc1a0c6a7fe0babd84 to prevent the SIOCSPFXFLUSH_IN6 ioctl from removing manually-added entries. However, this flag did actually not work due to an incomplete implementation making prelist_update() not handle it before calling nd6_prelist_add(). This patch removes the flag because a prefix is derived from an RA always has an entry in the ndpr_advrtrs member in the struct nd_prefix. Having a separate flag is not a good idea because it can cause a mismatch between the flag and the ndpr_advrtrs entry. Testing using LIST_EMPTY() is simpler for the origial goal. This also removes in a prefix check in the ICMPV6CTL_ND6_PRLIST sysctl to exclude manually-added entries. This ioctl is designed to list all entries, and there is no relationship to SIOCSPFXFLUSH_IN6. Differential Revision: https://reviews.freebsd.org/D46441 --- sys/netinet6/in6_var.h | 4 +--- sys/netinet6/nd6.c | 8 +++----- sys/netinet6/nd6.h | 1 - sys/netinet6/nd6_rtr.c | 1 - 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/sys/netinet6/in6_var.h b/sys/netinet6/in6_var.h index 918a3abe426e..e5ab83e6a2a1 100644 --- a/sys/netinet6/in6_var.h +++ b/sys/netinet6/in6_var.h @@ -323,8 +323,7 @@ struct in6_prflags { struct prf_ra { u_char onlink : 1; u_char autonomous : 1; - u_char ra_derived: 1; - u_char reserved : 5; + u_char reserved : 6; } prf_ra; u_char prf_reserved1; u_short prf_reserved2; @@ -355,7 +354,6 @@ struct in6_prefixreq { #define ipr_raf_onlink ipr_flags.prf_ra.onlink #define ipr_raf_auto ipr_flags.prf_ra.autonomous -#define ipr_raf_ra_derived ipr_flags.prf_ra.ra_derived #define ipr_statef_onlink ipr_flags.prf_state.onlink diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 6ec5a8b54cf4..8480e7fc90e3 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -84,11 +84,11 @@ #include +#define ND6_PREFIX_WITH_ROUTER(pr) !LIST_EMPTY(&(pr)->ndpr_advrtrs) + #define ND6_SLOWTIMER_INTERVAL (60 * 60) /* 1 hour */ #define ND6_RECALC_REACHTM_INTERVAL (60 * 120) /* 2 hours */ -#define SIN6(s) ((const struct sockaddr_in6 *)(s)) - MALLOC_DEFINE(M_IP6NDP, "ip6ndp", "IPv6 Neighbor Discovery"); VNET_DEFINE_STATIC(int, nd6_prune) = 1; @@ -1796,7 +1796,7 @@ nd6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp) ND6_WLOCK(); LIST_FOREACH_SAFE(pr, &V_nd_prefix, ndpr_entry, next) { - if (pr->ndpr_raf_ra_derived) + if (ND6_PREFIX_WITH_ROUTER(pr)) nd6_prefix_unlink(pr, &prl); } ND6_WUNLOCK(); @@ -2675,8 +2675,6 @@ nd6_sysctl_prlist(SYSCTL_HANDLER_ARGS) ND6_RLOCK(); LIST_FOREACH(pr, &V_nd_prefix, ndpr_entry) { - if (!pr->ndpr_raf_ra_derived) - continue; p.prefix = pr->ndpr_prefix; if (sa6_recoverscope(&p.prefix)) { log(LOG_ERR, "scope error in prefix list (%s)\n", diff --git a/sys/netinet6/nd6.h b/sys/netinet6/nd6.h index 1db1b666c60b..d0cbacff29d2 100644 --- a/sys/netinet6/nd6.h +++ b/sys/netinet6/nd6.h @@ -242,7 +242,6 @@ struct nd_prefix { #define ndpr_raf ndpr_flags #define ndpr_raf_onlink ndpr_flags.onlink #define ndpr_raf_auto ndpr_flags.autonomous -#define ndpr_raf_ra_derived ndpr_flags.ra_derived #define ndpr_raf_router ndpr_flags.router struct nd_pfxrouter { diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index c145af7d3ffc..927c7895305a 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -520,7 +520,6 @@ nd6_ra_input(struct mbuf *m, int off, int icmp6len) ND_OPT_PI_FLAG_ONLINK) ? 1 : 0; pr.ndpr_raf_auto = (pi->nd_opt_pi_flags_reserved & ND_OPT_PI_FLAG_AUTO) ? 1 : 0; - pr.ndpr_raf_ra_derived = 1; pr.ndpr_plen = pi->nd_opt_pi_prefix_len; pr.ndpr_vltime = ntohl(pi->nd_opt_pi_valid_time); pr.ndpr_pltime = ntohl(pi->nd_opt_pi_preferred_time); From nobody Thu Jun 12 19:22:52 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJC9Y1PZWz5yHj8 for ; Thu, 12 Jun 2025 19:23:13 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic308-55.consmr.mail.gq1.yahoo.com (sonic308-55.consmr.mail.gq1.yahoo.com [98.137.68.31]) (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 4bJC9W5zFlz3DX0 for ; Thu, 12 Jun 2025 19:23:11 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=gOeaKXg0; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.68.31 as permitted sender) smtp.mailfrom=marklmi@yahoo.com; dmarc=pass (policy=reject) header.from=yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1749756185; bh=2mk3nTNJUiLPB2opSTlIOOEn/GLa6PayeUvFCrPtdeI=; h=From:Subject:Date:To:References:From:Subject:Reply-To; b=gOeaKXg0aUwNTd/2njjiGQxO9afWQcHhDnUvLYtLV0SqeCKRt/dwAxmsuCyck51Hr63pWlDsZuIsV5/5KWwfHQCZNQCTIkikQJPLzdyJzUKhJe28LPCYfl/UnuvFb2JQu3fErzEHyUnS4wookY8vQoRUJWanFmA5xmqpayTDfpSRh4JTiGfTKuTKHuCztxxV2sxdmySVCxN4WMikOPEQkQgA11wPSRphstw994AmpzNdT8ipNVU+kxfdg1seeyhvoxf90XthmdNOR0vT/DLz8VhtP06pfc8PBIX800kpAqmyuTyM7XhOzZG/zvbiMLV1TET/R+nD0FBOEyoiE9YqOA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1749756185; bh=7WmObBsSe2j3fFxBklIPYun/JujToXQJ0YjB6EEMY6X=; h=X-Sonic-MF:From:Subject:Date:To:From:Subject; b=uByFtXx155cJm7o93o69TPgobILI5iPM4KHf3q3oubBRafX9ppmFlzPT9Wo635LMJUQz+V3FFljwYz128k7QjUAz8oK2s4CYDUQEvfdQw+NwArTWh3yvr3xW5oS95h9FSgqygW92dsU3sPMHdZ5r4ZRhZJll9onhJtmdDnS61tWX8weX+9KvJDWrAiOFl4IgtR4Dj7PCaP3U0sR9oRPD8UPlTDQ8jMgM2GW5TAbXmGZFMQcLr7Ch7EgrWLQ+zKu6f2n9ue0kSPT51hjqwo7S4w18MqRP4IlZNcObMpqjvSgPGk/9KDTiWgkModolN0RVSgxIRfXPd+1Kqj3d0CSAjQ== X-YMail-OSG: 5eDoj8gVM1n1At329cw4AjqZkLkcXnrGWYdaPImG0JxTDyQk26rKC6d5fAs_oYT C7qi0cAn.7jOu8caGHWbzBfTYNU5gTLkQWMU_4q7SocQHqfkSVbzPHPFKiFucnq0F2A7_FmBFdIW 0DPFp6O4x0Gh3H6ySPaP7_N5q5bnpwP7vILVEB2IRoQzgu8EDDW7L9vlOJcaRUZQhZjpE3sSdpaY qTAnQvdvscE7ehP3vELlz6OL5is.hL_nJgt4Dajedm2tXgg0bYRR_4rP19s_XAFeYlKpJkOCQQEQ .ahUAe3rbny1wqzaoOMjOeghwSxRK1GSkS7n32sOiEjw_XdM.q72wJFO_6INH2XR_hit042lgWUo WNDqdBt3ZQ3y8GY6xaNHoNRfCdpPVDJMfaVsbVyU0616YcXoJzasw9p_bPXuikfGJIdCOrcz3jHt NXbqz.tUQV0yLRjT1oXq48_v46VOsPxJ14Dd5rbtFjxb_yochTdrXnhuhLbnWZwNXVl9CR1DxN5J KuYVpLvDWTbxjxgqCoYxdZ6nTMT9Es685xDHy9Fs3Kx15IGLphCb8RjCb09opEFBi3e0Rx7ppUKe A.lCafdP_TuZaosjfT5wCJXLlLgIS6UBRn9ESEaMRpregxLhwn2N9tYyD37DEGs4Ss.7gZdEXxcS 2KyNjRtmsMpiLKQ9MU52p839RY_m26LHA9elgfJMxD8Sx_ON_ijNyrYYc1v._BtAO4zxYFFU3hBo YC92zAslkWrxdSbCFB5TYWj9kTN41nZxnPGwDAgHiorIlPSFro4eNWbV4BVn9YBBZR1P3wSBMj8w ICmSEgmdp59XOymxUyh_d3z7cHkH0RTveVO74L9Y6nPcVQjvpOMNM6qfGRp2CCx8c9zvi2GmyNn1 BG0Qopp93wO2p.C1yBkrXcq2Lh3Vj8ARA1tZERx5loIGSuc0GIJKIVIQFvDV6kckJbBZR5x_ZnqZ .6Vh3llgJhJEyVQIi_hbwtn.SJyfPCccLFpSUWDUkXSP815x2TxliDlG4MVYWHLRpH6KHyGOVTvP 6wf.1RfBOrsrRr95m8KHMDYltzLTpO5KnyIMQIHwOOmPHBAEW8cB0DhQrWL8SHh6ujEck5WnufOf LMyDJtOEFgjOw338Aaf740fwS_c_.tnHG8Ne27gNk1_hlky15kmtFDLDPolgKwoX3az3QT8M.xzH elg6QY.qA3svQWIovy_E4GG_bzGfnOTRz5ONy8FesRmX7Uaxcv5183GrJlfWvb96m1r_PA0Y3pfM rZc3xb1GI9JCljCBlthIAMEq5WydIYhT9nZXulM0XzIc4_xiW0zt_oZb.NKz1THVHrdoqUqhGEqg PXwMSqoBbaee6cOqHHO3lY6OFJig9nFDGpsaSWl._2VTB5D6MQKgY7dm0zZq6EMov4uTdRPp528s bPbAloDfOl4LxfNyVa9Fl_wPjoOi4ZqZ.kCayUcLRpCM1g01a2a6NQM73fHdLUCWqD3HgE1zxauV EnggUU3QHF4V0NEQ2INe5wL18HXtDVD4kuh9CVCZS4fnGdmXhZUEeK9qqQqqq7IBLOnDOVxBKs76 590JsP_TL.ULyQqU.MXjc2JI56TUEkFFLrEVFZhrC.MAfF8HYTCabYh2JA02hFXuN2TIVMBcHj68 baepKa.T0sH1ym3GqgnKlIN.ghQhxMZnN0x.CfHb2AdIDp.pn5bSm2veygma4GIuP8Eq.H80hIdm AvRzxAw5.6yy0Onstm4UCC__MgdjTrrDqo5D3ho5U0WNyfuTDkHZikVxeue5vsO3FT7njTS6vM_L Z5gv0RxqnVTHTpw_Dp.YCOBr9krrnd6vSZTmE4UuKF3CQsbbvRPClnMxaCaP9lt2iCaadNeYuACz XrpUqJEHqBs8MgYtD6XUMNmrXVHbb5_E6NKi_z_XfN4O6ak3bsmgtNBYmwdIC7Eg2oiNpSaJLiMr iQx3TjLJvExLzlX96F.CX8ckkE6Kg_cSpG2DEMJG2Vuf7_SMEQuPyOI25uExVMg3jVVvItG5qchi _ls9EW2enV7IJfNDS23OMOZjSMRKtyocnbtAQUow2YoTb5M2qqY0hKyHTSbHtPDEmIU089Nbx2Y8 T1Zw3FPwm8a1EkuI7ytF30ti46SKLFeVx3dotP5vuH.Hloxj_Xxinmyb_PTJrREpoMBpmypGBKOz CAIXKvB3cp.R8qHR14Nxx0CfnGgzccHJX5Q5oi.5PZWuMMtfn0d_ikZeMe3FRtpZIJsB8PreyTwj Kg1S2WhS5MGj06Qd2IzDxmi4izi6gyWoS2ozMDyhW8y6ZSwYSRkd9k3NLTY0fkBf4oOjfFEjXksp iAvgwIDpuKoKlYdoE9aI30A-- X-Sonic-MF: X-Sonic-ID: c0c03b1f-c9a1-4ee3-a9db-1adafc887a5a Received: from sonic.gate.mail.ne1.yahoo.com by sonic308.consmr.mail.gq1.yahoo.com with HTTP; Thu, 12 Jun 2025 19:23:05 +0000 Received: by hermes--production-gq1-74d64bb7d7-r5xbr (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 9d86ec8d8975c47f8b50c161281792d9; Thu, 12 Jun 2025 19:23:03 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.600.51.1.1\)) Subject: RE: git: 883596411327 - stable/14 - amd64: switch to amd64_set_tlsbase to set tls base [|| (. . . && osrel >= 1403502) test too?] Message-Id: <4C483AC0-4082-4EBB-AAC2-01610E0482B3@yahoo.com> Date: Thu, 12 Jun 2025 12:22:52 -0700 To: Konstantin Belousov , dev-commits-src-main@freebsd.org X-Mailer: Apple Mail (2.3826.600.51.1.1) References: <4C483AC0-4082-4EBB-AAC2-01610E0482B3.ref@yahoo.com> X-Spamd-Result: default: False [-1.65 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-0.79)[-0.789]; NEURAL_SPAM_SHORT(0.64)[0.637]; MV_CASE(0.50)[]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_FROM(0.00)[yahoo.com]; TO_DN_SOME(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; FROM_HAS_DN(0.00)[]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; RCVD_IN_DNSWL_NONE(0.00)[98.137.68.31:from]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.68.31:from]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; SUBJECT_HAS_QUESTION(0.00)[] X-Rspamd-Queue-Id: 4bJC9W5zFlz3DX0 X-Spamd-Bar: - Konstantin Belousov wrote on Date: Thu, 12 Jun 2025 18:03:03 UTC : > The branch stable/14 has been updated by kib: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D88359641132766cc0a8eed283a7a7045= 95c7c119 >=20 > commit 88359641132766cc0a8eed283a7a704595c7c119 > Author: Konstantin Belousov > AuthorDate: 2025-05-22 04:32:25 +0000 > Commit: Konstantin Belousov > CommitDate: 2025-06-12 18:02:50 +0000 >=20 > amd64: switch to amd64_set_tlsbase to set tls base > =20 > (cherry picked from commit = aef025fc9b6c8b06677086a93c866ee09622f6fa) > --- > libexec/rtld-elf/amd64/reloc.c | 6 ++++-- > sys/x86/include/tls.h | 2 +- > 2 files changed, 5 insertions(+), 3 deletions(-) >=20 > diff --git a/libexec/rtld-elf/amd64/reloc.c = b/libexec/rtld-elf/amd64/reloc.c > index 7e7f01a5d186..74693d35ba1d 100644 > --- a/libexec/rtld-elf/amd64/reloc.c > +++ b/libexec/rtld-elf/amd64/reloc.c > @@ -530,10 +530,12 @@ allocate_initial_tls(Obj_Entry *objs) > addr =3D allocate_tls(objs, 0, TLS_TCB_SIZE, TLS_TCB_ALIGN); > =20 > /* > - * This does not use _tcb_set() as it calls amd64_set_fsbase() > + * This does not use _tcb_set() as it calls amd64_set_tlsbase() > * which is an ifunc and rtld must not use ifuncs. > */ > - if (__getosreldate() >=3D P_OSREL_WRFSBASE && > + if (__getosreldate() >=3D P_OSREL_TLSBASE) lib/libc/amd64/sys/amd64_set_tlsbase.c has more in its test, "|| (P_OSREL_MAJOR(osrel) =3D=3D 14 && osrel >=3D 1403502)" : +DEFINE_UIFUNC(, int, amd64_set_tlsbase, (void *)) +{ + int osrel; + + osrel =3D __getosreldate(); + if (osrel >=3D P_OSREL_TLSBASE || + (P_OSREL_MAJOR(osrel) =3D=3D 14 && osrel >=3D 1403502)) + return (amd64_set_tlsbase_syscall); + return (amd64_set_fsbase); +} Is the difference in libexec/rtld-elf/amd64/reloc.c related to P_OSREL_TLSBASE like testing deliberate? > + sysarch(AMD64_SET_TLSBASE, &addr); > + else if (__getosreldate() >=3D P_OSREL_WRFSBASE && > (cpu_stdext_feature & CPUID_STDEXT_FSGSBASE) !=3D 0) > wrfsbase((uintptr_t)addr); > else > diff --git a/sys/x86/include/tls.h b/sys/x86/include/tls.h > index 4b6b58b4a5e3..b431c336122c 100644 > --- a/sys/x86/include/tls.h > +++ b/sys/x86/include/tls.h > @@ -59,7 +59,7 @@ static __inline void > _tcb_set(struct tcb *tcb) > { > #ifdef __amd64__ > - amd64_set_fsbase(tcb); > + amd64_set_tlsbase(tcb); > #else > i386_set_gsbase(tcb); > #endif =20 =3D=3D=3D Mark Millard marklmi at yahoo.com From nobody Thu Jun 12 19:31:57 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJCMf1Wm9z5yJD2; Thu, 12 Jun 2025 19:31:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJCMf0dkpz3MTl; Thu, 12 Jun 2025 19:31:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749756718; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EeOMC3pMQJqLU8yhZkjmrGhuam4J2v5DuPW7NhVOMwc=; b=OyC07B5GpFIe6nOygBkTMTEGDsClqJaAT+OR/k7khpLirNp/8F/XsSA3h+ZqpRzmY2xY9u 9CtDR2y+H+d1L562l8DfUZiODTKyDx/ZgxD8T2WfoDkvwsJNym1JxIGShhoLR0Ul8HGPGr AzpvcTQZBnH6m/1/sEjEO8iQPjzCKvi+Pmbx4uaxY4/sUa4ociwibIoBcRJmDZoDS2jrbX +zD4n2GUaQCpaCHAM2yaGsVNFrQrJYHsaqNVfki0mpVI99Fj6v6x1L+Z1PEozmc/CaVq3L hj1xD1O574ss2d2srcGJ1259pfckbpKLosHP0lxZdMSZamxPHhDL2372pRnViA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749756718; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EeOMC3pMQJqLU8yhZkjmrGhuam4J2v5DuPW7NhVOMwc=; b=CSkM/8kpyKnBoWlI0yoVaRFjOjVe+xPW3uYgYBGyC2M6bjyKVfZCq6mPBt5wWNcH5x2peF ktLPqc33Ro7fWFgOiwng/8aBqirYSH/gv3BNtfCMHGvB+ZU7/PzZczNcGTJL19UdHEAr0p urZl08b0twHoMsu5ZYKC/QbaStm1pte5GEAmeVO1BdTQrkEYwvK+L8wegWOO898+X0BDVe Ax5GaB2ul0PCJPNEQOhN7XA7KP2HN+DdOGe/yTcBfODhS3hEyympA+XopBisbY4tLD9+XH qwZyf4beMv/blaQRieChv/sQqimd9cM3Q4oARTRYPYIwaMtsV5ve2AAf/WEVkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749756718; a=rsa-sha256; cv=none; b=nBlwcKOrhQ8KKz4q8rl14FOr4WqI8X8+/JBxexJcW+5I5cPaKPGBzBB/I8WEkZLtZRaFqF 4Ld3Nc6leJAicTE8EIgSkb8yidPmHr03nOqXltDrQRgkzilnRFWLCmh08HXDsIwWBMeOtP XbB1heayLKDT8phZLmkGAQMUXmhfaqF+SvzhZgVjtgsCL7/tlvSk0Xegz2vKnE/3MU8ObW jqA3KS2adxzksLNNQ9s/YUAe9k9JDOVmpPlIy6QmFuGGdLlCRfJyk/DyAeaxSUgdVXShUb H2ujsszTrXhoilYFMs6DHR0oJGvgzlYRggzgek+REXf1ZaMBy9T2xhiLffThRQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJCMf09RGz9b5; Thu, 12 Jun 2025 19:31:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55CJVv6f035209; Thu, 12 Jun 2025 19:31:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55CJVvxF035206; Thu, 12 Jun 2025 19:31:57 GMT (envelope-from git) Date: Thu, 12 Jun 2025 19:31:57 GMT Message-Id: <202506121931.55CJVvxF035206@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hiroki Sato Subject: git: 4acd63a6266c - main - libusb: Fix netlink sysevent multicast group name List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hrs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4acd63a6266cffe45db2c6887ef1ccd38c8d3ffa Auto-Submitted: auto-generated The branch main has been updated by hrs: URL: https://cgit.FreeBSD.org/src/commit/?id=4acd63a6266cffe45db2c6887ef1ccd38c8d3ffa commit 4acd63a6266cffe45db2c6887ef1ccd38c8d3ffa Author: SHENGYI HUNG AuthorDate: 2025-06-12 19:18:38 +0000 Commit: Hiroki Sato CommitDate: 2025-06-12 19:30:29 +0000 libusb: Fix netlink sysevent multicast group name Reviewed by: hrs Differential Revision: https://reviews.freebsd.org/D50739 --- lib/libusb/libusb10_hotplug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libusb/libusb10_hotplug.c b/lib/libusb/libusb10_hotplug.c index 1e8037da1bd4..f148e4dd43f5 100644 --- a/lib/libusb/libusb10_hotplug.c +++ b/lib/libusb/libusb10_hotplug.c @@ -73,7 +73,7 @@ netlink_init(libusb_context *ctx) if (modfind("nlsysevent") < 0) return (false); if (!snl_init(&ctx->ss, NETLINK_GENERIC) || (group = - snl_get_genl_mcast_group(&ctx->ss, "nlsysevent", "ACPI", NULL)) == 0) + snl_get_genl_mcast_group(&ctx->ss, "nlsysevent", "USB", NULL)) == 0) return (false); if (setsockopt(ctx->ss.fd, SOL_NETLINK, NETLINK_ADD_MEMBERSHIP, &group, From nobody Thu Jun 12 19:32:59 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJCP622ZWz5yJG5 for ; Thu, 12 Jun 2025 19:33:14 +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 4bJCP46dHnz3Pkn for ; Thu, 12 Jun 2025 19:33:12 +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 55CJWxAg047645; Thu, 12 Jun 2025 22:33:02 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 55CJWxAg047645 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 55CJWxRR047644; Thu, 12 Jun 2025 22:32:59 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 12 Jun 2025 22:32:59 +0300 From: Konstantin Belousov To: Mark Millard Cc: dev-commits-src-main@freebsd.org Subject: Re: git: 883596411327 - stable/14 - amd64: switch to amd64_set_tlsbase to set tls base [|| (. . . && osrel >= 1403502) test too?] Message-ID: References: <4C483AC0-4082-4EBB-AAC2-01610E0482B3.ref@yahoo.com> <4C483AC0-4082-4EBB-AAC2-01610E0482B3@yahoo.com> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4C483AC0-4082-4EBB-AAC2-01610E0482B3@yahoo.com> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Rspamd-Queue-Id: 4bJCP46dHnz3Pkn X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] On Thu, Jun 12, 2025 at 12:22:52PM -0700, Mark Millard wrote: > Konstantin Belousov wrote on > Date: Thu, 12 Jun 2025 18:03:03 UTC : > > > The branch stable/14 has been updated by kib: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=88359641132766cc0a8eed283a7a704595c7c119 > > > > commit 88359641132766cc0a8eed283a7a704595c7c119 > > Author: Konstantin Belousov > > AuthorDate: 2025-05-22 04:32:25 +0000 > > Commit: Konstantin Belousov > > CommitDate: 2025-06-12 18:02:50 +0000 > > > > amd64: switch to amd64_set_tlsbase to set tls base > > > > (cherry picked from commit aef025fc9b6c8b06677086a93c866ee09622f6fa) > > --- > > libexec/rtld-elf/amd64/reloc.c | 6 ++++-- > > sys/x86/include/tls.h | 2 +- > > 2 files changed, 5 insertions(+), 3 deletions(-) > > > > diff --git a/libexec/rtld-elf/amd64/reloc.c b/libexec/rtld-elf/amd64/reloc.c > > index 7e7f01a5d186..74693d35ba1d 100644 > > --- a/libexec/rtld-elf/amd64/reloc.c > > +++ b/libexec/rtld-elf/amd64/reloc.c > > @@ -530,10 +530,12 @@ allocate_initial_tls(Obj_Entry *objs) > > addr = allocate_tls(objs, 0, TLS_TCB_SIZE, TLS_TCB_ALIGN); > > > > /* > > - * This does not use _tcb_set() as it calls amd64_set_fsbase() > > + * This does not use _tcb_set() as it calls amd64_set_tlsbase() > > * which is an ifunc and rtld must not use ifuncs. > > */ > > - if (__getosreldate() >= P_OSREL_WRFSBASE && > > + if (__getosreldate() >= P_OSREL_TLSBASE) > > lib/libc/amd64/sys/amd64_set_tlsbase.c has more in its test, > "|| (P_OSREL_MAJOR(osrel) == 14 && osrel >= 1403502)" : > > +DEFINE_UIFUNC(, int, amd64_set_tlsbase, (void *)) > +{ > + int osrel; > + > + osrel = __getosreldate(); > + if (osrel >= P_OSREL_TLSBASE || > + (P_OSREL_MAJOR(osrel) == 14 && osrel >= 1403502)) > + return (amd64_set_tlsbase_syscall); > + return (amd64_set_fsbase); > +} > > Is the difference in libexec/rtld-elf/amd64/reloc.c related > to P_OSREL_TLSBASE like testing deliberate? Thanks, should be fixed. From nobody Thu Jun 12 19:56:43 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJCwC6wrgz5yKSw; Thu, 12 Jun 2025 19:56:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJCwC42Pyz3lfc; Thu, 12 Jun 2025 19:56:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749758203; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ykv30TDrVsdhk9wOb6xocjnunczecUwvMpvlt8zuPpw=; b=bXWEIFQrTX4siw5oEODzZ7D7PlNiXCzCzkT5d7QXU8o7XJeo/kyiQA+9t7Dqjh1B1EdiIM vPNvqllh+T3sDxwNpyGQnPeDK7U+dRN1O/1WpLaGd2++z/AEx38mHS3mbPA7MOMPB2h7Vc JG4VMX9txSJPPPd3tx9BwE+wmqgCjSOel+LVnylI1Jg5TwCOCiRmFb4QB8mIphkDpbU6Ph 0WsKG7+d3kkzE5bYv/gtpPnf4IxmipnXxqZLzo2bXsPE0d1QmTmPOVOts8Tk5HF/YNKUNn GpWGYrTXnrfrh7TSqM1hG24Ip9W+eXIGabCPKdBMOfO+cgITRfsGNdYxssLjUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749758203; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ykv30TDrVsdhk9wOb6xocjnunczecUwvMpvlt8zuPpw=; b=UFtaccyBVYIPvdVk348fv/Eq+/o5p8PIupzq8bTtYlfxczn6qYU7SH46loYntuFxFBTOgg WJQBmB/ja+IiVtZcQzWnSfDbXeLvzxDCmRGtbWdIlVZuWp3mHpyo09XV8uhC6rxhQE93QC fsKRQPRA0aZfF78ZsPUu/OzQamLBhPGh1/b4ndXX99TIwqUqkXLvBz2fdBNLtMDXItGyCb PyKvmSkbTiQE5fGy1mQlqmufGs4jT7FfetvhcolI91Dz5lT/DREeRt3/A8U/EIbdIzxN/o aXp/C2Uj/C4pQLoFtSB/9t2TsSi6B8F2pomtUSLZZ214Lhy22QJ/oZuCsHk4iQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749758203; a=rsa-sha256; cv=none; b=px/6fkopBaa494RbYVfIad+lDrqtU2ZqMKkgdty2oJhvXfdbh/5mcGDJBsxodSwP23AeLa i/cIIIbvyxa/joISovhbSHEGCG6RJ66DpNtA0ggKRKmyih8oaIgHbrRj+tbF8J95UxBvRK oa8qEA7fUF+j65JaAWPta+hIh9ftAcnl1xIARv4KP7vNwRF8SpuuABncKTELXHLIz5iu/h 2q2ddfaGBR1yeXAHX8JLoxNVkQxTRb7MDaT+HKvtfiwhjoKTDTZKH5lbR5pQ5v+06O3X+5 eqEOFnBc5aYDTYy7jgHPQyvWNle8PZDEXSaoedoZxcm5a3/gICSdVNumvL5jjA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJCwC3bp8z9xk; Thu, 12 Jun 2025 19:56:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55CJuhGL074388; Thu, 12 Jun 2025 19:56:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55CJuh9k074385; Thu, 12 Jun 2025 19:56:43 GMT (envelope-from git) Date: Thu, 12 Jun 2025 19:56:43 GMT Message-Id: <202506121956.55CJuh9k074385@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: f580578877c9 - main - Makefile.inc1: Cleanup (un)compressed manpages List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f580578877c9c11ebe9103b203412680a87c64e2 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=f580578877c9c11ebe9103b203412680a87c64e2 commit f580578877c9c11ebe9103b203412680a87c64e2 Author: Ricardo Branco AuthorDate: 2024-06-16 18:39:49 +0000 Commit: Warner Losh CommitDate: 2025-06-12 19:55:51 +0000 Makefile.inc1: Cleanup (un)compressed manpages When switching between compressed and uncompressed manual pages, the other type is left behind as divots. Compensate by removing the now-unwanted man pages automatically. Reviewed by: imp, jhb Pull Request: https://github.com/freebsd/freebsd-src/pull/1295 --- Makefile.inc1 | 36 ++++++++++++++++++++++++++++++++++++ share/mk/bsd.man.mk | 6 ++---- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index fc61f5ec54c6..157be6dfdfc6 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -3512,6 +3512,25 @@ delete-old-files: .PHONY rm ${RM_I} $${catpage} <&3; \ fi; \ done +# Remove compressed copies of uncompressed manpages +.if ${MK_MANCOMPRESS} != "yes" + @exec 3<&0; \ + find ${DESTDIR}/usr/share/man ${DESTDIR}/usr/share/openssl/man ! -type d ! -name \*.gz 2>/dev/null | \ + while read manpage; do \ + if [ -e "$${manpage}.gz" ]; then \ + rm ${RM_I} $${manpage}.gz <&3; \ + fi; \ + done +# Remove uncompressed copies of compressed manpages +.else + @exec 3<&0; \ + find ${DESTDIR}/usr/share/man ${DESTDIR}/usr/share/openssl/man ! -type d ! -name \*.gz 2>/dev/null | \ + while read manpage; do \ + if [ -e "$${manpage}.gz" ]; then \ + rm ${RM_I} $${manpage} <&3; \ + fi; \ + done +.endif @echo ">>> Old files removed" check-old-files: .PHONY @@ -3537,6 +3556,23 @@ check-old-files: .PHONY echo $${catpage}; \ fi; \ done | sort +# Check for compressed copies of uncompressed manpages +.if ${MK_MANCOMPRESS} != "yes" + @find ${DESTDIR}/usr/share/man ${DESTDIR}/usr/share/openssl/man ! -type d ! -name \*.gz 2>/dev/null | \ + while read manpage; do \ + if [ -e "$${manpage}.gz" ]; then \ + echo $${manpage}.gz; \ + fi; \ + done | sort +# Check for uncompressed copies of compressed manpages +.else + @find ${DESTDIR}/usr/share/man ${DESTDIR}/usr/share/openssl/man ! -type d ! -name \*.gz 2>/dev/null | \ + while read manpage; do \ + if [ -e "$${manpage}.gz" ]; then \ + echo $${manpage}; \ + fi; \ + done | sort +.endif list-old-libs: .PHONY @cd ${.CURDIR}; \ diff --git a/share/mk/bsd.man.mk b/share/mk/bsd.man.mk index 2845d0c1fc1c..96b8f07c25e2 100644 --- a/share/mk/bsd.man.mk +++ b/share/mk/bsd.man.mk @@ -237,11 +237,9 @@ maninstall: ${MAN} # On MacOS, assume case folding FS, and don't install links from foo.x to FOO.x. .if ${.MAKE.OS} != "Darwin" || ${l:tu} != ${t:tu} .if ${MK_MANSPLITPKG} == "no" - rm -f ${DESTDIR}${t} ${DESTDIR}${t}${MCOMPRESS_EXT}; \ - ${INSTALL_MANLINK} ${TAG_ARGS} ${DESTDIR}${l}${ZEXT} ${DESTDIR}${t}${ZEXT} + ${INSTALL_MANLINK} ${TAG_ARGS} ${DESTDIR}${l}${ZEXT} ${DESTDIR}${t}${ZEXT} .else - rm -f ${DESTDIR}${t} ${DESTDIR}${t}${MCOMPRESS_EXT}; \ - ${INSTALL_MANLINK} ${TAG_ARGS:D${TAG_ARGS},man} ${DESTDIR}${l}${ZEXT} ${DESTDIR}${t}${ZEXT} + ${INSTALL_MANLINK} ${TAG_ARGS:D${TAG_ARGS},man} ${DESTDIR}${l}${ZEXT} ${DESTDIR}${t}${ZEXT} .endif .endif .endfor From nobody Thu Jun 12 19:56:44 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJCwF0LDMz5yKtm; Thu, 12 Jun 2025 19:56:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJCwD521bz3lnf; Thu, 12 Jun 2025 19:56:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749758204; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iXIGo9rkxPD3XtjzZ2xMgsBjBeUzNbAOHf3+aGBjicI=; b=cu6dOXI+oj/gnxDupRwHoOmw6bOCQ4DYV6UZwSvaSKFhnWomAiX9hLQjCD4b3PxuozGasR 95sVKkMMyzio+eNg6X8bEDX0f4CzpimuzO7q0TKhj+MBlHD45JzdiS00PJmlsxZO72ql+k QX3I2wy5euj0B7FQqVOCnAu4TBg6tlrON0OvC/f9tcJsJ2WE50QKIATimeR/sa2d0BumDB EO1O4VmWw+te33Qpkz8I1BVZ+CAPIrCbJ5qna6nHIvpZrbnEM3g7j7UW0mYNGzvi9b8PWQ NoLE1U+5NduxMcjEOArLGvkSP8yC2s7FbadMIcpFae7GWkqgyvRSiU/OdqSpww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749758204; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iXIGo9rkxPD3XtjzZ2xMgsBjBeUzNbAOHf3+aGBjicI=; b=B/CtZOB+xvWy/HvQzptP7rnfSD7HVHgXH2MSMbZ+dKyHCbn2zNpLKPtWC8uRqXKaACxst6 CVzptrjx9gXwfT8rZjzzQoY1KUl+OZDv+OCyoLM8OPtIVafmu6T9vnOnigFBFNa5R24hZm WIjs60XvU5+O2AXWAlTACVug1+k6JTAeYU/TuESyBzcZK+z027N4XtRCB5n4Ri3L7F3Fpm s3QvZRS3PqVH3PlIbUegpZ0mBCqCBmJYPlw4dOb37JeYNrb9PQgx5KJwWMqW6b9RXUY6k9 jBxO92eYdmTPz270WFshxCaRx0tzCx9Z1vcXnQnmh7hx9VBbkSXn8FIVi/FlZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749758204; a=rsa-sha256; cv=none; b=MuzPvO6/bCtb4srjOJTIVZ+22mIswSkp34Msn7QBEOyV0rHuAKJ/KEPJu89EiwdgH5JsFm renAwO8Wx1FP3moYlte8QObRrmSAC6r1WYGxLpaevcIs+bOBTO8jvkNsLtaoJtk8U28AgB 2e1WpCQfOAj2BPSDGeXfU7SKmcMiBTIpDxDvuRpmQhgOlO1HXCGY2dv8Zf7/l4jp4PCrK9 4wF3AyFH/NjoZIp7BisQ/BzMH61TpMfbYmoFFkcgFmanEzCrv9z8t+SjDyRtGYmqZ8Megx gZC6nKz5x6/ASy/P6IE41EOXmpzbdzPFRN7C2vAxNv1yCcXDXzW/1Ov7SZqgkA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJCwD4RkXzBH9; Thu, 12 Jun 2025 19:56:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55CJuii3074423; Thu, 12 Jun 2025 19:56:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55CJuiFe074420; Thu, 12 Jun 2025 19:56:44 GMT (envelope-from git) Date: Thu, 12 Jun 2025 19:56:44 GMT Message-Id: <202506121956.55CJuiFe074420@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: deeda8abd5e8 - main - Makefile.inc1: Cleanup manpages for arches not included in MAN_ARCH List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: deeda8abd5e8100beae745ebf8965c6f61bd108d Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=deeda8abd5e8100beae745ebf8965c6f61bd108d commit deeda8abd5e8100beae745ebf8965c6f61bd108d Author: Ricardo Branco AuthorDate: 2024-06-19 21:43:38 +0000 Commit: Warner Losh CommitDate: 2025-06-12 19:55:56 +0000 Makefile.inc1: Cleanup manpages for arches not included in MAN_ARCH Apply the fixes to cleanup the compressed or uncompressed man pages to arches not in MAN_ARCH as well. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1295 Closes: https://github.com/freebsd/freebsd-src/pull/1295 --- Makefile.inc1 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Makefile.inc1 b/Makefile.inc1 index 157be6dfdfc6..42a5f5cfb0a9 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -3530,6 +3530,13 @@ delete-old-files: .PHONY rm ${RM_I} $${manpage} <&3; \ fi; \ done +.endif +.if !empty(MAN_ARCH) && ${MAN_ARCH} != "all" + @exec 3<&0; \ + find -E /usr/share/man/man4/ -mindepth 1 -type d ! -regex '.*/(${MAN_ARCH:C/[[:space:]]+/|/gW})' | \ + while read dir; do \ + find $$dir ! -type d -exec rm ${RM_I} {} + <&3; \ + done .endif @echo ">>> Old files removed" @@ -3573,6 +3580,12 @@ check-old-files: .PHONY fi; \ done | sort .endif +.if !empty(MAN_ARCH) && ${MAN_ARCH} != "all" + @find -E /usr/share/man/man4/ -mindepth 1 -type d ! -regex '.*/(${MAN_ARCH:C/[[:space:]]+/|/gW})' | \ + while read dir; do \ + find $$dir ! -type d; \ + done | sort +.endif list-old-libs: .PHONY @cd ${.CURDIR}; \ From nobody Thu Jun 12 20:55:34 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJFD71z6kz5yPfc; Thu, 12 Jun 2025 20:55:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJFD66ByPz3VFm; Thu, 12 Jun 2025 20:55:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749761734; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eltUSmAHyrwpP6FNv/lWJSh8WpyTQ/89k1eEmL1kTJw=; b=N7kW6p19cVtnJS6GJKTouF+01x+sNjFLMdyTulWnpz4iHfWrxMyXP6NXxm/9HDYyZ5VXbQ pS27evDtcEQZAdEotzCYDHkg1ujY49JnlsHvtwPjskVTebjJtAtsDi8v0cDRep0SiBJlI5 5hoKDzT+ZCX88XSDK4wbyT/xqQKjAsZlBLpjqbKwrfbjHjyUwLRP8KOCg07vRoVfJ/Sxrm Dl9SlAi9JAx5HrwPsUmHSJNsNpCkYTYzc5+XGkUnP/bHsx4YLgNCf1RVYaeSYtYgcEbR+a D+SReZo9l7O2BI3QMmpswGhhjgqzoGd58TmXU9dvkBrh8vZUBJughMTsP78/4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749761734; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eltUSmAHyrwpP6FNv/lWJSh8WpyTQ/89k1eEmL1kTJw=; b=Ej8lWIjcwGsKWT50Wr4heQ/eU94D2L+ISUQIR7UC6fvM5PqZfy2+QklomWAFxgv7ZPK+D9 W96yqOb90zEabeFtpsiFWxC/POSSCi0oUSZdzOUfznZhzm5VUfcCzSvrElgnYiUIrEysg9 GddqqbAB4g8ShxBkkba+gBfoG33VKHZP6Oq6J8Bvn0JgH8s35DU4x+NXLT/mmJcL+yiodO 4uBoXsL/TQkNP70BSUtOay5Cr5jb+WRXls4N1rDF/urvOJdioubKg+H0CKTM2Vr1RcZVUY BBLWePzsDA+OfdHiOz6MCLPvtmY2EWOib3OBvtmPOJz+l0LPFeztAD0pNLYLdQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749761734; a=rsa-sha256; cv=none; b=u4fvLMN7N6A/5BqaPXM/CiepIOQUsZop//HyARgl8iiVzbFdEhwlD1ersxOoa6JXG2irhy f+/wqx7cmmf+Spznuu5SCE+49weko3FAyPoqTe112Fg8hRWSqujivF1bD8aND7G8EEFC7V m9nsWVPxsBIlMVOoIibtkQIjqWzHVoW1tjyWavcB9qRHvI+H1o6Svr76N0LhPtkVqUAIdP dVyd9EvjayrfzjJ/jNmYptgZhn41lB3vY64cWrwd3TygHB4+kpyO+Onp0l0wiuiP0YrzFM UnOU7ihj7Vv/G7GMFgGJraH6bx5O0umVdJWhM5tSg5fOzbT9zP5sB+8BjakqCg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJFD65flPzCr6; Thu, 12 Jun 2025 20:55:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55CKtYjU086524; Thu, 12 Jun 2025 20:55:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55CKtYOl086521; Thu, 12 Jun 2025 20:55:34 GMT (envelope-from git) Date: Thu, 12 Jun 2025 20:55:34 GMT Message-Id: <202506122055.55CKtYOl086521@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: f1ad4340e4ad - main - vm/vm_mmap.c: provide extended errors for most places List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f1ad4340e4adfbe9e64b4e2e9e9b19d87fa84eef Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f1ad4340e4adfbe9e64b4e2e9e9b19d87fa84eef commit f1ad4340e4adfbe9e64b4e2e9e9b19d87fa84eef Author: Konstantin Belousov AuthorDate: 2025-06-11 08:36:20 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-12 20:32:26 +0000 vm/vm_mmap.c: provide extended errors for most places Reviewed by: brooks Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D50792 --- sys/vm/vm_mmap.c | 103 +++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 81 insertions(+), 22 deletions(-) diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c index 492233215d4b..8444a8cbf021 100644 --- a/sys/vm/vm_mmap.c +++ b/sys/vm/vm_mmap.c @@ -231,35 +231,53 @@ kern_mmap(struct thread *td, const struct mmap_req *mrp) */ if (!SV_CURPROC_FLAG(SV_AOUT)) { if ((len == 0 && p->p_osrel >= P_OSREL_MAP_ANON) || - ((flags & MAP_ANON) != 0 && (fd != -1 || pos != 0))) + ((flags & MAP_ANON) != 0 && (fd != -1 || pos != 0))) { + SET_ERROR2(EINVAL, + "offset not zero/fd not -1 for MAP_ANON", + fd, pos); return (EINVAL); + } } else { if ((flags & MAP_ANON) != 0) pos = 0; } if (flags & MAP_STACK) { - if ((fd != -1) || - ((prot & (PROT_READ | PROT_WRITE)) != (PROT_READ | PROT_WRITE))) + if ((fd != -1) || ((prot & (PROT_READ | PROT_WRITE)) != + (PROT_READ | PROT_WRITE))) { + SET_ERROR1(EINVAL, "MAP_STACK with prot < rw", prot); return (EINVAL); + } flags |= MAP_ANON; pos = 0; } if ((flags & ~(MAP_SHARED | MAP_PRIVATE | MAP_FIXED | MAP_HASSEMAPHORE | MAP_STACK | MAP_NOSYNC | MAP_ANON | MAP_EXCL | MAP_NOCORE | - MAP_PREFAULT_READ | MAP_GUARD | MAP_32BIT | MAP_ALIGNMENT_MASK)) != 0) + MAP_PREFAULT_READ | MAP_GUARD | MAP_32BIT | + MAP_ALIGNMENT_MASK)) != 0) { + SET_ERROR0(EINVAL, "reserved flag set"); return (EINVAL); - if ((flags & (MAP_EXCL | MAP_FIXED)) == MAP_EXCL) + } + if ((flags & (MAP_EXCL | MAP_FIXED)) == MAP_EXCL) { + SET_ERROR0(EINVAL, "EXCL without FIXED"); return (EINVAL); - if ((flags & (MAP_SHARED | MAP_PRIVATE)) == (MAP_SHARED | MAP_PRIVATE)) + } + if ((flags & (MAP_SHARED | MAP_PRIVATE)) == (MAP_SHARED | + MAP_PRIVATE)) { + SET_ERROR0(EINVAL, "both SHARED and PRIVATE set"); return (EINVAL); + } if (prot != PROT_NONE && - (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC)) != 0) + (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC)) != 0) { + SET_ERROR1(EINVAL, "invalid prot", prot); return (EINVAL); + } if ((flags & MAP_GUARD) != 0 && (prot != PROT_NONE || fd != -1 || pos != 0 || (flags & ~(MAP_FIXED | MAP_GUARD | MAP_EXCL | - MAP_32BIT | MAP_ALIGNMENT_MASK)) != 0)) + MAP_32BIT | MAP_ALIGNMENT_MASK)) != 0)) { + SET_ERROR0(EINVAL, "GUARD with wrong parameters"); return (EINVAL); + } /* * Align the file position to a page boundary, @@ -279,8 +297,10 @@ kern_mmap(struct thread *td, const struct mmap_req *mrp) align = flags & MAP_ALIGNMENT_MASK; if (align != 0 && align != MAP_ALIGNED_SUPER && (align >> MAP_ALIGNMENT_SHIFT >= sizeof(void *) * NBBY || - align >> MAP_ALIGNMENT_SHIFT < PAGE_SHIFT)) + align >> MAP_ALIGNMENT_SHIFT < PAGE_SHIFT)) { + SET_ERROR1(EINVAL, "bad alignment", align); return (EINVAL); + } /* * Check for illegal addresses. Watch out for address wrap... Note @@ -293,14 +313,21 @@ kern_mmap(struct thread *td, const struct mmap_req *mrp) * should be aligned after adjustment by pageoff. */ addr -= pageoff; - if (addr & PAGE_MASK) + if ((addr & PAGE_MASK) != 0) { + SET_ERROR1(EINVAL, "fixed mapping not aligned", addr); return (EINVAL); + } /* Address range must be all in user VM space. */ - if (!vm_map_range_valid(&vms->vm_map, addr, addr + size)) + if (!vm_map_range_valid(&vms->vm_map, addr, addr + size)) { + SET_ERROR0(EINVAL, "mapping outside vm_map"); return (EINVAL); - if (flags & MAP_32BIT && addr + size > MAP_32BIT_MAX_ADDR) + } + if (flags & MAP_32BIT && addr + size > MAP_32BIT_MAX_ADDR) { + SET_ERROR0(EINVAL, + "fixed 32bit mapping does not fit into 4G"); return (EINVAL); + } } else if (flags & MAP_32BIT) { /* * For MAP_32BIT, override the hint if it is too high and @@ -367,6 +394,7 @@ kern_mmap(struct thread *td, const struct mmap_req *mrp) goto done; if ((flags & (MAP_SHARED | MAP_PRIVATE)) == 0 && p->p_osrel >= P_OSREL_MAP_FSTRICT) { + SET_ERROR0(EINVAL, "neither SHARED nor PRIVATE req"); error = EINVAL; goto done; } @@ -1296,6 +1324,7 @@ vm_mmap_vnode(struct thread *td, vm_size_t objsize, vm_pager_update_writecount(obj, 0, objsize); } } else { + SET_ERROR0(EINVAL, "non-reg file"); error = EINVAL; goto done; } @@ -1379,14 +1408,18 @@ vm_mmap_cdev(struct thread *td, vm_size_t objsize, vm_prot_t prot, *flagsp |= MAP_ANON; return (0); } + /* * cdevs do not provide private mappings of any kind. */ if ((*maxprotp & VM_PROT_WRITE) == 0 && (prot & VM_PROT_WRITE) != 0) return (EACCES); - if (flags & (MAP_PRIVATE|MAP_COPY)) + if ((flags & (MAP_PRIVATE | MAP_COPY)) != 0) { + SET_ERROR0(EINVAL, "cdev mapping must be shared"); return (EINVAL); + } + /* * Force device mappings to be shared. */ @@ -1410,8 +1443,10 @@ vm_mmap_cdev(struct thread *td, vm_size_t objsize, vm_prot_t prot, return (error); obj = vm_pager_allocate(OBJT_DEVICE, cdev, objsize, prot, *foff, td->td_ucred); - if (obj == NULL) + if (obj == NULL) { + SET_ERROR0(EINVAL, "cdev driver does not support mmap"); return (EINVAL); + } *objp = obj; *flagsp = flags; return (0); @@ -1428,8 +1463,10 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, vm_size_t size, vm_prot_t prot, int error; boolean_t writecounted; - if (size == 0) + if (size == 0) { + SET_ERROR0(EINVAL, "zero-sized req"); return (EINVAL); + } size = round_page(size); object = NULL; @@ -1455,6 +1492,7 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, vm_size_t size, vm_prot_t prot, handle, &foff, &object, &writecounted); break; default: + SET_ERROR1(EINVAL, "unsupported backing obj type", handle_type); error = EINVAL; break; } @@ -1536,21 +1574,32 @@ vm_mmap_object(vm_map_t map, vm_offset_t *addr, vm_size_t size, vm_prot_t prot, * callbacks) and other internal mapping requests (such as in * exec). */ - if (foff & PAGE_MASK) + if ((foff & PAGE_MASK) != 0) { + SET_ERROR1(EINVAL, "offset not page-aligned", foff); return (EINVAL); + } if ((flags & MAP_FIXED) == 0) { fitit = true; *addr = round_page(*addr); } else { - if (*addr != trunc_page(*addr)) + if (*addr != trunc_page(*addr)) { + SET_ERROR1(EINVAL, + "non-fixed mapping address not aligned", *addr); return (EINVAL); + } fitit = false; } if (flags & MAP_ANON) { - if (object != NULL || foff != 0) + if (object != NULL) { + SET_ERROR0(EINVAL, "anon mapping backed by an object"); + return (EINVAL); + } + if (foff != 0) { + SET_ERROR0(EINVAL, "anon mapping with non-zero offset"); return (EINVAL); + } docow = 0; } else if (flags & MAP_PREFAULT_READ) docow = MAP_PREFAULT; @@ -1569,8 +1618,10 @@ vm_mmap_object(vm_map_t map, vm_offset_t *addr, vm_size_t size, vm_prot_t prot, if (writecounted) docow |= MAP_WRITECOUNT; if (flags & MAP_STACK) { - if (object != NULL) + if (object != NULL) { + SET_ERROR0(EINVAL, "stack mapping backed by an object"); return (EINVAL); + } docow |= MAP_STACK_AREA; } if ((flags & MAP_EXCL) != 0) @@ -1632,16 +1683,24 @@ vm_mmap_object(vm_map_t map, vm_offset_t *addr, vm_size_t size, vm_prot_t prot, int vm_mmap_to_errno(int rv) { + int error; switch (rv) { case KERN_SUCCESS: return (0); case KERN_INVALID_ADDRESS: case KERN_NO_SPACE: - return (ENOMEM); + error = ENOMEM; + break; case KERN_PROTECTION_FAILURE: - return (EACCES); + error = EACCES; + break; default: - return (EINVAL); + error = EINVAL; + break; } + if ((curthread->td_pflags2 & (TDP2_UEXTERR | TDP2_EXTERR)) == + TDP2_UEXTERR) + SET_ERROR1(error, "mach error", rv); + return (error); } From nobody Thu Jun 12 21:31:33 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJG1f0ZkDz5yS8Z; Thu, 12 Jun 2025 21:31:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJG1d5NvCz3q5k; Thu, 12 Jun 2025 21:31:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749763893; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sN+8FZDIYRk16TbRtyrPB47UVQWKgqOz/KzSIrrIwKU=; b=lKbMbz12OOE6r8sL0L4YnzSIPMJ22K63YZ6qdRHxZPkNxFB1v/chAfS5Zd0yJrT6vb0Hvb B1AHzTt9Unq8FpLwNaaZa/URV9ByIW5KcU5+q88AJbmfOfJDi9PCllx0GVP+6fNpkOxolF BSVFHkgxov++HowY0qxq5aCFrnA+IY0wno/IFVEL9rcko2ndy5TbayLEXwFurKmSO8t4au tZcnido6+doBYFC0FvW87M8vMMbG3mZFPsX48pjbSjD6MLv4+8xh4Ibcn4ggxTiqXdmoCC J5iOyAbPbexuvsA/Fy6g8BFDQTFE932uy3zIehR7g1xhOwCNDIOZ2DsjyPuXmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749763893; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sN+8FZDIYRk16TbRtyrPB47UVQWKgqOz/KzSIrrIwKU=; b=adVzOGtmvWr5gGX7zRY8bFkAVkl61Lz/ABpWfiz4spJ/IUO/WrWz0IU2ZD4vb70cIp0BN8 MwYiB1d8JinUcpBBkIjX78VeqoGbEnjKENUrxTj2hhdP2ZgM+rm6uzd/DvhgYMdN08FJ5H +fZwB+BrTMG6mJvKLmZIDha6Ffl7GrcrdY0ZIm+lMtdBl6Gh4VcTYwhVROWnwq/w+9TsBu pHArKfqLQQly5Ly2UYaG5Pmll36iHZIvjTyVP18zhAi4pcoKPqfoQYqXDhjo29WchyYN5u KqQAlCB9FR1wZkty8D2V5QHnZT61Af6Mp+dEs206guq7lSMzjVBMYUEVFAC4Eg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749763893; a=rsa-sha256; cv=none; b=QaBdtPweWpMoRZbFp+I+0ANjCIlr9oAiYQbKlGstnM87tNZgLPLnd60mh2ePH7TD3Vd23Z qRN5Hm9qdXqIICBtSSmC2JRd4jfF8MefNowmnPHwwuV/59bmpoA1NQVWUgCtXHREsb5TSy tiFACb22O7Tbc4kczKs0K7xRbwoPeN6vpEmGE3IB0d+EwHIOQXTL5v9RNT9SP16WJZxtw4 v9weoh3kyEj1s3o+Qoj3g7BpjdtwlQoU42GGPoEi9bL/8bOaBAVLlU5Cd6B0HTp3SJWM4s 7bJfqqZfxHyiaIg9VlawH4GjQa0zPVjyGEYhP+FYg2Q/OHff4k/f34SxyRJwdw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJG1d50MszTJM; Thu, 12 Jun 2025 21:31:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55CLVXHC057053; Thu, 12 Jun 2025 21:31:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55CLVXau057050; Thu, 12 Jun 2025 21:31:33 GMT (envelope-from git) Date: Thu, 12 Jun 2025 21:31:33 GMT Message-Id: <202506122131.55CLVXau057050@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: 1b6936e12538 - main - manuals: Align our tree with upstream C23 macro List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1b6936e125382523509901a4fc5b2932ed0e742d Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=1b6936e125382523509901a4fc5b2932ed0e742d commit 1b6936e125382523509901a4fc5b2932ed0e742d Author: Alexander Ziaee AuthorDate: 2025-05-05 18:52:06 +0000 Commit: Alexander Ziaee CommitDate: 2025-06-12 21:24:10 +0000 manuals: Align our tree with upstream C23 macro Switch all instances of the -isoC-2024 macro to -isoC-2023 selected by upstream. Keep -isoC-2024 defined, but deprecated, for backwards compat. MFC after: 3 days (I will resolve merge conflicts with cdefs) --- contrib/mandoc/st.c | 2 ++ lib/libc/string/memccpy.3 | 2 +- lib/libc/string/memset.3 | 2 +- share/man/man9/cdefs.9 | 10 +++++----- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/contrib/mandoc/st.c b/contrib/mandoc/st.c index 9b9fee4ded17..8a2c687dfc94 100644 --- a/contrib/mandoc/st.c +++ b/contrib/mandoc/st.c @@ -56,6 +56,8 @@ LINE("-isoC-tcor1", "ISO/IEC 9899/TCOR1:1994 (\\(lqISO\\~C90, Technical Corrigen LINE("-isoC-tcor2", "ISO/IEC 9899/TCOR2:1995 (\\(lqISO\\~C90, Technical Corrigendum 2\\(rq)") LINE("-isoC-99", "ISO/IEC 9899:1999 (\\(lqISO\\~C99\\(rq)") LINE("-isoC-2011", "ISO/IEC 9899:2011 (\\(lqISO\\~C11\\(rq)") +LINE("-isoC-2023", "ISO/IEC 9899:2024 (\\(lqISO\\~C23\\(rq)") +/* the -isoC-2024 macro is deprecated in favor of upstream -isoC-2023 */ LINE("-isoC-2024", "ISO/IEC 9899:2024 (\\(lqISO\\~C23\\(rq)") LINE("-iso9945-1-90", "ISO/IEC 9945-1:1990 (\\(lqPOSIX.1\\(rq)") LINE("-iso9945-1-96", "ISO/IEC 9945-1:1996 (\\(lqPOSIX.1\\(rq)") diff --git a/lib/libc/string/memccpy.3 b/lib/libc/string/memccpy.3 index 2de981449119..0d35a68fce67 100644 --- a/lib/libc/string/memccpy.3 +++ b/lib/libc/string/memccpy.3 @@ -80,7 +80,7 @@ The function conforms to .St -p1003.1-2004 and -.St -isoC-2024 . +.St -isoC-2023 . .Sh HISTORY The .Fn memccpy diff --git a/lib/libc/string/memset.3 b/lib/libc/string/memset.3 index f2dba3ec5a48..f6ab9dacb516 100644 --- a/lib/libc/string/memset.3 +++ b/lib/libc/string/memset.3 @@ -141,4 +141,4 @@ conforms to K.3.7.4.1. .Fn memset_explicit conforms to -.St -isoC-2024 . +.St -isoC-2023 . diff --git a/share/man/man9/cdefs.9 b/share/man/man9/cdefs.9 index 397ddb0891bb..cc56e34d070a 100644 --- a/share/man/man9/cdefs.9 +++ b/share/man/man9/cdefs.9 @@ -319,7 +319,7 @@ to distinguish it from newer standards. Support for this compilation environment is dependent on compilers supporting this configuration. Most of the old forms of C have been deprecated or removed in -.St -isoC-2024 . +.St -isoC-2023 . Compilers make compiling in this mode increasingly difficult and support for it may ultimately be removed from the tree. .It St -ansiC @@ -349,7 +349,7 @@ since there are no new C17 only symbols or macros. .Pp This version of the standard did not introduce any new features, only made minor, technical corrections. -.It St -isoC-2024 +.It St -isoC-2023 .Dv __STDC_VERSION__ = 202311L Strict environment selected with .Dv _C23_SOURCE @@ -385,7 +385,7 @@ implements this as a NOP because too much software breaks with the correct stric .It Dv _ANSI_SOURCE Ta St -ansiC .It Dv _C99_SOURCE Ta St -isoC-99 .It Dv _C11_SOURCE Ta St -isoC-2011 -.It Dv _C23_SOURCE Ta St -isoC-2024 +.It Dv _C23_SOURCE Ta St -isoC-2023 .It Dv _BSD_SOURCE Ta Everything, including Fx extensions .El .Pp @@ -406,7 +406,7 @@ Likewise, when C23 dialog is selected with or .St -p1003.1-2024 , definitions for -.St -isoC-2024 +.St -isoC-2023 are also included. .Ss Header Visibility Macros These macros are set by @@ -432,7 +432,7 @@ Possible values include 1990, 1999, 2011, 2017 and 2023 for .St -isoC-99 , .St -isoC-2011 , ISO/IEC 9899:2018 ("ISO C17"), and -.St -isoC-2024 , +.St -isoC-2023 , respectively. .It Dv __BSD_VISIBLE Ta 1 if the .Fx From nobody Thu Jun 12 21:31:50 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJG271pP4z5ySDf; Thu, 12 Jun 2025 21:31:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJG2716Brz3qh6; Thu, 12 Jun 2025 21:31:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749763919; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eYFLTcP3axb3WOnx+RzvXrls4BPbnEyLl5Ttjh6qzV0=; b=qwcf2dkmyh4DvG7WCqiZnAboxXCGGgkbgA37D9wouvuzKZE6AUTzaYKPngLRQcObANiLLV MbuuNTzzU6/zPe7ZaaL6K1hPybIVHAcmh9DZTTANRPh99mz6nQuzRsAY7WHuA8LZuun5iH JcdRPQVe2j8egfWYGA8d5Nsa3Vq14Gr/gUxbu0vTWjyfbYiRXWlzEEZCEXXAXA7jSmr0Kb auYF/xXJuK1fmuuje9nsQjYazvxwDmB9E2Axf1RnkcIVgdRMVGUAkpkENKzbtm2TzOhwby rBMl+PQjvmP/Eq2NLP5PbpWyU+6YSqugxejPO9cb9eohtSJlnsdd+d01/WGhpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749763919; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eYFLTcP3axb3WOnx+RzvXrls4BPbnEyLl5Ttjh6qzV0=; b=RBzVcyebJ+JCTM3kGdLV1UWpYu136pFXCALoVHYqUgnvLc6ZXtFvVInVGRWDcnmhgPKhlm slzhVxvkhyiWA59tuluFUU4QhJScgTvp9Jvhn6eHYyOrLwir8tQNLq5/O3PXS2+OqlNmBO AeuiHimsC8AeMLQKtW5JLQPx7oiS924mK5j07ArGWKM8m0VY8JqCPyrNyUyT61ojndLLxe oNReEsFGWxPJTk+cbrE+4InJPFoZpiwDBDPaOCNa0Gcu3EPDPFu6I/y0ntEGl5VumUes/N bJDTYYeGf7bcHXFr3Y30D6+6+8bAPfXRiYO7ylt01O+Hm9c/Lrnrl/r6vwiboQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749763919; a=rsa-sha256; cv=none; b=ll1swc/yvQpMkKzWDIEPinIko4QYIdV9g4LfVVQXYScZASqmwxMgj6QCko74U98fzlERsX cbN/3W+8BsmMZUCaOL+lHdKwC+a503OGq7kRl7b9xiNT2zVZJoJOiPyPNwsMNjQVV/NDWo 0Ir/5zrlcVAQnzWNkWYMtY6otrh1MUWkMnfzy8BBbV2n0oD0uD/4TH29ayNFylku3pbP0h yWEuLMrFqWf/UXPouhQh6HrK76Lc96njxeAi3LmpMsgosc/NPhy2k7vyyX6JbDUzU6PiAj X4jsAa0hWVUBiYWXhyUoNRqs3pnUzSOtQfEsYHQfjN3bo19wsUi7MK+dyNfweA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJG270PBJzD6v; Thu, 12 Jun 2025 21:31:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55CLVwXp060889; Thu, 12 Jun 2025 21:31:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55CLVo8E058230; Thu, 12 Jun 2025 21:31:50 GMT (envelope-from git) Date: Thu, 12 Jun 2025 21:31:50 GMT Message-Id: <202506122131.55CLVo8E058230@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: 80c12959679a - main - mandoc: Vendor import of upstream at 2025-04-08 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 80c12959679ab203459dc20eb9ece3a7328b7de5 Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=80c12959679ab203459dc20eb9ece3a7328b7de5 commit 80c12959679ab203459dc20eb9ece3a7328b7de5 Merge: 1b6936e12538 393b94eb9f51 Author: Alexander Ziaee AuthorDate: 2025-06-12 21:25:42 +0000 Commit: Alexander Ziaee CommitDate: 2025-06-12 21:25:42 +0000 mandoc: Vendor import of upstream at 2025-04-08 Interesting changes: + correct legacy mandoc date typo, reported on our very own bugzilla + improve libmandoc manual + strengthen recommendations to omit macros from title lines in mdoc(7) + improve html5 compliance in html output + improve RFC linking in markdown output + libmandoc and mdoc manuals have been improved + support arithmetic operations in tbl(7) column widths for DocBook + define the St -isoC-2023 macro for referencing the C23 spec Approved by: mhorne (mentor, implicit) Reviewed by: imp Discussed with: adrian, bapt, brooks Closes: https://github.com/freebsd/freebsd-src/pull/1689 contrib/mandoc/TODO | 11 +++- contrib/mandoc/libmandoc.h | 3 +- contrib/mandoc/man.1 | 38 ++++++++++- contrib/mandoc/mandoc.1 | 14 ++-- contrib/mandoc/mandoc.3 | 37 ++++++++++- contrib/mandoc/mandoc.css | 5 +- contrib/mandoc/mandoc.h | 5 +- contrib/mandoc/mandoc_msg.c | 3 +- contrib/mandoc/mdoc.7 | 36 +++++----- contrib/mandoc/mdoc_html.c | 61 ++++++++++++----- contrib/mandoc/mdoc_man.c | 7 +- contrib/mandoc/mdoc_markdown.c | 35 +++++++++- contrib/mandoc/out.c | 10 +-- contrib/mandoc/roff.c | 146 +++++++++++++++++++++-------------------- contrib/mandoc/st.c | 2 +- contrib/mandoc/tbl.c | 3 +- contrib/mandoc/tbl.h | 3 +- contrib/mandoc/tbl_layout.c | 36 +++++----- 18 files changed, 304 insertions(+), 151 deletions(-) From nobody Thu Jun 12 23:02:48 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJJ2x09nDz5yYx8; Thu, 12 Jun 2025 23:02:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJJ2w6PMWz3bxf; Thu, 12 Jun 2025 23:02:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749769368; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=F120qRw3FjMPb22FgD2DViFW1/UVd9XqYYOv3B80iEE=; b=Bq0vSDSzBX2QLvCfrucDEPPO3z8sBPUAwcy3CiCgHfdIfUiTAyV2cbyaMz3yENRhm5lF/+ naHCadS01P1ROERe4KIlxBTVGPnEXYz6niaIIgHAEGdbYl0twEYS423H983lv2TKXYh/VA 9lHajNhSsnDvZ3NAX8r8hCAa3e2d1kts2ydzHpiWlQT1zJhHESDTL5KsMXGQHU03UdtICD fPWO0YDXBSwDo8jA2wfXeih+XQb8RYfNiyL/iMZPFlsN9VkstSwiiLkcO/kh1S1KOAGnz3 GTkAhsRLH5txbzUKhueGNyApNDV/N4wIK8ssrSf475pUqxIHse34dKLF+6zXOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749769368; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=F120qRw3FjMPb22FgD2DViFW1/UVd9XqYYOv3B80iEE=; b=n1/++9AE2NyrjyxytqgUnlKcL4/NFEqRxNL113rgZ98H9DB49KEs54145JfUno9JacVAXE 19XT2pqWphY0PktBS6qZDyKmQ2ZRBtP5KB4DDYIi58gq6Z44yeP4z8xUZfgsJAh19OPanb mlgu873MNV3J4GBFOsZ/4PvQLfH+MUNQPCFlGQCs+Y8/Rww3dU/eZVG3AY6ZQLmFJcCEVV LSUNDifPLtTdBxfnfZ8sOrZkMeeYNdLIbD09xhXz9jzi5/imxJ2yiEZ2Y6Rx0Yr3vMIDoB q+q1qEr6UK9MW1f/iq2maYNUsg+XmvAk7Dya8MLt3rAckWQmLwJaX7hiL/D1og== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749769368; a=rsa-sha256; cv=none; b=EXd9A2hIYK41K8Gxw+Khz0yrwOoiuFfiu/uWwpDCs5rSVxA6ExvO0S2htuxI7YVEItvPoB Il12ODg3QQmnKXZdra/HqhxVq6MVicmyxvT/M0p7/2mf+4XrJjPE5K0FD3/6NVS4nsN7wU 5yr979xLhcBRlfVXPfB2hvfGT5Tzs+nNm6DKMbt4i9gdX5yRxli1tkEXASabKoLP77+ohv fVN63dEYhUDr5lLK1BN8/p4MkDtjhMWIrF8GiQ36JfBGxGIiUKeGJsCP6WVZwJgeIujiRx EntuAOW/D+7ukf5VNI/ZAMbqokNJ08LwFnMTTujudP519B99VkxkhOJU0sb5vQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJJ2w5mKQzYk2; Thu, 12 Jun 2025 23:02:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55CN2mOc030163; Thu, 12 Jun 2025 23:02:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55CN2mSp030160; Thu, 12 Jun 2025 23:02:48 GMT (envelope-from git) Date: Thu, 12 Jun 2025 23:02:48 GMT Message-Id: <202506122302.55CN2mSp030160@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 84e730744127 - main - snd_hda: Patch Lenovo T420s List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 84e73074412719ec83143fb514625c09d27f468c Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=84e73074412719ec83143fb514625c09d27f468c commit 84e73074412719ec83143fb514625c09d27f468c Author: Christos Margiolis AuthorDate: 2025-06-11 17:28:40 +0000 Commit: Christos Margiolis CommitDate: 2025-06-12 23:02:15 +0000 snd_hda: Patch Lenovo T420s PR: 222636 Tested by: vermaden@interia.pl Sponsored by: The FreeBSD Foundation MFC after: 1 day --- sys/dev/sound/pci/hda/hdaa_patches.c | 16 ++++++++++++++++ sys/dev/sound/pci/hda/hdac.h | 1 + 2 files changed, 17 insertions(+) diff --git a/sys/dev/sound/pci/hda/hdaa_patches.c b/sys/dev/sound/pci/hda/hdaa_patches.c index e5473ad48cc1..8967cb49125c 100644 --- a/sys/dev/sound/pci/hda/hdaa_patches.c +++ b/sys/dev/sound/pci/hda/hdaa_patches.c @@ -306,6 +306,22 @@ hdac_pin_patch(struct hdaa_widget *w) patch_str = "as=2"; break; } + } else if (id == HDA_CODEC_CX20590 && + subid == LENOVO_T420S_SUBVENDOR) { + switch (nid) { + case 25: + patch_str = "as=1 seq=15"; + break; + case 27: + patch_str = "as=2 seq=15"; + break; + case 31: + patch_str = "as=1 seq=0"; + break; + case 35: + patch_str = "as=2 seq=0"; + break; + } } else if (id == HDA_CODEC_ALC235 && subid == ASUS_GL553VE_SUBVENDOR) { switch (nid) { case 33: diff --git a/sys/dev/sound/pci/hda/hdac.h b/sys/dev/sound/pci/hda/hdac.h index 2a79cb47353c..223434a214b1 100644 --- a/sys/dev/sound/pci/hda/hdac.h +++ b/sys/dev/sound/pci/hda/hdac.h @@ -373,6 +373,7 @@ #define LENOVO_X300_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x20ac) #define LENOVO_T400_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x20f2) #define LENOVO_T420_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21ce) +#define LENOVO_T420S_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21d2) #define LENOVO_T430_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21f3) #define LENOVO_T430S_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21fb) #define LENOVO_T520_SUBVENDOR HDA_MODEL_CONSTRUCT(LENOVO, 0x21cf) From nobody Thu Jun 12 23:06:12 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJJ6r4t5Gz5yZ0R; Thu, 12 Jun 2025 23:06:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJJ6r49r9z3dwl; Thu, 12 Jun 2025 23:06:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749769572; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ev1QWCpBz4vQ2jE1wJqBoz68JBOz0/pMGEEPaWPLeyQ=; b=Zw232RO47ssiNRDVHDB88up6g9p3fW6chl7k4+rrOQJkV8/prXzDzV6JBY9QsBL3uwq7zX hVinaIjp6ANTzSSsHuw91G3DYf3Y9kr3Rj/69Sa6DMF/CE/pyE1mENs9ckJGWy7+FyWXGt 7L47iGd38d3Foo54CIgBzD8KWZGDFW0s3Nlf6lbB2222bnJgDh7jsRQ6QeOur9H+IIawA6 ywHDqxFbsAk3fCq0DmLLI648deYWjCxjD/KSNLUtIVHwHBSPsqd5QLIzuI29geOXFN4Pe/ j0Fp1mQUkJYeNIRSvHkZHUhuC+SS8jMbb5yM/LpM2rgd0WtM9D9eYVRv8jPL/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749769572; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ev1QWCpBz4vQ2jE1wJqBoz68JBOz0/pMGEEPaWPLeyQ=; b=avKOX8fTbcBQzgwiyLY6FyV9FrSi+Dsf76WF1Q7mrXQMr3hoxiP94P9+BkKAlqP9vg2Z2j RQfjKXUpqu4wO81z4nZpUDGMAHNcv54vMoRWwoMcc4Ynr/0bQccQcWHcEJbm8EbEzK4v7a 6n60ENLxw5z9FH1bb03F+Prh+/7uhMtZ0/fPopCrU3FBAlpub3ToJKXE9fi+LBW55UCknZ 6yjx6yQTPLyem2gPVag4qVLg9MlzeusL+pg+a18srvko/SVGVvyHzA5wZgI65b6RMumtNx IulSxqhk/XIYEKGNgIDvjI4R/wJg9A9dJmQM/JDsyIJFQD6HbUd4LYr9lz7GyQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749769572; a=rsa-sha256; cv=none; b=EGlFFWks1YnQRZZ3aqN63Mc6rRIZ8XQtrbF+/0Bk2FURl0nrfP+avG/lpeMaoNQLF0ro6a jDfKc22xv261c5I7H/LgXhEHx1Q123jAY+UGSJuX70gS06KTAfLnJLW0C5KNhhx/TlVzpz cCXXI4+1uoxjK+i0jsSWZUgpisa0R1A6ZG/QhUc2BBFgFUrN0YJ4VOXsBwEbfN+G39bY3U tw0CRYj6WwgP8vLDgfnr7tJZdKGfhLFKJ8JQfILTru/JYL6sHcd5w2AQnKC2wEc2YkEWUr uByLtLA5bcXe/4fXBfz/U9FsptacMScKNS1pHIu9DFmX7NcCkeeMZMBmaKvVTA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJJ6r3lvGzYvP; Thu, 12 Jun 2025 23:06:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55CN6CdQ031426; Thu, 12 Jun 2025 23:06:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55CN6CuX031423; Thu, 12 Jun 2025 23:06:12 GMT (envelope-from git) Date: Thu, 12 Jun 2025 23:06:12 GMT Message-Id: <202506122306.55CN6CuX031423@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: cc9c21308679 - main - fusefs: Fix a panic when unmounting before init List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cc9c213086795fd821e6c17ee99a1db81a2141b2 Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=cc9c213086795fd821e6c17ee99a1db81a2141b2 commit cc9c213086795fd821e6c17ee99a1db81a2141b2 Author: Alan Somers AuthorDate: 2025-06-05 20:00:48 +0000 Commit: Alan Somers CommitDate: 2025-06-12 23:04:34 +0000 fusefs: Fix a panic when unmounting before init fusefs would page fault due to the following sequence of events: * The server did not respond to FUSE_INIT in timely fashion. * Some other process tried to do unmount. * That other process got killed by a signal. * The server finally responded to FUSE_INIT. PR: 287438 MFC after: 2 weeks Sponsored by: ConnectWise Reviewed by: arrowd Differential Revision: https://reviews.freebsd.org/D50799 --- sys/fs/fuse/fuse_internal.c | 3 + tests/sys/fs/fusefs/Makefile | 1 + tests/sys/fs/fusefs/mockfs.cc | 18 +++-- tests/sys/fs/fusefs/mockfs.hh | 6 +- tests/sys/fs/fusefs/pre-init.cc | 154 ++++++++++++++++++++++++++++++++++++++++ tests/sys/fs/fusefs/utils.cc | 3 +- tests/sys/fs/fusefs/utils.hh | 2 + 7 files changed, 179 insertions(+), 8 deletions(-) diff --git a/sys/fs/fuse/fuse_internal.c b/sys/fs/fuse/fuse_internal.c index c6354ae7150f..61fe2ed032f6 100644 --- a/sys/fs/fuse/fuse_internal.c +++ b/sys/fs/fuse/fuse_internal.c @@ -979,6 +979,9 @@ fuse_internal_init_callback(struct fuse_ticket *tick, struct uio *uio) struct fuse_data *data = tick->tk_data; struct fuse_init_out *fiio = NULL; + if (fdata_get_dead(data)) + goto out; + if ((err = tick->tk_aw_ohead.error)) { goto out; } diff --git a/tests/sys/fs/fusefs/Makefile b/tests/sys/fs/fusefs/Makefile index 4265f5b71dfa..b1ac704ab4f6 100644 --- a/tests/sys/fs/fusefs/Makefile +++ b/tests/sys/fs/fusefs/Makefile @@ -39,6 +39,7 @@ GTESTS+= nfs GTESTS+= notify GTESTS+= open GTESTS+= opendir +GTESTS+= pre-init GTESTS+= read GTESTS+= readdir GTESTS+= readlink diff --git a/tests/sys/fs/fusefs/mockfs.cc b/tests/sys/fs/fusefs/mockfs.cc index b1621d05703c..65cdc3919652 100644 --- a/tests/sys/fs/fusefs/mockfs.cc +++ b/tests/sys/fs/fusefs/mockfs.cc @@ -420,7 +420,7 @@ MockFS::MockFS(int max_read, int max_readahead, bool allow_other, bool push_symlinks_in, bool ro, enum poll_method pm, uint32_t flags, uint32_t kernel_minor_version, uint32_t max_write, bool async, bool noclusterr, unsigned time_gran, bool nointr, bool noatime, - const char *fsname, const char *subtype) + const char *fsname, const char *subtype, bool no_auto_init) : m_daemon_id(NULL), m_kernel_minor_version(kernel_minor_version), m_kq(pm == KQ ? kqueue() : -1), @@ -529,7 +529,9 @@ MockFS::MockFS(int max_read, int max_readahead, bool allow_other, ON_CALL(*this, process(_, _)) .WillByDefault(Invoke(this, &MockFS::process_default)); - init(flags); + if (!no_auto_init) + init(flags); + bzero(&sa, sizeof(sa)); sa.sa_handler = sigint_handler; sa.sa_flags = 0; /* Don't set SA_RESTART! */ @@ -543,10 +545,7 @@ MockFS::MockFS(int max_read, int max_readahead, bool allow_other, MockFS::~MockFS() { kill_daemon(); - if (m_daemon_id != NULL) { - pthread_join(m_daemon_id, NULL); - m_daemon_id = NULL; - } + join_daemon(); ::unmount("mountpoint", MNT_FORCE); rmdir("mountpoint"); if (m_kq >= 0) @@ -787,6 +786,13 @@ void MockFS::kill_daemon() { m_fuse_fd = -1; } +void MockFS::join_daemon() { + if (m_daemon_id != NULL) { + pthread_join(m_daemon_id, NULL); + m_daemon_id = NULL; + } +} + void MockFS::loop() { std::vector> out; diff --git a/tests/sys/fs/fusefs/mockfs.hh b/tests/sys/fs/fusefs/mockfs.hh index 1de77767d0c9..ba6f7fded9d0 100644 --- a/tests/sys/fs/fusefs/mockfs.hh +++ b/tests/sys/fs/fusefs/mockfs.hh @@ -366,13 +366,17 @@ class MockFS { enum poll_method pm, uint32_t flags, uint32_t kernel_minor_version, uint32_t max_write, bool async, bool no_clusterr, unsigned time_gran, bool nointr, - bool noatime, const char *fsname, const char *subtype); + bool noatime, const char *fsname, const char *subtype, + bool no_auto_init); virtual ~MockFS(); /* Kill the filesystem daemon without unmounting the filesystem */ void kill_daemon(); + /* Wait until the daemon thread terminates */ + void join_daemon(); + /* Process FUSE requests endlessly */ void loop(); diff --git a/tests/sys/fs/fusefs/pre-init.cc b/tests/sys/fs/fusefs/pre-init.cc new file mode 100644 index 000000000000..e990d3cafffa --- /dev/null +++ b/tests/sys/fs/fusefs/pre-init.cc @@ -0,0 +1,154 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2025 ConnectWise + * + * 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. + */ + +extern "C" { +#include +#include +#include +#include + +#include +#include +#include +#include +} + +#include "mockfs.hh" +#include "utils.hh" + +using namespace testing; + +/* Tests for behavior that happens before the server responds to FUSE_INIT */ +class PreInit: public FuseTest { +void SetUp() { + m_no_auto_init = true; + FuseTest::SetUp(); +} +}; + +static void* unmount1(void* arg __unused) { + ssize_t r; + + r = unmount("mountpoint", 0); + if (r >= 0) + return 0; + else + return (void*)(intptr_t)errno; +} + +/* + * Attempting to unmount the file system before it fully initializes should + * work fine. The unmount will complete after initialization does. + */ +TEST_F(PreInit, unmount_before_init) +{ + sem_t sem0; + pthread_t th1; + + ASSERT_EQ(0, sem_init(&sem0, 0, 0)) << strerror(errno); + + EXPECT_CALL(*m_mock, process( + ResultOf([](auto in) { + return (in.header.opcode == FUSE_INIT); + }, Eq(true)), + _) + ).WillOnce(Invoke(ReturnImmediate([&](auto in, auto& out) { + SET_OUT_HEADER_LEN(out, init); + out.body.init.major = FUSE_KERNEL_VERSION; + out.body.init.minor = FUSE_KERNEL_MINOR_VERSION; + out.body.init.flags = in.body.init.flags & m_init_flags; + out.body.init.max_write = m_maxwrite; + out.body.init.max_readahead = m_maxreadahead; + out.body.init.time_gran = m_time_gran; + sem_wait(&sem0); + }))); + expect_destroy(0); + + ASSERT_EQ(0, pthread_create(&th1, NULL, unmount1, NULL)); + nap(); /* Wait for th1 to block in unmount() */ + sem_post(&sem0); + /* The daemon will quit after receiving FUSE_DESTROY */ + m_mock->join_daemon(); +} + +/* + * Don't panic in this very specific scenario: + * + * The server does not respond to FUSE_INIT in timely fashion. + * Some other process tries to do unmount. + * That other process gets killed by a signal. + * The server finally responds to FUSE_INIT. + * + * Regression test for bug 287438 + * https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=287438 + */ +TEST_F(PreInit, signal_during_unmount_before_init) +{ + sem_t sem0; + pid_t child; + + ASSERT_EQ(0, sem_init(&sem0, 0, 0)) << strerror(errno); + + EXPECT_CALL(*m_mock, process( + ResultOf([](auto in) { + return (in.header.opcode == FUSE_INIT); + }, Eq(true)), + _) + ).WillOnce(Invoke(ReturnImmediate([&](auto in, auto& out) { + SET_OUT_HEADER_LEN(out, init); + out.body.init.major = FUSE_KERNEL_VERSION; + /* + * Use protocol 7.19, like libfuse2 does. The server must use + * protocol 7.27 or older to trigger the bug. + */ + out.body.init.minor = 19; + out.body.init.flags = in.body.init.flags & m_init_flags; + out.body.init.max_write = m_maxwrite; + out.body.init.max_readahead = m_maxreadahead; + out.body.init.time_gran = m_time_gran; + sem_wait(&sem0); + }))); + + if ((child = ::fork()) == 0) { + /* + * In child. This will block waiting for FUSE_INIT to complete + * or the receipt of an asynchronous signal. + */ + (void) unmount("mountpoint", 0); + _exit(0); /* Unreachable, unless parent dies after fork */ + } else if (child > 0) { + /* In parent. Wait for child process to start, then kill it */ + nap(); + kill(child, SIGINT); + waitpid(child, NULL, WEXITED); + } else { + FAIL() << strerror(errno); + } + m_mock->m_quit = true; /* Since we are by now unmounted. */ + sem_post(&sem0); + m_mock->join_daemon(); +} diff --git a/tests/sys/fs/fusefs/utils.cc b/tests/sys/fs/fusefs/utils.cc index d702dec50247..125b7e2d6fc7 100644 --- a/tests/sys/fs/fusefs/utils.cc +++ b/tests/sys/fs/fusefs/utils.cc @@ -151,7 +151,8 @@ void FuseTest::SetUp() { m_default_permissions, m_push_symlinks_in, m_ro, m_pm, m_init_flags, m_kernel_minor_version, m_maxwrite, m_async, m_noclusterr, m_time_gran, - m_nointr, m_noatime, m_fsname, m_subtype); + m_nointr, m_noatime, m_fsname, m_subtype, + m_no_auto_init); /* * FUSE_ACCESS is called almost universally. Expecting it in * each test case would be super-annoying. Instead, set a diff --git a/tests/sys/fs/fusefs/utils.hh b/tests/sys/fs/fusefs/utils.hh index 9dd8dad6b5cc..91bbba909672 100644 --- a/tests/sys/fs/fusefs/utils.hh +++ b/tests/sys/fs/fusefs/utils.hh @@ -69,6 +69,7 @@ class FuseTest : public ::testing::Test { bool m_async; bool m_noclusterr; bool m_nointr; + bool m_no_auto_init; unsigned m_time_gran; MockFS *m_mock = NULL; const static uint64_t FH = 0xdeadbeef1a7ebabe; @@ -95,6 +96,7 @@ class FuseTest : public ::testing::Test { m_async(false), m_noclusterr(false), m_nointr(false), + m_no_auto_init(false), m_time_gran(1), m_fsname(""), m_subtype(""), From nobody Fri Jun 13 00:15:14 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJKfV5VZkz5yfSj; Fri, 13 Jun 2025 00:15:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJKfV4cNsz3Xtv; Fri, 13 Jun 2025 00:15:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749773714; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gy9B/PSUHJo2NLRapG73KOnr8uCmqS4kWEKy51qjYBE=; b=O2RyXkVcKKtB9B05NsAh2hiKLBDInXKVx64sw8Ql2tTwJdzdjt9Mi82fiyxwwKsCetae8+ c3AYKH2AYQfUDvOing2VdAPwc9d5WxRzF65xNXFdVOzeQ+ulmOg1LYzcNA5+s/fZRzq0nW M0qawRI3/+SfJiZVAhO84YLmpyzlZcHDxdc4jnABWB2voGdzRss6V66dFReetvptr8miFg Ftp1WYd79KJYJonYdxttdHSJ2IFFs81OCkTG8oBV9dmNgGqnuLmJup/9KlBHdJRrHpO7Wg u3TfYM123TPIxtQGh8ZstNvnlYJPe74DOsjuPeKUNiIX8xeDT6fJVjVOUwC6hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749773714; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gy9B/PSUHJo2NLRapG73KOnr8uCmqS4kWEKy51qjYBE=; b=Twr6plO+RehbF4nod3WCOw91TiQhnp3QvCiowVHo0r+P5ng7W5+nazLQ4rzEkndZ8QJ5Vu 13gu1zLxSqWdy/r+D3qxV/6e2MhUkC1Z5oPBUd9uiv50jBAodJjL+MDrZiAVng40iaAAl7 6bPtfptiBCNpxoFv5G5bSxOVIGkvIpWVUe8K531Dvcsf8hTb6a/d06h63FhhLg/72+CMkj 3HtjZuL+ndhsUCQA/bt8oUrAq5jl23+0s8SqfKE7DwWsAEr8f4UbdrpHSaSQWrP24d8Bis ExZjwG3IsdPMEHc0wFshx3BA9/WNjrJ0gg/4yUg/4Mimx6vX0R+2eYvzfXM9Bg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749773714; a=rsa-sha256; cv=none; b=OcAYLgzER8oH8JQo8RqS4rgh06xSMiZdFO9brM60kqBZS1r5YajRUelmkOa+wEzwWK2VFC 8S5prPyNw5fu4KNzf4KSfFpz4LiLMILON19qeAAIbtRQ81Zv7KoCg+7mehTMmThI1u1SD0 5b0T2wydOc3xZrJYUWap2ad8Pa/tla6dOvS0khx4YZAfAYA/2gO/bjJ4xXCbyqAAU/WNfK KILK/VhkvE2XkGSsAgZ0+8EuLhk9eJx+5qBc/Q6j/OBwCKa3IFgbh3pKeFelK6H6hCcxrj NfWU3OxDnyEh35gMrAXWegXSlnBGirjoI0WXUB9SiSPiQmtt4nz+9aDxHHVVxw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJKfV42B0zbLn; Fri, 13 Jun 2025 00:15:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55D0FEJ8062168; Fri, 13 Jun 2025 00:15:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55D0FEmZ062165; Fri, 13 Jun 2025 00:15:14 GMT (envelope-from git) Date: Fri, 13 Jun 2025 00:15:14 GMT Message-Id: <202506130015.55D0FEmZ062165@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Enji Cooper Subject: git: a14573de29de - main - atf-c(3): fill in prototypes for functions List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ngie X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a14573de29deda5b86b4458901aa5a0a9bf84375 Auto-Submitted: auto-generated The branch main has been updated by ngie: URL: https://cgit.FreeBSD.org/src/commit/?id=a14573de29deda5b86b4458901aa5a0a9bf84375 commit a14573de29deda5b86b4458901aa5a0a9bf84375 Author: Enji Cooper AuthorDate: 2025-06-07 03:13:31 +0000 Commit: Enji Cooper CommitDate: 2025-06-13 00:14:23 +0000 atf-c(3): fill in prototypes for functions This change fills in prototypes for functions exposed by atf-c(3) to aid the programmer with using the APIs with the library. MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D50734 --- contrib/atf/atf-c/atf-c.3 | 111 ++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 92 insertions(+), 19 deletions(-) diff --git a/contrib/atf/atf-c/atf-c.3 b/contrib/atf/atf-c/atf-c.3 index 6369cb5697f8..287ebd41a033 100644 --- a/contrib/atf/atf-c/atf-c.3 +++ b/contrib/atf/atf-c/atf-c.3 @@ -131,25 +131,98 @@ .Fn ATF_TC_WITHOUT_HEAD "name" .Fn ATF_TP_ADD_TC "tp_name" "tc_name" .Fn ATF_TP_ADD_TCS "tp_name" -.Fn atf_tc_get_config_var "tc" "varname" -.Fn atf_tc_get_config_var_wd "tc" "variable_name" "default_value" -.Fn atf_tc_get_config_var_as_bool "tc" "variable_name" -.Fn atf_tc_get_config_var_as_bool_wd "tc" "variable_name" "default_value" -.Fn atf_tc_get_config_var_as_long "tc" "variable_name" -.Fn atf_tc_get_config_var_as_long_wd "tc" "variable_name" "default_value" -.Fn atf_no_error -.Fn atf_tc_expect_death "reason" "..." -.Fn atf_tc_expect_exit "exitcode" "reason" "..." -.Fn atf_tc_expect_fail "reason" "..." -.Fn atf_tc_expect_pass -.Fn atf_tc_expect_signal "signo" "reason" "..." -.Fn atf_tc_expect_timeout "reason" "..." -.Fn atf_tc_fail "reason" -.Fn atf_tc_fail_nonfatal "reason" -.Fn atf_tc_pass -.Fn atf_tc_require_kmod "kmod" -.Fn atf_tc_require_prog "prog" -.Fn atf_tc_skip "reason" +.Ft const char* +.Fo atf_tc_get_config_var +.Fa "const atf_tc_t *tc" +.Fa "const char *name" +.Fc +.Ft const char* +.Fo atf_tc_get_config_var_wd +.Fa "const atf_tc_t *tc" +.Fa "const char *name" +.Fa "const char *defval" +.Fc +.Ft bool +.Fo atf_tc_get_config_var_as_bool +.Fa "const atf_tc_t *tc" +.Fa "const char *name" +.Fc +.Ft bool +.Fo atf_tc_get_config_var_as_bool_wd +.Fa "const atf_tc_t *tc" +.Fa "const char *name" +.Fa "const bool defval" +.Fc +.Ft long +.Fo atf_tc_get_config_var_as_long +.Fa "const atf_tc_t *tc" +.Fa "const char *name" +.Fc +.Ft long +.Fo atf_tc_get_config_var_as_long_wd +.Fa "const atf_tc_t *tc" +.Fa "const char *name" +.Fa "const long defval" +.Fc +.Ft void +.Fo atf_no_error +.Fa "void" +.Fc +.Ft void +.Fo atf_tc_expect_death +.Fa "const char *reason" +.Fa "..." +.Fc +.Ft void +.Fo atf_tc_expect_exit +.Fa "const int exitcode" +.Fa "const char *reason" +.Fa "..." +.Fc +.Ft void +.Fo atf_tc_expect_fail +.Fa "const char *reason" +.Fa "..." +.Fc +.Ft void +.Fo atf_tc_expect_pass +.Fa "void" +.Fc +.Ft void +.Fo atf_tc_expect_signal +.Fa "const int signo" +.Fa "const char *reason" +.Fa "..." +.Fc +.Ft void +.Fo atf_tc_expect_timeout +.Fa "const char *reason" +.Fa "..." +.Fc +.Ft void +.Fo atf_tc_fail +.Fa "const char *reason" +.Fc +.Ft void +.Fo atf_tc_fail_nonfatal +.Fa "const char *reason" +.Fc +.Ft void +.Fo atf_tc_pass +.Fa "void" +.Fc +.Ft void +.Fo atf_tc_require_kmod +.Fa "const char *kmod" +.Fc +.Ft void +.Fo atf_tc_require_prog +.Fa "const char *prog" +.Fc +.Ft void +.Fo atf_tc_skip +.Fa "const char *reason" +.Fc .Ft void .Fo atf_utils_cat_file .Fa "const char *file" From nobody Fri Jun 13 00:20:20 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJKmN5gGGz5yfhH; Fri, 13 Jun 2025 00:20:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJKmN4Vrjz3cTb; Fri, 13 Jun 2025 00:20:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749774020; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YFi35g3uUF91DrejgG1uZWqqjkurBfWMAZePjz/rWKE=; b=gd6rompaqtcNIb+kNKD0iS8djWm9m/jnGOB68Me2D7QFrryCXgl8e1nitTxMiYLeP/HZww 1gJGTQjqUBbwaF/LFV0CBotLrC6fCgM9B5fLd9IJHnZcQ0E/m0fRfAXWeLdiisM9i5AAzV sxRCUfhMCorLWpG1mGmWeesqOcLy5uJgMSw0+qCHp4d9I+ICWaGzEImWVV8NFe9FQHdq40 6bL0/dptfh8m3/P3tfi3vS4Hf8mLLnKiYLLqVM4Yo3jhs02dx+knBxR5qugOfCgoNrEt54 CHZ5Rki5i3mMoC1xZVxrcpYsyq0cYgHQbloXaadcW7r0AL4IvZBB8P9XT14Hqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749774020; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YFi35g3uUF91DrejgG1uZWqqjkurBfWMAZePjz/rWKE=; b=O4JdyfbaRElBzPVlKlRIULAglklkUX7yOCskxlQB78JBTbaarmrTaFi5qKBMX33pWNCNC8 FGXy8YDfzco1YGTJCCJouo/dCnTpvyBz7jE57yr0XsqGrl+rjGE5Ua90zraiIXx7zPYBCC mNPDlm+A4STQetIxlL1xyzRoZ7j/v4yX3jj9KJiQIeFCKEsKG05x42+SP59sxAhTsq0b5v 65BhENp0gOXlV5wlZHo4DgUL2JrhjQYb7+nZjfw00jRf5AMlwuzVV+nvg8hgy8OcM0tMuV eZTsk1CNS0TMuii266XSFMyfwsneJTa/GoOR8o+DBJnHArhSIG/HUqghpEnWIg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749774020; a=rsa-sha256; cv=none; b=C0tTv7JGvG6cuMIOewlBc/EzzR9llSDYVEz67WOp6NLcJfPRlh2L1qeZb3eK2NdvO8zm5w +5+ECQXEDlMyHDe8Uuxt/RYufeV9YlFN/B4zYccuzlseOr3Y998xUlxT1Vb7XPIVelKQGa NFAQLIEVfzx2u8wggAzqy1P6Vgnd76wQvhuLhe+l/2zNxLajTBZKAnstHJXx/7Mrua61h6 uTNPqUFNm9W9S14QG/aIYZm8UjVsBspyI+1uNpKGek2tzBG0MpqGmVHFcVSIr46y0fOM6C i5wk0ql+T6wMUfULbOlnhtbJq4fwY2gihVlIjEHR1HaP1slqI6Jo47hQLFq6VA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJKmN403nzZyN; Fri, 13 Jun 2025 00:20:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55D0KKTw072380; Fri, 13 Jun 2025 00:20:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55D0KKnP072378; Fri, 13 Jun 2025 00:20:20 GMT (envelope-from git) Date: Fri, 13 Jun 2025 00:20:20 GMT Message-Id: <202506130020.55D0KKnP072378@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Enji Cooper Subject: git: 2a678ff8907f - main - atf-c(3): bump .Dd for the content change List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ngie X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2a678ff8907fa0197e65bd9b9f0e4b5a3b236b20 Auto-Submitted: auto-generated The branch main has been updated by ngie: URL: https://cgit.FreeBSD.org/src/commit/?id=2a678ff8907fa0197e65bd9b9f0e4b5a3b236b20 commit 2a678ff8907fa0197e65bd9b9f0e4b5a3b236b20 Author: Enji Cooper AuthorDate: 2025-06-13 00:19:33 +0000 Commit: Enji Cooper CommitDate: 2025-06-13 00:19:33 +0000 atf-c(3): bump .Dd for the content change MFC after: 2 weeks MFC with: a14573de29de --- contrib/atf/atf-c/atf-c.3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/atf/atf-c/atf-c.3 b/contrib/atf/atf-c/atf-c.3 index 287ebd41a033..153c09fb0f7e 100644 --- a/contrib/atf/atf-c/atf-c.3 +++ b/contrib/atf/atf-c/atf-c.3 @@ -22,7 +22,7 @@ .\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -.Dd May 11, 2025 +.Dd June 12, 2025 .Dt ATF-C 3 .Os .Sh NAME From nobody Fri Jun 13 01:21:44 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJM7F3wG3z5ykGv; Fri, 13 Jun 2025 01:21:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJM7D375Kz3L0f; Fri, 13 Jun 2025 01:21:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749777704; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pLbimveUhImbfG8/ZTIk2a3rmpRpBhXiqBm4apcfmJQ=; b=rJOSJFmlkJn5A5F19cutkcUkmpFhhGZBxDN6y9G30ekbPnESkmzoOXPuXkdDnrK0vyt3bX E6ANnmn3Vaklf98QGD3m77lc6Tx55kTKg0t+hAq1L8pt56rxnrXnpw8EvDWtOUOFgsaC2M GNP22Cb9AI1Csk/0dfpYIejGLgUe9rk0KYnqJys0uDiaAlCP3TpsBN5p2Iahn/fY+569CT j9669yxCKqSMHGIQR2fufVON592h6+fS3eA7s+el+8q4kvmQ5ftep6Za05CtxKUi9+ZLA0 38GfZte1jdNEEV6jfthCgCwJ6NqOF969I5+ScIUsk/dhI9sY2Q7kJr+L8lZT4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749777704; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pLbimveUhImbfG8/ZTIk2a3rmpRpBhXiqBm4apcfmJQ=; b=jDEmgr6uzKo9FCCNczXrOsqotQznmvpNGIagH2/Y3fgx6HIBB7ue6XZIhro+X4LPKz15IH sO6zmjVQOdWuyXMWWRIOl6UO3uHbx3Ht82yTHnyYeDnVsw1YiXUtmOHI7dzuJ/ThAgoFk3 dd1gi5GoLgy/fgJU3zK9kktoPs85guC8MFLW5dtK7PyLDdpPSQ76sDOo116p5o+7Ew0CEP R/XYBTSKWsw50a5QCynMsGtEbjI2vuIjCb0moBj8ZeINaSc57dHrdVS6Dcft3MVtH7HHBf YYU38rYEkWYbFDhoDl5DdBq4ryhskD78U0xyCiOANxk6CqrIAL1qh4O2fg7IeA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749777704; a=rsa-sha256; cv=none; b=HsLK/1Gfe3BO8UN0m7SIwA/92Tsiwr6zMl3i0mVoNEWRCWxVfCHEZrHiPNHPImRcjt6oFS ZlmdlpwNKCSNccPEEWBaHuhJ7etLLqw9neyNSLuXcTIc/XqN6itfaDrPehtZByIhU6h3pe 3fMg3igDVatoDB7oLUSmKvpkLcnn7FkIy77NIZM0Bf5eNypdbT7rX6ZCC6ptiRD7lfh5WM /SNf2SbGd0cPMsyGzeXe/oXMqvomlCV9l5dVvKYmZ+p+DwPu1nvOHqdvOKvdvaPCSu9sBi qM1W9b9W+jryuWmSP26G/09AoIpngVXxUoR/PjgjzrMaRL0KUdPrA+HmRHsTCg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJM7D2l3Czd0f; Fri, 13 Jun 2025 01:21:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55D1Li1B086495; Fri, 13 Jun 2025 01:21:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55D1LiMA086493; Fri, 13 Jun 2025 01:21:44 GMT (envelope-from git) Date: Fri, 13 Jun 2025 01:21:44 GMT Message-Id: <202506130121.55D1LiMA086493@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 3601528f19c3 - main - Makefile.inc1: define PKG_VERSION_FROM only if $REPO/latest symlink exists List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3601528f19c30b633e3c5631b74e2bf79705aac9 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=3601528f19c30b633e3c5631b74e2bf79705aac9 commit 3601528f19c30b633e3c5631b74e2bf79705aac9 Author: Siva Mahadevan AuthorDate: 2024-10-04 22:03:27 +0000 Commit: Warner Losh CommitDate: 2025-06-13 01:21:44 +0000 Makefile.inc1: define PKG_VERSION_FROM only if $REPO/latest symlink exists Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1445 --- Makefile.inc1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 42a5f5cfb0a9..e56c40c114fc 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2000,7 +2000,7 @@ PKG_EXT= pkg .endif .if !defined(PKG_VERSION_FROM) && make(real-update-packages) -.if exists(${PKG_ABI_FILE}) && exists(${REPODIR}/${PKG_ABI}) +.if exists(${PKG_ABI_FILE}) && exists(${REPODIR}/${PKG_ABI}/latest) PKG_VERSION_FROM!=/usr/bin/readlink ${REPODIR}/${PKG_ABI}/latest PKG_VERSION_FROM_DIR= ${REPODIR}/${PKG_ABI}/${PKG_VERSION_FROM} # Determine the name of the branch base on the version From nobody Fri Jun 13 01:21:45 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJM7G46gZz5ykGw; Fri, 13 Jun 2025 01:21:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJM7F4F6Pz3Kmb; Fri, 13 Jun 2025 01:21:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749777705; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qW1cA8rPwKzFN0CzAleHpHz41PqjVbQYkTE2Yh4vbFg=; b=lFdZYpvOCzQSr3+FZjwgFHkM3qyvkWPrkDTzLx04sJQ5csl2AIchQZ8ayOgJcE5ozXg77J IThgNcslBh8Qw12g2SrRM1PeLvhXNuJzn+zO8J3P5UXqDFdYGQgoAQG9ZzJVLvrh1FU/7a NV0PFGUVHUtd+R6pzz9e5H05ekzkjpFYh4StDs9MNLBZ3Gslwpnz8nMZebHP+mxSjd8KsY QVWSqngS6+lGvgIT2qB+zSlBkg0AI+W+v+SbRmA1YuNQlrHG+F7N2lM+oGB5J9ZIkyyASm 70hdfIi/ITj6FulVMM9uFuIAIkhhR8+yw4vab8VgM7A3MZvHtBqOgVeTuKsciA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749777705; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qW1cA8rPwKzFN0CzAleHpHz41PqjVbQYkTE2Yh4vbFg=; b=m0LZ6mLggnyEy9IlEO1pbdU/vuptSI3V/qslRBUi/CJqDvw9HC8InInbFUTpjxg0rrvohD 4vxSBQjPO2VHiJyEM8RI60UfebKHGo8zxmM/ANW7Y4RBRLrcQVoPDEAynsGZ/c3CAqYA8T 2/4/NBBXF28PzVTv1/zlw8+0K5OHnXdaQzEHJb74THId5y/32axtcuGUogcPDLXkNp/4xP fIBRJI7MtJrBlKVVAYtRMRUoFQjzswfmH3ZvwliT/Tb0zA35DI/ow28chOL5n+NJbdBAab 0L2AFrJMpIjLqCw4fJb47HLJ/0uajEtfPQx5Vi/RUb/5S9lkzqiOMIgEd6EFGA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749777705; a=rsa-sha256; cv=none; b=iDYHne5YFD+aPyDHKummwdE/qxOKJjG7eHPylprLkKpbxQpzkH5gKQ8dONeMmVqrM53qsC WqHndYCBuYyR3lXZujlhLbayFMDZGkoSO6rLhbI9WU0FbcdUMkJOgAGXAFS7xF4upc/GyR WIpEz8dobJc0nvkYybkRDaXsbGBzSsGml7ua3Z12O7G2bTTDnKFWaUllgjniKE5+HV9s4y wY7cZtxc7OrN5A/1Qdno9CqKMPEpEBURvdhsEdXMfVgz5z5stYKwucXBRTRUATI+vFZBlY niw/OSu+0TOASNufoCArNot0QCr9hBDRSJzaWswPKLNQ5fnmbjBKT3z83ml3SA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJM7F3jTszdVB; Fri, 13 Jun 2025 01:21:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55D1Lj9S086529; Fri, 13 Jun 2025 01:21:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55D1LjOB086526; Fri, 13 Jun 2025 01:21:45 GMT (envelope-from git) Date: Fri, 13 Jun 2025 01:21:45 GMT Message-Id: <202506130121.55D1LjOB086526@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: d0f4b71cc053 - main - Makefile.inc1: minor style changes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d0f4b71cc053c3d28870c1bf47c4f1d2c7d49d3a Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d0f4b71cc053c3d28870c1bf47c4f1d2c7d49d3a commit d0f4b71cc053c3d28870c1bf47c4f1d2c7d49d3a Author: Siva Mahadevan AuthorDate: 2024-10-04 22:35:08 +0000 Commit: Warner Losh CommitDate: 2025-06-13 01:21:44 +0000 Makefile.inc1: minor style changes Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1445 --- Makefile.inc1 | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index e56c40c114fc..50efeecd5def 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1999,8 +1999,8 @@ PKG_EXT= ${PKG_FORMAT} PKG_EXT= pkg .endif -.if !defined(PKG_VERSION_FROM) && make(real-update-packages) -.if exists(${PKG_ABI_FILE}) && exists(${REPODIR}/${PKG_ABI}/latest) +.if !defined(PKG_VERSION_FROM) && make(real-update-packages) && \ + exists(${PKG_ABI_FILE}) && exists(${REPODIR}/${PKG_ABI}/latest) PKG_VERSION_FROM!=/usr/bin/readlink ${REPODIR}/${PKG_ABI}/latest PKG_VERSION_FROM_DIR= ${REPODIR}/${PKG_ABI}/${PKG_VERSION_FROM} # Determine the name of the branch base on the version @@ -2023,11 +2023,6 @@ BRANCH_EXT_FROM= rc .elif ${PKG_VERSION_FROM:M*.a*} BRANCH_EXT_FROM= alpha .endif -.else -PKG_VERSION_FROM= -PKG_VERSION_FROM_DIR= -BRANCH_EXT_FROM= -.endif .endif PKGMAKEARGS+= PKG_VERSION=${PKG_VERSION} \ @@ -2051,9 +2046,7 @@ real-packages: stage-packages create-packages sign-packages .PHONY real-update-packages: stage-packages .PHONY ${_+_}${MAKE} -C ${.CURDIR} PKG_VERSION=${PKG_VERSION} create-packages -.if empty(PKG_VERSION_FROM_DIR) - @echo "==> Bootstrapping repository, not checking for new packages" -.else +.if defined(PKG_VERSION_FROM_DIR) @echo "==> Checking for new packages (comparing ${PKG_VERSION} to ${PKG_VERSION_FROM})" @for pkg in ${PKG_VERSION_FROM_DIR}/${PKG_NAME_PREFIX}-*; do \ pkgname=$$(pkg query -F $${pkg} '%n' | sed 's/${PKG_NAME_PREFIX}-\(.*\)/\1/') ; \ @@ -2071,9 +2064,10 @@ real-update-packages: stage-packages .PHONY echo "==> New package $${newpkgname}" ; \ fi ; \ done +.else + @echo "==> Bootstrapping repository, not checking for new packages" .endif - ${_+_}@cd ${.CURDIR}; \ - ${MAKE} -f Makefile.inc1 PKG_VERSION=${PKG_VERSION} sign-packages + ${_+_}${MAKE} -C ${.CURDIR} -f Makefile.inc1 PKG_VERSION=${PKG_VERSION} sign-packages stage-packages-world: .PHONY @mkdir -p ${WSTAGEDIR} From nobody Fri Jun 13 01:21:47 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJM7J4NmKz5ykDC; Fri, 13 Jun 2025 01:21:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJM7H6GB0z3Kmn; Fri, 13 Jun 2025 01:21:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749777707; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RgJ+SzQw9Ay3FZgC8PZeJX8pX9B2Dj4gGs0Xvn1TWEc=; b=HaDItsBdIrffbRSqTvUzikGQXzbEUp2Q+SllblgwSQkZhMxKZXRl3MaZS/YcvmTbgqWXFZ wwYL5gVt4OTge9WYOtRfZDEwejoJlYreVNjmyJxfxhj0KWHYStPLvN3CqbHyFg+WcWA+xU w2jihN/jKvZ77iN2bNrsR0SnBRStoi+tqtXMJPUzCbZVSZ97GIVeipT7foI01u0fLAKhf+ 9hpToJsa5ZBLo10TQaJZer0Fva+prYRWTr5QYdFT/rjm8yl0LUooBIoaNBBqeHfLrg4bDq iPq4bWUb8OYIOcaELg/LtbjHv5VzhXsCrUkTACxgAxc5VnHtR1U7El9Xjpp/iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749777707; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RgJ+SzQw9Ay3FZgC8PZeJX8pX9B2Dj4gGs0Xvn1TWEc=; b=aO+l0l9enOGtiL7pvkMGoIaXYiLxBLm/W6WmXibqk3ojXJlydBd8x0n4suLePe1LlgCbV0 dAHfX8Y7rrcBU0t41iWGvBzCyyr/wMKiIwh9ZPZWwvsKOVCAiiPqTmPGX+1TW7BT6Ql+7Q 6cyKDOiNB9VHPK7vFMPor1PfFIcWa62mAgO8k3KhpRbfGP3qK0kwZKIK8S/2CnSGLw8TsR pH4G07uwRF+IqWzuoEBetOp3BRJdKuYrIylnr4s9JCxRe+M84gVKMtX1+o0aI3tDaaftKN s77ocQIgGOVPkV4gPzHyNVwqC9lII9rS9xVhp2qUq4lQJ/TXY3FXa0OGGUeflQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749777707; a=rsa-sha256; cv=none; b=mnRzcpqokpo1+duYBjvCKAfu0kWZ9OfNWzvu3+etlR63xWF4a5nXmSXFs+3f7zm1MYD0mH XAuXL1kNXKS+nNirJWlaAGEXpzC4ercYWCm3Jt6z9NlTRZacIfkLd7GINAcUvJ1QrNYBGv PtAn6a9JTd/9bRvBKtSQOpJtO02QJ1Pby8lrtXeLSV7hQFHrk0FhR5NS423lI/05Io1PVH Vuu63xvMQd9lkwXe0TWX/9t13mJ/uEEAf/0d5urOOzq1YI7SgA83Q63Fha2I5S26fFE/Rh Gn4Pj1vEtOnJyRpHWf9XZWjwNgwB5HZBgKrHLE7Y0A/0ZflNlocLZjH3DR5NlA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJM7H5t1HzdVG; Fri, 13 Jun 2025 01:21:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55D1LltF086597; Fri, 13 Jun 2025 01:21:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55D1LlDb086594; Fri, 13 Jun 2025 01:21:47 GMT (envelope-from git) Date: Fri, 13 Jun 2025 01:21:47 GMT Message-Id: <202506130121.55D1LlDb086594@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 954ac4049852 - main - acpi_wmi.4: fall cleaning List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 954ac4049852cc1cf6d6074d9247b67f02b84b12 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=954ac4049852cc1cf6d6074d9247b67f02b84b12 commit 954ac4049852cc1cf6d6074d9247b67f02b84b12 Author: Alexander Ziaee AuthorDate: 2024-10-17 05:24:50 +0000 Commit: Warner Losh CommitDate: 2025-06-13 01:21:44 +0000 acpi_wmi.4: fall cleaning + add descriptions to existing examples + github repo url in sysctls => port named in example using it + reword MOF description for consistency with external docs + restore standard link, move to STANDARDS + grammar and markup nits + tag SPDX MFC after: 3 days Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1477 Closes: https://github.com/freebsd/freebsd-src/pull/1477 --- share/man/man4/acpi_wmi.4 | 61 ++++++++++++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 24 deletions(-) diff --git a/share/man/man4/acpi_wmi.4 b/share/man/man4/acpi_wmi.4 index 9ad14ed7892a..e5c5517ba4ac 100644 --- a/share/man/man4/acpi_wmi.4 +++ b/share/man/man4/acpi_wmi.4 @@ -1,3 +1,6 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2009 Michael Gmelin .\" All rights reserved. .\" @@ -22,47 +25,45 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd September 5, 2019 +.Dd June 12, 2025 .Dt ACPI_WMI 4 .Os .Sh NAME .Nm acpi_wmi -.Nd "ACPI to WMI mapping driver" +.Nd ACPI to WMI mapping driver .Sh SYNOPSIS To compile this driver into the kernel, place the following line in your kernel configuration file: -.Bd -ragged -offset indent -.Cd "device acpi_wmi" -.Ed +.Pp +.Dl Cd "device acpi_wmi" .Pp Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : -.Bd -literal -offset indent -acpi_wmi_load="YES" -.Ed +.Pp +.Dl acpi_wmi_load="YES" .Sh DESCRIPTION The .Nm driver provides an interface for vendor specific WMI implementations -(e.g. HP and Acer laptops). -It creates /dev/wmistat%d, which can be read to get -information about GUIDs found in the system. +.Pq e.g. HP and Acer laptops . +It creates +.Pa /dev/wmistat%d , +which can be read to get information about GUIDs found in the system. .Sh FILES .Bl -tag -width /dev/wmistat%d -compact .It Pa /dev/wmistat%d -WMI status device. +WMI status devices. .El .Sh SYSCTLS The following sysctl node is currently implemented: -.Bl -tag +.Bl -tag -width "dev.acpi_wmi.%d.bmof" .It Va dev.acpi_wmi.%d.bmof -Managed Object Format (MOF) blob. -You can obtain human readable output by bmf2mof in bmfdec tool. -(https://github.com/pali/bmfdec) +binary Managed Object Format (MOF) buffer .El .Sh EXAMPLES +Read GUIDs from the first WMI interface found in the system: .Bd -literal # cat /dev/wmistat0 GUID INST EXPE METH STR EVENT OID @@ -78,7 +79,14 @@ GUID INST EXPE METH STR EVENT OID {8232DE3D-663D-4327-A8F4-E293ADB9BF05} 0 NO NO NO NO BG {8F1F6436-9F42-42C8-BADC-0E9424F20C9A} 0 NO NO NO NO BH {8F1F6435-9F42-42C8-BADC-0E9424F20C9A} 0 NO NO NO NO BI -# sysctl -b dev.acpi_wmi.0.bmof |bmf2mof +.Ed +.Pp +Read first WMI interface description with +.Sy bmf2mof +from +.Pa ports/converters/bmfdec : +.Bd -literal +# sysctl -b dev.acpi_wmi.0.bmof | bmf2mof [abstract] class Lenovo_BIOSElement { }; @@ -91,10 +99,15 @@ class Lenovo_BiosSetting : Lenovo_BiosElement { [WmiDataId(1), Description("BIOS setting")] String CurrentSetting; }; ... - .Ed .Sh SEE ALSO .Xr acpi 4 +.Sh STANDARDS +.Rs +.%T Windows Instrumentation: WMI and ACPI +.%I Microsoft Corporation +.%U https://github.com/microsoft/Windows-driver-samples/tree/main/wmi/wmiacpi +.Re .Sh HISTORY The .Nm @@ -107,13 +120,13 @@ The driver was written by .An Michael Gmelin Aq Mt freebsd@grem.de . .Pp -Work has been inspired by the Linux acpi-wmi driver written by Carlos Corbacho. -.Pp -See http://www.microsoft.com/whdc/system/pnppwr/wmi/wmi-acpi.mspx for -the specification of ACPI-WMI. +Work inspired by the Linux +.Sy acpi-wmi +driver written by Carlos Corbacho. .Pp -MOF part has been inspired by the Linux wmi-bmof driver -written by Andy Lutomirski. +MOF handling inspired by the Linux +.Sy wmi-bmof +driver written by Andy Lutomirski. .Pp This manual page was written by .An Michael Gmelin Aq Mt freebsd@grem.de . From nobody Fri Jun 13 01:21:46 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJM7H2KNHz5ykW4; Fri, 13 Jun 2025 01:21:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJM7G5kYcz3Kxj; Fri, 13 Jun 2025 01:21:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749777706; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3f8bqUU8wV6X+5EyC5XqK/WLKMR/0zYCD2JQhR4Y/VM=; b=whIwgu0K9BcZNSE4aNVbzzCNg3SWdHsvCh66thykQUj+Wi2qizgwzP++yNSj2ewZr8jCT2 MtuhHyDZA2bzfr9cEaKdjtBWJ0uE85UBsBIB7kfnktBfCsKIDJaSB1cElvn/YgeBRIgYA7 S+lf4HHp4V61CpCfUkRDIW3Edz9VBsqDgtZcmkBHvZuIcY4evAB6Q8xXddn9+0U+E3Rfkk QJqH9in8uwPXs1vz7WyFlI0rTOl3MRd5nsd9ssYdegN/nIojpsRTSKLwkCfsjH4yAW48wT Iz7GKo5WDrgxSijv7bqAs1inqXXmlbbmJrL0o6Kxl0Cpe6IS+Aa7mJf7ZOKBvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749777706; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3f8bqUU8wV6X+5EyC5XqK/WLKMR/0zYCD2JQhR4Y/VM=; b=dh9MwO3RjQPjlBis1hj5432gWPAWSki1SjxgSHKCwxSO6mLPGdz48fm+iMmZrh3Uv5kR7G pDXR352qv0LWuwgXFVyF/gRemTYjl47f6rRbq/EKiCka/MtSZBsuoDAeGGJuTTqGstv0TC WfA2buNiCmp7R4m5rqhel4pqhBT3zCkES3MeqopGE5Fd6mFMKh7d0xJjs6bGmatz9nLtEi pFnTvYyeryBSjlAPeGp0U11weAt5ED/5R+N8GRVF7uOHJpiaSAeKGEqGQdYnaC95SLIcfn 4BEzN96kDc1/RQwW/tNKLr3KE/9cvrKb1Weyjs9aYwnatXkikdpKF3kfcn7lvA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749777706; a=rsa-sha256; cv=none; b=NmArJzx4Ehj69mEAxnG7pBWeKYasMJPj5Wa1XhYCFAG4NlagyCfe7NMlwDJwFpV3pQJSNv OoGTBDLe+c1QNjYEjJ8hIeizNqqxfji8bLPe6RcToq2ik9DwZNTiXudQSA3JH4t+uIVlSX DQ/zPVNQjI5YAzilOTZrkupWTxGtRaC+VHbPhPFDOBtCEwALd/ZYUYR6/UGAAabreFHJMs 1xYayKRwzHdbjd0yTC8MhEx3va4sSCjcdWNUOw8j39s8izYjeUzVV5DL9HgkenLDNhk1Wa Qb7w3EUUIbGa3X3aQK6twh2BzhOEgGE3hTIWSILEkZfuAUloCkzxiuNgOoZkUA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJM7G58XGzcwb; Fri, 13 Jun 2025 01:21:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55D1Lk5V086562; Fri, 13 Jun 2025 01:21:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55D1LkN5086559; Fri, 13 Jun 2025 01:21:46 GMT (envelope-from git) Date: Fri, 13 Jun 2025 01:21:46 GMT Message-Id: <202506130121.55D1LkN5086559@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: b44147bb1245 - main - Makefile.inc1: allow real-update-packages to be called independently List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b44147bb12450bdf851a519d1cdc85402f89ed1f Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=b44147bb12450bdf851a519d1cdc85402f89ed1f commit b44147bb12450bdf851a519d1cdc85402f89ed1f Author: Siva Mahadevan AuthorDate: 2024-10-04 22:46:09 +0000 Commit: Warner Losh CommitDate: 2025-06-13 01:21:44 +0000 Makefile.inc1: allow real-update-packages to be called independently To perform an incremental update of a pkgbase repo, you would call 'make update-packages', which will stage, create, and incrementally choose newer package versions to sign as part of a pkg repo. However, this forces you to stage the kernel and source packages along with the world packages. For a jail-only installation of FreeBSD, these packages are generally not required. This patch separates the 'update-packages' target from the 'real-update-packages' target to allow choosing world, kernel, and/or source individually at the command line like so: Jail-only installation: 1. make -j`nproc` buildworld 2. make PKG_VERSION='15.snap' \ stage-packages-world create-packages-world \ real-update-packages Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1445 Closes: https://github.com/freebsd/freebsd-src/pull/1445 --- Makefile.inc1 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 50efeecd5def..588f95654e99 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2031,8 +2031,8 @@ PKGMAKEARGS+= PKG_VERSION=${PKG_VERSION} \ packages: .PHONY ${_+_}${MAKE} -C ${.CURDIR} ${PKGMAKEARGS} real-packages -update-packages: .PHONY - ${_+_}${MAKE} -C ${.CURDIR} ${PKGMAKEARGS} real-update-packages +update-packages: stage-packages .PHONY + ${_+_}${MAKE} -C ${.CURDIR} ${PKGMAKEARGS} create-packages real-update-packages package-pkg: .PHONY rm -rf /tmp/ports.${TARGET} || : @@ -2044,8 +2044,7 @@ package-pkg: .PHONY real-packages: stage-packages create-packages sign-packages .PHONY -real-update-packages: stage-packages .PHONY - ${_+_}${MAKE} -C ${.CURDIR} PKG_VERSION=${PKG_VERSION} create-packages +real-update-packages: .PHONY .if defined(PKG_VERSION_FROM_DIR) @echo "==> Checking for new packages (comparing ${PKG_VERSION} to ${PKG_VERSION_FROM})" @for pkg in ${PKG_VERSION_FROM_DIR}/${PKG_NAME_PREFIX}-*; do \ From nobody Fri Jun 13 01:21:48 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJM7K6BFJz5ykDD; Fri, 13 Jun 2025 01:21:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJM7K0NXnz3LBg; Fri, 13 Jun 2025 01:21:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749777709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V4F3BKp6+kRhPMG8wLRtFxhGpDv88WEne5jdqnQdVxs=; b=X4NfSZihOEzxEOVoqHdyRrwrf8/dyx9oznR9l+rCy+9k+xJ2KVBqoKjk1HQDrgwxZRUaGF uYYtxecWdk0ppV5G45psmcQJOsY+iorB+Hprc0JNjFrwhJywQvTs8SL1n3hIANo951m/YF j5PiUV2V3A82zajRiDMZ59s0ovmqWuR2J759tESKdEqnLVhKk38R230Sjvcc2UtFpMHKlZ sTONJUSGxdMDVX53lB93kgPc5XwAv+uFltwjG/xd/UJ3yX1uwNMaOHFk+tJMqAG9jbOhzH OWiAAhX1EGc23RdQos/IKPyQB06srfTuyo8tqzvGXOvNCu32HVo6TqD7hI5goA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749777709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V4F3BKp6+kRhPMG8wLRtFxhGpDv88WEne5jdqnQdVxs=; b=D+CC1CFRgro4uHh8NRQ/yIFWfLCEoKQvo4L7WtoRm6AvCRBAzKQnPdu2y0jK6nhWVMpccr uDFoVBCRXLQNwGt+oW49EnQ1pryUvx8NrdIhtNQmbZAQ0vIkmKI8m4pMyiVNwxDe3gmF6D WLGolSyrYhCUpMLxR3Gcs6i00uNz/SqMcIA8HKSR9jTwKOUD/tJOq2eMsAqP2Brbji62pH RU6Yynw/d0eSLcBcO3q4tXhGpj3ninqyQx8pxivz/2eNrV/SzzU/l9vTuNGg86+t7Xeju8 KZ3QBWrkbe0pNO3t3mAxOdoRtmxMjCK/xWY7/47nNG4RgzKKyO7u+7/oH9xZbw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749777709; a=rsa-sha256; cv=none; b=aCPlCFd2daSYpYGEusS4A1ChIPPwaQStt44uNp4lH5iKe4eGuWiHHzGyEVUpfjabMkXYO5 HNlTYK9qwRlJ7qBd07Ymnj54GPFbrmOSIHZEo+FyqwN87FqntgnET1QbVMilTSiiUGCNWB 517UfNfOMzxSQVMXEsF+J+sByu6M9qwL+zSsM0CRFcHK2I7k52HlGIl9w7CzMPik0hOZpD 96BqAvFiNOmo0GgVkbXilzHJE6G3DRf8SoHiG3PCXjmfxMWc2Uve1hA/2RzGrxxSpcWh2i ztT2AI67ZgDgIc5zzlEjeoWJU8pZI9mmLlZAAXW8L7Nc4ZpB/5XxHs8TGNotWg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJM7J6s3lzdFp; Fri, 13 Jun 2025 01:21:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55D1Lmms086630; Fri, 13 Jun 2025 01:21:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55D1LmFs086627; Fri, 13 Jun 2025 01:21:48 GMT (envelope-from git) Date: Fri, 13 Jun 2025 01:21:48 GMT Message-Id: <202506130121.55D1LmFs086627@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 54f278caf37f - main - pf.conf.5: additional quoting for ranges in lists List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 54f278caf37f9ab578ee58fc70c7b66446ea7e84 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=54f278caf37f9ab578ee58fc70c7b66446ea7e84 commit 54f278caf37f9ab578ee58fc70c7b66446ea7e84 Author: Quentin Thébault AuthorDate: 2024-11-07 06:13:05 +0000 Commit: Warner Losh CommitDate: 2025-06-13 01:21:45 +0000 pf.conf.5: additional quoting for ranges in lists When defining network address ranges in macros that will later be used as items in list macro, these ranges must be quoted with additiona simple quotes. For instance, the following does not work and is rejected as a syntax error: usr = "192.168.1.0/24" srv = "192.168.2.10 - 192.168.29" nat_ranges = "{" $usr $srv "}" Defining ranges as the following instead will work: usr = "'192.168.1.0/24'" srv = "'192.168.2.10 - 192.168.29'" MFC after: 3 days Reviewed by: imp, ziaee Pull Request: https://github.com/freebsd/freebsd-src/pull/1516 --- share/man/man5/pf.conf.5 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/share/man/man5/pf.conf.5 b/share/man/man5/pf.conf.5 index a9fd9e8b29e1..30d0e4ca9904 100644 --- a/share/man/man5/pf.conf.5 +++ b/share/man/man5/pf.conf.5 @@ -100,6 +100,8 @@ Macro names may not be reserved words (for example .Ar in , .Ar out ) . Macros are not expanded inside quotes. +Ranges of network addresses used in macros that will be expanded in lists +later on must be quoted with additional simple quotes. .Pp For example, .Bd -literal -offset indent @@ -107,6 +109,11 @@ ext_if = \&"kue0\&" all_ifs = \&"{\&" $ext_if lo0 \&"}\&" pass out on $ext_if from any to any pass in on $ext_if proto tcp from any to any port 25 + +usr_lan_range = "'192.0.2.0/24'" +srv_lan_range = "'198.51.100.0 - 198.51.100.255'" +nat_ranges = \&"{\&" $usr_lan_range $srv_lan_range \&"}\&" +nat on $ext_if from $nat_ranges to any -> ($ext_if) .Ed .Sh TABLES Tables are named structures which can hold a collection of addresses and From nobody Fri Jun 13 01:21:49 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJM7L4sPSz5ykQB; Fri, 13 Jun 2025 01:21:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJM7L15Pgz3Ks8; Fri, 13 Jun 2025 01:21:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749777710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XAAW5I1tD0xck+7QM9yAu5LG0i8oRYuYj7Y62b4rnI0=; b=xFdq1VKBrzXmRupZkGTbGsT4/cPnNQt1MNDlVoBrsZzt818P2V2nEOd6stCPUC6ZCL5brt JxJJyLNYmHB2Q201bZAUr3da7ZYFtpXl+aHtySi2qUjI/eQbCE6TB6KLwW15kWOs2z/lK1 CVGcnXZxDC3Jkh3mykcbM2XvyWROODcQgWfAVPHYOOM85GD4PDoU/94n8ohfyNM1kyC5zk kE/3j485akcc8UGpJr5wK7yR+w2753zNpqMggH4JINHt0Fmps804nCl7hieQh6/no7udAQ dNBvmQdJYT2+J7FDMKOf+D2sOE9XBZf7DRzNKcW6O4erM2ohYv3Bqve3f19Jvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749777710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XAAW5I1tD0xck+7QM9yAu5LG0i8oRYuYj7Y62b4rnI0=; b=d3d/c+9ANWRFLEP8DCtL2bMVIvuea/io+uQ1tfTapt/my4KT0gjpo7rwzfwxRFGiFAeZ6U GXXLTtFy9Z05r2RCT+SEmrRbLcJoJl6twqSJX0djpo8dICe+RIU7cUZcTN9rxQst1BGL+n MCz3fBIJ1ad7RFkjyLuES15lGZ3CT2O373Qb5va7OyP+V1qbLFLGRHQEmkLW0Umdhh4s4Z 5aZPOe9KIEHYZhP5TjXsJnrH1erk5mEMu6y02+hoox6q59NDBtYdaTIM4sGmP+VOycS335 LuOBe5b0B3Jt+dzDHkcv+PLmmS4uExfP69lT5FieeAbfE7PfruwPWyv9kStvjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749777710; a=rsa-sha256; cv=none; b=Q8/X0vlAryElYxIVI89n+lO3ThNG5LL54y5XUEV8nAO3RIALGksOEYP46XCu0a+hmeo2HQ fVnkLFtZgZrSrpfZmYQoHOxvW/f+2q+7TZrV7OnNVziWz/3wKBq6NOW8RM4aSvc2+5w9N0 JbjJsJ/6Rn2vqf84lGor/1V3mYxF+x9/PVsNTiJdO+Bz3rt2ZJ4g2NkEyXg7i1TyQsv2zP LP4juTgv7iFUzWm4JmeMGa3QkjMTHMJQM3Nlrbywcdo/es/XZFCPF8si2PF3hTVoxAI2fg Qj+37L++M2cO4RK2YKZH6NBCH7DTmQ7vL3+CYABC8YZwbrBXfreeU1oNHIgDLQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJM7L0gN6zdP9; Fri, 13 Jun 2025 01:21:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55D1LnW9086668; Fri, 13 Jun 2025 01:21:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55D1LnwS086665; Fri, 13 Jun 2025 01:21:49 GMT (envelope-from git) Date: Fri, 13 Jun 2025 01:21:49 GMT Message-Id: <202506130121.55D1LnwS086665@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 12859ee366d0 - main - pf.conf.5: use subsections and reword titles List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 12859ee366d084b5506d58b030079f839c4915e3 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=12859ee366d084b5506d58b030079f839c4915e3 commit 12859ee366d084b5506d58b030079f839c4915e3 Author: Quentin Thébault AuthorDate: 2024-11-13 06:54:46 +0000 Commit: Warner Losh CommitDate: 2025-06-13 01:21:45 +0000 pf.conf.5: use subsections and reword titles The current manpage has two PARAMETERS top-level sections, which can be confusing when searching or browsing documentation quickly. Since the parameters described in these two sections are actually applicable within the scope of the sections they follow (ETHERNET FILTERING and PACKET FILTERING respectively), I propose we move them to subsections. I also propose we reword the title of one of those subsections to facilitate quick searching or browsing. MFC after: 3 days Reviewed by: imp, ziaee Pull Request: https://github.com/freebsd/freebsd-src/pull/1516 Closes: https://github.com/freebsd/freebsd-src/pull/1516 --- share/man/man5/pf.conf.5 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/man/man5/pf.conf.5 b/share/man/man5/pf.conf.5 index 30d0e4ca9904..edcb335619ba 100644 --- a/share/man/man5/pf.conf.5 +++ b/share/man/man5/pf.conf.5 @@ -27,7 +27,7 @@ .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd May 29, 2025 +.Dd June 12, 2025 .Dt PF.CONF 5 .Os .Sh NAME @@ -726,7 +726,7 @@ Unlike for layer 3 traffic the packet is always silently dropped. The packet is passed; no state is created for layer 2 traffic. .El -.Sh PARAMETERS +.Ss Parameters applicable to layer 2 rules The rule parameters specify the packets to which a rule applies. A packet always comes in on, or goes out through, one interface. Most parameters are optional. @@ -1750,7 +1750,7 @@ handles state tracking. See .Sx STATEFUL TRACKING OPTIONS below for further details. -.Sh PARAMETERS +.Ss Parameters The rule parameters specify the packets to which a rule applies. A packet always comes in on, or goes out through, one interface. Most parameters are optional. From nobody Fri Jun 13 01:21:52 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJM7P1dfsz5ykSJ; Fri, 13 Jun 2025 01:21:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJM7N2np5z3LFX; Fri, 13 Jun 2025 01:21:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749777712; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SjSe/lQOdxfbZXF3LQfdRg2LG/jGHyCkwI0eXlvUmLI=; b=LpJwXuGngjj0AN7hOEOoKbIs3jKfbqZY1DWiwLqwQ6Kby9XgfCv/an7IxqpOONUR+WQ3/u dCOKo0EKHMbm4FASGNChW5MnrdH4y5vtXlYUsbHMjm4G8mifJRsglSIzt1Ch83ifFPAmMY mxQmToBkRG4+ag4O3KPe2i0OZ0en/iILcHAAkNBuccX5n1A4J3oRZIGvMYqZ9Z4IeyC2Cw daBSlzegnMs0xOSprak0GWKgTNfb0XZUNe6N/Cu5/U6SHCrWbcy8NFUGcU0tXiY0fBi+Kc mFkRoo4lQ13I4RbBEyINWS76xwyblhFccvGep2XkSjD1pGaROAIsM4aMwsPa/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749777712; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SjSe/lQOdxfbZXF3LQfdRg2LG/jGHyCkwI0eXlvUmLI=; b=uK/qd7pXaAZE//MadvfRNGn+hXNtdbLMoa8PF640KyTEMM7MHbhtaGJDkyn1tiJC19smVT m4gQJAcmOuhnnQb8L+HAPparXkU4nT+oew964s0RB5Xoy3FCuBP9BSbxnxHPlokShNFGkk qvdbaSxOsPIMtY54BLgz1GKp/JQfPikmWpMNdUt6OGzxP+xO2PBEMRPJfOVBRv555B2G9u 60GV4mJMf9DDFNqTlyoPg9AeYRjCuSCID1Thy63c+uWh5KheLbalsT8wMRCg9Ij1CHKxFt a8tDrfDlpKL5NI2rL+Eldr/hL+NDiMfc5nmtRtJdA1LqYxkgOw/qAbmqBXo/Vg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749777712; a=rsa-sha256; cv=none; b=qQlkCaz+d0//9oEauhNzeGksHtj0B/GwRHYGECq6qxpjuzmmyUXGHb9M+qQENZmo2S1czq XGv+Prvo/C8h3bha4Sw98noB/dcVUBbOiwofzeIE4/7IPnYx4ifSEsztv0RDk0mA0z2F2c wGx5IL5bVReRszAw5qRwC/0tmgNbjRqQdQYdVolJt4ZONIoDp7Bj7fMGIybqoM2bJmOPXm i0kj9VZfEVKFxS7Yp+W4w4gk6QH2wrC7tstg5KO/GsL9HXWdNBRdy4GbC0qmOmm/g6bSwi iPliW2qrkP3MC2DjU7OyZZyCD5q9fmJuknyhs9b1YYub6J2AQ7jKTws+FYfi3g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJM7N26GpzdJM; Fri, 13 Jun 2025 01:21:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55D1LqSY087798; Fri, 13 Jun 2025 01:21:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55D1LqdJ087795; Fri, 13 Jun 2025 01:21:52 GMT (envelope-from git) Date: Fri, 13 Jun 2025 01:21:52 GMT Message-Id: <202506130121.55D1LqdJ087795@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: d8f021add40c - main - jail: add JID, JNAME and JPATH to environment for exec.* commands List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d8f021add40c321c4578da55dae52fb93c7ccb5f Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d8f021add40c321c4578da55dae52fb93c7ccb5f commit d8f021add40c321c4578da55dae52fb93c7ccb5f Author: Quentin Thébault AuthorDate: 2025-03-05 09:51:06 +0000 Commit: Warner Losh CommitDate: 2025-06-13 01:21:45 +0000 jail: add JID, JNAME and JPATH to environment for exec.* commands Although variable substitution is available in the jail configuration file, the jail identifier is often not since it is dynamically attributed at run time. In order to facilitate scripting of exec.* commands executed on the system, this change sets the JID, JNAME and JPATH environment variables. These variables are not added when using exec.clean. Neither are they for commands executed inside jails, to avoid disclosing information about the host system. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1609 Closes: https://github.com/freebsd/freebsd-src/pull/1609 --- usr.sbin/jail/command.c | 14 +++++++++++++- usr.sbin/jail/jail.8 | 21 +++++++++++++++++++++ usr.sbin/jail/tests/commands.jail.conf | 3 +++ usr.sbin/jail/tests/jail_basic_test.sh | 11 +++++++++-- 4 files changed, 46 insertions(+), 3 deletions(-) diff --git a/usr.sbin/jail/command.c b/usr.sbin/jail/command.c index fe6563230bde..8ea3f3ee8795 100644 --- a/usr.sbin/jail/command.c +++ b/usr.sbin/jail/command.c @@ -290,7 +290,7 @@ run_command(struct cfjail *j) const struct cfstring *comstring, *s; login_cap_t *lcap; const char **argv; - char *acs, *cs, *comcs, *devpath; + char *acs, *ajidstr, *cs, *comcs, *devpath; const char *jidstr, *conslog, *fmt, *path, *ruleset, *term, *username; enum intparam comparam; size_t comlen, ret; @@ -795,6 +795,18 @@ run_command(struct cfjail *j) } endpwent(); } + if (!injail) { + if (asprintf(&ajidstr, "%d", j->jid) == -1) { + jail_warnx(j, "asprintf jid=%d: %s", j->jid, + strerror(errno)); + exit(1); + } + setenv("JID", ajidstr, 1); + free(ajidstr); + setenv("JNAME", string_param(j->intparams[KP_NAME]), 1); + path = string_param(j->intparams[KP_PATH]); + setenv("JPATH", path ? path : "", 1); + } if (consfd != 0 && (dup2(consfd, 1) < 0 || dup2(consfd, 2) < 0)) { jail_warnx(j, "exec.consolelog: %s", strerror(errno)); diff --git a/usr.sbin/jail/jail.8 b/usr.sbin/jail/jail.8 index 8d7bc25a8694..dd7b91d5cefa 100644 --- a/usr.sbin/jail/jail.8 +++ b/usr.sbin/jail/jail.8 @@ -858,6 +858,22 @@ commands in sequence. All commands must succeed (return a zero exit status), or the jail will not be created or removed, as appropriate. .Pp +The following variables are added to the environment: +.Bl -tag -width indent -offset indent +.It Ev JID +The +.Va jid , +or jail identifier. +.It Ev JNAME +The +.Va name +of the jail. +.It Ev JPATH +The +.Va path +of the jail. +.El +.Pp The pseudo-parameters are: .Bl -tag -width indent .It Va exec.prepare @@ -922,6 +938,11 @@ is imported from the current environment. is set to "/bin:/usr/bin". The environment variables from the login class capability database for the target login are also set. +.Ev JID , +.Ev JNAME , +and +.Ev JPATH +are not set. If a user is specified (as with .Va exec.jail_user ) , commands are run from that (possibly jailed) user's directory. diff --git a/usr.sbin/jail/tests/commands.jail.conf b/usr.sbin/jail/tests/commands.jail.conf index 4ea24ec6b058..afd56d1fa5d6 100644 --- a/usr.sbin/jail/tests/commands.jail.conf +++ b/usr.sbin/jail/tests/commands.jail.conf @@ -1,6 +1,9 @@ exec.prestop = "echo STOP"; exec.prestart = "echo START"; +exec.poststart = "env"; persist; +path = "/tmp/test_${name}_root"; + basejail {} diff --git a/usr.sbin/jail/tests/jail_basic_test.sh b/usr.sbin/jail/tests/jail_basic_test.sh index 5d67f42c2d56..6498eb1c1fdc 100755 --- a/usr.sbin/jail/tests/jail_basic_test.sh +++ b/usr.sbin/jail/tests/jail_basic_test.sh @@ -129,13 +129,19 @@ commands_head() { atf_set descr 'Commands jail test' atf_set require.user root + mkdir /tmp/test_basejail_root } commands_body() { - # exec.prestart - atf_check -s exit:0 -o inline:"START\n" \ + # exec.prestart (START) and exec.poststart (env) + atf_check -s exit:0 -o save:stdout -e empty \ jail -f $(atf_get_srcdir)/commands.jail.conf -qc basejail + grep -E '^START$' stdout || atf_fail "exec.prestart output not found" + grep -E '^JID=[0-9]+' stdout || atf_fail "JID not found in exec.poststart env output" + grep -E '^JNAME=basejail$' stdout || atf_fail "JNAME not found in exec.poststart env output" + grep -E '^JPATH=/tmp/test_basejail_root$' stdout || atf_fail "JPATH not found in exec.poststart env output" + # exec.prestop by jailname atf_check -s exit:0 -o inline:"STOP\n" \ jail -f $(atf_get_srcdir)/commands.jail.conf -qr basejail @@ -152,6 +158,7 @@ commands_cleanup() then jail -r basejail fi + rmdir /tmp/test_basejail_root } atf_init_test_cases() From nobody Fri Jun 13 01:21:51 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJM7M4hW8z5ykMh; Fri, 13 Jun 2025 01:21:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJM7M1rwhz3L1F; Fri, 13 Jun 2025 01:21:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749777711; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WOVQbSxqDdgmdQKpYM+l61J+UJLgPFntnOXvX0nysAA=; b=crkj2wUSByAKMH+JzpkDu7RMNvkLy5F9myAa7AkEw/J0SQ2FMPqr1t5k3eBPo2y+91fDAp uBte+7kHrVAAKGIxRg/m/80RNAlh4G9oVoqQGB3Lyn0t+a887TIHOAZ2vl4Rk+8fKlzShC q8DtxvsriwmIxSpu9nc6IyZ5+TEQHIHpL2bosZCDlt4/LbyYuso8qBwLOtvPNOadoCZbf9 MBjk1jxCfOEvuWt1Srk2m3LDrMfp9dI021+SKsZ6o0mhJXiaZbiomXQvjh9W2IYu+dqtYG UeqtFqG4pfq9cV+hQ/7LXj8weauPTZkCoVYl7KzOBSzNOXUAruM3tPLLYOvu4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749777711; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WOVQbSxqDdgmdQKpYM+l61J+UJLgPFntnOXvX0nysAA=; b=s9A1ad+9R/K0ClMqmMWJ6UzAKdz8xMPyKPXysE2G6q7nShu2I1mXSu0NoXjulHzC9LDutX CbhxGyn7ApDzlAWJSq4DKTXR3ps+Ypq+wJYn3NxcaM/Nut1j1fCChnowPRURuQNhuUhDkR 5bcwO7tPsX/MSZcJGtmvrOMzE2JtWChNrNzlh1JS219Mw8HqnKHCLVPxOqIxt5tHrxx7R8 pmCU3TakZ1JKHzRyV9SgD7p3DyswXPSgRJz9SkWO2VsUsJS0L05eYlumhtGcJMoxzCXvr8 tneToGtcgrST17nvRgFEizsbEPtbDOER8n1LdFPg+arTidBcQ9r1nAKE/PhghA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749777711; a=rsa-sha256; cv=none; b=fIUgibdmfCGZn3zOeReRMgEyuwfbRNGUB6kjKlknDnf46jdHlkTftVmKWIdUH53nFVtHgS immwaxx1tfp7HfRepnGg+6PexwQdklYgMFOBsiYH4et/81K8qRAFqsLGCRD+jcJgJ+3zQD BI5wtrFF6mcWM0eEwhfVKHfzKomJtHIil7zTPd+AUqul6OM0oJPI3r1Iwsu0mKuH1VcYH7 P19z+aXlYKGemf31iIdzjMSrCnG8xJhutqyOVYGhiJU/MP93Ntm1qdUw0dv5eqkN41FQ/f POAkU1u2MK4wus4OPbI4mzIWotmzbfSHqz8Vq6UBaKaHKTQwuesL2mhnNuJx1A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJM7M1LPTzd2w; Fri, 13 Jun 2025 01:21:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55D1LpP3087643; Fri, 13 Jun 2025 01:21:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55D1LpJH087629; Fri, 13 Jun 2025 01:21:51 GMT (envelope-from git) Date: Fri, 13 Jun 2025 01:21:51 GMT Message-Id: <202506130121.55D1LpJH087629@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 754bc3dcd3c4 - main - bsdinstall: fix ps3 regression List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 754bc3dcd3c42c0342978eb9fb5143b6fce2b33c Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=754bc3dcd3c42c0342978eb9fb5143b6fce2b33c commit 754bc3dcd3c42c0342978eb9fb5143b6fce2b33c Author: Chattrapat Sangmanee AuthorDate: 2025-02-07 21:31:56 +0000 Commit: Warner Losh CommitDate: 2025-06-13 01:21:45 +0000 bsdinstall: fix ps3 regression b6644f5 introduces FREEBSD_BOOTLABEL="FreeBSD" as default value but cc42ef5 removed this line, expecting it to be set by update_uefi_bootentry() But ps3 don't use this function so its broken completely. So we add this line back. Signed-off-by: Chattrapat Sangmanee Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1594 --- usr.sbin/bsdinstall/scripts/bootconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/usr.sbin/bsdinstall/scripts/bootconfig b/usr.sbin/bsdinstall/scripts/bootconfig index 618a1966095e..9b330801e409 100755 --- a/usr.sbin/bsdinstall/scripts/bootconfig +++ b/usr.sbin/bsdinstall/scripts/bootconfig @@ -29,6 +29,9 @@ BSDCFG_SHARE="/usr/share/bsdconfig" . $BSDCFG_SHARE/common.subr || exit 1 + +FREEBSD_BOOTLABEL=$OSNAME + f_dprintf "%s: loading_includes..." "$0" f_include $BSDCFG_SHARE/dialog.subr From nobody Fri Jun 13 02:23:48 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJNVr6sBHz5ypNw; Fri, 13 Jun 2025 02:23:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJNVr4xTVz48tc; Fri, 13 Jun 2025 02:23:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749781428; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=71nuP1b5RyiVWhg1NiDHU7h7PmYHrbWSXIgkkqZA698=; b=lBRcfEKDxs3DrPqjP68C7gROpu38VI75a/57Nh9Qff09/dYYzUjftXYJP1zDGhD2iTHnzU nAMit7+560MQTJ/RjEHxa5k1oOgUetbGrqz8M2+oU8H98ZrFZMaxlcCsWfVOkSAttWn2Uw F9tp2F3WKclGyOF+BfBzOs6KNDcCZwRyFOv9xefb/YWOxI7+ydyshW6aIhIirezva9NsbP r8zAPCp4fENjSVXvS9oygzNrSmJ28gYjigixXVwfELCNRBXUvoe9QNODbpjRxw9VBsSct7 zpwxaIsyarxRXpaHEvyyZffygY5N7XNnURzmNIX1VUGmI8ZAy2geZtecgw/rNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749781428; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=71nuP1b5RyiVWhg1NiDHU7h7PmYHrbWSXIgkkqZA698=; b=V0O10fzI+P3RhKBnFrk/6F7IgrZHNaCmyjjsDXU0SKQkLYmpbMU+Z49f6pM/iWPe8ivvMd iuXB5A+B29u8oPRcaMEp3hBGylm9xJTaNNWWTYhIgRvuD8JnlN26/bWVSI+eM4NB9WG291 OiBsFX+OrrI5ZDDGdrET2eF7ZTBXDUdKfFfGJeSuL58wvsA5XZj+BuMagsVoKIepARhhyi 91ysAfBkWeARX3xDP8x8o2ALKha98kWpNHKRMHDIplc0tTQTFGWn/A6P67P3TXc8j64oo9 yp5hVqqrO4i4LmY8EvVBOUoj83YJ0Vz8QSVK2M4vxK6azINyqHuj3eOqixtB6Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749781428; a=rsa-sha256; cv=none; b=IekWDs9hpJtaAeqlwLZmYezH8tKQULHozSYkoOEVW1Ls+GWYhtp1znoYTeXo4YzPMp5qYO wnbTi9Ne5PgNvygqA2BSDNCANETiYyG84QquQ5+mqztsR6sWVrTZUzHgRuaBgK6ToUdgWt OBwUeED5ufs32S/VMMEGgBfNjZsJ+7wMyCT9FLgzDlJG/YA1g6wHk2YmqRytr0Mx21wyD6 mNYBnOv0sz4ledWZKHXiNEYEcnmV87RT8FVXKEbQfKfQ39Mi1MCD95l0sp7LCgzJpveajN xu8uklToKBrj1hjmuWJf5mThUthQCs+hMlIzyCOV+RglhcfKsSMtY0QROIR/pA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJNVr4629zfj8; Fri, 13 Jun 2025 02:23:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55D2NmSh003431; Fri, 13 Jun 2025 02:23:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55D2NmjC003428; Fri, 13 Jun 2025 02:23:48 GMT (envelope-from git) Date: Fri, 13 Jun 2025 02:23:48 GMT Message-Id: <202506130223.55D2NmjC003428@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 33d3373faf30 - main - stand: lua: convert orb to a new format that allows per-graphic shift List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 33d3373faf30d5e7a1890ab686d932c984bc4b75 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=33d3373faf30d5e7a1890ab686d932c984bc4b75 commit 33d3373faf30d5e7a1890ab686d932c984bc4b75 Author: Kyle Evans AuthorDate: 2025-06-13 02:23:39 +0000 Commit: Kyle Evans CommitDate: 2025-06-13 02:23:39 +0000 stand: lua: convert orb to a new format that allows per-graphic shift Previously, we had one shift that had to work for both the ASCII version and the image that we may draw if we have a framebuffer to play with. That makes it more difficult to get the positioning just right, so split them out into their own tables for convenience. While we're here, stop clipping off the bottom of the orb when the autoboot sequence is interrupted. There's plenty of space for it to move up a hair, so let's do that.. Reviewed by: imp, tsoome Differential Revision: https://reviews.freebsd.org/D50801 --- stand/lua/drawer.lua | 104 ++++++++++++++++++++++++++++++++++-------------- stand/lua/gfx-orb.lua | 15 ++++--- stand/lua/gfx-orbbw.lua | 36 +++++++++-------- 3 files changed, 104 insertions(+), 51 deletions(-) diff --git a/stand/lua/drawer.lua b/stand/lua/drawer.lua index d4c6bf850e86..bc0dc543a9fd 100644 --- a/stand/lua/drawer.lua +++ b/stand/lua/drawer.lua @@ -330,20 +330,23 @@ local function drawbrand() branddef = getBranddef(drawer.default_brand) end - local graphic = branddef.graphic + local graphic = branddef.ascii.image x = x + shift.x y = y + shift.y - if branddef.shift ~= nil then - x = x + branddef.shift.x - y = y + branddef.shift.y - end - local gfx_requested = branddef.image and gfxenabled() + local gfx_requested = branddef.fb and gfxenabled() if gfx_requested and gfxcapable() then - if gfx.term_putimage(branddef.image, x, y, 0, 7, 0) then + if branddef.fb.shift then + x = x + (branddef.fb.shift.x or 0) + y = y + (branddef.fb.shift.y or 0) + end + if gfx.term_putimage(branddef.fb.image, x, y, 0, 7, 0) then return true end + elseif branddef.ascii.shift then + x = x + (branddef.ascii.shift.x or 0) + y = y + (branddef.ascii.shift.y or 0) end draw(x, y, graphic) end @@ -359,8 +362,8 @@ local function drawlogo() local logodef = getLogodef(logo) - if logodef == nil or logodef.graphic == nil or - (not colored and logodef.requires_color) then + if logodef == nil or logodef.ascii == nil or + (not colored and logodef.ascii.requires_color) then -- Choose a sensible default if colored then logodef = getLogodef(drawer.default_color_logodef) @@ -374,7 +377,8 @@ local function drawlogo() end end - if logodef ~= nil and logodef.graphic == none then + -- XXX What the hell is going on here? + if logodef and logodef.ascii.image == none then shift = logodef.shift else shift = default_shift @@ -383,20 +387,23 @@ local function drawlogo() x = x + shift.x y = y + shift.y - if logodef ~= nil and logodef.shift ~= nil then - x = x + logodef.shift.x - y = y + logodef.shift.y - end - - local gfx_requested = logodef.image and gfxenabled() + local gfx_requested = logodef.fb and gfxenabled() if gfx_requested and gfxcapable() then - local y1 = logodef.image_rl or 15 + local y1 = logodef.fb.width or 15 - if gfx.term_putimage(logodef.image, x, y, 0, y + y1, 0) then + if logodef.fb.shift then + x = x + (logodef.fb.shift.x or 0) + y = y + (logodef.fb.shift.y or 0) + end + if gfx.term_putimage(logodef.fb.image, x, y, 0, y + y1, 0) then return true end + elseif logodef.ascii.shift then + x = x + (logodef.ascii.shift.x or 0) + y = y + (logodef.ascii.shift.y or 0) end - draw(x, y, logodef.graphic) + + draw(x, y, logodef.ascii.image) end local function drawitem(func) @@ -453,11 +460,15 @@ branddefs = { -- Indexed by valid values for loader_brand in loader.conf(5). Valid -- keys are: graphic (table depicting graphic) ["fbsd"] = { - graphic = fbsd_brand, - image = "/boot/images/freebsd-brand-rev.png", + ascii = { + image = fbsd_brand, + }, + fb = { + image = "/boot/images/freebsd-brand-rev.png", + }, }, ["none"] = { - graphic = none, + fb = { image = none }, }, } @@ -466,13 +477,19 @@ logodefs = { -- are: requires_color (boolean), graphic (table depicting graphic), and -- shift (table containing x and y). ["tribute"] = { - graphic = fbsd_brand, + ascii = { + image = fbsd_brand, + }, }, ["tributebw"] = { - graphic = fbsd_brand, + ascii = { + image = fbsd_brand, + }, }, ["none"] = { - graphic = none, + ascii = { + image = none, + }, shift = {x = 17, y = 0}, }, } @@ -492,14 +509,43 @@ drawer.default_bw_logodef = 'orbbw' -- drawer module in case it's a filesystem issue. drawer.default_fallback_logodef = 'none' --- These should go away after FreeBSD 13; only available for backwards --- compatibility with old logo- files. +-- Backwards compatibility shims for previous FreeBSD versions, please document +-- new additions +local function adapt_fb_shim(def) + -- In FreeBSD 14.x+, we have improved framebuffer support in the loader + -- and some graphics may have images that we can actually draw on the + -- screen. Those graphics may come with shifts that are distinct from + -- the ASCII version, so we move both ascii and image versions into + -- their own tables. + if not def.ascii then + def.ascii = { + image = def.graphic, + requires_color = def.requires_color, + shift = def.shift, + } + end + if def.image then + assert(not def.fb, + "Unrecognized graphic definition format") + + -- Legacy images may have adapted a shift from the ASCII + -- version, or perhaps we just didn't care enough to adjust it. + -- Steal the shift. + def.fb = { + image = def.image, + width = def.image_rl, + shift = def.shift, + } + end + return def +end + function drawer.addBrand(name, def) - branddefs[name] = def + branddefs[name] = adapt_fb_shim(def) end function drawer.addLogo(name, def) - logodefs[name] = def + logodefs[name] = adapt_fb_shim(def) end drawer.frame_styles = { diff --git a/stand/lua/gfx-orb.lua b/stand/lua/gfx-orb.lua index cd834a2d6b8e..6845d6fa07bb 100644 --- a/stand/lua/gfx-orb.lua +++ b/stand/lua/gfx-orb.lua @@ -27,7 +27,8 @@ return { logo = { - graphic = { + ascii = { + image = { " \027[31m``` \027[31;1m`\027[31m", " s` `.....---...\027[31;1m....--.``` -/\027[31m", " +o .--` \027[31;1m/y:` +.\027[31m", @@ -43,10 +44,14 @@ return { " `:` \027[31;1m`:`", " \027[31;1m.-- `--.", " .---.....----.\027[m", + }, + requires_color = true, + shift = {x = 5, y = -1}, + }, + fb = { + image = "/boot/images/freebsd-logo-rev.png", + width = 15, + shift = {x = 2, y = -2}, }, - requires_color = true, - shift = {x = 2, y = -1}, - image = "/boot/images/freebsd-logo-rev.png", - image_rl = 15 } } diff --git a/stand/lua/gfx-orbbw.lua b/stand/lua/gfx-orbbw.lua index a97174a6a5a4..135ff806b67c 100644 --- a/stand/lua/gfx-orbbw.lua +++ b/stand/lua/gfx-orbbw.lua @@ -27,23 +27,25 @@ return { logo = { - graphic = { - " ``` `", - " s` `.....---.......--.``` -/", - " +o .--` /y:` +.", - " yo`:. :o `+-", - " y/ -/` -o/", - " .- ::/sy+:.", - " / `-- /", - " `: :`", - " `: :`", - " / /", - " .- -.", - " -- -.", - " `:` `:`", - " .-- `--.", - " .---.....----.", + ascii = { + image = { + " ``` `", + " s` `.....---.......--.``` -/", + " +o .--` /y:` +.", + " yo`:. :o `+-", + " y/ -/` -o/", + " .- ::/sy+:.", + " / `-- /", + " `: :`", + " `: :`", + " / /", + " .- -.", + " -- -.", + " `:` `:`", + " .-- `--.", + " .---.....----.", + }, + shift = {x = 2, y = -1}, }, - shift = {x = 2, y = -1}, } } From nobody Fri Jun 13 02:34:36 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJNlJ55thz5yq5W; Fri, 13 Jun 2025 02:34:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJNlJ4FD6z3LSg; Fri, 13 Jun 2025 02:34:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749782076; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Lb+fNjuzpFxROQAVucWzC8TZrPERXzvDTNoXI7MWXbg=; b=SDTYV/SbEjq/S7sPp2DRiW1oxaC5FHMEE7biht4aTMBxK119w08GKU2TkxGKKj9W7mIlMd d6UT6B8G7LVZMAUzZ27tvyzTCpUHBPiKZJ2yJfjytXRkX8DiGcvCorE5Gdv4qnuq/I4+ir 9iMW+IUFdMbODsvSISfgCJ0nOy3ba6LBLijETwyBdulKzJ/yunBZTO0VziHYRSKUZas0jw j1rN6EwOcrCsgZh/fbHr8kPXshvR/HhL00nIMGNbZBqKqThcyhKHtxlJ99YpSh1mMGjmj9 8LBri/TG+TF4bYjVSL4VDKbw/LXTeTa1gafMHyl0Cf3oAXcFijKOTylj2SyjKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749782076; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Lb+fNjuzpFxROQAVucWzC8TZrPERXzvDTNoXI7MWXbg=; b=hOBRfEBPvuC7MrTm5c+HaQuOqG8+L6pKAEPY6bE5D41eVOpTu5v7kUjaj1ti3grwrN4i+u xic7fmtKkdUjGOGdkZymwgYz7nzlnzKFdQyUo+zPuXivnF7Z11MjqpTjgKNKp4CgpNDodW z6UcrRkiKUTx3C7vu5PvSsdy+ArmPHGI6uxdYXa8t+k83BYFNVOvo6kRCaDcGlHCVbxMQN ToEeHwUHLtZtjEnBomnKjlTHGepnKFQUsGl5+J+9ZMkMWoImvFYeRKTL4pKkLHs/X9gvdz 3imSlVvYZ7w6xeczf3fPuyhUq8lsLbdaTp0keTUwdWccTlm2SIdzIm+NHWbNVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749782076; a=rsa-sha256; cv=none; b=ksA7zRZKSxaZd0AzpIvzUz+jAF/+t0JzpIaGAPtJTvc7jWeGTuR0yjyhEKB7N8x8Jo0ReD zeK2wBdAZDAnKPssUCBxWBkqr9R3QmZmCuEkaYn/flP3haDVQJFSaRpZjnne5U746za2JG 4huAL2ECntXDT/2/I8roOPQfCdUlOwcJQL5dHmTXnoq6DVFccbH2W8698v6VlbWmHXYTvW 5cbneGYkyxHrYKqzd0vGK1Ch0PcykFVA07EqO2FdPx1TdeG4j590an1rd3a/eZuw0ZJVUF jMGnEDXFJwDN7WKrrwKvJugeSKQWTmkKiBSktAsSr1CruNZof/OGYK/z1JAW0g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJNlJ3hzVzgGf; Fri, 13 Jun 2025 02:34:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55D2YaY2022305; Fri, 13 Jun 2025 02:34:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55D2YakX022302; Fri, 13 Jun 2025 02:34:36 GMT (envelope-from git) Date: Fri, 13 Jun 2025 02:34:36 GMT Message-Id: <202506130234.55D2YakX022302@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 1beab149d0b9 - main - stand: lua: add a more productive comment List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1beab149d0b9768ad6d07501326a2060d7b0ba58 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=1beab149d0b9768ad6d07501326a2060d7b0ba58 commit 1beab149d0b9768ad6d07501326a2060d7b0ba58 Author: Kyle Evans AuthorDate: 2025-06-13 02:31:54 +0000 Commit: Kyle Evans CommitDate: 2025-06-13 02:33:11 +0000 stand: lua: add a more productive comment The global `shift` is a special little hack for shifting everything when the logo is gone, and we should explain that. Fixes: 33d3373faf30d ("stand: lua: convert orb to a new format [...]") --- stand/lua/drawer.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stand/lua/drawer.lua b/stand/lua/drawer.lua index bc0dc543a9fd..334d8724f6bc 100644 --- a/stand/lua/drawer.lua +++ b/stand/lua/drawer.lua @@ -377,7 +377,9 @@ local function drawlogo() end end - -- XXX What the hell is going on here? + -- This is a special little hack for the "none" logo to re-align the + -- menu and the brand to avoid having a lot of extraneous whitespace on + -- the right side. if logodef and logodef.ascii.image == none then shift = logodef.shift else From nobody Fri Jun 13 06:17:36 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJThv1QZ6z5c4qv; Fri, 13 Jun 2025 06:17:51 +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 4bJTht1MBqz3r1G; Fri, 13 Jun 2025 06:17:50 +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 55D6Hacs003600; Fri, 13 Jun 2025 09:17:39 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 55D6Hacs003600 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 55D6Haer003599; Fri, 13 Jun 2025 09:17:36 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 13 Jun 2025 09:17:36 +0300 From: Konstantin Belousov To: Warner Losh Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 7b7ba7857ce8 - main - Implement CLOCK_TAI Message-ID: References: <202506121825.55CIPemP006355@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202506121825.55CIPemP006355@gitrepo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Rspamd-Queue-Id: 4bJTht1MBqz3r1G X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] On Thu, Jun 12, 2025 at 06:25:40PM +0000, Warner Losh wrote: > The branch main has been updated by imp: > > URL: https://cgit.FreeBSD.org/src/commit/?id=7b7ba7857ce8be0bf6ab905d936d8ba1363e4ec2 > > commit 7b7ba7857ce8be0bf6ab905d936d8ba1363e4ec2 > Author: Nathan Whitehorn > AuthorDate: 2025-06-12 17:52:30 +0000 > Commit: Warner Losh > CommitDate: 2025-06-12 18:25:31 +0000 > > Implement CLOCK_TAI > > Provide a clock through clock_gettime() that returns the current TAI > time (UTC without leap seconds) as a complement to CLOCK_REALTIME. This > provides compatibility with Linux, which also provides a CLOCK_TAI since > kernel 2.6.26, and this seems to be becoming the standard way to acquire > TAI time. Unlike Linux, this code will return EINVAL if the TAI offset > (set by ntpd, ptpd, etc.) is not known since it seems pathological for > CLOCK_TAI to silently give the wrong (UTC) time if the offset is not > known as it does on Linux. > > Reviewed by: imp > Differential Revision: https://reviews.freebsd.org/D46268 > --- > lib/libsys/_umtx_op.2 | 2 ++ > lib/libsys/clock_gettime.2 | 14 ++++++++++-- > lib/libsys/nanosleep.2 | 4 +++- > lib/libsys/timer_create.2 | 3 ++- > lib/libthr/thread/thr_condattr.c | 1 + > share/man/man3/pthread_condattr.3 | 3 ++- > sys/kern/kern_ntptime.c | 3 ++- > sys/kern/kern_tc.c | 10 ++++++++- > sys/kern/kern_time.c | 46 ++++++++++++++++++++++++++------------- > sys/kern/kern_umtx.c | 7 ++++-- > sys/sys/_clock_id.h | 4 ++++ > sys/sys/timeffc.h | 4 +++- > sys/sys/timex.h | 2 +- > 13 files changed, 77 insertions(+), 26 deletions(-) > > diff --git a/lib/libsys/_umtx_op.2 b/lib/libsys/_umtx_op.2 > index 974850fb8425..c590f8e8e0c8 100644 > --- a/lib/libsys/_umtx_op.2 > +++ b/lib/libsys/_umtx_op.2 > @@ -210,6 +210,8 @@ Valid clock identifiers are a subset of those for > .It > .Dv CLOCK_SECOND > .It > +.Dv CLOCK_TAI > +.It > .Dv CLOCK_UPTIME > .It > .Dv CLOCK_UPTIME_FAST > diff --git a/lib/libsys/clock_gettime.2 b/lib/libsys/clock_gettime.2 > index fcdc5be498f2..1dcfd9d1faf7 100644 > --- a/lib/libsys/clock_gettime.2 > +++ b/lib/libsys/clock_gettime.2 > @@ -27,7 +27,7 @@ > .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > .\" SUCH DAMAGE. > .\" > -.Dd June 28, 2024 > +.Dd August 10, 2024 > .Dt CLOCK_GETTIME 2 > .Os > .Sh NAME > @@ -99,11 +99,20 @@ query, using an in-kernel cached value of the current second. > Returns the execution time of the calling process. > .It Dv CLOCK_THREAD_CPUTIME_ID > Returns the execution time of the calling thread. > +.It Dv CLOCK_TAI > +Increments in SI seconds like a wall clock. > +It uses a 1970 epoch and implements the TAI timescale. > +Similar to CLOCK_REALTIME, but without leap seconds. .Dv CLOCK_REALTIME > +It will increase monotonically during a leap second. > +Will return EINVAL if the current offset between TAI and UTC is not known, .Er EINVAL > +which may be the case early in boot before NTP or other time daemon has > +synchronized. > .El > .Pp > The clock IDs > .Dv CLOCK_BOOTTIME , > .Dv CLOCK_REALTIME , > +.Dv CLOCK_TAI , > .Dv CLOCK_MONOTONIC , > and > .Dv CLOCK_UPTIME > @@ -202,7 +211,8 @@ The clock IDs > .Dv CLOCK_MONOTONIC_PRECISE , > .Dv CLOCK_REALTIME_FAST , > .Dv CLOCK_REALTIME_PRECISE , > -.Dv CLOCK_SECOND > +.Dv CLOCK_SECOND , > +.Dv CLOCK_TAI , > .Dv CLOCK_UPTIME , > .Dv CLOCK_UPTIME_FAST , > and > diff --git a/lib/libsys/nanosleep.2 b/lib/libsys/nanosleep.2 > index ba9aae1edf57..290565dbd6e1 100644 > --- a/lib/libsys/nanosleep.2 > +++ b/lib/libsys/nanosleep.2 > @@ -27,7 +27,7 @@ > .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > .\" SUCH DAMAGE. > .\" > -.Dd April 29, 2025 > +.Dd May 3, 2025 > .Dt NANOSLEEP 2 > .Os > .Sh NAME > @@ -116,6 +116,8 @@ CLOCK_REALTIME_PRECISE > .It > CLOCK_SECOND > .It > +CLOCK_TAI > +.It > CLOCK_UPTIME > .It > CLOCK_UPTIME_FAST > diff --git a/lib/libsys/timer_create.2 b/lib/libsys/timer_create.2 > index e8489b390845..8f6ff2e27c51 100644 > --- a/lib/libsys/timer_create.2 > +++ b/lib/libsys/timer_create.2 > @@ -126,7 +126,8 @@ the value of the timer ID. > This implementation supports a > .Fa clock_id > of > -.Dv CLOCK_REALTIME > +.Dv CLOCK_REALTIME , > +.Dv CLOCK_TAI , > or > .Dv CLOCK_MONOTONIC . > .Pp > diff --git a/lib/libthr/thread/thr_condattr.c b/lib/libthr/thread/thr_condattr.c > index 0dc3e52bab5e..dc56363fc084 100644 > --- a/lib/libthr/thread/thr_condattr.c > +++ b/lib/libthr/thread/thr_condattr.c > @@ -94,6 +94,7 @@ _pthread_condattr_setclock(pthread_condattr_t *attr, clockid_t clock_id) > if (attr == NULL || *attr == NULL) > return (EINVAL); > if (clock_id != CLOCK_REALTIME && > + clock_id != CLOCK_TAI && > clock_id != CLOCK_VIRTUAL && > clock_id != CLOCK_PROF && > clock_id != CLOCK_MONOTONIC) { > diff --git a/share/man/man3/pthread_condattr.3 b/share/man/man3/pthread_condattr.3 > index 96d30263d7f2..33ad904f9a3d 100644 > --- a/share/man/man3/pthread_condattr.3 > +++ b/share/man/man3/pthread_condattr.3 > @@ -85,7 +85,8 @@ in > .Xr pthread_cond_timedwait 3 > and may be set to > .Dv CLOCK_REALTIME > -(default) > +(default), > +.Dv CLOCK_TAI , > or > .Dv CLOCK_MONOTONIC . > .Pp > diff --git a/sys/kern/kern_ntptime.c b/sys/kern/kern_ntptime.c > index 65746021028b..892a6798ab1f 100644 > --- a/sys/kern/kern_ntptime.c > +++ b/sys/kern/kern_ntptime.c > @@ -504,7 +504,7 @@ sys_ntp_adjtime(struct thread *td, struct ntp_adjtime_args *uap) > * simulation. > */ > void > -ntp_update_second(int64_t *adjustment, time_t *newsec) > +ntp_update_second(int64_t *adjustment, time_t *newsec, long *tai_off) > { > int tickrate; > l_fp ftemp; /* 32/64-bit temporary */ > @@ -624,6 +624,7 @@ ntp_update_second(int64_t *adjustment, time_t *newsec) > L_ADD(time_adj, ftemp); > } > *adjustment = time_adj; > + *tai_off = time_tai; > > #ifdef PPS_SYNC > if (pps_valid > 0) > diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c > index a797a101bf6f..e85812e415c7 100644 > --- a/sys/kern/kern_tc.c > +++ b/sys/kern/kern_tc.c > @@ -72,6 +72,7 @@ struct timehands { > uint64_t th_scale; > u_int th_large_delta; > u_int th_offset_count; > + long th_tai_offset; > struct bintime th_offset; > struct bintime th_bintime; > struct timeval th_microtime; > @@ -1066,6 +1067,7 @@ sysclock_getsnapshot(struct sysclock_snap *clock_snap, int fast) > th = timehands; > gen = atomic_load_acq_int(&th->th_generation); > fbi->th_scale = th->th_scale; > + fbi->th_tai_offset = th->th_tai_offset; > fbi->tick_time = th->th_offset; > #ifdef FFCLOCK > ffth = fftimehands; > @@ -1139,6 +1141,11 @@ sysclock_snap2bintime(struct sysclock_snap *cs, struct bintime *bt, > getboottimebin(&boottimebin); > bintime_add(bt, &boottimebin); > } > + if (!(flags & FBCLOCK_LEAPSEC)) { > + if (cs->fb_info.th_tai_offset == 0) > + return (EINVAL); > + bt->sec += cs->fb_info.th_tai_offset; > + } > break; > #ifdef FFCLOCK > case SYSCLOCK_FFWD: > @@ -1433,7 +1440,8 @@ tc_windup(struct bintime *new_boottimebin) > > do { > t = bt.sec; > - ntp_update_second(&th->th_adjustment, &bt.sec); > + ntp_update_second(&th->th_adjustment, &bt.sec, > + &th->th_tai_offset); > if (bt.sec != t) > th->th_boottime.sec += bt.sec - t; > --i; > diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c > index 0c31c1563d99..5960136eb515 100644 > --- a/sys/kern/kern_time.c > +++ b/sys/kern/kern_time.c > @@ -49,6 +49,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -60,7 +61,7 @@ > #include > #include > > -#define MAX_CLOCKS (CLOCK_MONOTONIC+1) > +#define MAX_CLOCKS (CLOCK_TAI+1) > #define CPUCLOCK_BIT 0x80000000 > #define CPUCLOCK_PROCESS_BIT 0x40000000 > #define CPUCLOCK_ID_MASK (~(CPUCLOCK_BIT|CPUCLOCK_PROCESS_BIT)) > @@ -101,7 +102,6 @@ static int realtimer_gettime(struct itimer *, struct itimerspec *); > static int realtimer_settime(struct itimer *, int, > struct itimerspec *, struct itimerspec *); > static int realtimer_delete(struct itimer *); > -static void realtimer_clocktime(clockid_t, struct timespec *); > static void realtimer_expire(void *); > static void realtimer_expire_l(struct itimer *it, bool proc_locked); > > @@ -318,7 +318,10 @@ int > kern_clock_gettime(struct thread *td, clockid_t clock_id, struct timespec *ats) > { > struct timeval sys, user; > + struct sysclock_snap clk; > + struct bintime bt; > struct proc *p; > + int err; We usually spell it as 'error'. > > p = td->td_proc; > switch (clock_id) { > @@ -329,6 +332,14 @@ kern_clock_gettime(struct thread *td, clockid_t clock_id, struct timespec *ats) > case CLOCK_REALTIME_FAST: > getnanotime(ats); > break; > + case CLOCK_TAI: > + sysclock_getsnapshot(&clk, 0); > + err = sysclock_snap2bintime(&clk, &bt, clk.sysclock_active, > + (clk.sysclock_active == SYSCLOCK_FFWD) ? FFCLOCK_LERP : 0); Extra () > + if (err) if (err != 0) > + return (err); > + bintime2timespec(&bt, ats); > + break; > case CLOCK_VIRTUAL: > PROC_LOCK(p); > PROC_STATLOCK(p); > @@ -451,6 +462,7 @@ kern_clock_getres(struct thread *td, clockid_t clock_id, struct timespec *ts) > case CLOCK_REALTIME: > case CLOCK_REALTIME_FAST: > case CLOCK_REALTIME_PRECISE: > + case CLOCK_TAI: > case CLOCK_MONOTONIC: > case CLOCK_MONOTONIC_FAST: > case CLOCK_MONOTONIC_PRECISE: > @@ -516,6 +528,7 @@ kern_clock_nanosleep(struct thread *td, clockid_t clock_id, int flags, > return (EINVAL); > switch (clock_id) { > case CLOCK_REALTIME: > + case CLOCK_TAI: > precise = nanosleep_precise; > is_abs_real = (flags & TIMER_ABSTIME) != 0; > break; > @@ -1167,6 +1180,7 @@ itimer_start(void) > NULL, NULL, itimer_init, itimer_fini, UMA_ALIGN_PTR, 0); > register_posix_clock(CLOCK_REALTIME, &rt_clock); > register_posix_clock(CLOCK_MONOTONIC, &rt_clock); > + register_posix_clock(CLOCK_TAI, &rt_clock); > p31b_setcfg(CTL_P1003_1B_TIMERS, 200112L); > p31b_setcfg(CTL_P1003_1B_DELAYTIMER_MAX, INT_MAX); > p31b_setcfg(CTL_P1003_1B_TIMER_MAX, TIMER_MAX); > @@ -1327,6 +1341,7 @@ kern_ktimer_create(struct thread *td, clockid_t clock_id, struct sigevent *evp, > switch (clock_id) { > default: > case CLOCK_REALTIME: > + case CLOCK_TAI: > it->it_sigev.sigev_signo = SIGALRM; > break; > case CLOCK_VIRTUAL: > @@ -1570,10 +1585,14 @@ static int > realtimer_gettime(struct itimer *it, struct itimerspec *ovalue) > { > struct timespec cts; > + int err; > > mtx_assert(&it->it_mtx, MA_OWNED); > > - realtimer_clocktime(it->it_clockid, &cts); > + err = kern_clock_gettime(curthread, it->it_clockid, &cts); > + if (err) Again, if (error != 0) and s/err/error/. And more places below. > + return (err); > + > *ovalue = it->it_time; > if (ovalue->it_value.tv_sec != 0 || ovalue->it_value.tv_nsec != 0) { > timespecsub(&ovalue->it_value, &cts, &ovalue->it_value); > @@ -1594,6 +1613,7 @@ realtimer_settime(struct itimer *it, int flags, struct itimerspec *value, > struct timespec cts, ts; > struct timeval tv; > struct itimerspec val; > + int err; > > mtx_assert(&it->it_mtx, MA_OWNED); > > @@ -1613,7 +1633,10 @@ realtimer_settime(struct itimer *it, int flags, struct itimerspec *value, > > it->it_time = val; > if (timespecisset(&val.it_value)) { > - realtimer_clocktime(it->it_clockid, &cts); > + err = kern_clock_gettime(curthread, it->it_clockid, &cts); > + if (err) > + return (err); > + > ts = val.it_value; > if ((flags & TIMER_ABSTIME) == 0) { > /* Convert to absolute time. */ > @@ -1636,15 +1659,6 @@ realtimer_settime(struct itimer *it, int flags, struct itimerspec *value, > return (0); > } > > -static void > -realtimer_clocktime(clockid_t id, struct timespec *ts) > -{ > - if (id == CLOCK_REALTIME) > - getnanotime(ts); > - else /* CLOCK_MONOTONIC */ > - getnanouptime(ts); > -} > - > int > itimer_accept(struct proc *p, int timerid, ksiginfo_t *ksi) > { > @@ -1689,10 +1703,12 @@ realtimer_expire_l(struct itimer *it, bool proc_locked) > struct timeval tv; > struct proc *p; > uint64_t interval, now, overruns, value; > + int err; > + > + err = kern_clock_gettime(curthread, it->it_clockid, &cts); > > - realtimer_clocktime(it->it_clockid, &cts); > /* Only fire if time is reached. */ > - if (timespeccmp(&cts, &it->it_time.it_value, >=)) { > + if (err == 0 && timespeccmp(&cts, &it->it_time.it_value, >=)) { > if (timespecisset(&it->it_time.it_interval)) { > timespecadd(&it->it_time.it_value, > &it->it_time.it_interval, > diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c > index dc6fee1f8f38..905ebd4f98ac 100644 > --- a/sys/kern/kern_umtx.c > +++ b/sys/kern/kern_umtx.c > @@ -693,6 +693,7 @@ umtx_abs_timeout_init(struct umtx_abs_timeout *timo, int clockid, > timo->is_abs_real = clockid == CLOCK_REALTIME || > clockid == CLOCK_REALTIME_FAST || > clockid == CLOCK_REALTIME_PRECISE || > + clockid == CLOCK_TAI || > clockid == CLOCK_SECOND; > } > } > @@ -787,6 +788,7 @@ umtx_abs_timeout_getsbt(struct umtx_abs_timeout *timo, sbintime_t *sbt, > case CLOCK_PROF: > case CLOCK_THREAD_CPUTIME_ID: > case CLOCK_PROCESS_CPUTIME_ID: > + case CLOCK_TAI: /* Boot time is not necessarily stable in TAI */ > default: > kern_clock_gettime(curthread, timo->clockid, &timo->cur); > if (timespeccmp(&timo->end, &timo->cur, <=)) > @@ -2953,8 +2955,9 @@ do_cv_wait(struct thread *td, struct ucond *cv, struct umutex *m, > umtx_key_release(&uq->uq_key); > return (EFAULT); > } > - if (clockid < CLOCK_REALTIME || > - clockid >= CLOCK_THREAD_CPUTIME_ID) { > + if ((clockid < CLOCK_REALTIME || > + clockid >= CLOCK_THREAD_CPUTIME_ID) && > + clockid != CLOCK_TAI) { > /* hmm, only HW clock id will work. */ > umtx_key_release(&uq->uq_key); > return (EINVAL); > diff --git a/sys/sys/_clock_id.h b/sys/sys/_clock_id.h > index 728346a0f0ab..83130d1f8a16 100644 > --- a/sys/sys/_clock_id.h > +++ b/sys/sys/_clock_id.h > @@ -74,6 +74,10 @@ > #define CLOCK_PROCESS_CPUTIME_ID 15 > #endif /* __POSIX_VISIBLE >= 199309 */ > > +#ifdef __BSD_VISIBLE > +#define CLOCK_TAI 16 > +#endif > + > /* > * Linux compatible names. > */ > diff --git a/sys/sys/timeffc.h b/sys/sys/timeffc.h > index a83b62b1672c..8bec73ed48a4 100644 > --- a/sys/sys/timeffc.h > +++ b/sys/sys/timeffc.h > @@ -89,7 +89,7 @@ extern int sysclock_active; > * of the kernel tick timer (1/hz [s]). > * FFCLOCK_LERP: Linear interpolation of ffclock time to guarantee > * monotonic time. > - * FFCLOCK_LEAPSEC: Include leap seconds. > + * {FB|FF}CLOCK_LEAPSEC: Include leap seconds. > * {FB|FF}CLOCK_UPTIME: Time stamp should be relative to system boot, not epoch. > */ > #define FFCLOCK_FAST 0x00000001 > @@ -100,6 +100,7 @@ extern int sysclock_active; > > #define FBCLOCK_FAST 0x00010000 /* Currently unused. */ > #define FBCLOCK_UPTIME 0x00020000 > +#define FBCLOCK_LEAPSEC 0x00040000 > #define FBCLOCK_MASK 0xffff0000 > > /* > @@ -111,6 +112,7 @@ struct fbclock_info { > struct bintime error; > struct bintime tick_time; > uint64_t th_scale; > + long th_tai_offset; > int status; > }; > > diff --git a/sys/sys/timex.h b/sys/sys/timex.h > index 072297375792..03632bdb119c 100644 > --- a/sys/sys/timex.h > +++ b/sys/sys/timex.h > @@ -154,7 +154,7 @@ struct timex { > #ifdef __FreeBSD__ > > #ifdef _KERNEL > -void ntp_update_second(int64_t *adjustment, time_t *newsec); > +void ntp_update_second(int64_t *adjustment, time_t *newsec, long *tai_off); > #else /* !_KERNEL */ > #include > From nobody Fri Jun 13 06:22:22 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJTp83z2Mz5c533; Fri, 13 Jun 2025 06:22:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJTp71qq1z3tdX; Fri, 13 Jun 2025 06:22:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749795743; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=buggbe8K1dMjXPknUV8BpWmtZ+AbfmHaZFdLjqzQgKw=; b=tazUtc//wlreqdmFyLtcFFvF1Ci9JwSUYgeFEd7Uu80cN5LmWCQHcMDg+bKA8foC3G+5QO el3Fc76f8X0gXBAmqTIwfc4F3y//v6OD2XnBmTG+xX7+R7KfkAxUI2ZEAkozZWerilRo7h MfdHcdmAK8mpWtvIY9/iPw95t5VkdH/YzfCduVmoGn33sNoFNdVZjGHhS3A9lMzuxJx3d8 qNsQhLhmcUa4Gc8jqAJeiYdkONwR4eb1F1ejgQSmFVvz3dJ4sIuc5T8omqpu+58O/QkGNR 0Yw/ORsa1NFGQxsOE1YoPhGyudj39gkSrkb8zwgZ5fyWfnqhsoUVauTUysAaCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749795743; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=buggbe8K1dMjXPknUV8BpWmtZ+AbfmHaZFdLjqzQgKw=; b=cQpSu5Juf2dNgc26OzrwvJ83vdKV6cJgQr7j1CcyOaHiMI13mDig/UFnIt8hJPr4v3bPWu lI9qG9RhCcko7t0eTENAWk0b3Azj1lJcL8ThvOQnjoK2wGXgoJw1RdLtBMaChcFpV0CKko opyL05r3cVK/mD7rAwSbeectan2hZ4aw/7svOPYi+0eW4Pb0gvey5LnswpsxpfnluKiOU3 MEhi5oo3GU/0tYSxoMAwvF47NQqGVZcECFFFCiYfpZcxsVtwWwD3o97R+6dQ5IFl85RuwP gl37STNXlFUuWYFUc5S3AEt4qTJPVfjMvenN5pfvj8eL6nHAeZLKSPoYS/yoPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749795743; a=rsa-sha256; cv=none; b=FhreC2eNfNocNIjaFneiPPwGh7wkExdi3MpgZq8zrLQKxWYxsbDmv28t3luuktsQuLnB1g H6Mksx2CgjmI0lhqOc2k7luy0M9rR0WsQqepnkr3Bfyx5+oLZEsv5HDOYooQwW1Q63rQTI TjDQbBGIvXQNM4lepaBRlVRWFyAlqkEY3EM7Tz+GI0WmTR/vqW70j+kgOLHz6qa2zQ6aze COOYJgqw3+pPikHPzN3Dm783Epxs3+35hPMU/IqE5i930UzZZ3XJ05y3T07mM7I0YTtJ7B SINInlGTH42Ee0cRUX2fCg5kkbOBKAVNeWRtmGsvaYdrthjXayf6hEAUDtmJwg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJTp66j7hzm4v; Fri, 13 Jun 2025 06:22:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55D6MMSI056893; Fri, 13 Jun 2025 06:22:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55D6MMOo056874; Fri, 13 Jun 2025 06:22:22 GMT (envelope-from git) Date: Fri, 13 Jun 2025 06:22:22 GMT Message-Id: <202506130622.55D6MMOo056874@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ahmad Khalifa Subject: git: 1873f2a5fd41 - main - committers-src: add myself List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vexeduxr X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1873f2a5fd4111476cf1fb03654c9a95df98f1b5 Auto-Submitted: auto-generated The branch main has been updated by vexeduxr: URL: https://cgit.FreeBSD.org/src/commit/?id=1873f2a5fd4111476cf1fb03654c9a95df98f1b5 commit 1873f2a5fd4111476cf1fb03654c9a95df98f1b5 Author: Ahmad Khalifa AuthorDate: 2025-06-12 20:50:56 +0000 Commit: Ahmad Khalifa CommitDate: 2025-06-13 06:20:19 +0000 committers-src: add myself Add myself (vexeduxr@) as a new src committer with imp@ as my mentor. Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D50824 --- share/misc/committers-src.dot | 2 ++ 1 file changed, 2 insertions(+) diff --git a/share/misc/committers-src.dot b/share/misc/committers-src.dot index e8719a44fae7..60ef52278a53 100644 --- a/share/misc/committers-src.dot +++ b/share/misc/committers-src.dot @@ -384,6 +384,7 @@ uqs [label="Ulrich Spoerlein\nuqs@FreeBSD.org\n2010/01/28"] vangyzen [label="Eric van Gyzen\nvangyzen@FreeBSD.org\n2015/03/08"] vanhu [label="Yvan Vanhullebus\nvanhu@FreeBSD.org\n2008/07/21"] versus [label="Konrad Jankowski\nversus@FreeBSD.org\n2008/10/27"] +vexeduxr [label="Ahmad Khalifa\nvexeduxr@FreeBSD.org\n2025/06/13"] vmaffione [label="Vincenzo Maffione\nvmaffione@FreeBSD.org\n2018/03/19"] weongyo [label="Weongyo Jeong\nweongyo@FreeBSD.org\n2007/12/21"] wes [label="Wes Peters\nwes@FreeBSD.org\n1998/11/25"] @@ -638,6 +639,7 @@ imp -> takawata imp -> toshi imp -> tsoome imp -> uch +imp -> vexeduxr jake -> bms jake -> gordon From nobody Fri Jun 13 10:08:27 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJZq00mfQz5pkFP; Fri, 13 Jun 2025 10:08:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJZpz75n5z3MDd; Fri, 13 Jun 2025 10:08:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749809308; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=brnQMKifnN+OxWA3imrnsiT2k/O+CesnInBF6tmHa2g=; b=MlFFgRa3y17QAIKfbhcOnzzB45eD/KmLWOnGo0CGbk9ZNIP0IG9glK2ORmAVZPVdJ/58+A 5wKK0YnR1E0MERcU0ZgY0+QYAkVW8xK3Uba38UkHvwEDhfZuK5gC4kGwHXqOC8Ld+5NAJ8 y8yk2C59Dxs03bXOquVYAizFPMzKwYhE13sibANtbs8uMhyVKLlay5oyrRSjVQb/Ula7Mw GG844TEpP5UjuxHRVqerETr+GhGDb6kfXiUooQqHx6BiiI0meg2e9uKGFN0hilgy+H0M7v 5Uh1HeNNSpIY4J3wzAohxTitLuJ+5f9Ox0rCfpX4PwbBpjuX++jB0JXYTQo/Rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749809308; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=brnQMKifnN+OxWA3imrnsiT2k/O+CesnInBF6tmHa2g=; b=LalW3wElC60JvrJx9RyqvzSG9IC7dP9APBtyydlCyZ3ngX0OdEFeQlG0TmJSzsI8BmiBEX QzOP0W2p7XZIbM8EiUry/6MvqQCh6up7UsSUE7fzLjjfJCn15K10ynI0IM1IZsPUmB9Sx+ 1OYrKXtDYwr6dwtBg72flLRmk6zT8eRVLCkG7Va/4xz8HaFdTPKeyRA0AI0F8iFvd9Lvx1 20kk6VGW1p7iRcABMpNEhk+VZzj+ch7CTCqQjWQgEXyQsrQQMgeo44xd5RFOecprd52Ray GTr1jz1h/A5W1emA0Rk7/WJPpleGXrRIX57RBkPRn+UiuvXDgd5kuzTv1LD5ag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749809308; a=rsa-sha256; cv=none; b=no18qpus3ojRmATSlJQFubJdlk6+35nViBj4ytBOB+ilYE37BDqHXajruJeL2v2d9eqncd sViXuWCByQFU8+0byZUpJvmx3wRz4RVcAUzYBNH8rAkXv3JRc9caJRg0++rZkldMAuxar9 rMfzlqCoKuTQwX5SVQfVLue1YKDRaheibgDNh/JKU5dQcfnyZ5eTwXEfYGdy3F2dg2Uu1G Y+cjALoOVVhXuEDfGFP0TvObUdwXk3Rw7c9sQbDWK+gC4MdKij2a8KH4nWAYcHuCDuzX8v yIfRZhswg6H2auvhvryVmx5s1kuNUYJ3NMRpoA8boxlyv7PIFxBqt9vSeryq0Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJZpz6jMPzsr2; Fri, 13 Jun 2025 10:08:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55DA8RoI069194; Fri, 13 Jun 2025 10:08:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55DA8RqT069191; Fri, 13 Jun 2025 10:08:27 GMT (envelope-from git) Date: Fri, 13 Jun 2025 10:08:27 GMT Message-Id: <202506131008.55DA8RqT069191@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: c43d6dadf7e3 - main - ng_iface(4): Remove a redundant assignment of if_type List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c43d6dadf7e34a94f4d119ff6d7113ad9a9b4d38 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=c43d6dadf7e34a94f4d119ff6d7113ad9a9b4d38 commit c43d6dadf7e34a94f4d119ff6d7113ad9a9b4d38 Author: Zhenlei Huang AuthorDate: 2025-06-13 10:07:18 +0000 Commit: Zhenlei Huang CommitDate: 2025-06-13 10:07:18 +0000 ng_iface(4): Remove a redundant assignment of if_type That is unnecessary since change [1], as if_alloc(IFT_PROPVIRTUAL) has set if_type already. [1] fc74a9f93a5f Stop embedding struct ifnet at the top of driver softcs No functional change intended. MFC after: 1 week --- sys/netgraph/ng_iface.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/netgraph/ng_iface.c b/sys/netgraph/ng_iface.c index d42e74d5fd22..fbe89e13474b 100644 --- a/sys/netgraph/ng_iface.c +++ b/sys/netgraph/ng_iface.c @@ -545,7 +545,6 @@ ng_iface_constructor(node_p node) ifp->if_ioctl = ng_iface_ioctl; ifp->if_mtu = NG_IFACE_MTU_DEFAULT; ifp->if_flags = (IFF_SIMPLEX|IFF_POINTOPOINT|IFF_NOARP|IFF_MULTICAST); - ifp->if_type = IFT_PROPVIRTUAL; /* XXX */ ifp->if_addrlen = 0; /* XXX */ ifp->if_hdrlen = 0; /* XXX */ ifp->if_baudrate = 64000; /* XXX */ From nobody Fri Jun 13 14:09:23 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJh8z5Zl9z5q3X0; Fri, 13 Jun 2025 14:09:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJh8z4qBcz3LRt; Fri, 13 Jun 2025 14:09:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749823763; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=i2WOQ+owzRKJG+B/AoJsdSS7kE9DAFqRqXfFYnxHwl4=; b=RKKGqJnRU+aJZAl1+lOKgx3RCtw8hqVn5TgCSovv2nWf+mvEzstxlnkVxqmEu8rDpGzCAS 9/ad125jKAxc7y5pyw2RvyT+6+TiQGfzh8rlN9HtREkj7TIpXPQW6tmkU3XKKHhkItwu/j ti1QIwXo5+eeSqL9mHGqa2ifv3XFZSZU9ZnTAtYYl4zGHg+YKgC4QxqkWlEnCvOE9D7uTT r3uX5zdXg9m2kHnEKtDVGdX4U1iQQ6TEAYdZT6RHzhPJlyDm+I3H9Q/HDm8f2tBT9qRxN0 4T4cxld8q+SV9XY6WWIg2sQ4m8tYUavO8zVMRAx683h0GiBethpzIpga5Rifww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749823763; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=i2WOQ+owzRKJG+B/AoJsdSS7kE9DAFqRqXfFYnxHwl4=; b=wal/cdxSxZEmEIhO4AlzL8vfKfVqaj3Z+q/qRwAGPIrTiBpkWgnPQvWKGahPEIAjALbnPN Ea4AQA3TeCUoTr1BBxEdPTFeghFHZgVcF9LVkx65SD0NGc2I/ZfUxepA5B61t6kbwA3Tb8 esFAwnowvqkN1+IQyfwG83XPbLioreRBsIQbIwx5m30fWbtCgTuoyK8JTo2f4Sab1w/lqi LyiKw81SXdjgKk7OCv4rh+CrS3atgi/yatZfWZRrLwXQnYnC4UvS3k2E+imMoUlBLL3Xzd HuCQ0QnZXIeKOiu0+o15At0bCb7jun2QAV1EdREmy3FwKsoZSc2gTpos5KUMoQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749823763; a=rsa-sha256; cv=none; b=jEX9zvQDcrR7oANMjHsByLHqc5pd2YcByqGb2jN5PulZCcgxkXvfqMCWGOmnh+8qRMJdVV 0f9lbTzTNZ/f8nX2d7WYQDvmDj42KtdWQe/eplp6iw6O/s0C3hdgnEgiguZn8FPyjEgMbd SMJEgoMo7p2HFjT7IKCueSU++sbcf5nhIKfwWmBvCpWeBI9SxMBMIISHr0uk3y96KBAPR+ Rk/xzk95OWlfoCcVG1/GgQgkr4nLHdAs0dmy0njQ/BdgJLRgji6g32kdRUkhBcPlE0zV+3 7En5bKWlK0B61VY/9VlEhDrYUVF2RTsZ3sRxiUDKq9zbZ7I2wad+VGnsSph4hw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJh8z4Pggz10tM; Fri, 13 Jun 2025 14:09:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55DE9NJc016780; Fri, 13 Jun 2025 14:09:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55DE9NPC016777; Fri, 13 Jun 2025 14:09:23 GMT (envelope-from git) Date: Fri, 13 Jun 2025 14:09:23 GMT Message-Id: <202506131409.55DE9NPC016777@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Sergey A. Osokin" Subject: git: 83f7e20c251a - main - bsd-family-tree: add Dragonfly 6.4.2 and FreeBSD 14.3 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osa X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 83f7e20c251a56dadfc0a462cb10b999079aa93c Auto-Submitted: auto-generated The branch main has been updated by osa: URL: https://cgit.FreeBSD.org/src/commit/?id=83f7e20c251a56dadfc0a462cb10b999079aa93c commit 83f7e20c251a56dadfc0a462cb10b999079aa93c Author: Sergey A. Osokin AuthorDate: 2025-06-13 14:08:55 +0000 Commit: Sergey A. Osokin CommitDate: 2025-06-13 14:08:55 +0000 bsd-family-tree: add Dragonfly 6.4.2 and FreeBSD 14.3 --- share/misc/bsd-family-tree | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/share/misc/bsd-family-tree b/share/misc/bsd-family-tree index 2c55e542f5e8..07f79008257f 100644 --- a/share/misc/bsd-family-tree +++ b/share/misc/bsd-family-tree @@ -471,12 +471,15 @@ FreeBSD 5.2 | | | | | | 13.4 | | | OpenBSD 7.6 | | FreeBSD | | | | | | | 14.2 | | | | | | - | | | | NetBSD | | - | | | | 10.1 | | - | FreeBSD | | | | - | 13.5 | | | | - | | | OpenBSD 7.7 | - | | | | DragonFly 6.4.1 + | | | | | NetBSD | | + | | | | | 10.1 | | + | | FreeBSD | | | | + | | 13.5 | | | | + | | | | OpenBSD 7.7 | + | | | | | DragonFly 6.4.1 + | | | | | DragonFly 6.4.2 + | FreeBSD | | | | + | 14.3 | | | | | | | | | FreeBSD 15 -current | NetBSD -current OpenBSD -current DragonFly -current | | | | | @@ -920,6 +923,8 @@ NetBSD 10.1 2024-12-16 [NBD] FreeBSD 13.5 2025-03-11 [FBD] OpenBSD 7.7 2025-04-28 [OBD] DragonFly 6.4.1 2025-04-30 [DFB] +DragonFly 6.4.2 2025-05-09 [DFB] +FreeBSD 14.3 2025-06-10 [FBD] Bibliography ------------------------ From nobody Fri Jun 13 14:25:50 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJhWy32Xsz5q46L; Fri, 13 Jun 2025 14:25:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJhWy1zDpz3NMY; Fri, 13 Jun 2025 14:25:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749824750; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dVoUIqnMu32G9YTLCbFbkVYCxmdIj2HVjO1ohAQUV6Q=; b=nTWbGytl8rtyEfcUf5Y8zKYSuZcStzla0xNOqyAjjLyWlLxN2Oe7pguys5VuUwtkQV4B3K l8IQQ30Rd06q6oQqwhGhxR7baBtF1jSQo6z6Ah0wedO5VdhK2IOpYTIhMn2XeETeQPP80C /RWTZ86AZOwa0IwXEDQBNsgkvcX/VSz+zfYGijNVtDiPPBltfQYde6E1qDTr+S1NDssh3C LD3eWouMOG1cZzt9BlZUwwar7WvIJuUiq87o6xEgbVx/SZIqfdampGv5PX1lfqTId/3TVg lvAcmQgCMU+iL/c03SokCvbj9NTx06EN+luaVRtECUmH1EGJwfS+j4cNtKuk4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749824750; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dVoUIqnMu32G9YTLCbFbkVYCxmdIj2HVjO1ohAQUV6Q=; b=aiESKDQBPSQ5CjGZXes++Yaq980wYfHqsVw55vrcVDfh4cqPoS8GILqS4QBstwggB5nchs hl9cPD43HtRevBYMKu6CYcyIStMnD3c/AG9PvgIj4AM+92oxk7JIk9ol8YAJUNinoUz11A dynHEFwy3b1clu6tlrCmnq5MC8GU0dBblq21C4pY2GikYJFNjLkMM9R1FMHoSCbGcwTILs 5O0zKYircZS1nQe9COlvh5vno/de8Ac+VFjXCc+uzbTCMxQHzg/kAG84Es0fI+etf8pNHt 5NEhcS0drsNbo1oWq/Kc0jO00NxLDqAMsm/7wZDEKmdNnhNK5TAmsOzLXIZ/IA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749824750; a=rsa-sha256; cv=none; b=ImQm4RkOPfSJN0KUW7pWeTFdnER7whyKrk1FNIfg7qhw1kqSdRBsyXjI7nQND1nTwLu4rG J8o79uHZqcBQG0yjoXU24Fl64HtON3cPdAQ4iHyP+0CPnExuPrZlX/KL/x+EJyQFCAdrQ5 ZBAa41UJzX7TAXY9hLplQhrWAwTHjLgYhzhhCIBlivd6tPhmge05hshnWNh3aJuJihSL2D +VwcxujbZf7CWfazgC1q3QYQ7vm9QbKUFz4r5FbkTwnxg8ffAKAup9c72P+KWFW76HVhzF vyTs8yazhnrJM6usaz5lF0wJHU+lqWeccNohm0bkXuecjJGRMHZsoUp/nvl/Bg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJhWy1TYtz11Vw; Fri, 13 Jun 2025 14:25:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55DEPoTm053164; Fri, 13 Jun 2025 14:25:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55DEPoZr053160; Fri, 13 Jun 2025 14:25:50 GMT (envelope-from git) Date: Fri, 13 Jun 2025 14:25:50 GMT Message-Id: <202506131425.55DEPoZr053160@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 65cda8a11df4 - main - bin/cat: add test for reading data from stdin List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 65cda8a11df4718d963ef0624eb2f6e0f5201a8c Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=65cda8a11df4718d963ef0624eb2f6e0f5201a8c commit 65cda8a11df4718d963ef0624eb2f6e0f5201a8c Author: K Rin AuthorDate: 2025-04-20 09:59:34 +0000 Commit: Warner Losh CommitDate: 2025-06-13 14:25:54 +0000 bin/cat: add test for reading data from stdin Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1671 Closes: https://github.com/freebsd/freebsd-src/pull/1671 --- bin/cat/tests/Makefile | 1 + contrib/netbsd-tests/bin/cat/stdin_test.out | 1 + contrib/netbsd-tests/bin/cat/t_cat.sh | 15 +++++++++++++++ 3 files changed, 17 insertions(+) diff --git a/bin/cat/tests/Makefile b/bin/cat/tests/Makefile index 2f48c7d4e0cf..347f4826ba4d 100644 --- a/bin/cat/tests/Makefile +++ b/bin/cat/tests/Makefile @@ -12,6 +12,7 @@ ${PACKAGE}FILES+= d_s_output.in ${PACKAGE}FILES+= d_s_output.out ${PACKAGE}FILES+= d_vt_output.in ${PACKAGE}FILES+= d_vt_output.out +${PACKAGE}FILES+= stdin_test.out .include diff --git a/contrib/netbsd-tests/bin/cat/stdin_test.out b/contrib/netbsd-tests/bin/cat/stdin_test.out new file mode 100644 index 000000000000..7caf37d4c05d --- /dev/null +++ b/contrib/netbsd-tests/bin/cat/stdin_test.out @@ -0,0 +1 @@ +This is nothing but a cat test. diff --git a/contrib/netbsd-tests/bin/cat/t_cat.sh b/contrib/netbsd-tests/bin/cat/t_cat.sh index 10706372f87d..4e88276b371f 100755 --- a/contrib/netbsd-tests/bin/cat/t_cat.sh +++ b/contrib/netbsd-tests/bin/cat/t_cat.sh @@ -112,6 +112,20 @@ vt_output_body() { } # End FreeBSD +# Begin FreeBSD +atf_test_case stdin_test +stdin_test_head() { + atf_set "descr" "Test that cat(1) receives data from stdin " \ + "and outputs." +} + +stdin_test_body() { + echo "This is nothing but a cat test." | \ + atf_check -s ignore -o file:$(atf_get_srcdir)/stdin_test.out \ + cat +} +# End FreeBSD + atf_init_test_cases() { atf_add_test_case align @@ -124,5 +138,6 @@ atf_init_test_cases() atf_add_test_case s_output atf_add_test_case e_output atf_add_test_case vt_output + atf_add_test_case stdin_test # End FreeBSD } From nobody Fri Jun 13 14:35:25 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJhl12HSqz5q5CF; Fri, 13 Jun 2025 14:35:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJhl11VtRz3RlG; Fri, 13 Jun 2025 14:35:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749825325; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gJZ5PCCIZ1/4UaC9FmuOTMqPJ2yWl1JzsqRtSN+/c+g=; b=U2mmY+ywqYLLOxz7dlzEjNkWOIkXC9kz6D9/m3Jj5wE5Wf0gkeHKjuraM2oV6KUEareQsT xwWo1A0NvrKyC8LsPI46sjJFnHbNuVP25+UKYA7QCtZziR/4YR1Ijyuy+4x2Dm1RKo86Id hiyvcFx48GC4EHJzH6ECoUntkoxQjEr4B9jxgVjFsGQGorVDOHqJPDTt6v+M08ACfjqyGX AJwTKqaX7vTLw7kHgWJE93hNjzcNpwR+WO4P1EbHT1llRN5uanOHsbGmYD2sxgESgr3GKz QjoRwjzt1KYgQuvQQHIKkraVlpdJ0+Ae/VAsgT63skHAJlzv00mvTSVhnq8Dug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749825325; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gJZ5PCCIZ1/4UaC9FmuOTMqPJ2yWl1JzsqRtSN+/c+g=; b=cb/JFOcOV1O2p5G6GZteFKzXTC9riqBrygISe1i085AnR2pgu/JgpO2sbXqmA/zeuDeSu8 fvxiCHy9DVx7fl1loe/snNLjNB92KFPO6kLjqNqyJ2d+J7I4xHvwPbLXgvk0vp4afGTNm9 CfpuswF9SY3Yhj73CoLlagUZsjVfB4gGgPo/SsV+w/AzEH3JNLAqeseUaqi11kTCgwcJNx /Ye6i5MtRKnGCnkKfaX/UTuoCo5AtvhOBTMqBJiAoWNZdGadILZwL+AMi2ngxzmd7w+fR5 JeWv49l69C75FFO7oKOmE3Le3mSJQH/lIOeXUsTsWC6UXn3+8cKzxe7PxRruEA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749825325; a=rsa-sha256; cv=none; b=c821loDJXXiLezESnx4Ovsu0N03A2MHJE+trPPHkbThIo/DYixGLNwKOZoqbgaVJ5gmoi4 J36apBy8msqcsjK6xhGbkNLs97we2/EXUVNDQ7w8s3uGk/XjcZrki76jtVEHV5kUYJYr3W bF/Y1wgo0vbcjNrzFxnxWxaYtOjUiujIXJKQY4OU45k6gzdQr26zWHd3gIf8OWnTY6CPQz WUnwI3uiRLZy+Xudb7xaccVIlU2nBWHSbYzmIYm+KZ31qzthzZjvdrCYZJuxA7aNx4Hh/Y JE1wG+iw8T/oZBbfpe6WlA943KtmrXjUZGD31X3Ogoz6aVjLIsh3cUPOdMmkjQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJhl114vSz11mZ; Fri, 13 Jun 2025 14:35:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55DEZPiK071537; Fri, 13 Jun 2025 14:35:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55DEZPQE071534; Fri, 13 Jun 2025 14:35:25 GMT (envelope-from git) Date: Fri, 13 Jun 2025 14:35:25 GMT Message-Id: <202506131435.55DEZPQE071534@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: bd8621c6cd8a - main - kern_time: minor style nits List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bd8621c6cd8a7499e7c8be189cf1ffd102dcc9d1 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=bd8621c6cd8a7499e7c8be189cf1ffd102dcc9d1 commit bd8621c6cd8a7499e7c8be189cf1ffd102dcc9d1 Author: Warner Losh AuthorDate: 2025-06-13 14:34:21 +0000 Commit: Warner Losh CommitDate: 2025-06-13 14:34:21 +0000 kern_time: minor style nits Typically we spell error values 'error' not 'err'. And fix EINVAL markup nit. Suggested by: kib Fixes: 7b7ba7857ce8 Sponsored by: Netflix --- lib/libsys/clock_gettime.2 | 4 +++- sys/kern/kern_time.c | 32 ++++++++++++++++---------------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/lib/libsys/clock_gettime.2 b/lib/libsys/clock_gettime.2 index 1dcfd9d1faf7..c3b8fb92c9c1 100644 --- a/lib/libsys/clock_gettime.2 +++ b/lib/libsys/clock_gettime.2 @@ -104,7 +104,9 @@ Increments in SI seconds like a wall clock. It uses a 1970 epoch and implements the TAI timescale. Similar to CLOCK_REALTIME, but without leap seconds. It will increase monotonically during a leap second. -Will return EINVAL if the current offset between TAI and UTC is not known, +Will return +.Er EINVAL +if the current offset between TAI and UTC is not known, which may be the case early in boot before NTP or other time daemon has synchronized. .El diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index 5960136eb515..9830e5093a3a 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -321,7 +321,7 @@ kern_clock_gettime(struct thread *td, clockid_t clock_id, struct timespec *ats) struct sysclock_snap clk; struct bintime bt; struct proc *p; - int err; + int error; p = td->td_proc; switch (clock_id) { @@ -334,10 +334,10 @@ kern_clock_gettime(struct thread *td, clockid_t clock_id, struct timespec *ats) break; case CLOCK_TAI: sysclock_getsnapshot(&clk, 0); - err = sysclock_snap2bintime(&clk, &bt, clk.sysclock_active, - (clk.sysclock_active == SYSCLOCK_FFWD) ? FFCLOCK_LERP : 0); - if (err) - return (err); + error = sysclock_snap2bintime(&clk, &bt, clk.sysclock_active, + clk.sysclock_active == SYSCLOCK_FFWD ? FFCLOCK_LERP : 0); + if (error != 0) + return (error); bintime2timespec(&bt, ats); break; case CLOCK_VIRTUAL: @@ -1585,13 +1585,13 @@ static int realtimer_gettime(struct itimer *it, struct itimerspec *ovalue) { struct timespec cts; - int err; + int error; mtx_assert(&it->it_mtx, MA_OWNED); - err = kern_clock_gettime(curthread, it->it_clockid, &cts); - if (err) - return (err); + error = kern_clock_gettime(curthread, it->it_clockid, &cts); + if (error != 0) + return (error); *ovalue = it->it_time; if (ovalue->it_value.tv_sec != 0 || ovalue->it_value.tv_nsec != 0) { @@ -1613,7 +1613,7 @@ realtimer_settime(struct itimer *it, int flags, struct itimerspec *value, struct timespec cts, ts; struct timeval tv; struct itimerspec val; - int err; + int error; mtx_assert(&it->it_mtx, MA_OWNED); @@ -1633,9 +1633,9 @@ realtimer_settime(struct itimer *it, int flags, struct itimerspec *value, it->it_time = val; if (timespecisset(&val.it_value)) { - err = kern_clock_gettime(curthread, it->it_clockid, &cts); - if (err) - return (err); + error = kern_clock_gettime(curthread, it->it_clockid, &cts); + if (error != 0) + return (error); ts = val.it_value; if ((flags & TIMER_ABSTIME) == 0) { @@ -1703,12 +1703,12 @@ realtimer_expire_l(struct itimer *it, bool proc_locked) struct timeval tv; struct proc *p; uint64_t interval, now, overruns, value; - int err; + int error; - err = kern_clock_gettime(curthread, it->it_clockid, &cts); + error = kern_clock_gettime(curthread, it->it_clockid, &cts); /* Only fire if time is reached. */ - if (err == 0 && timespeccmp(&cts, &it->it_time.it_value, >=)) { + if (error == 0 && timespeccmp(&cts, &it->it_time.it_value, >=)) { if (timespecisset(&it->it_time.it_interval)) { timespecadd(&it->it_time.it_value, &it->it_time.it_interval, From nobody Fri Jun 13 14:36:21 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJhmR5RTFz5q5CX for ; Fri, 13 Jun 2025 14:36:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJhmR2mV0z3Rq4 for ; Fri, 13 Jun 2025 14:36:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pg1-x52f.google.com with SMTP id 41be03b00d2f7-b2fc93728b2so1831057a12.0 for ; Fri, 13 Jun 2025 07:36:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1749825393; x=1750430193; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=rxEWJXzFWHAL+KobLmQVeOxvzrGwxFvXsFcyT6Ug7R8=; b=S8CQQIjRV82U3c7NrGiJdupZ0toU8sWX/CyNZOo9IXEsrf1b6yAPR8u1xtrhbiGDL8 Xv7LeAEN1Q2LfOQnnFwxjXmgD4NpR3ShR+jj8o1LlzPaU/u+DvEiFZ+xjCo25vL/yzF3 XqhRLJ0jICACY/UpST0xFJNB1JSLqmEh9E+/RUlN5TKRuHc3b2M1LVynMKap+oHL9AKK qhI4gRbFv44MaJbFBMADroaNV+Emnjcc6ZspbrwiJ+OfJcUgGH/YpdZjuty/6peILDbs 031X5x+OjG3tgA3F58whumStNVOkY3LdYnOpe4ksTHVAM1SNS/X+1EBsOZuJRwDP2fqL zXiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749825393; x=1750430193; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rxEWJXzFWHAL+KobLmQVeOxvzrGwxFvXsFcyT6Ug7R8=; b=l+kYZywSRSDfepS8+ina8pQ6l/NAjWveyQ8uxOeIq4oYr5HawVSlITUhJl8ibo8B54 7QMLka6dTG1lfelks4TmTwhlu5ih0SZoi4OYHqC6m5g0yWBJlal58+pb1BoNhuS4YDBR o+2aitU8eoqDZvgislLqiNB51iR+DyilsW9SO79NTe4nRbir0a7RWFrS3ljguzX97akF MN+B8aO28eYQIrceUKMiHiralhSMVbI05RdePcPg1hqqwhQHH+lnlxBjwc60cVp3s6Iv UKJtohcfFwJJ0e4C/18DqF/uRFlswxRAXMtqIh54oyszu8FNDhKl0aBMiRexDNWC8YuS Tdiw== X-Forwarded-Encrypted: i=1; AJvYcCXAHDDczcKgbqwrY9BLsUszJehOSs5crx7nIHftlEyLhR6/DJX03HXWHjrHCHGUFbdQBcDTUw9jdfM3/ZiUwDiSPbA+xg==@freebsd.org X-Gm-Message-State: AOJu0YxdZPX8ZgnkWj17RBelPbv6c8NkQYmbQt7zYYVBl9Z3SJRQ5m7s RvyT57LxAVMiGY7TEBWgbxIPdH3+lu7ymlfwMPDVbMQoBFfZdHOKap19AwHEHYrUNkjUcnhOcPC cd+UIBtVfBJL8ICyAC44KUJgecbNa4IVP+DJP7jrUfw== X-Gm-Gg: ASbGnct1pUTkfBXFeUsCEmgPx4jfOOvj0XtoML9MBYN/lgDGyHCTWlvZ0qLvXrkgLKz ri4WTPOpP9gHYlYJ1p3Hm6clmQCelqEsCKD1i8VWLQPaMrA7/wTyRo+3WpesduEg0H3AilWS59m ej94W2V95T8XG5BUUfWgsXT18YtG2XZhDrzyEL8wtn2nUksQ== X-Google-Smtp-Source: AGHT+IF/1igJy5Cj3DPw8e8W6XwjRI/mllnviVrmSDauRswauPFfPoGRz4i7MZG1k7+PWEMQuLZ08IVz7ysA+ZRenwI= X-Received: by 2002:a17:90b:1dcd:b0:312:1b53:5ea8 with SMTP id 98e67ed59e1d1-313d9e9c8ccmr5446600a91.24.1749825392851; Fri, 13 Jun 2025 07:36:32 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202506121825.55CIPemP006355@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Fri, 13 Jun 2025 10:36:21 -0400 X-Gm-Features: AX0GCFv2X_pMsR27cw6DeFuvBS4K3UgEixnaIVj37TllOJKAwG_Cz1FZBnYjnyA Message-ID: Subject: Re: git: 7b7ba7857ce8 - main - Implement CLOCK_TAI To: Konstantin Belousov Cc: Warner Losh , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4bJhmR2mV0z3Rq4 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] Ah, good feedback. Applied in bd8621c6cd8a. Anything else? Warner On Fri, Jun 13, 2025 at 2:17=E2=80=AFAM Konstantin Belousov wrote: > > On Thu, Jun 12, 2025 at 06:25:40PM +0000, Warner Losh wrote: > > The branch main has been updated by imp: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D7b7ba7857ce8be0bf6ab905d= 936d8ba1363e4ec2 > > > > commit 7b7ba7857ce8be0bf6ab905d936d8ba1363e4ec2 > > Author: Nathan Whitehorn > > AuthorDate: 2025-06-12 17:52:30 +0000 > > Commit: Warner Losh > > CommitDate: 2025-06-12 18:25:31 +0000 > > > > Implement CLOCK_TAI > > > > Provide a clock through clock_gettime() that returns the current TA= I > > time (UTC without leap seconds) as a complement to CLOCK_REALTIME. = This > > provides compatibility with Linux, which also provides a CLOCK_TAI = since > > kernel 2.6.26, and this seems to be becoming the standard way to ac= quire > > TAI time. Unlike Linux, this code will return EINVAL if the TAI off= set > > (set by ntpd, ptpd, etc.) is not known since it seems pathological = for > > CLOCK_TAI to silently give the wrong (UTC) time if the offset is no= t > > known as it does on Linux. > > > > Reviewed by: imp > > Differential Revision: https://reviews.freebsd.org/D46268 > > --- > > lib/libsys/_umtx_op.2 | 2 ++ > > lib/libsys/clock_gettime.2 | 14 ++++++++++-- > > lib/libsys/nanosleep.2 | 4 +++- > > lib/libsys/timer_create.2 | 3 ++- > > lib/libthr/thread/thr_condattr.c | 1 + > > share/man/man3/pthread_condattr.3 | 3 ++- > > sys/kern/kern_ntptime.c | 3 ++- > > sys/kern/kern_tc.c | 10 ++++++++- > > sys/kern/kern_time.c | 46 ++++++++++++++++++++++++++-----= -------- > > sys/kern/kern_umtx.c | 7 ++++-- > > sys/sys/_clock_id.h | 4 ++++ > > sys/sys/timeffc.h | 4 +++- > > sys/sys/timex.h | 2 +- > > 13 files changed, 77 insertions(+), 26 deletions(-) > > > > diff --git a/lib/libsys/_umtx_op.2 b/lib/libsys/_umtx_op.2 > > index 974850fb8425..c590f8e8e0c8 100644 > > --- a/lib/libsys/_umtx_op.2 > > +++ b/lib/libsys/_umtx_op.2 > > @@ -210,6 +210,8 @@ Valid clock identifiers are a subset of those for > > .It > > .Dv CLOCK_SECOND > > .It > > +.Dv CLOCK_TAI > > +.It > > .Dv CLOCK_UPTIME > > .It > > .Dv CLOCK_UPTIME_FAST > > diff --git a/lib/libsys/clock_gettime.2 b/lib/libsys/clock_gettime.2 > > index fcdc5be498f2..1dcfd9d1faf7 100644 > > --- a/lib/libsys/clock_gettime.2 > > +++ b/lib/libsys/clock_gettime.2 > > @@ -27,7 +27,7 @@ > > .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILIT= Y OF > > .\" SUCH DAMAGE. > > .\" > > -.Dd June 28, 2024 > > +.Dd August 10, 2024 > > .Dt CLOCK_GETTIME 2 > > .Os > > .Sh NAME > > @@ -99,11 +99,20 @@ query, using an in-kernel cached value of the curre= nt second. > > Returns the execution time of the calling process. > > .It Dv CLOCK_THREAD_CPUTIME_ID > > Returns the execution time of the calling thread. > > +.It Dv CLOCK_TAI > > +Increments in SI seconds like a wall clock. > > +It uses a 1970 epoch and implements the TAI timescale. > > +Similar to CLOCK_REALTIME, but without leap seconds. > .Dv CLOCK_REALTIME > > +It will increase monotonically during a leap second. > > +Will return EINVAL if the current offset between TAI and UTC is not kn= own, > .Er EINVAL > > +which may be the case early in boot before NTP or other time daemon ha= s > > +synchronized. > > .El > > .Pp > > The clock IDs > > .Dv CLOCK_BOOTTIME , > > .Dv CLOCK_REALTIME , > > +.Dv CLOCK_TAI , > > .Dv CLOCK_MONOTONIC , > > and > > .Dv CLOCK_UPTIME > > @@ -202,7 +211,8 @@ The clock IDs > > .Dv CLOCK_MONOTONIC_PRECISE , > > .Dv CLOCK_REALTIME_FAST , > > .Dv CLOCK_REALTIME_PRECISE , > > -.Dv CLOCK_SECOND > > +.Dv CLOCK_SECOND , > > +.Dv CLOCK_TAI , > > .Dv CLOCK_UPTIME , > > .Dv CLOCK_UPTIME_FAST , > > and > > diff --git a/lib/libsys/nanosleep.2 b/lib/libsys/nanosleep.2 > > index ba9aae1edf57..290565dbd6e1 100644 > > --- a/lib/libsys/nanosleep.2 > > +++ b/lib/libsys/nanosleep.2 > > @@ -27,7 +27,7 @@ > > .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILIT= Y OF > > .\" SUCH DAMAGE. > > .\" > > -.Dd April 29, 2025 > > +.Dd May 3, 2025 > > .Dt NANOSLEEP 2 > > .Os > > .Sh NAME > > @@ -116,6 +116,8 @@ CLOCK_REALTIME_PRECISE > > .It > > CLOCK_SECOND > > .It > > +CLOCK_TAI > > +.It > > CLOCK_UPTIME > > .It > > CLOCK_UPTIME_FAST > > diff --git a/lib/libsys/timer_create.2 b/lib/libsys/timer_create.2 > > index e8489b390845..8f6ff2e27c51 100644 > > --- a/lib/libsys/timer_create.2 > > +++ b/lib/libsys/timer_create.2 > > @@ -126,7 +126,8 @@ the value of the timer ID. > > This implementation supports a > > .Fa clock_id > > of > > -.Dv CLOCK_REALTIME > > +.Dv CLOCK_REALTIME , > > +.Dv CLOCK_TAI , > > or > > .Dv CLOCK_MONOTONIC . > > .Pp > > diff --git a/lib/libthr/thread/thr_condattr.c b/lib/libthr/thread/thr_c= ondattr.c > > index 0dc3e52bab5e..dc56363fc084 100644 > > --- a/lib/libthr/thread/thr_condattr.c > > +++ b/lib/libthr/thread/thr_condattr.c > > @@ -94,6 +94,7 @@ _pthread_condattr_setclock(pthread_condattr_t *attr, = clockid_t clock_id) > > if (attr =3D=3D NULL || *attr =3D=3D NULL) > > return (EINVAL); > > if (clock_id !=3D CLOCK_REALTIME && > > + clock_id !=3D CLOCK_TAI && > > clock_id !=3D CLOCK_VIRTUAL && > > clock_id !=3D CLOCK_PROF && > > clock_id !=3D CLOCK_MONOTONIC) { > > diff --git a/share/man/man3/pthread_condattr.3 b/share/man/man3/pthread= _condattr.3 > > index 96d30263d7f2..33ad904f9a3d 100644 > > --- a/share/man/man3/pthread_condattr.3 > > +++ b/share/man/man3/pthread_condattr.3 > > @@ -85,7 +85,8 @@ in > > .Xr pthread_cond_timedwait 3 > > and may be set to > > .Dv CLOCK_REALTIME > > -(default) > > +(default), > > +.Dv CLOCK_TAI , > > or > > .Dv CLOCK_MONOTONIC . > > .Pp > > diff --git a/sys/kern/kern_ntptime.c b/sys/kern/kern_ntptime.c > > index 65746021028b..892a6798ab1f 100644 > > --- a/sys/kern/kern_ntptime.c > > +++ b/sys/kern/kern_ntptime.c > > @@ -504,7 +504,7 @@ sys_ntp_adjtime(struct thread *td, struct ntp_adjti= me_args *uap) > > * simulation. > > */ > > void > > -ntp_update_second(int64_t *adjustment, time_t *newsec) > > +ntp_update_second(int64_t *adjustment, time_t *newsec, long *tai_off) > > { > > int tickrate; > > l_fp ftemp; /* 32/64-bit temporary */ > > @@ -624,6 +624,7 @@ ntp_update_second(int64_t *adjustment, time_t *news= ec) > > L_ADD(time_adj, ftemp); > > } > > *adjustment =3D time_adj; > > + *tai_off =3D time_tai; > > > > #ifdef PPS_SYNC > > if (pps_valid > 0) > > diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c > > index a797a101bf6f..e85812e415c7 100644 > > --- a/sys/kern/kern_tc.c > > +++ b/sys/kern/kern_tc.c > > @@ -72,6 +72,7 @@ struct timehands { > > uint64_t th_scale; > > u_int th_large_delta; > > u_int th_offset_count; > > + long th_tai_offset; > > struct bintime th_offset; > > struct bintime th_bintime; > > struct timeval th_microtime; > > @@ -1066,6 +1067,7 @@ sysclock_getsnapshot(struct sysclock_snap *clock_= snap, int fast) > > th =3D timehands; > > gen =3D atomic_load_acq_int(&th->th_generation); > > fbi->th_scale =3D th->th_scale; > > + fbi->th_tai_offset =3D th->th_tai_offset; > > fbi->tick_time =3D th->th_offset; > > #ifdef FFCLOCK > > ffth =3D fftimehands; > > @@ -1139,6 +1141,11 @@ sysclock_snap2bintime(struct sysclock_snap *cs, = struct bintime *bt, > > getboottimebin(&boottimebin); > > bintime_add(bt, &boottimebin); > > } > > + if (!(flags & FBCLOCK_LEAPSEC)) { > > + if (cs->fb_info.th_tai_offset =3D=3D 0) > > + return (EINVAL); > > + bt->sec +=3D cs->fb_info.th_tai_offset; > > + } > > break; > > #ifdef FFCLOCK > > case SYSCLOCK_FFWD: > > @@ -1433,7 +1440,8 @@ tc_windup(struct bintime *new_boottimebin) > > > > do { > > t =3D bt.sec; > > - ntp_update_second(&th->th_adjustment, &bt.sec); > > + ntp_update_second(&th->th_adjustment, &bt.sec, > > + &th->th_tai_offset); > > if (bt.sec !=3D t) > > th->th_boottime.sec +=3D bt.sec - t; > > --i; > > diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c > > index 0c31c1563d99..5960136eb515 100644 > > --- a/sys/kern/kern_time.c > > +++ b/sys/kern/kern_time.c > > @@ -49,6 +49,7 @@ > > #include > > #include > > #include > > +#include > > #include > > #include > > #include > > @@ -60,7 +61,7 @@ > > #include > > #include > > > > -#define MAX_CLOCKS (CLOCK_MONOTONIC+1) > > +#define MAX_CLOCKS (CLOCK_TAI+1) > > #define CPUCLOCK_BIT 0x80000000 > > #define CPUCLOCK_PROCESS_BIT 0x40000000 > > #define CPUCLOCK_ID_MASK (~(CPUCLOCK_BIT|CPUCLOCK_PROCESS_BIT)) > > @@ -101,7 +102,6 @@ static int realtimer_gettime(struct itimer *= , struct itimerspec *); > > static int realtimer_settime(struct itimer *, int, > > struct itimerspec *, struct itimerspec *); > > static int realtimer_delete(struct itimer *); > > -static void realtimer_clocktime(clockid_t, struct timespec *); > > static void realtimer_expire(void *); > > static void realtimer_expire_l(struct itimer *it, bool proc_locked); > > > > @@ -318,7 +318,10 @@ int > > kern_clock_gettime(struct thread *td, clockid_t clock_id, struct times= pec *ats) > > { > > struct timeval sys, user; > > + struct sysclock_snap clk; > > + struct bintime bt; > > struct proc *p; > > + int err; > We usually spell it as 'error'. > > > > > p =3D td->td_proc; > > switch (clock_id) { > > @@ -329,6 +332,14 @@ kern_clock_gettime(struct thread *td, clockid_t cl= ock_id, struct timespec *ats) > > case CLOCK_REALTIME_FAST: > > getnanotime(ats); > > break; > > + case CLOCK_TAI: > > + sysclock_getsnapshot(&clk, 0); > > + err =3D sysclock_snap2bintime(&clk, &bt, clk.sysclock_act= ive, > > + (clk.sysclock_active =3D=3D SYSCLOCK_FFWD) ? FFCLOCK_= LERP : 0); > Extra () > > > + if (err) > if (err !=3D 0) > > > + return (err); > > + bintime2timespec(&bt, ats); > > + break; > > case CLOCK_VIRTUAL: > > PROC_LOCK(p); > > PROC_STATLOCK(p); > > @@ -451,6 +462,7 @@ kern_clock_getres(struct thread *td, clockid_t cloc= k_id, struct timespec *ts) > > case CLOCK_REALTIME: > > case CLOCK_REALTIME_FAST: > > case CLOCK_REALTIME_PRECISE: > > + case CLOCK_TAI: > > case CLOCK_MONOTONIC: > > case CLOCK_MONOTONIC_FAST: > > case CLOCK_MONOTONIC_PRECISE: > > @@ -516,6 +528,7 @@ kern_clock_nanosleep(struct thread *td, clockid_t c= lock_id, int flags, > > return (EINVAL); > > switch (clock_id) { > > case CLOCK_REALTIME: > > + case CLOCK_TAI: > > precise =3D nanosleep_precise; > > is_abs_real =3D (flags & TIMER_ABSTIME) !=3D 0; > > break; > > @@ -1167,6 +1180,7 @@ itimer_start(void) > > NULL, NULL, itimer_init, itimer_fini, UMA_ALIGN_PTR, 0); > > register_posix_clock(CLOCK_REALTIME, &rt_clock); > > register_posix_clock(CLOCK_MONOTONIC, &rt_clock); > > + register_posix_clock(CLOCK_TAI, &rt_clock); > > p31b_setcfg(CTL_P1003_1B_TIMERS, 200112L); > > p31b_setcfg(CTL_P1003_1B_DELAYTIMER_MAX, INT_MAX); > > p31b_setcfg(CTL_P1003_1B_TIMER_MAX, TIMER_MAX); > > @@ -1327,6 +1341,7 @@ kern_ktimer_create(struct thread *td, clockid_t c= lock_id, struct sigevent *evp, > > switch (clock_id) { > > default: > > case CLOCK_REALTIME: > > + case CLOCK_TAI: > > it->it_sigev.sigev_signo =3D SIGALRM; > > break; > > case CLOCK_VIRTUAL: > > @@ -1570,10 +1585,14 @@ static int > > realtimer_gettime(struct itimer *it, struct itimerspec *ovalue) > > { > > struct timespec cts; > > + int err; > > > > mtx_assert(&it->it_mtx, MA_OWNED); > > > > - realtimer_clocktime(it->it_clockid, &cts); > > + err =3D kern_clock_gettime(curthread, it->it_clockid, &cts); > > + if (err) > Again, if (error !=3D 0) and s/err/error/. > And more places below. > > > + return (err); > > + > > *ovalue =3D it->it_time; > > if (ovalue->it_value.tv_sec !=3D 0 || ovalue->it_value.tv_nsec != =3D 0) { > > timespecsub(&ovalue->it_value, &cts, &ovalue->it_value); > > @@ -1594,6 +1613,7 @@ realtimer_settime(struct itimer *it, int flags, s= truct itimerspec *value, > > struct timespec cts, ts; > > struct timeval tv; > > struct itimerspec val; > > + int err; > > > > mtx_assert(&it->it_mtx, MA_OWNED); > > > > @@ -1613,7 +1633,10 @@ realtimer_settime(struct itimer *it, int flags, = struct itimerspec *value, > > > > it->it_time =3D val; > > if (timespecisset(&val.it_value)) { > > - realtimer_clocktime(it->it_clockid, &cts); > > + err =3D kern_clock_gettime(curthread, it->it_clockid, &ct= s); > > + if (err) > > + return (err); > > + > > ts =3D val.it_value; > > if ((flags & TIMER_ABSTIME) =3D=3D 0) { > > /* Convert to absolute time. */ > > @@ -1636,15 +1659,6 @@ realtimer_settime(struct itimer *it, int flags, = struct itimerspec *value, > > return (0); > > } > > > > -static void > > -realtimer_clocktime(clockid_t id, struct timespec *ts) > > -{ > > - if (id =3D=3D CLOCK_REALTIME) > > - getnanotime(ts); > > - else /* CLOCK_MONOTONIC */ > > - getnanouptime(ts); > > -} > > - > > int > > itimer_accept(struct proc *p, int timerid, ksiginfo_t *ksi) > > { > > @@ -1689,10 +1703,12 @@ realtimer_expire_l(struct itimer *it, bool proc= _locked) > > struct timeval tv; > > struct proc *p; > > uint64_t interval, now, overruns, value; > > + int err; > > + > > + err =3D kern_clock_gettime(curthread, it->it_clockid, &cts); > > > > - realtimer_clocktime(it->it_clockid, &cts); > > /* Only fire if time is reached. */ > > - if (timespeccmp(&cts, &it->it_time.it_value, >=3D)) { > > + if (err =3D=3D 0 && timespeccmp(&cts, &it->it_time.it_value, >=3D= )) { > > if (timespecisset(&it->it_time.it_interval)) { > > timespecadd(&it->it_time.it_value, > > &it->it_time.it_interval, > > diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c > > index dc6fee1f8f38..905ebd4f98ac 100644 > > --- a/sys/kern/kern_umtx.c > > +++ b/sys/kern/kern_umtx.c > > @@ -693,6 +693,7 @@ umtx_abs_timeout_init(struct umtx_abs_timeout *timo= , int clockid, > > timo->is_abs_real =3D clockid =3D=3D CLOCK_REALTIME || > > clockid =3D=3D CLOCK_REALTIME_FAST || > > clockid =3D=3D CLOCK_REALTIME_PRECISE || > > + clockid =3D=3D CLOCK_TAI || > > clockid =3D=3D CLOCK_SECOND; > > } > > } > > @@ -787,6 +788,7 @@ umtx_abs_timeout_getsbt(struct umtx_abs_timeout *ti= mo, sbintime_t *sbt, > > case CLOCK_PROF: > > case CLOCK_THREAD_CPUTIME_ID: > > case CLOCK_PROCESS_CPUTIME_ID: > > + case CLOCK_TAI: /* Boot time is not necessarily stable in TAI */ > > default: > > kern_clock_gettime(curthread, timo->clockid, &timo->cur); > > if (timespeccmp(&timo->end, &timo->cur, <=3D)) > > @@ -2953,8 +2955,9 @@ do_cv_wait(struct thread *td, struct ucond *cv, s= truct umutex *m, > > umtx_key_release(&uq->uq_key); > > return (EFAULT); > > } > > - if (clockid < CLOCK_REALTIME || > > - clockid >=3D CLOCK_THREAD_CPUTIME_ID) { > > + if ((clockid < CLOCK_REALTIME || > > + clockid >=3D CLOCK_THREAD_CPUTIME_ID) && > > + clockid !=3D CLOCK_TAI) { > > /* hmm, only HW clock id will work. */ > > umtx_key_release(&uq->uq_key); > > return (EINVAL); > > diff --git a/sys/sys/_clock_id.h b/sys/sys/_clock_id.h > > index 728346a0f0ab..83130d1f8a16 100644 > > --- a/sys/sys/_clock_id.h > > +++ b/sys/sys/_clock_id.h > > @@ -74,6 +74,10 @@ > > #define CLOCK_PROCESS_CPUTIME_ID 15 > > #endif /* __POSIX_VISIBLE >=3D 199309 */ > > > > +#ifdef __BSD_VISIBLE > > +#define CLOCK_TAI 16 > > +#endif > > + > > /* > > * Linux compatible names. > > */ > > diff --git a/sys/sys/timeffc.h b/sys/sys/timeffc.h > > index a83b62b1672c..8bec73ed48a4 100644 > > --- a/sys/sys/timeffc.h > > +++ b/sys/sys/timeffc.h > > @@ -89,7 +89,7 @@ extern int sysclock_active; > > * of the kernel tick timer (1/hz [s]). > > * FFCLOCK_LERP: Linear interpolation of ffclock time to guarantee > > * monotonic time. > > - * FFCLOCK_LEAPSEC: Include leap seconds. > > + * {FB|FF}CLOCK_LEAPSEC: Include leap seconds. > > * {FB|FF}CLOCK_UPTIME: Time stamp should be relative to system b= oot, not epoch. > > */ > > #define FFCLOCK_FAST 0x00000001 > > @@ -100,6 +100,7 @@ extern int sysclock_active; > > > > #define FBCLOCK_FAST 0x00010000 /* Currently unused. *= / > > #define FBCLOCK_UPTIME 0x00020000 > > +#define FBCLOCK_LEAPSEC 0x00040000 > > #define FBCLOCK_MASK 0xffff0000 > > > > /* > > @@ -111,6 +112,7 @@ struct fbclock_info { > > struct bintime error; > > struct bintime tick_time; > > uint64_t th_scale; > > + long th_tai_offset; > > int status; > > }; > > > > diff --git a/sys/sys/timex.h b/sys/sys/timex.h > > index 072297375792..03632bdb119c 100644 > > --- a/sys/sys/timex.h > > +++ b/sys/sys/timex.h > > @@ -154,7 +154,7 @@ struct timex { > > #ifdef __FreeBSD__ > > > > #ifdef _KERNEL > > -void ntp_update_second(int64_t *adjustment, time_t *newsec); > > +void ntp_update_second(int64_t *adjustment, time_t *newsec, long *tai_= off); > > #else /* !_KERNEL */ > > #include > > From nobody Fri Jun 13 14:49:25 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJj3B1MGPz5q5sd; Fri, 13 Jun 2025 14:49:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJj3B0D8pz3SnL; Fri, 13 Jun 2025 14:49:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749826166; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5fY+NPESaxiB8q10g/isP1a9/2gXj77cNbjgnLcdL0A=; b=J9XI2VMjMR6eVnndyNSEGR/44TTvW6X9lckqJGCGn5ebJlsjSqf9/CTKW74Gi5Qw5nik4V BQAHAIhWEqjEG8WBxqy/GvvabiAMSnj36W/AU8MA59Yh50iOF2DEF1iZR/UHQglEuY4bfh xbxCm40CoLtlUex0ECrsejJC58VGKA6GO9tKILOm1XbWqpngCQ+IIVfLWYt50rVlxw9oim X6B9MG4cu1/SR4UkNlnUy2WzH40Vw3q6vQ/S1uTFlzQRUxpMYfqidxeMSRB9GlYxJhu9b+ WiRg0p+9hsalrU47p0pQchGO0ogJfC06ohiYMCeq5OdNIBCycqh4wVZmJkZQEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749826166; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5fY+NPESaxiB8q10g/isP1a9/2gXj77cNbjgnLcdL0A=; b=ggfNlcS2likoOa0LUAtyUkKyV8uiTIOugdwImS7kAGHjjykoWqk09Ii+W8or33MU4N6uXE zZsnALR4SMutYdyb/yBLxC1bQgMW3+dkMUAxE1a6W/eINLCXUBFqb17OXRT7qcCYJlh13N MeqkTmglBIyKWPAgADIxenJDl4MXBqzLR8C9NhF/mAJbkM5bFyHKo9AClZn7uME5aQEluc CMVQXA2t9mIqigZl8ZUR9j+t28zkwG9pN/5oC+3d5LQi0GtiQJU47jHgZ+BVMXqlACbTo/ WzwHyKySbejBbhnN5pESlINywYI47wEky9suOxXwH0ECWyQOY3h7vcR09nEQrg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749826166; a=rsa-sha256; cv=none; b=g/5nZRYotfVqEAkTSYWRaUXiXljLE5FDOEdzdfes5Aj2AnCDGPcWSODJXUjtwBKQ3CI9HP kEcC8LRF4ovc680C0d0eejONcLrBkGd9uIQQ3WhQ18Eyv8Htr9e4K/+ifNiiKKjzcPH3RA SxA42qCIvMxK2nakm3/xmvwAv7tK4SkMVTjLAwxZ+xJ2lg1HL4kf2UH9PQjICx/8+4rHWS n45wGxFt5AaXJgVfodvoHX4fCcf1vJkW/E/X1eqRCqC5rCZRhEeS4Iw+SmlGnQ0lI6zOQv jnU6SYHBFViR4TfCP7ElPMy6+uMBtZrF0ApZnQGTk0cMCNZg/QRZn5jnSpFhDQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJj396vk2z11yg; Fri, 13 Jun 2025 14:49:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55DEnPju091030; Fri, 13 Jun 2025 14:49:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55DEnPgE091027; Fri, 13 Jun 2025 14:49:25 GMT (envelope-from git) Date: Fri, 13 Jun 2025 14:49:25 GMT Message-Id: <202506131449.55DEnPgE091027@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 4f7473d18a62 - main - qlnx: fix panic at startup List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4f7473d18a62077a218ac00817bae09a95b8cbcb Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=4f7473d18a62077a218ac00817bae09a95b8cbcb commit 4f7473d18a62077a218ac00817bae09a95b8cbcb Author: Kristof Provost AuthorDate: 2025-06-12 16:53:33 +0000 Commit: Kristof Provost CommitDate: 2025-06-13 14:48:51 +0000 qlnx: fix panic at startup While attaching the qlnx driver we can end up trying to call ifmedia functions before those are set up (through ether_ifattach() -> rtnl_handle_ifattach() -> dump_iface() -> get_operstate_ether() -> ifmedia_ioctl()). Postpone the ether_ifattach() until after the ifmedia setup. Reviewed by: markj,zlei Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D50819 --- sys/dev/qlnx/qlnxe/qlnx_os.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/qlnx/qlnxe/qlnx_os.c b/sys/dev/qlnx/qlnxe/qlnx_os.c index a984908abf34..05ec69a70dfe 100644 --- a/sys/dev/qlnx/qlnxe/qlnx_os.c +++ b/sys/dev/qlnx/qlnxe/qlnx_os.c @@ -2339,9 +2339,6 @@ qlnx_init_ifnet(device_t dev, qlnx_host_t *ha) ha->primary_mac[5] = (rnd >> 16) & 0xFF; } - ether_ifattach(ifp, ha->primary_mac); - bcopy(if_getlladdr(ha->ifp), ha->primary_mac, ETHER_ADDR_LEN); - if_setcapabilities(ifp, IFCAP_HWCSUM); if_setcapabilitiesbit(ifp, IFCAP_JUMBO_MTU, 0); @@ -2396,6 +2393,9 @@ qlnx_init_ifnet(device_t dev, qlnx_host_t *ha) ifmedia_set(&ha->media, (IFM_ETHER | IFM_AUTO)); + ether_ifattach(ifp, ha->primary_mac); + bcopy(if_getlladdr(ha->ifp), ha->primary_mac, ETHER_ADDR_LEN); + QL_DPRINT2(ha, "exit\n"); return; From nobody Fri Jun 13 14:57:39 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJjDh1Ts0z5q6X0; Fri, 13 Jun 2025 14:57:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJjDh0MpFz3V9r; Fri, 13 Jun 2025 14:57:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749826660; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BKs+bo35od+JDQNy7WZPVYBz7DpxNjd0j4JGELFigG0=; b=wfoY96PBaOcGZgMVqva4HY3ioR2gP1857V1VnD1cB65d8MPzQe1qkwvpymHqWW4J6lha6b SLf8LQDajkIPY3Awf/Le1DtmLbdenVmrZL0+/wNCdnq3u5cfss7OlL71Zhr1f1u8MYPpTv mBr9VzJUQOpqbUQUd6eBVPqpO6j06MalWrCUbmlmANbuWvMtaSUWiJd1gCD1T+GZxqVxqT fyXISH3EHbb/lg/IUs3kJrDBv4XTqwDMIXqP5AIbCL1ZU0ofUcO+PhcXl089oyWWifE349 LTwiNJrLoEsKtX4ptjViOQFG1x6BcHrWq130acIv0AoUMcGMAPnC9m8j+Or3jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749826660; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BKs+bo35od+JDQNy7WZPVYBz7DpxNjd0j4JGELFigG0=; b=NGVSskt3qqJhJBIDY7Yng7oa9ENF/Y5RbHK9kFLBZ/SzPw3C4gZ8vOTyTrZ3UTogsm5ZzX o2KZaCqtmVciDe76rRWxcg/YWBRVgPSMNi15Syw6iHZTWCTRF1hUgGxcv7MfcMvlXmgxfH pAtBbl3O8Bk3Wh//kJKTNZKBKC9lRI1uA7MhRKpscT/QgEDAXEKY/r1BkTSgqzKOieTxVj YKwIQ8exLFl9EnYdhJ4xBSqR64MdnTyM/LXxDchkxCIl/TvuKKGAYoVwcj4z7Yl8+UjCnj YnYtcui5cmmxBLZCdXf4sVS40pC4VPP0HhjN6jkl2qNob27NMF4IFwDhM/2d7A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749826660; a=rsa-sha256; cv=none; b=hl9WIISCskScxcwT9TTJGwrvY2amaTCMAaMlhExcnRzpP83BCMyPqTkooy2+rqTEifbS84 I0OkAJ8RS15e3TulIb1RE1NF1pPDIqmTHY0Aztr+3aKvEVMJgNsTTiZtoJO6UWTQ8ACMCr Rza5vn1oU5g9GbLQaJMWa10ERfOcb1xD8wfzofPuZ/Xao23avBoh7faGpZjQ4AKeIIs1Lr shd3mgaHpFF6N+tpt6PNHTCddiThNeG7Kmfck6gvE94Nq2+/jVXqTLnXfl3Lju4ncoY/xD +hASdDLz8Y2lZZmKN/FTFj0MFAG9JP5mTM1Ju/Pz3PlYibTPP5fR5kCWRmMekA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJjDg6swNz12mV; Fri, 13 Jun 2025 14:57:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55DEvdnk009439; Fri, 13 Jun 2025 14:57:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55DEvdb4009436; Fri, 13 Jun 2025 14:57:39 GMT (envelope-from git) Date: Fri, 13 Jun 2025 14:57:39 GMT Message-Id: <202506131457.55DEvdb4009436@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: a3d38c1abf6c - main - wlan.4: and add rtw89 and iwx drivers in see also List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a3d38c1abf6c7987ece04c5eb27b0a48ecd88c0d Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=a3d38c1abf6c7987ece04c5eb27b0a48ecd88c0d commit a3d38c1abf6c7987ece04c5eb27b0a48ecd88c0d Author: Bjoern A. Zeeb AuthorDate: 2025-06-11 06:37:05 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-13 14:57:21 +0000 wlan.4: and add rtw89 and iwx drivers in see also Sponsored by: The FreBSD Foundation MFC after: 3 days X-MFC: no iwx.4 in stable/14 yet Reviewed by: ziaee Differential Revision: https://reviews.freebsd.org/D50788 --- share/man/man4/wlan.4 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/share/man/man4/wlan.4 b/share/man/man4/wlan.4 index 62095fb81ede..1d297c48d9d6 100644 --- a/share/man/man4/wlan.4 +++ b/share/man/man4/wlan.4 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 9, 2025 +.Dd June 13, 2025 .Dt WLAN 4 .Os .Sh NAME @@ -174,6 +174,7 @@ Stations implementing earlier drafts (e.g., Linux) may be incompatible. .Xr iwlwifi 4 , .Xr iwm 4 , .Xr iwn 4 , +.Xr iwx 4 , .Xr malo 4 , .Xr mwl 4 , .Xr netintro 4 , @@ -181,6 +182,7 @@ Stations implementing earlier drafts (e.g., Linux) may be incompatible. .Xr ral 4 , .Xr rsu 4 , .Xr rtw88 4 , +.Xr rtw89 4 , .Xr rtwn 4 , .Xr rum 4 , .Xr run 4 , From nobody Fri Jun 13 14:57:40 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJjDj1lQHz5q6TZ; Fri, 13 Jun 2025 14:57:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJjDj15jsz3V5G; Fri, 13 Jun 2025 14:57:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749826661; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v+DQpKdLQp5+tmDDvvIEurhwDXKcPMBaDQrviNr7rqw=; b=veICmh0chRUe0otq7k74pqFmI+iCGdfYkN85eSQUsBxClZdtecO3olOect50sTEZZnU0qm Tc8xbLre1CAnmzw8tBxCx7eGDXGceuwulV9g27uhjrcvxiSn9OzSVBvN8b6o4GD3KZ4i4O YbgHyUyJlEljqDARF76ImhXVEExNPd8VIzrYZF9OwWQ+kDeten5x/+qR7R2ima9TG1DhVf i5URrTGg3qvvgaMY9WEHGDzwhgBnibc9DMgCLJ1PA6tDj4veJSClTDtLNVHMZYYGoNsDwy 6Yh02zlhoskJ9itw/FtYZcVz6XqzcgsckcQcBXLXTTPwzC6r59pt7qhoKPkiMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749826661; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v+DQpKdLQp5+tmDDvvIEurhwDXKcPMBaDQrviNr7rqw=; b=dTW2X095rBoTYyq2qy4Sgk/h1T1Ot+l/D8cF+vJx8Q5CddswRO0QZOSFD/zFkFdj/Ave4u moBSsNdaAWnoQpntt11ojgQ7pw0ETlVk+17R3xFaG/3wYB4SbTSrl7xGI2H7TX+NfGWq0P DtQNyzu0zy3IP3Y1D0q3OUGpOv9qEmO9UcNwY0cdLqvbl+Sm+B2I8Puoczyqs3Bi3xpYPW nUq+FslSQrgRWvLeqL4E3nv+GUUFS/l3YOM/bZIJiCzdtFtuoYRjcWUD3jsL8WbU9WyqAy OtM40xo29bE/NRUj9qx+6kc7zYJNyhG5XkE9u5qjecLySiNswY/Xfnx2HDLxhQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749826661; a=rsa-sha256; cv=none; b=kwvRS6V5M0MudLfh2NdgFE7F+028Ipm5kQaGLaXNgNm2I8KWBiqJByxDHqeCyhDKcNyTOn GdICLR0Nu/alEDcjS2r36Dgzm6ncebDlYXb7NMXAFeHvouAsgvPyig5BRW5Aq1TaJqKVWt 0LnFDD0ONaa3fkkQd/JHqCviF++ZDHO8zFC34LfvlUsJRHhZUuNItu4BtvX2ZLWaD61CBz c+GmXIMEeVLjNcjANtlLrDrhqTjxKBoV74+sFjNdYocwGBM7C8jdtX9khmEs1lgBQYTYmd zwGZUtywma72GH1LIccVvA297uydBRT7RRQOAczUWle/hR5T/7rjiz2mWleZig== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJjDj0hL5z12fc; Fri, 13 Jun 2025 14:57:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55DEveXm009478; Fri, 13 Jun 2025 14:57:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55DEveK7009475; Fri, 13 Jun 2025 14:57:40 GMT (envelope-from git) Date: Fri, 13 Jun 2025 14:57:40 GMT Message-Id: <202506131457.55DEveK7009475@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: ca6d68a06317 - main - wlan_gcmp.4: add man page List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ca6d68a063171655c34daaddb6eb7768ed283dee Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=ca6d68a063171655c34daaddb6eb7768ed283dee commit ca6d68a063171655c34daaddb6eb7768ed283dee Author: Bjoern A. Zeeb AuthorDate: 2025-06-11 07:17:07 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-13 14:57:21 +0000 wlan_gcmp.4: add man page The man page is heavily based on wlan_ccmp.4 with minor modifications for GCMP. Add the .Xr to the other wlan*.4 man pages. Sposnored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: adrian, ziaee Differential Revision: https://reviews.freebsd.org/D50789 --- share/man/man4/wlan.4 | 1 + share/man/man4/wlan_ccmp.4 | 1 + share/man/man4/wlan_gcmp.4 | 72 ++++++++++++++++++++++++++++++++++++++++++++++ share/man/man4/wlan_tkip.4 | 1 + share/man/man4/wlan_wep.4 | 1 + 5 files changed, 76 insertions(+) diff --git a/share/man/man4/wlan.4 b/share/man/man4/wlan.4 index 1d297c48d9d6..ff983c66c1cb 100644 --- a/share/man/man4/wlan.4 +++ b/share/man/man4/wlan.4 @@ -192,6 +192,7 @@ Stations implementing earlier drafts (e.g., Linux) may be incompatible. .Xr urtw 4 , .Xr wlan_acl 4 , .Xr wlan_ccmp 4 , +.Xr wlan_gcmp 4 , .Xr wlan_tkip 4 , .Xr wlan_wep 4 , .Xr wlan_xauth 4 , diff --git a/share/man/man4/wlan_ccmp.4 b/share/man/man4/wlan_ccmp.4 index f0efa86d2fdb..ffd4da8694e9 100644 --- a/share/man/man4/wlan_ccmp.4 +++ b/share/man/man4/wlan_ccmp.4 @@ -53,6 +53,7 @@ calculations in hardware, the module will do the work. .Sh SEE ALSO .Xr wlan 4 , +.Xr wlan_gcmp 4 , .Xr wlan_tkip 4 , .Xr wlan_wep 4 .Sh STANDARDS diff --git a/share/man/man4/wlan_gcmp.4 b/share/man/man4/wlan_gcmp.4 new file mode 100644 index 000000000000..a7657a9ad91b --- /dev/null +++ b/share/man/man4/wlan_gcmp.4 @@ -0,0 +1,72 @@ +.\" +.\" Copyright (c) 2004 Sam Leffler +.\" All rights reserved. +.\" Copyright (c) 2025 The FreeBSD Foundation +.\" +.\" Portions of this documentation were written by Bj\xc3\xb6rn 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. +.\" +.\" Based on wlan_ccmp.4. +.\" +.Dd June 13, 2025 +.Dt WLAN_GCMP 4 +.Os +.Sh NAME +.Nm wlan_gcmp +.Nd AES-GCMP crypto support for 802.11 devices +.Sh SYNOPSIS +.Cd "device wlan_gcmp" +.Sh DESCRIPTION +The +.Nm +module handles the +.Em Galois/Counter Mode Protocol +cryptographic requirements of the IEEE 802.11ad and WPA2/WPA3 protocols. +It does encapsulation and decapsulation of GCMP-encoded 802.11 frames +and optionally calculates the AES-GCMP cipher. +The +.Nm +module is an 802.11 cryptographic plugin module for use by the +.Xr wlan 4 +module. +This module is automatically loaded if an AES-GCMP key is configured; +typically by a WPA supplicant program such as wpa_supplicant, +or a WPA authenticator program such as +.Nm hostapd . +Should the underlying network device not be capable of doing the AES-GCMP +calculations in hardware, the +.Nm +module will do the work. +.Sh SEE ALSO +.Xr wlan 4 , +.Xr wlan_ccmp 4 , +.Xr wlan_tkip 4 , +.Xr wlan_wep 4 +.Sh STANDARDS +More information can be found in the IEEE 802.11, and WPA Standards. +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 15.0 . diff --git a/share/man/man4/wlan_tkip.4 b/share/man/man4/wlan_tkip.4 index 2e812ceffe9a..e74c24d45614 100644 --- a/share/man/man4/wlan_tkip.4 +++ b/share/man/man4/wlan_tkip.4 @@ -54,6 +54,7 @@ module will do the work. .Sh SEE ALSO .Xr wlan 4 , .Xr wlan_ccmp 4 , +.Xr wlan_gcmp 4 , .Xr wlan_wep 4 .Sh STANDARDS More information can be found in the IEEE 802.11, WPA, and 802.11i Standards. diff --git a/share/man/man4/wlan_wep.4 b/share/man/man4/wlan_wep.4 index 4e5887bbc35e..d83ef23e7a4e 100644 --- a/share/man/man4/wlan_wep.4 +++ b/share/man/man4/wlan_wep.4 @@ -51,6 +51,7 @@ module will do the work. .Sh SEE ALSO .Xr wlan 4 , .Xr wlan_ccmp 4 , +.Xr wlan_gcmp 4 , .Xr wlan_tkip 4 .Sh STANDARDS More information can be found in the IEEE 802.11 Standard. From nobody Fri Jun 13 14:57:42 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJjDk5yCtz5q6Rt; Fri, 13 Jun 2025 14:57:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJjDk2gGgz3V18; Fri, 13 Jun 2025 14:57:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749826662; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UHI+90WPeJ9eghiSPdkAGcyIQX6MCwW0CBEryCpvEDE=; b=Wnvigp4iIjq+OfsiRHV+Qd7IDbLztloZ+buRzJqQ+Muybc2GNUDKmoF7+sgsslrDl43sc8 yJTldJBreBIzirTVi86rcvvZ4iYWy9GsY4xHS2gLKI53/69BmV/wtcouUdkNhlzk7XcTlE lzFU5JemmGTsvbnak341+vmL9bMkRI8HRIjK54rR3F/POQGsdLzRYhGpUWXoHUR/DKwdYp jn5R8qYk4zPVPi8Gg4Hvqgr+8oH473/r8sFa6AwmfL2n9LSvKHoAxeSBhrFz5KSqxoyXRz 4NhB2lYxA55B6IuEccvk5zDI8TgsxpXcDPwhoy3NnXmKq4jHz3MRBoGZAxA0/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749826662; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UHI+90WPeJ9eghiSPdkAGcyIQX6MCwW0CBEryCpvEDE=; b=FsHsbVjeGPKosRxoaRCPEnkY71uk53UdS7m9Ng6evWwm8GlWpI62n1CenUMG8PKhGsuDe1 eB3sp7J2DdTwpH2Z/9/JPSmZkXveDbKzxWyXsNW9RKyDyiaJ8I9ZHc3mafuDnVvXdI2299 Q2tzYZMGsBeQHv+yC0kYh3jkMavfjaTMw4rk5E+NLMqDjOL/GxMtKE+Og0A4Ld4XhY9qP3 iWw7kqYE9cN4Lx0DVMJY4zFlGktKfyyl1eYGxHIrvqYU5p8ft7cxZSPUq/rjQJQnn10KIn jH+CvqeNLIBExaFMnA4j2kVQ0W4717qvMYAlq2eWW7vSXenrHglmwzLn3Dz+lg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749826662; a=rsa-sha256; cv=none; b=GD+MoW790al/SKa1uGrFzaVNwU3rgiRi0UUsQbPN3aIoJN7AjAQHL/2nNG8xa5g7pyV9uO wKmtG2sJQDetJ8S2VOOf3EG7DrG5PceerIuiJcqr008XF4BCFOZlqLJrcApw2eNxvjv4TS +zWHfPnXw7wBHPEELkKiZa0a+llD3CHs5ODdMsA8q1pH8QO/KHiGVkzzMKK4xcqGpkc78L T3FYP+BkaZhkG0CDMDUsf/Af6d5pCiChLKWDy1Kv48vKNfskhjbIXz4DA076mkbOFa9nyB 49RnmNfbMUjVWROP8vHjbLmzqF+clqoDQ1SMzOOyUZmYWM8PyLPvphgUZJciLQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJjDk1fRvz12gN; Fri, 13 Jun 2025 14:57:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55DEvgni009516; Fri, 13 Jun 2025 14:57:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55DEvguX009513; Fri, 13 Jun 2025 14:57:42 GMT (envelope-from git) Date: Fri, 13 Jun 2025 14:57:42 GMT Message-Id: <202506131457.55DEvguX009513@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: bfaec3e64741 - main - linuxkpi.4, linuxkpi_wlan.4: add short man pages List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bfaec3e6474139c592f39b4adbdbeb35c9026c25 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=bfaec3e6474139c592f39b4adbdbeb35c9026c25 commit bfaec3e6474139c592f39b4adbdbeb35c9026c25 Author: Bjoern A. Zeeb AuthorDate: 2025-06-11 07:47:49 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-13 14:57:21 +0000 linuxkpi.4, linuxkpi_wlan.4: add short man pages Add brief documentation on LinuxKPI. Add brief documentation on LinuxKPI 802.11 compat so we can refer to something about which features are supported. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: dumbbell, ziaee, pauamma_gundo.com Differential Revision: https://reviews.freebsd.org/D50790 --- share/man/man4/linuxkpi.4 | 42 +++++++++++++ share/man/man4/linuxkpi_wlan.4 | 134 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 176 insertions(+) diff --git a/share/man/man4/linuxkpi.4 b/share/man/man4/linuxkpi.4 new file mode 100644 index 000000000000..cd4135c28d6d --- /dev/null +++ b/share/man/man4/linuxkpi.4 @@ -0,0 +1,42 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2025 The FreeBSD Foundation +.\" +.\" This documentation was written by Bj\xc3\xb6rn Zeeb under sponsorship from +.\" the FreeBSD Foundation. +.\" +.Dd June 13, 2025 +.Dt LINUXKPI 4 +.Os +.Sh NAME +.Nm linuxkpi +.Nd Linux Kernel Programming Interface support +.Sh DESCRIPTION +The +.Nm +kernel module provides a limited KPI (kernel programming interface) to allow +Linux kernel drivers and other Linux kernel code to be compiled on +.Fx +and used along the +.Fx +kernel with little or no modification. +.Pp +While historically +.Em OpenFabrics Enterprise Distribution (Infiniband) , +and certain vendor drivers have used +.Nm . +.Em drm-kmod +for graphics driver support +and +.Xr linuxkpi_wlan 4 +for wireless drivers are prominent consumers. +.Pp +.Nm +is not to be confused with +.Xr linux 4 +which provides limited Linux ABI (application binary interface) compatibility +to allow running Linux application binaries unmodified on +.Fx . +.Sh SEE ALSO +.Xr linuxkpi_wlan 4 diff --git a/share/man/man4/linuxkpi_wlan.4 b/share/man/man4/linuxkpi_wlan.4 new file mode 100644 index 000000000000..136e04c32bb7 --- /dev/null +++ b/share/man/man4/linuxkpi_wlan.4 @@ -0,0 +1,134 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2025 The FreeBSD Foundation +.\" +.\" This documentation was written by Bj\xc3\xb6rn Zeeb under sponsorship from +.\" the FreeBSD Foundation. +.\" +.Dd June 13, 2025 +.Dt LINUXKPI_WLAN 4 +.Os +.Sh NAME +.Nm linuxkpi_wlan +.Nd LinuxKPI 802.11 support +.Sh DESCRIPTION +The +.Nm +kernel module provides an 802.11 compat layer to translate between Linux +802.11 drivers and the native net8011 wireless stack. +It currently supports +.Em mac80211 +based drivers. +Parts of the +.Em cfg80211 +exist but there is no code for net80211 to drive it. +.Pp +.Nm +currently supports the following +.Em wlanmode +operating modes: +.Bl -tag -width monitor -compact +.It Cm sta +client station in an infrastructure bss (IBSS). +.El +.Pp +Compat code for 802.11n (HT) and 802.11ac (VHT) is implemented but +support may vary for different drivers due to different KPI usage. +.Pp +Crypto support for hardware acceleration needs to be enabled using the +.Va compat.linuxkpi.80211.hw_crypto +tunable. +The following cipher suites are supported: +.Bl -tag -width CCMP -compact +.It Cm tkip +Support for +.Xr wlan_tkip 4 +has to be manually enabled using the +.Va compat.linuxkpi.80211.tkip +tunable. +.It Cm ccmp +Support for +.Xr wlan_ccmp 4 +is available. +.It Cm gcmp +Support for +.Xr wlan_gcmp 4 +is available. +.El +Further cipher suites will be implemented as soon as +.Xr net80211 4 +grows support. +While it would be possible to implement +.Xr wlan_wep 4 +support, it was decided not to do so given +.Em Wired Equivalent Privacy (WEP) +has been deprecated since 2004. +.Pp +The list of supported drivers includes +.Xr iwlwifi 4 , +.Xr rtw88 4 , +and +.Xr rtw89 4 . +.Sh SYSCTL VARIABLES AND LOADER TUNABLES +The +.Nm +module supports the following +.Xr loader 8 +tunable and read-only +.Xr sysctl 8 +variables: +.Bl -tag -width "compat.linuxkpi.80211.hw_crypto" +.It Va compat.linuxkpi.80211.hw_crypto +Turn on hardware crypto offload support. +Default +.Ql 0 . +.It Va compat.linuxkpi.80211.tkip +Turn on support for +.Xr wlan_tkip 4 +offloading. +Default +.Ql 0 . +.El +.Pp +The +.Nm +module supports the following +.Xr sysctl 8 +variables: +.Bl -tag -width "compat.linuxkpi.80211.IF.dump_stas" +.It Va compat.linuxkpi.80211.debug +If the kernel is compiled with +.Dv IEEE80211_DEBUG +or +.Dv LINUXKPI_DEBUG_80211 +is manually enabled, the sysctl is a bitmask to turn on individual +debug messages. +See +.Pa sys/compat/linuxkpi/common/src/linux_80211.h +for details. +.It Va compat.linuxkpi.80211.IF.dump_stas +Print statistics for a given, associated +.Xr wlan 4 +interface; typically IF would be +.Em wlan0 . +.El +.Sh SEE ALSO +.Xr iwlwifi 4 , +.Xr linuxkpi 4 , +.Xr rtw88 4 , +.Xr rtw89 4 , +.Xr wlan 4 +.Sh HISTORY +The +.Nm +module first appeared in +.Fx 13.1 . +Support for IEEE 802.11n and 802.11ac in +.Nm +first appeared in +.Fx 14.3 . +.Sh AUTHORS +LinuxKPI 802.11 support was developed by +.An Bjoern A. Zeeb +under sponsorship from the FreeBSD Foundation. From nobody Fri Jun 13 14:57:43 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJjDl4B4xz5q6DG; Fri, 13 Jun 2025 14:57:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJjDl309Zz3V5g; Fri, 13 Jun 2025 14:57:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749826663; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mZinKiRvfOL82pC+yj5/qBO83yhtKYvjiKswmKU1d+4=; b=WE9D/IqEXBGXay4bOBZxNl372wYncYruM21icsSTgyFcbDCJa2qKBCbYvSnoLkY4E5oGwp hjmATKxfULCTQe6xN5ViQS/aqoxXtXCXZ3YNGwg3yyQAliFQ0arcN2eohY9GLOc0qHIBh8 MDD0odnyrpB3c8jL3zh50keNkIpZjbV81fZI3kLFIK+MzOAO5+7xSfIk21GwJVEMiMQFcq erzPSeA8gYxkDP1+SUjbZ0eVsmUsOg9L24xw8i0lnAL0+p83A2/b60GOHsw8jlX1Y36/tG wx2ZzdNFlRHXD88T6sHPAcfjYVfOu4gfkve8rEe3/+rCnJRUf4tCeSi3qwKdCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749826663; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mZinKiRvfOL82pC+yj5/qBO83yhtKYvjiKswmKU1d+4=; b=av5YXxEBv4YueaCZjhJUsWmnuu3LSb8qCrGM7GoHw7eTX6okfd0xiJO08N1NbcMK/6hZMa rR2on7C/2fNjgKETobaTov3o2JWSXH0br2KLOSEW3dWkVX2q5azBtaOL8oQmyd5lx2J4I6 cq7jmjcGSVwCHnNdkrVMe7Cy7x2MLaoNN1JVdSWDE02ZR55ESLipvuxaP+5k3VnAwrp6gO IMKlDZJZutoir2PtHFElXFCLLsb72gbbdWwsbAQtgHlmOwOB47n5grQl3FbvRqJaWtB+HS lUYAsiSl0gx7cQPLeR/wACNzjcgy8CMKgARGS4lfgm6dLrCvZIRsfqxRNPTfsg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749826663; a=rsa-sha256; cv=none; b=OnZQrsh9Hr+jnSRTtsyGNwCTiG15CUxthmK/4f2p1dGw0YdYdNykBfUOGBKrgPzUoTboOC CCkJC/dBdV0MORaEoLp/Ivd4RoAkncQxVPK8laW9buOeetcK46F79EwdXrOy6f4+Iq0A27 VaEyHc6Plb/GGBsu4iEgDWB1dEaT3v8YnzH6Z6CpxR/EA5611RlvWNuJquWGN71w+x5MnQ 39Flg2bn9mWSTJ8IWY/3NEtI5QQMiwPjvqv4ys5JJjQRLY9Y4Nw1AEazn7B5Hx5pSVDMFH GBzJ2ZG0EGELfvJQdC9/ndRKMAdXmFdVeLGcDP89X/eGjgVxT5oe7aGTdI2Gkw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJjDl2Kltz12k2; Fri, 13 Jun 2025 14:57:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55DEvhhf009553; Fri, 13 Jun 2025 14:57:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55DEvhrB009550; Fri, 13 Jun 2025 14:57:43 GMT (envelope-from git) Date: Fri, 13 Jun 2025 14:57:43 GMT Message-Id: <202506131457.55DEvhrB009550@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 458308acf38b - main - iwlwifi.4: add a note on how to bootstrap firmware files List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 458308acf38bd53bc957a4f7ebbe1f6bc4ce1bf4 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=458308acf38bd53bc957a4f7ebbe1f6bc4ce1bf4 commit 458308acf38bd53bc957a4f7ebbe1f6bc4ce1bf4 Author: Bjoern A. Zeeb AuthorDate: 2025-06-11 08:14:03 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-13 14:57:22 +0000 iwlwifi.4: add a note on how to bootstrap firmware files In case someone ends up without any networking and no firmware files add short instructions on how firmware can be bootstrapped manually. This was prompted by PR287393 and D50777 during the 14.3-RELEASE days after firmware was removed from the stable/14 and only available via ports/package/fwget. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: ziaee, pauamma_gundo.com Differential Revision: https://reviews.freebsd.org/D50791 --- share/man/man4/iwlwifi.4 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/share/man/man4/iwlwifi.4 b/share/man/man4/iwlwifi.4 index 3da4e68ad805..c34553fe53d3 100644 --- a/share/man/man4/iwlwifi.4 +++ b/share/man/man4/iwlwifi.4 @@ -27,7 +27,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 12, 2025 +.Dd June 13, 2025 .Dt IWLWIFI 4 .Os .Sh NAME @@ -302,6 +302,17 @@ driver requires firmware from This firmware package will be installed automatically with .Xr fwget 8 if the appropriate hardware is detected at installation or runtime. +.Pp +As a last resort for bootstrapping, individual firmware files can be +manually downloaded, e.g., on a different computer and transferred using a +.Xr umass 4 +device. +The firmware files can be found at +.Lk git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git +with names as requested by the driver. +Copies should be placed into the +.Pa /boot/firmware +directory. .Sh SEE ALSO .Xr iwlwififw 4 , .Xr iwm 4 , From nobody Fri Jun 13 14:57:44 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJjDm6PJfz5q6X8; Fri, 13 Jun 2025 14:57:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJjDm3zMkz3TvY; Fri, 13 Jun 2025 14:57:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749826664; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YBgpqfFOBZva6zKaheqAl8SypZEUD9dfGomvqkTfgj0=; b=tN3SkdnDHo9WKdYqjdT905ei8MaTld9uQH/M/kPnAZU7WXFD2SyDczoqCy1K6Fek1Caz0Z PwyXcf8MJc+lr1xfpfhkEf4vo4R5hm9GyIzrQgqm8zduiTZQ3r1ONCh8+dMWUhVy/Wz4GM ybVHzf41Y3G9iPss27A1ddcT3ypx51IRZH4wdtLtXbGwXvtzlnQtfkFL2BqRP/bsWbqr6P LSOWiWIzPECferd5KVokQOwyV45C3FKzaN4XYemlggSHPvo0384HueJiZZ/EL3k/81gXh0 bPMfU+xe7lq+psga7PVuNX65pJoasrETSbvrWE6vWyjPmH3OwU+b/b2WD1+yBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749826664; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YBgpqfFOBZva6zKaheqAl8SypZEUD9dfGomvqkTfgj0=; b=gEdH38HgScCq/M2YUUlm9ztNPEWGTCp71k1tf7spbuEGjD2223ZMEPLYOuLj3Q0MJGCBzA yRuyQ80+CW8Erir2Gg2R48v6AW1O3dxgh5Hk+mtgJkbmzHZaGPI2SPpnN9VYBa3TrHovpd hzB72T+ItsRhHwvad15uR3JDgjKSvyhvRwvHe2QPSQc8URcspfxbeFfKFqntUnB3I6zQRD p/fFoss5U57z/mIFemFivJlJrbtsQed4o2h4F0Z8b2KdW+ZOKRpzPdgnivP3KAgvZjsM9B hcHkjIO/j1yL9OmhmKXjPyNE463qGd3oteJBHUCH/YsFRFJmDi1AiQf/gZnkFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749826664; a=rsa-sha256; cv=none; b=ryD/gObkyUctypwrczxeuBWwcpzLMwu8A1e8GfMAnSd5MEryDt/RTm0niICcySuAIR6rQY +zczUmn2oPkKxiJouzbtQtuv0FTECVTxsZpvP38a7k27jja13+admYR3H4j/MDPPIWAzLX 2/WcByI1jHS/ILlaEAEHZ04FMj04VnRGGE3BzCX5f0t/JxUe65HEVhY3Pg+SUp5UFGUm2m diwQXJqZb7QBAfkKUi9NjvG+wOvnAHdP4zCT4t7M9cyuLocCHdpo+7oEeHFLeY/zZX8Q9c yls3BH+CweV/no1Qr7FoZjGchb62M5KUbZMmhqTLV4CKjGFqFMd+PoCXL9uVvQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJjDm3LKFz12gP; Fri, 13 Jun 2025 14:57:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55DEvi6H009594; Fri, 13 Jun 2025 14:57:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55DEvieL009591; Fri, 13 Jun 2025 14:57:44 GMT (envelope-from git) Date: Fri, 13 Jun 2025 14:57:44 GMT Message-Id: <202506131457.55DEvieL009591@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: eb8a794662d2 - main - iwlwifi.4/rtw88.4/rtw89.4: adjust note about loading from loader List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: eb8a794662d2e694a99f927d7161b6efffdd295d Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=eb8a794662d2e694a99f927d7161b6efffdd295d commit eb8a794662d2e694a99f927d7161b6efffdd295d Author: Bjoern A. Zeeb AuthorDate: 2025-06-12 15:01:09 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-13 14:57:22 +0000 iwlwifi.4/rtw88.4/rtw89.4: adjust note about loading from loader Despite being discouraged in the man page already, people are trying to load the driver(s) from loader. Now that the drivers are on module_blacklist="" simply state that it is not possible. If someone wants anyway they can figure out how to remove it from there, load the driver, and loader the firmware file(s) upfront. Sponsored by: The FreeBSD Foundation (iwlwifi) MFC after: 3 days PR: 287480 Reviewed by: pauamma_gundo.com Differential Revision: https://reviews.freebsd.org/D50816 --- share/man/man4/iwlwifi.4 | 2 +- share/man/man4/rtw88.4 | 29 ++++------------------------- share/man/man4/rtw89.4 | 27 +++------------------------ 3 files changed, 8 insertions(+), 50 deletions(-) diff --git a/share/man/man4/iwlwifi.4 b/share/man/man4/iwlwifi.4 index c34553fe53d3..4a251f239a55 100644 --- a/share/man/man4/iwlwifi.4 +++ b/share/man/man4/iwlwifi.4 @@ -54,7 +54,7 @@ See section .Sx "FILES" below for how to install the firmware. .Pp -It is discouraged to load the driver from +It is not possible to load the driver from .Xr loader 8 . .Sh DESCRIPTION The diff --git a/share/man/man4/rtw88.4 b/share/man/man4/rtw88.4 index 1165c5763de8..4c2cba8311ae 100644 --- a/share/man/man4/rtw88.4 +++ b/share/man/man4/rtw88.4 @@ -1,30 +1,9 @@ .\"- -.\" SPDX-License-Identifer: BSD-2-Clause +.\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2022-2024 Bjoern A. Zeeb +.\" Copyright (c) 2022-2025 Bjoern A. Zeeb .\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -.\" SUCH DAMAGE. -.\" -.Dd November 10, 2024 +.Dd June 13, 2025 .Dt RTW88 4 .Os .Sh NAME @@ -44,7 +23,7 @@ to manually load the driver as a module at boot time: kld_list="${kld_list} if_rtw88" .Ed .Pp -It is discouraged to load the driver from +It is not possible to load the driver from .Xr loader 8 . .Sh DESCRIPTION The diff --git a/share/man/man4/rtw89.4 b/share/man/man4/rtw89.4 index 5834a804630c..8c7132673db5 100644 --- a/share/man/man4/rtw89.4 +++ b/share/man/man4/rtw89.4 @@ -1,30 +1,9 @@ .\"- .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2023-2024 Bjoern A. Zeeb +.\" Copyright (c) 2023-2025 Bjoern A. Zeeb .\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -.\" SUCH DAMAGE. -.\" -.Dd November 10, 2024 +.Dd June 13, 2025 .Dt RTW89 4 .Os .Sh NAME @@ -44,7 +23,7 @@ to manually load the driver as a module at boot time: kld_list="${kld_list} if_rtw89" .Ed .Pp -It is discouraged to load the driver from +It is not possible to load the driver from .Xr loader 8 . .Sh DESCRIPTION The From nobody Fri Jun 13 15:34:23 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJk336rXHz5xZBc; Fri, 13 Jun 2025 15:34:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJk335j6cz3Zg7; Fri, 13 Jun 2025 15:34:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749828863; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NLnEWywbMNBW11QEyKvNqYhDcPIlxkuSw27isfzvnNk=; b=THFHOTgWnNK3uEJXJYOMAXwYriMXMOQyD020uUqr5IUnWMPpoTzoJXYN+rg13bnejA9bsr kQ90/WGtwXN0Nv6WkfLL3kKvPbs/jBEHqOeNNQABoB9Slh2jmx84Ge65A4S7ee0PM7adyS QRY2jldPGUM+cFejO0jlk17ZZjMQkFWzy0tHyO4T+DwFkyspzpEnafU6i3Qy4hh0dBYrfM uIbm8GJQmpGInDDuJ24Uv7G2kaEmzGxO4YkkphWyy1dNzsYl7vQs7eiB5+GgfRzRS/NCHG mNZhYeduIZhX+QAuauID7KixOv1eFvteruyNrNxDVHuK7q2XlNCM8H8RWgGOQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749828863; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NLnEWywbMNBW11QEyKvNqYhDcPIlxkuSw27isfzvnNk=; b=iXGNXUwTglbgMR6BJmamexTIjAGo6QqVVMktO1fSOwxDUTY3oBZhjV81ImX9Wu/q6gPvyG zy3WgucE7DrqB6uNg7bKztD9etLDp+rOnHa9WlgOz4NFhMADxhXxHZGO2efz7WuqG0fxTn lWvakCQw1VahMnKt+f+cHa2/60lR7LoQEJrQrzIPDCLH3BcDURGlZvcY3EuSeErGVXInVD zlLGdOan4lbEH4xldK2pnVg7QUCCCJVkSEb4H5PtBc2RuxMLcvD4M5mus7xBtH7LOeCB63 o4yNmIfb8VpS6cvQv2LxrpLxudhwu71A8KgmAckr94oMFApWiDSobFCZlhAJ4Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749828863; a=rsa-sha256; cv=none; b=KNKdPyNQICI3eG42PA+TC5JL6sj7Bnk2XhQZQHrOtdLyShlBFOGlQ0zjKa/AumIKbdFtzi VImyTJ138JhWnE1liEyQ8WireYPh1l+pxf2oGQFGh8IJbekcdQg/acrBc4WEfUCiroTDGL nti86c1fiGeJkEubyCy4j5bEVI+YeJEhtaDPUvgeLmjeDszYAbCypQIOC0AmDUdZQOFbhc d8+yE/FcfJd/ZL9X0drM/rNRYu6xmCDVrrjaWF7DJ2yJy0/51qMJQRTS8MKJmIfONyecYM XWSQ3eH1oknU1zVp6j1OUFy7Y3gC7jOlk1mkkPS+TV7gRJRsqrZ+U/7W2WwvSw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJk335Hwjz13GB; Fri, 13 Jun 2025 15:34:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55DFYNHH084617; Fri, 13 Jun 2025 15:34:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55DFYN7e084614; Fri, 13 Jun 2025 15:34:23 GMT (envelope-from git) Date: Fri, 13 Jun 2025 15:34:23 GMT Message-Id: <202506131534.55DFYN7e084614@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: cae3d6c8d40a - main - nuageinit: fix typo List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cae3d6c8d40a417f32be165aa9a9b4be86bb7f49 Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=cae3d6c8d40a417f32be165aa9a9b4be86bb7f49 commit cae3d6c8d40a417f32be165aa9a9b4be86bb7f49 Author: Baptiste Daroussin AuthorDate: 2025-06-13 15:33:14 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-13 15:33:53 +0000 nuageinit: fix typo PR: 287503 Reported by: crest@rlwinm.de --- libexec/rc/rc.d/nuageinit_user_data_script | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rc/rc.d/nuageinit_user_data_script b/libexec/rc/rc.d/nuageinit_user_data_script index 97ccc45f8658..cea7fb5c6aa0 100755 --- a/libexec/rc/rc.d/nuageinit_user_data_script +++ b/libexec/rc/rc.d/nuageinit_user_data_script @@ -16,7 +16,7 @@ rcvar="nuageinit_enable" execute_user_data_script() { if [ -x /var/cache/nuageinit/runcmds ]; then - echo "Executing 'runcmd'" | tee -e /var/log/nuageinit.log + echo "Executing 'runcmd'" | tee -a /var/log/nuageinit.log /var/cache/nuageinit/runcmds 2>&1 | tee -a /var/log/nuageinit.log fi test -x /var/cache/nuageinit/user_data || return From nobody Fri Jun 13 15:48:52 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJkMm56Mhz5xbb8; Fri, 13 Jun 2025 15:48:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJkMm4RrZz3dSN; Fri, 13 Jun 2025 15:48:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749829732; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QTCXK3eRwQfaHTPgNz3ivTcIReEa/1DhJyjIt4PusyQ=; b=nUuONgOTEWmbYz2eC+mxNcnZr8C0aUsAcoLmy//Cxq8ZzSFrWqd9ds2Tg9tKRwDOG1BhOb Bf06xmTazGF/vUdhH5OADeg5d/rbnTEwgVThDwzr3uWuzL44lJ07Nbmid2MmER6dw5hZsW wo+oGbX72CxSTjhMhBHWtuMcpukHCq4zjKiu4oDMMfLCy24kaMkr4HYKKK9D+lL/aGv7tJ Y5AQdcx28mCvPkUbqnPY8KhOafbx69tYrfvnHvrBBgknWyCWrJSQuPOe6Z7MSsUwRDHmIH NQPRXax71+Jqqg6wyc8vtXdrBNVD8Agt3XnHqXIaYt0+/qxmH/aOEsJi25QwYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749829732; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QTCXK3eRwQfaHTPgNz3ivTcIReEa/1DhJyjIt4PusyQ=; b=s/hgV00Y4t4D0dpijco7ek4NoXBFurZ+xg1SrdyoaOkn09FG9qHBCBAo2ETE7NKXZXgAxI eqc6utO017eFzeopTUx6qznjnFtVtSiV5ME7MUsOzL7PXwomPbBdRVOEyGAdSGne2FPZGA A0LxdaEdw4xWcxGOVbXIqB2lZXdEBSzrTLFM8Adw53QPeETzueqWvFOtm2jiv/c2uSn2GU uUbK5P3Hr6m4JGgc+ItP8022XrTnd+QjKuDPv3xLORg1ovenmWZyW83f54T2LUKdKYHdMS pEQPHQ8lY8Ikv4Mrcd7+WrGbylNmxaneE9Le3H9C9A5Wayzer4uvCYEZqbUGcg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749829732; a=rsa-sha256; cv=none; b=FHMkgA6z759vlds3BBcqjFaWre1Q/QERFL3W0kQ+tBXq2gAThA/2WjmjcSP5qS1644nDr0 5QMyBfW6NrweRNSSsGTyziJwJPTvXm351Qn0Id70A+4AA8H50PdDW54hlA2fpm+O7DwFGr 5Dm7M0xTHJcPeOeFiu/tI94/RAmCZhcOTLXjautkfvonD/1+F3JWQ9oEykj7+L+pUFVgCC DeTY/gVZdupTChdTgxt5DKlqK6OpqW2XwEDzyGTN6yqcgoHWltoTUUq15D2+mIm+B/LKge jaLI+TTV0Q8F3aGf/WxKRPHWKGMdZEwi7Y++inLgvMLu00EqLTcywPSvJolF1g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJkMm3Z1gz13ly; Fri, 13 Jun 2025 15:48:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55DFmqJV004630; Fri, 13 Jun 2025 15:48:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55DFmqnu004627; Fri, 13 Jun 2025 15:48:52 GMT (envelope-from git) Date: Fri, 13 Jun 2025 15:48:52 GMT Message-Id: <202506131548.55DFmqnu004627@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 900bc0206348 - main - rc.d/zpool: change mountcritlocal dep from BEFORE to REQUIRE List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 900bc0206348a439b3a0625a7239cb87a2dc27c5 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=900bc0206348a439b3a0625a7239cb87a2dc27c5 commit 900bc0206348a439b3a0625a7239cb87a2dc27c5 Author: Siva Mahadevan AuthorDate: 2025-03-14 15:52:12 +0000 Commit: Warner Losh CommitDate: 2025-06-13 15:47:25 +0000 rc.d/zpool: change mountcritlocal dep from BEFORE to REQUIRE In cases where the `/boot` directory is mounted from a different disk, `/boot/zfs/zpool.cache` will not be found during a `rc.d/zpool` run. This is because `/etc/fstab` mounts are mounted in `rc.d/mountcritlocal`, which currently runs AFTER (i.e. `REQUIRE:`) `rc.d/zpool`. This change swaps the `rcorder` of `rc.d/zpool`'s dependency on `mountcritlocal` from `BEFORE:` to `REQUIRE:`. This will ensure that `/boot` (or even `/etc/` in some configurations) to be visible while searching for `zpool.cache`. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1614 Closes: https://github.com/freebsd/freebsd-src/pull/1614 --- libexec/rc/rc.d/zpool | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libexec/rc/rc.d/zpool b/libexec/rc/rc.d/zpool index 94e107bd9ae0..63f040ad122b 100755 --- a/libexec/rc/rc.d/zpool +++ b/libexec/rc/rc.d/zpool @@ -3,8 +3,7 @@ # # PROVIDE: zpool -# REQUIRE: hostid disks -# BEFORE: mountcritlocal +# REQUIRE: hostid disks mountcritlocal # KEYWORD: nojail . /etc/rc.subr From nobody Fri Jun 13 15:50:35 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJkPl4Nmfz5xbgn; Fri, 13 Jun 2025 15:50:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJkPl3b8Zz3ddP; Fri, 13 Jun 2025 15:50:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749829835; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZO9z2xpK+zMXHJpZ20usQnPubIsW4M59BCBguFEx3TE=; b=MBMfmsefUaSWrpEa+McWBquaYRyMVTOwy+ZUb96iuFT0V+7mZphs4VJqIr6QFPxx24eB8t H9umMmc2SiJUSNSxqf4vOk2PH5i2e2Kz1mon0vC5ojQ9iHY8N0nOR4BU6GTg/CHppRCylu Lj5JmCShdiV6EjmrOKwozjrfArONIYPIBC1e31Vc7xLg9h1B0nqp0UFPEKHY1y/5qN4aXM CnL62qlpuFUaMCwEzUlk4JMW2XeQxqcVuB2xOMPRysMNq+nZJyFfAitiOwnGdfrSddJFqx egS9LWikmhKidIebdcXhXwkWXf8lc3ZJNBdVHvl35ijigj5ES5AFO/YZn/CSFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749829835; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZO9z2xpK+zMXHJpZ20usQnPubIsW4M59BCBguFEx3TE=; b=VeVcgy5lAn7JKgxSRXw2ZMhoZ99MMFqtfM4E1nqVyDyOKviT0Z6QPafZQLhKEYkWJOhLyX hWVOGS+SslTkQ8ZJ3s5GOMIGmCBPPxRH1txY7+PI70ye9l4pawpkjUMnZpMYtUCQYAudW9 Utk/bGwIgcg87vQ2x+8Vp7bJ36lxYCWpxzpyrCwMc4YoX4kSbQbobemEDNy/frSXJCV3HD pTriwDBlzGfdtXUav/STUcxsZUtRo6wj6kwbmZIWbb+uuDvrni1lOtFKOJqgIOoEny9X8d fS7c2ri4NkntFzk/DMFhGr5D7SiFdy+SOAKUQTw88WjhC0GetXYApCEQpLJL1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749829835; a=rsa-sha256; cv=none; b=Ii4t9puIZHF1K1of/YsoBsrZp/CUnVNr3jc+UHSZkTYN9DH6Uop9A0NbL1u1A5/K5SzWLl 2sREm4MPuN6UxN/CAt8Z6F1L4OM53OBrlZW9r8OMGQfMlb537Q9i+DqY/Bm8Ql+PP8QGkp m7gsGFD3MJUUDUg9xGW0P4kWceAv6RZ1MUmxmdzxlHDjuWTHbS9VcCQuYqbjk8KQmsaKmQ pfbJRcM4nj9I3TasJh+NanO532ly7DGkn29j8X85PCg5tyEVjNlpTwllvXLi2NawuA/UEC cRPgzkwALPS/k/jH6SNHR3rYRj0bpzDpbhJRbFWD0WbSkDhbHO7bZBFE8yObzQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJkPl2mcHz13k8; Fri, 13 Jun 2025 15:50:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55DFoZqC013832; Fri, 13 Jun 2025 15:50:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55DFoZhL013829; Fri, 13 Jun 2025 15:50:35 GMT (envelope-from git) Date: Fri, 13 Jun 2025 15:50:35 GMT Message-Id: <202506131550.55DFoZhL013829@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Li-Wen Hsu Subject: git: 1563b306d19d - main - linuxkpi.4, linuxkpi_wlan.4: connect to build List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1563b306d19db25f5bbf071897b60429b192040c Auto-Submitted: auto-generated The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=1563b306d19db25f5bbf071897b60429b192040c commit 1563b306d19db25f5bbf071897b60429b192040c Author: Li-Wen Hsu AuthorDate: 2025-06-13 15:50:30 +0000 Commit: Li-Wen Hsu CommitDate: 2025-06-13 15:50:30 +0000 linuxkpi.4, linuxkpi_wlan.4: connect to build Fixes: bfaec3e64741 linuxkpi.4, linuxkpi_wlan.4: add short man pages Sponsored by: The FreeBSD Foundation --- share/man/man4/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index ed39aafebbc3..a12493de4280 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -290,6 +290,8 @@ MAN= aac.4 \ linprocfs.4 \ linsysfs.4 \ ${_linux.4} \ + ${_linuxkpi.4} \ + ${_linuxkpi_wlan.4} \ liquidio.4 \ lm75.4 \ lo.4 \ @@ -929,6 +931,8 @@ _gve.4= gve.4 _if_vmx.4= if_vmx.4 _ipmi.4= ipmi.4 _linux.4= linux.4 +_linuxkpi.4= linuxkpi.4 +_linuxkpi_wlan.4= linuxkpi_wlan.4 _ossl.4= ossl.4 _pvscsi.4= pvscsi.4 _vmx.4= vmx.4 From nobody Fri Jun 13 17:32:40 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJmgX6RXzz5xkmb; Fri, 13 Jun 2025 17:32:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJmgX4Tl5z3q4m; Fri, 13 Jun 2025 17:32:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749835960; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5NtmRTfp6/dbSlYlwcCsAx42q1dY32EbrLHuiU92Ls8=; b=NX+AjYgUeoLB/+81sigZrhK+Q9sLXRHykypess9OUCmMt298XZHGtfo9UxYmnIogl4FEwO fVRammdn2DqV/Ld1Y/DTZkR2ysy7mcKnEWRp1ix8U1woHZvNu+JYzHVbK5Kvx4MzKcOBcF zLoKlzuG/YU9BtcsLq7LttD3MChziSb7yUCkEydmRsZL4tQoS4Qb3cIxhuScXIcjiNSBf5 aSq6w4lNUK0qBCYjpPCBbFQY/qQmUNe9QXIUav18dL9rASfQv9wWZI3JPEAzixFqpm5KHD pv0bvlSTsCCpYwMj5SU9BPpMXE2c4ZrhVnco+HrnSCVj9XYuewF3QXeiL1tBNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749835960; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5NtmRTfp6/dbSlYlwcCsAx42q1dY32EbrLHuiU92Ls8=; b=SauzcNL+7N8RRox/OYibleRCGOsv66K2YDAxcIBL5RLXoGd9Oms/0CcgHwE0AV66lxq+3l XxfVwx+Ov7iT3G8/bw4bqyhmLtv6qfynYRgMLPeBLxgGUlikfzU4/sn4X4WThxUZSDUSmN WoIY+FYL3BGS4iDG9qYHMR+3oXX/dXaUCgrrUW7rm3/6YFsixQZKzWc2RhwXoPsu8q5nQk dHDlMJKDsHwD6O+lI3T2ugWHbwxFDcd0RIsOmktWUHkQqQiy2n44MLONSoXw1QzBTBl2Jr 3HBF/Awic1grElI7q0OwA/XfWZ+54hA7mYQepgy55zHBKrEEC80Sfj9VCTMgyg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749835960; a=rsa-sha256; cv=none; b=uPcVw43YklDv3Rzzl9u0RNoSDRnL8O80nYOtkYyRtG2gj1BD2pxIJ3CiShanEx97UoMI3h bR83xOyj3Gs4Jiz9LH9fK0GBSqaj6ZJ3KGCGDmCkkDHpPMTh2IcqKL+6EKrCCKxTy08aal WiWEuOI+bHYg54aFCamGqfc7obU+KERNNu7+T55n9X7oJP8KaRfxGIpT2WT+XDdWxNwLY4 0FBu/FDZI+xKwR7q+O0ffHm/WyQ1W/lAuICFCTRU8xMbVib2m+3O8XgwtjgPRyG0hwA6q1 izP4REsh87ZKSdZ4Po9TV/JW1hEhAPvMTDEQqLsH+kBVZfW4GRI5Wxv1Ef/nvg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJmgX3y85z16d1; Fri, 13 Jun 2025 17:32:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55DHWeIw009097; Fri, 13 Jun 2025 17:32:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55DHWeGV009093; Fri, 13 Jun 2025 17:32:40 GMT (envelope-from git) Date: Fri, 13 Jun 2025 17:32:40 GMT Message-Id: <202506131732.55DHWeGV009093@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Cox Subject: git: b7536f9593a3 - main - arm64 pmap: Simplify pmap_demote_l{2,3}c() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b7536f9593a30b8253546214f53c9ef063c656a9 Auto-Submitted: auto-generated The branch main has been updated by alc: URL: https://cgit.FreeBSD.org/src/commit/?id=b7536f9593a30b8253546214f53c9ef063c656a9 commit b7536f9593a30b8253546214f53c9ef063c656a9 Author: Alan Cox AuthorDate: 2025-06-09 06:34:13 +0000 Commit: Alan Cox CommitDate: 2025-06-13 17:31:53 +0000 arm64 pmap: Simplify pmap_demote_l{2,3}c() Simplify the loop for remaking the mappings in pmap_demote_l{2,3}c(). Since the mappings are invalid, we needn't use an atomic read-modify- write operation to remake the mappings. The accessed and dirty bits won't concurrently change. --- sys/arm64/arm64/pmap.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index f8e422848e94..3529314b07c7 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -8662,10 +8662,10 @@ pmap_demote_l2c(pmap_t pmap, pt_entry_t *l2p, vm_offset_t va) /* * Remake the mappings, updating the accessed and dirty bits. */ + l2e = (pmap_load(l2c_start) & ~mask) | nbits; for (tl2p = l2c_start; tl2p < l2c_end; tl2p++) { - l2e = pmap_load(tl2p); - while (!atomic_fcmpset_64(tl2p, &l2e, (l2e & ~mask) | nbits)) - cpu_spinwait(); + pmap_store(tl2p, l2e); + l2e += L2_SIZE; } dsb(ishst); @@ -8751,10 +8751,10 @@ pmap_demote_l3c(pmap_t pmap, pt_entry_t *l3p, vm_offset_t va) /* * Remake the mappings, updating the accessed and dirty bits. */ + l3e = (pmap_load(l3c_start) & ~mask) | nbits; for (tl3p = l3c_start; tl3p < l3c_end; tl3p++) { - l3e = pmap_load(tl3p); - while (!atomic_fcmpset_64(tl3p, &l3e, (l3e & ~mask) | nbits)) - cpu_spinwait(); + pmap_store(tl3p, l3e); + l3e += L3_SIZE; } dsb(ishst); From nobody Fri Jun 13 17:42:23 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJmtz73FHz5xlWR; Fri, 13 Jun 2025 17:42:35 +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 4bJmtz4yStz3rHg; Fri, 13 Jun 2025 17:42:35 +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 55DHgNfw044965; Fri, 13 Jun 2025 20:42:26 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 55DHgNfw044965 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 55DHgNiR044964; Fri, 13 Jun 2025 20:42:23 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 13 Jun 2025 20:42:23 +0300 From: Konstantin Belousov To: Warner Losh Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: bd8621c6cd8a - main - kern_time: minor style nits Message-ID: References: <202506131435.55DEZPQE071534@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202506131435.55DEZPQE071534@gitrepo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Rspamd-Queue-Id: 4bJmtz4yStz3rHg X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] On Fri, Jun 13, 2025 at 02:35:25PM +0000, Warner Losh wrote: > The branch main has been updated by imp: > > URL: https://cgit.FreeBSD.org/src/commit/?id=bd8621c6cd8a7499e7c8be189cf1ffd102dcc9d1 > > commit bd8621c6cd8a7499e7c8be189cf1ffd102dcc9d1 > Author: Warner Losh > AuthorDate: 2025-06-13 14:34:21 +0000 > Commit: Warner Losh > CommitDate: 2025-06-13 14:34:21 +0000 > > kern_time: minor style nits > > Typically we spell error values 'error' not 'err'. And fix EINVAL markup > nit. > > Suggested by: kib > Fixes: 7b7ba7857ce8 > Sponsored by: Netflix > --- > lib/libsys/clock_gettime.2 | 4 +++- > sys/kern/kern_time.c | 32 ++++++++++++++++---------------- > 2 files changed, 19 insertions(+), 17 deletions(-) > > diff --git a/lib/libsys/clock_gettime.2 b/lib/libsys/clock_gettime.2 > index 1dcfd9d1faf7..c3b8fb92c9c1 100644 > --- a/lib/libsys/clock_gettime.2 > +++ b/lib/libsys/clock_gettime.2 > @@ -104,7 +104,9 @@ Increments in SI seconds like a wall clock. > It uses a 1970 epoch and implements the TAI timescale. > Similar to CLOCK_REALTIME, but without leap seconds. Still .Dv CLOCK_REALTIME would be the right markup. From nobody Fri Jun 13 17:53:06 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJn7942TJz5xlR6; Fri, 13 Jun 2025 17:53:09 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJn793C5Mz3s7K; Fri, 13 Jun 2025 17:53:09 +0000 (UTC) (envelope-from bz@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749837189; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Q9ZSmrJjgZ4GSQ+IQ5GawJpM5Pr5fWv1WV73Xdlcqs0=; b=V7VQ8PCS9yq3kNeNktiJvMgpuHQpv3oTaBWYTLgzJxCjsfr4og7SuO6xrtmpw9Y4OsraZ5 2Ce6DCqH+kCRAgoJbPtapstiTu+DHgSjAOysgk1ZSBCv7oIn4y/LTBmFSMnXg+zT456MgG w6wMmzCg9I+SJGKvD7HD9IwIRe2EgMm4t6mUZBSpXe9uP8juLmbqNc3gmLLKabW2ZUBamf WO3Ga5eFoyQF7zmCbBXA4UNtuCTn4OrzobS9f/wbqjpPpzl80+4DlV89OB5qc1dtaRULJW 4vQRKs6U987nXLetAlRCVRutaHR4xbhBwYNUyZZvdt249gDR+n8EBb03Fklkyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749837189; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Q9ZSmrJjgZ4GSQ+IQ5GawJpM5Pr5fWv1WV73Xdlcqs0=; b=LJUiahaDqn30rUyZYiT3PjgHlK6IUwt+EzPupmDHIP6zvKwMJ8KjbIvMLaYXIXDu/S6Jx5 DX52sMvrfAcJKZlEt2pcyGnHjvXpGqBfL6Cm1ttZws3kTD3Vkpr4RhWRBqIa6zQOrp4lRU BZcZGQj9ZqGKN7bEDqVvkvrEUOYpwlEi1dkFrqgbbyAiouumOA6VFy1Xd0tsBrxoCGplYs 3MtZhrTrVaFTKwhYGBgD23ORWDeT2/76ETQ3syJc+WPm9VIZqwqrqlk3+Cao/6Li8qo2Zc S9m3iPgBPWTPyn1iJJFm+kF4vlZuASQRv8tdlu36yVqbieeaWfxeIyUH24Ylpw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749837189; a=rsa-sha256; cv=none; b=wXbwgDXdqQaZ5VODtIiB4lfyBjZBMRTS97VGZAwu2ktkmBlSKuMB31t2LkQtrhsqua1VBz UkNrYpdqWarLnPPAbK9FRQgQbbKCs3+v0L/jzIQ60Dm70M784rN21jHM9hw9FyDu+EWqg3 E7Sno7fuML75WkZr14EqZUFAifRn4K/Uapq8cUm13reX7FZ2xGCEoXM+6O37zR3SBAePLl St3umCKtT/kO9wRRJ3ZUSx4HlUfPZ4KHk4fJSOSHzSxaG4Kz1J64gFV1MIvEYE3hghpCUy Suc2SD8v7q/iYoYoL3JfwqKNNspKWZ4o9xlJkRLvuZnTbEKgRjq++rr1PePICA== Received: from mx-01.divo.sbone.de (mx-01.divo.sbone.de [IPv6:2003:a:140a:2200:6:594:fffe:19]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature ECDSA (prime256v1) client-digest SHA256) (Client CN "mx-01.divo.sbone.de", Issuer "E5" (verified OK)) (Authenticated sender: bz/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bJn791QLCz19Ng; Fri, 13 Jun 2025 17:53:09 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mx-01.divo.sbone.de (Postfix) with ESMTPS id C57F8A64805; Fri, 13 Jun 2025 17:53:05 +0000 (UTC) Received: from content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 6B1372D029E1; Fri, 13 Jun 2025 17:53:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) by content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (amavisd-new, port 10024) with ESMTP id OTg0wvf7NQQH; Fri, 13 Jun 2025 17:53:06 +0000 (UTC) Received: from strong-rtwn0.sbone.de (strong-rtwn0.sbone.de [IPv6:fde9:577b:c1a9:4902:3e64:cfff:fe55:bc80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id DC1BC2D029D8; Fri, 13 Jun 2025 17:53:06 +0000 (UTC) Date: Fri, 13 Jun 2025 17:53:06 +0000 (UTC) From: "Bjoern A. Zeeb" To: Li-Wen Hsu cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 1563b306d19d - main - linuxkpi.4, linuxkpi_wlan.4: connect to build In-Reply-To: <202506131550.55DFoZhL013829@gitrepo.freebsd.org> Message-ID: <2210n12s-244r-8p53-262q-o2ps9n815s4q@SerrOFQ.bet> References: <202506131550.55DFoZhL013829@gitrepo.freebsd.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed On Fri, 13 Jun 2025, Li-Wen Hsu wrote: > The branch main has been updated by lwhsu: > > URL: https://cgit.FreeBSD.org/src/commit/?id=1563b306d19db25f5bbf071897b60429b192040c > > commit 1563b306d19db25f5bbf071897b60429b192040c > Author: Li-Wen Hsu > AuthorDate: 2025-06-13 15:50:30 +0000 > Commit: Li-Wen Hsu > CommitDate: 2025-06-13 15:50:30 +0000 > > linuxkpi.4, linuxkpi_wlan.4: connect to build > > Fixes: bfaec3e64741 linuxkpi.4, linuxkpi_wlan.4: add short man pages > Sponsored by: The FreeBSD Foundation > --- > share/man/man4/Makefile | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile > index ed39aafebbc3..a12493de4280 100644 > --- a/share/man/man4/Makefile > +++ b/share/man/man4/Makefile > @@ -290,6 +290,8 @@ MAN= aac.4 \ > linprocfs.4 \ > linsysfs.4 \ > ${_linux.4} \ > + ${_linuxkpi.4} \ > + ${_linuxkpi_wlan.4} \ > liquidio.4 \ > lm75.4 \ > lo.4 \ > @@ -929,6 +931,8 @@ _gve.4= gve.4 > _if_vmx.4= if_vmx.4 > _ipmi.4= ipmi.4 > _linux.4= linux.4 > +_linuxkpi.4= linuxkpi.4 > +_linuxkpi_wlan.4= linuxkpi_wlan.4 Thanks but those are not correct. We do build the modules for both unconditionally. Please remind me to see if I need to put them on the release notes template and copes for 15.0 if I forget. > _ossl.4= ossl.4 > _pvscsi.4= pvscsi.4 > _vmx.4= vmx.4 > -- Bjoern A. Zeeb r15:7 From nobody Fri Jun 13 17:58:48 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJnFh5K5Cz5xmfJ; Fri, 13 Jun 2025 17:58:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJnFh4lZTz3sRX; Fri, 13 Jun 2025 17:58:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749837528; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9uUi+bcXRsySdRg5ZvM/kzLECuXpVZo3gvhgkuW4Ebg=; b=dWrCEgjINbnCo3KKIywRRAUg8HP2ydrBHNQZZ/aEJXIeTRFLbKi966iQY2608BLWX26iDU 7jm/cbnDJr+pcgbysQ92n8PbqNaJzuYLA+Z6xhpuli15gpJX32zDhjhxM5Z2OOFC1/H9lI PoTeCqe/kBT5jUjLXzXdifeYZ1KCSUxuEAoToRQynlk5xlsnjsfLY3MLXjCWzJ6R+dYwFt SKr98ygAIYsRSrFVp5LYSY1HjuJMMd6VJ/vcTIVKq3W1VRtf9Mzpp1zzIhunT61EJiRA0y RQZ0OwqNXQStZorbCYumypVLSWgMnirf+gBCAkWnpwqsLDrKJ7W60gNHqvbQ8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749837528; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9uUi+bcXRsySdRg5ZvM/kzLECuXpVZo3gvhgkuW4Ebg=; b=jqcc2NwS4ZxmIC98LD1rFpvg4CbvAazmgkuFq5shfs/TYcxGuwBntmAjSCFJsk7sWPbtEg BjZLOiTsTHrJYc8oqFDkdxETTCCgCJnLNb+Vvp3mqJ8mQ9YDLkEqFZHQ35xyH3AArltalB h+UkdjDd/sKVt40OQFS6Xsaf/rEzEcLyPHue6hr+Pl6Ne2s1DYAdVlDIVVZQIBpCqGNj+/ AX99vac2hsXkBUiV8AN0JRPmCgZ8z0PAKm0DjtkCg701yw9jV+jCRyJfUdyOMv/0lFUQpL RbZcTxEyXXVAeGtXS7KSBGPTxIuKMl3yKnhWS4J59xhbIawwXixUiwjgNWvGOw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749837528; a=rsa-sha256; cv=none; b=kfEx3VmuzvZ3q3lFdWo2v61ut/vp2DEA1oRlLiRJLbAO4lyRPbJSWINqFSN3YFQfHSi2nv +Gcr+dhlnDN7rqEnAnxqnZfETD8csFJEiQul25XMqE+CKDLDkMMeDWI6TbJiHeoy4w8OsP XEwVplvHcJ92snoby3kgHB7N1chph9AK9a8XUN7PHprIpk2eNK+otSTaiRJSsnSnKIbSOb 3QL5AHz5eOYdlOgIsW9mK8XP9P9APBwzLDSM8tPt0Ho6SpP+wBosoHN5MtP644buTF8jKw nZiOYQif0dyUdfg3JThyBqE77DzbIieZQsZvt8M0vy90NtbxUxDOLwOXIJvFfg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJnFh42Cfz173H; Fri, 13 Jun 2025 17:58:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55DHwmww048294; Fri, 13 Jun 2025 17:58:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55DHwmra048291; Fri, 13 Jun 2025 17:58:48 GMT (envelope-from git) Date: Fri, 13 Jun 2025 17:58:48 GMT Message-Id: <202506131758.55DHwmra048291@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 67f18e8d494f - main - usr.sbin: Gate bhyve/bhyvectl on MK_BHYVE for riscv List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 67f18e8d494f0a1f30663074d738ca8acdd9a3a2 Auto-Submitted: auto-generated The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=67f18e8d494f0a1f30663074d738ca8acdd9a3a2 commit 67f18e8d494f0a1f30663074d738ca8acdd9a3a2 Author: Jessica Clarke AuthorDate: 2025-06-13 17:56:51 +0000 Commit: Jessica Clarke CommitDate: 2025-06-13 17:56:51 +0000 usr.sbin: Gate bhyve/bhyvectl on MK_BHYVE for riscv When this is false there is no libvmmapi, nor even its headers, for these to build against. Reported by: Milan Obuch Fixes: 7ab1a32cd43c ("bhyve/riscv: Initial import.") --- usr.sbin/Makefile.riscv | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr.sbin/Makefile.riscv b/usr.sbin/Makefile.riscv index a8897983059c..97a83e863f5d 100644 --- a/usr.sbin/Makefile.riscv +++ b/usr.sbin/Makefile.riscv @@ -1,2 +1,4 @@ +.if ${MK_BHYVE} != "no" SUBDIR+= bhyve SUBDIR+= bhyvectl +.endif From nobody Fri Jun 13 18:12:37 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJnYf1xTZz5xp68; Fri, 13 Jun 2025 18:12:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJnYd73zxz3tsw; Fri, 13 Jun 2025 18:12:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749838358; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0w9OlA3sjGKrhNOKn2qiACr1dE7oFFIV83B7duXK81M=; b=gCQwEvd93dt3S8shoQWIBOPZ/VGfacHQI6E2litgmbCQWpoACQIjRX3356Y3EWMLbtA+tD U0xl0Z8NQbLsdJpK63DP4Dm/Czu4BY+yUAdOxOtDiOKM7fdG6+fd/lJ+D8iekRxqf7DNOv gBr6WBCVqCsCS17a7aiH1mmj25c50IVZ9aJo5ITrLlcZiNJJr6JkTJLF0byve58lVRSQn1 fQoUjpsAkc8OEOJ63YJU5OT9z07nbBrYFtb10B3tLe8JwCbgQak5oesrMIH3E8t97jfKXD reySs5/AcvT1WQtb/rNdSw4MJSsngymoDhZMcostoMS/Qq5+xmXTl1mq1Z4jHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749838358; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0w9OlA3sjGKrhNOKn2qiACr1dE7oFFIV83B7duXK81M=; b=aWN62dMVtLrFidY90Y3QrIXwxwsDNLbn1/+k3IAzVgmYD8vPZAljl/5+gPvwZxxTFe/PW3 sF+hEvCZwF7KEiNOAZM5WZubSn+9aFcz7hpKdIFVZUngjUKz/vRnzR5yGhvsnuAsxeotNn rVVuY/uhPssyxLu1k95BjLcUcR7f2fuz6TTTS9gOB7MM8qnbB8bngJ+6Xcw0EntBqdZvC4 4Jg+6d0kp0ycCarqy2PJVfpFzsX6ODcsY77fCFY12tMyC3fb6JmGhkRu6D4XzAJ1QuRrWU +AtcjAhhS1Y7b91H90TtErNhpTRBOtcqNTs3keqLn9w8aLtY45vmQjh+dRaQ9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749838358; a=rsa-sha256; cv=none; b=v4J7Ohi9F8oIi5mHM1UpLMhUO0MsofVWDLqnDOzgdEDW1r68Zdj5af2Crs0i82oWNF4M+l IbBxcuiKpxkbxdIjfzQqwyBbNSg8yG6lDQI8pWDsxJ8G0taJ848Lu5O43pABfJaYl5yzlq yTveK45NZ87JvUYv6s2dw9orDkkcbWr9X/d7UgdLrYr/Iwdai0oFiKmeEviT2CRhgYS3wr 7PWbCp16+DsBllVKklDCKbOpbvt2j2gbpXq2OLYiNF4YaWS2VINf+D/qOq4VFVwhyan7TN eA/8qKdhoz2pskPa2dlp7hgQmg32ImTuphbarFqr3JL1D5z4KZ8prxuOK0ZYlg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJnYd6ZxMz16Jt; Fri, 13 Jun 2025 18:12:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55DICbT1084258; Fri, 13 Jun 2025 18:12:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55DICb28084255; Fri, 13 Jun 2025 18:12:37 GMT (envelope-from git) Date: Fri, 13 Jun 2025 18:12:37 GMT Message-Id: <202506131812.55DICb28084255@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: 7747d826573a - main - mac_do(4): Bump .Dd to reflect latest update List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7747d826573a38e6caa06619f5596b792dc5a976 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=7747d826573a38e6caa06619f5596b792dc5a976 commit 7747d826573a38e6caa06619f5596b792dc5a976 Author: Olivier Certner AuthorDate: 2025-06-13 18:06:24 +0000 Commit: Olivier Certner CommitDate: 2025-06-13 18:12:06 +0000 mac_do(4): Bump .Dd to reflect latest update MFC with: 94828b338033 ("mac_do(4): Examples: Fix some descriptions and a typo") Sponsored by: The FreeBSD Foundation --- share/man/man4/mac_do.4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man4/mac_do.4 b/share/man/man4/mac_do.4 index f64eae600436..fb165dfe5a1a 100644 --- a/share/man/man4/mac_do.4 +++ b/share/man/man4/mac_do.4 @@ -8,7 +8,7 @@ .\" at Kumacom SARL under sponsorship from the FreeBSD .\" Foundation. .\" -.Dd December 19, 2024 +.Dd June 11, 2025 .Dt MAC_DO 4 .Os .Sh NAME From nobody Fri Jun 13 18:24:16 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJnq43BCTz50vPY; Fri, 13 Jun 2025 18:24:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJnq424Jnz3wMw; Fri, 13 Jun 2025 18:24:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749839056; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2m8MZZ7e4KXDfJAancU4X31B71Aqbz/5ce+icMkLdpQ=; b=vLAVKHaD9QIR5ZYFk0N3hWOdXdO2AuLW1oFBYtI0RdCTw/qeca5xsmdGKBpY/Q5+3xcKzC ukW20wkGF26epcXkyQFLlk4bMfXaDgINq2tv8x5PSgH1vk7wEgRmGxnFxHJaDKh/Y6b1Gd //FC1P8lNxAl7eFlqFAywRTYmsmGf/TleksGjDe7QdwXOgfdPUw+AlHFiX3cuCGTPyVm3N IycFo8551LjxSJHYnxlOvxHFRg5Vs6u5Ic/qVSsd8W42/sLFLGJHv8XkyFp7DPvp+2CIvx CeRALume4YQVvswc1xGeqcsFcN1rn/0eKrwXM6F9Exh2MVke8AgU8ybEjg2CAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749839056; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2m8MZZ7e4KXDfJAancU4X31B71Aqbz/5ce+icMkLdpQ=; b=cZerHqU14GpUBxwNhDuo24vFn/PTJPaE7yQVRIUfulfHfv5Ln9kqy/DX7hcfSJb8/E7IvV xEMarHfFXMrkwgmyx9Os1AT0ZqtwfLwpSth5nCruF8BE1aXSR/M6WFDqGR1qy6RNrRAZR7 Xu4KuB4dwxhwI1rqX/PRDiaf0ByPjvzYrFig5m9A81Y4fV20rwv+DVUsHFaV6Me6bd6crf qLktV2+KtKJXhTprFRk7BP+/Jh9YgDsdzGWtpBOZLm6oPmpBEqQ08wKeGXKcwy9+5OFMjN uHbj7FLIYEfmRbc98/Wy5suv1Qp0uRNjItDLnGzPWXk8psdnvN3hYo6Y60w+xA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749839056; a=rsa-sha256; cv=none; b=TI9pZZMo6XCpWbJskTSrEtQoKx26KYQbkwb6cZPWQzCGK43KArdV8slR8U+BL4aAqkeAaS PDKbhJezkD2V+nW+GE3999s5NwcVB3QiUNBF/K6sRsd/5/R+q2X+XNZiKAAEL9tRSwLK3a FEoxxP/2wWe5FwdWVpGSTt6yvJ/PsWoN7Y4q8eEJ79YJTYZmJNnXxwcewwy8GSTAzVSywh 09Er4ibC4pnf8+zUuFDVIFR9l7fq/+rUAFlg0+EZRHHpVqn7xMoM1i4h31inOEsmkch5w3 Ytwa8Nl7RxRrXOK1/cxS6K3cL2WDlYYN9+mxV8CN9ZLAj+GLKbWM2UEqFcvyJQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJnq41N0Mz17qJ; Fri, 13 Jun 2025 18:24:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55DIOG75004148; Fri, 13 Jun 2025 18:24:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55DIOGon004145; Fri, 13 Jun 2025 18:24:16 GMT (envelope-from git) Date: Fri, 13 Jun 2025 18:24:16 GMT Message-Id: <202506131824.55DIOGon004145@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Cox Subject: git: 330b17e1cf5c - main - vm: remove pa_index from the machine-independent layer List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 330b17e1cf5c2e259f99ad6ac21eda6bd92a0836 Auto-Submitted: auto-generated The branch main has been updated by alc: URL: https://cgit.FreeBSD.org/src/commit/?id=330b17e1cf5c2e259f99ad6ac21eda6bd92a0836 commit 330b17e1cf5c2e259f99ad6ac21eda6bd92a0836 Author: Alan Cox AuthorDate: 2025-06-12 20:12:36 +0000 Commit: Alan Cox CommitDate: 2025-06-13 18:23:28 +0000 vm: remove pa_index from the machine-independent layer After the demise of vm_page_lock(), the only remaining uses of pa_index() are in various pmap implementations. In many cases, e.g., amd64, the pmap implementations already provided their own definitions, often identical to the machine-independent one. For those that didn't provide one, this change adds it. Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D50823 --- sys/amd64/amd64/pmap.c | 1 - sys/powerpc/aim/mmu_oea64.c | 5 ++++- sys/riscv/riscv/pmap.c | 3 ++- sys/vm/vm_page.h | 8 -------- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 4ad1335329da..2962f2823596 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -342,7 +342,6 @@ safe_to_clear_referenced(pmap_t pmap, pt_entry_t pte) #define PV_STAT(x) do { } while (0) #endif -#undef pa_index #ifdef NUMA #define pa_index(pa) ({ \ KASSERT((pa) <= vm_phys_segs[vm_phys_nsegs - 1].end, \ diff --git a/sys/powerpc/aim/mmu_oea64.c b/sys/powerpc/aim/mmu_oea64.c index 40dd232f47c1..79cea408bb5f 100644 --- a/sys/powerpc/aim/mmu_oea64.c +++ b/sys/powerpc/aim/mmu_oea64.c @@ -125,6 +125,9 @@ uintptr_t moea64_get_unique_vsid(void); #define PV_LOCK_COUNT MAXCPU static struct mtx_padalign pv_lock[PV_LOCK_COUNT]; +#define PV_LOCK_SHIFT 21 +#define pa_index(pa) ((pa) >> PV_LOCK_SHIFT) + /* * Cheap NUMA-izing of the pv locks, to reduce contention across domains. * NUMA domains on POWER9 appear to be indexed as sparse memory spaces, with the @@ -145,7 +148,7 @@ static struct mtx_padalign pv_lock[PV_LOCK_COUNT]; /* Superpage PV lock */ -#define PV_LOCK_SIZE (1<> L1_SHIFT)) #define pmap_l2_pindex(v) ((v) >> L2_SHIFT) +#define pa_index(pa) ((pa) >> L2_SHIFT) #define pa_to_pvh(pa) (&pv_table[pa_index(pa)]) #define NPV_LIST_LOCKS MAXCPU #define PHYS_TO_PV_LIST_LOCK(pa) \ - (&pv_list_locks[pmap_l2_pindex(pa) % NPV_LIST_LOCKS]) + (&pv_list_locks[pa_index(pa) % NPV_LIST_LOCKS]) #define CHANGE_PV_LIST_LOCK_TO_PHYS(lockp, pa) do { \ struct rwlock **_lockp = (lockp); \ diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h index 062cf00b5b33..ba3f88864661 100644 --- a/sys/vm/vm_page.h +++ b/sys/vm/vm_page.h @@ -336,14 +336,6 @@ SLIST_HEAD(spglist, vm_page); extern vm_page_t bogus_page; #endif /* _KERNEL */ -#if defined(__arm__) -#define PDRSHIFT PDR_SHIFT -#elif !defined(PDRSHIFT) -#define PDRSHIFT 21 -#endif - -#define pa_index(pa) ((pa) >> PDRSHIFT) - /* * The vm_page's aflags are updated using atomic operations. To set or clear * these flags, the functions vm_page_aflag_set() and vm_page_aflag_clear() From nobody Fri Jun 13 18:29:53 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJnxY4R1Cz50vfL; Fri, 13 Jun 2025 18:29:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJnxY3bvzz3wdf; Fri, 13 Jun 2025 18:29:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749839393; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1TJOJAoy6HL0W6w49M0RXtKnGFmJIGVd1+0Hc7SyLrE=; b=oYKdHXBK/2+CCbyRc9I6/FgjlB8N+Yky8I4Wv3sr6lEwUSajA7CbBXW9yT9KYpA6ax82O6 f7Wh7+pmlZY6kX5nLzUdAe2CbnnqHX4TjLLo2f52thnIoXyzKdk9EmTg+Ek0IUejPFrvlN r0/cAuXBylxbCUYWakgLVmSpAEu6iKNjCXF4M53y/KCpzYaeetmgHhDV89fDLqbUzpX7fE 3hJ/8wCZpMxeomvbStrasTUv8OgVRyKqy74pzYLUXV33IH5vfp4rDmPnIFs5ibtV2HtLsB Rpf1QYz+t5gecpObFJRGmqLbrd8xRy23XVR2IUKuW04UcQnTYwqBbQvzV4dEdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749839393; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1TJOJAoy6HL0W6w49M0RXtKnGFmJIGVd1+0Hc7SyLrE=; b=GtQnNcVRAvGMkxfeSBekBHX2ADaMruJnxeYsHfy4Y3kmpX/YnOr6wF3yYxEkUewb2IGMKG ymZ/vZvLZCD8vNenqDxT38BsYiPFkg1tVLZlkEHk8Eqnw60FiX2IDAo0ZMQYiDYuDlL8u6 +h5fBmhEUXeZIYdEuIo9YtY3Entxw0Qp5ln8E3B9uI/IDavYr89kPfO2eNFjCB5nzooZWP CNwYaK+x0VFHHyNQjO2wuzEjEuyTy/weyod7qjvPADqAeAqf7PKpjZThqYjoxAorgGWmx3 4OJQtgJfg5KEszx45EcqNs2aPFIbO+3s/0ePTU0tlsFgIxsoD6aS7sep2+D5mQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749839393; a=rsa-sha256; cv=none; b=NB1HagF+MM4rEj6YZF6jrD5VpeMXG4ruRw4mQpdaoZz9gMdH0LAMDjPK0YOyWG9iaO/RCu xT3VRNSAuxVtmc+bX3LTAMJrVTi0D2I7VnnNy4db3nPTfLYvzpPN9vM5P0IvhZhpGws7Qh 1KMG7At4KhIkLFxyPOwm/31fELgdxtI4d+SQpcG5nSHEGJDiTUnJtFhAkUSuCmyVEhH0Nx fYoa1amWc81fv8XJqppP2OfFBJbMlJw5MY/8g3alLI7XlUpbw2B4c4JQkAQovCbljb9vPy z9OeXyovFQTZTvdjk2J81Qyot0EzvQMw0JOFOwjzccY44AzARrgULDXxWpkQEA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJnxY2x2Tz17LM; Fri, 13 Jun 2025 18:29:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55DITrHj005852; Fri, 13 Jun 2025 18:29:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55DITrt8005849; Fri, 13 Jun 2025 18:29:53 GMT (envelope-from git) Date: Fri, 13 Jun 2025 18:29:53 GMT Message-Id: <202506131829.55DITrt8005849@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 67c5db938c87 - main - clock_gettime: Better markup List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 67c5db938c87fd3e6688070b6958da70f8a1ee90 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=67c5db938c87fd3e6688070b6958da70f8a1ee90 commit 67c5db938c87fd3e6688070b6958da70f8a1ee90 Author: Warner Losh AuthorDate: 2025-06-13 18:01:31 +0000 Commit: Warner Losh CommitDate: 2025-06-13 18:29:38 +0000 clock_gettime: Better markup Markup CLOCK_REALTIME better. Noticed by: kib Fixes: 7b7ba7857ce8 Sponsored by: Netflix --- lib/libsys/clock_gettime.2 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/libsys/clock_gettime.2 b/lib/libsys/clock_gettime.2 index c3b8fb92c9c1..89551d0f720b 100644 --- a/lib/libsys/clock_gettime.2 +++ b/lib/libsys/clock_gettime.2 @@ -102,7 +102,9 @@ Returns the execution time of the calling thread. .It Dv CLOCK_TAI Increments in SI seconds like a wall clock. It uses a 1970 epoch and implements the TAI timescale. -Similar to CLOCK_REALTIME, but without leap seconds. +Similar to +.Dv CLOCK_REALTIME , +but without leap seconds. It will increase monotonically during a leap second. Will return .Er EINVAL From nobody Fri Jun 13 18:54:48 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJpVJ6Hc0z50xGj; Fri, 13 Jun 2025 18:54:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJpVJ5Yr9z3yp1; Fri, 13 Jun 2025 18:54:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749840888; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iJk8DWpw889Cey5gVeEp6LqjjxoqCTibcn5j4eKzQWM=; b=ohKXV7Kw4luQI2VR1+5Xta3ANFysX/LdN5FiD9fyVVo8TOeE70C3pfWIWrvU9Qq7npD6Wf CtHZRhjXEN7AUGj3wyAdLUfqKDGOYjy+jqHDHk/vm3V665pz6lVjQj6ZUSxP0kc5aOYrJd dzDL3yPEvYONk1vhGDIqkscUR5RBUK7bddBkOgRl64hDut8UnegCWrcPUd3Mb6czdRu4AL C2yX/wgJ/+YwrQSZyk6mXrfJ1X1kfYF+52bCJ7ZKhM2DBLHEa1Frshd+78Ned4XYSDN2pH t3jBvZpSzgHThbC3N6QqXvSV1yz27qgbCz8uTA37+4rx+efgpGnhIxxUm9m5vQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749840888; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iJk8DWpw889Cey5gVeEp6LqjjxoqCTibcn5j4eKzQWM=; b=cB4C5jRfE6TXlXxChmxbvTYg4w8R4tIxz9SrvAYuBTu+dvwVMwu/GtvR1Og7Npedpq11Fd 3PmEdDm0VcoRKL/ozD9c0QL3aTyWvpw4Whm68udYDVWFkT825vlxMqntDD0M1hjvlBB0DP UCP1/iejihGVEsdP+88hENhUSnMfl4jeJfn6dSdmdg6+UWIOXNXTL6RBra7V8x2xiUIqAy bibDUQ/PNWRgPtK9FFqlyFdv+1CcEL4iS8RD/MGcvZqpPi3SNm+kOZgvGs9DDkHbrXpuL4 P2IuP/ggUd1PfwPv6VlA5BxFP8TFRx6av505NukfWi+YMVJH0wMDwS1QSMNbQQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749840888; a=rsa-sha256; cv=none; b=RqE713/eIwBguPGVwoDU1dhjlFE56VAlE+NNTqzYDE/vXWYnq/MIURG3gy+g215oNFlCTs CohuMQfi9eMrQYK3K220rvRkcAdEFcC7jtuIj770eHrs7PcwjDwa2u++tGw7tVHaFgI02j i2oxBvo3W+MU6JX9+7mfoapwicFfbxBB+p7kpPgo45l2SDAwdmRqFn5+1qL/G7ogR/wKFC P6byAnY5f3kkGI0UZ8JHiTL65cBs+T/zYcc7KzdLg0NBAeG4LHsmK6mfBKvIfjMcGa0fHO v/3Pq70128sh0e4NsHAqEiI3v1ZfQYWlTbDxDpAPvDAYeyr0CEACi4GAldYSYg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJpVJ4tHMz18nw; Fri, 13 Jun 2025 18:54:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55DIsmb7059737; Fri, 13 Jun 2025 18:54:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55DIsm67059734; Fri, 13 Jun 2025 18:54:48 GMT (envelope-from git) Date: Fri, 13 Jun 2025 18:54:48 GMT Message-Id: <202506131854.55DIsm67059734@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 71702df61262 - main - gve: Add support for 4k RX Buffers when using DQO queue formats List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 71702df6126226b31dc3ec66459388e32b993be1 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=71702df6126226b31dc3ec66459388e32b993be1 commit 71702df6126226b31dc3ec66459388e32b993be1 Author: Vee Agarwal AuthorDate: 2025-06-13 17:52:25 +0000 Commit: Mark Johnston CommitDate: 2025-06-13 18:53:51 +0000 gve: Add support for 4k RX Buffers when using DQO queue formats This change adds support for using 4K RX Buffers when using DQO queue formats when a boot-time tunable flag is set to true by the user. When this flag is enabled, the driver will use 4K RX Buffer size either when HW LRO is enabled or mtu > 2048. Signed-off-by: Vee Agarwal Reviewed by: markj, ziaee MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D50786 --- share/man/man4/gve.4 | 8 ++++++++ sys/dev/gve/gve.h | 20 ++++++++++++++++++++ sys/dev/gve/gve_adminq.c | 5 ++++- sys/dev/gve/gve_dqo.h | 8 ++++++-- sys/dev/gve/gve_main.c | 30 +++++++++++++++++++++++++++--- sys/dev/gve/gve_rx_dqo.c | 26 +++++++++++++++----------- sys/dev/gve/gve_sysctl.c | 4 ++++ 7 files changed, 84 insertions(+), 17 deletions(-) diff --git a/share/man/man4/gve.4 b/share/man/man4/gve.4 index 924a01a06d08..c5627e929044 100644 --- a/share/man/man4/gve.4 +++ b/share/man/man4/gve.4 @@ -230,6 +230,14 @@ The default value is 0, which means hardware LRO is enabled by default. The software LRO stack in the kernel is always used. This sysctl variable needs to be set before loading the driver, using .Xr loader.conf 5 . +.It Va hw.gve.allow_4k_rx_buffers +Setting this boot-time tunable to 1 enables support for 4K RX Buffers. +The default value is 0, which means 2K RX Buffers will be used. +4K RX Buffers are only supported on DQO_RDA and DQO_QPL queue formats. +When enabled, 4K RX Buffers will be used either when HW LRO is enabled +or mtu is greated than 2048. +This sysctl variable needs to be set before loading the driver, using +.Xr loader.conf 5 . .It Va dev.gve.X.num_rx_queues and dev.gve.X.num_tx_queues Run-time tunables that represent the number of currently used RX/TX queues. The default value is the max number of RX/TX queues the device can support. diff --git a/sys/dev/gve/gve.h b/sys/dev/gve/gve.h index 48e9a371df21..dd432dc0eb45 100644 --- a/sys/dev/gve/gve.h +++ b/sys/dev/gve/gve.h @@ -65,6 +65,7 @@ #define ADMINQ_SIZE PAGE_SIZE #define GVE_DEFAULT_RX_BUFFER_SIZE 2048 +#define GVE_4K_RX_BUFFER_SIZE_DQO 4096 /* Each RX bounce buffer page can fit two packet buffers. */ #define GVE_DEFAULT_RX_BUFFER_OFFSET (PAGE_SIZE / 2) @@ -84,6 +85,11 @@ static MALLOC_DEFINE(M_GVE, "gve", "gve allocations"); +_Static_assert(MCLBYTES == GVE_DEFAULT_RX_BUFFER_SIZE, + "gve: bad MCLBYTES length"); +_Static_assert(MJUMPAGESIZE >= GVE_4K_RX_BUFFER_SIZE_DQO, + "gve: bad MJUMPAGESIZE length"); + struct gve_dma_handle { bus_addr_t bus_addr; void *cpu_addr; @@ -633,6 +639,7 @@ struct gve_priv { /* The index of tx queue that the timer service will check on its next invocation */ uint16_t check_tx_queue_idx; + uint16_t rx_buf_size_dqo; }; static inline bool @@ -666,6 +673,18 @@ gve_is_qpl(struct gve_priv *priv) priv->queue_format == GVE_DQO_QPL_FORMAT); } +static inline bool +gve_is_4k_rx_buf(struct gve_priv *priv) +{ + return (priv->rx_buf_size_dqo == GVE_4K_RX_BUFFER_SIZE_DQO); +} + +static inline bus_size_t +gve_rx_dqo_mbuf_segment_size(struct gve_priv *priv) +{ + return (gve_is_4k_rx_buf(priv) ? MJUMPAGESIZE : MCLBYTES); +} + /* Defined in gve_main.c */ void gve_schedule_reset(struct gve_priv *priv); int gve_adjust_tx_queues(struct gve_priv *priv, uint16_t new_queue_cnt); @@ -746,6 +765,7 @@ bool gve_timestamp_valid(int64_t *timestamp_sec); /* Systcl functions defined in gve_sysctl.c */ extern bool gve_disable_hw_lro; +extern bool gve_allow_4k_rx_buffers; extern char gve_queue_format[8]; extern char gve_version[8]; void gve_setup_sysctl(struct gve_priv *priv); diff --git a/sys/dev/gve/gve_adminq.c b/sys/dev/gve/gve_adminq.c index 3415d2fa4b60..9b59570a2af4 100644 --- a/sys/dev/gve/gve_adminq.c +++ b/sys/dev/gve/gve_adminq.c @@ -296,7 +296,6 @@ gve_adminq_create_rx_queue(struct gve_priv *priv, uint32_t queue_index) .ntfy_id = htobe32(rx->com.ntfy_id), .queue_resources_addr = htobe64(qres_dma->bus_addr), .rx_ring_size = htobe16(priv->rx_desc_cnt), - .packet_buffer_size = htobe16(GVE_DEFAULT_RX_BUFFER_SIZE), }; if (gve_is_gqi(priv)) { @@ -308,6 +307,8 @@ gve_adminq_create_rx_queue(struct gve_priv *priv, uint32_t queue_index) htobe32(queue_index); cmd.create_rx_queue.queue_page_list_id = htobe32((rx->com.qpl)->id); + cmd.create_rx_queue.packet_buffer_size = + htobe16(GVE_DEFAULT_RX_BUFFER_SIZE); } else { cmd.create_rx_queue.queue_page_list_id = htobe32(GVE_RAW_ADDRESSING_QPL_ID); @@ -320,6 +321,8 @@ gve_adminq_create_rx_queue(struct gve_priv *priv, uint32_t queue_index) cmd.create_rx_queue.enable_rsc = !!((if_getcapenable(priv->ifp) & IFCAP_LRO) && !gve_disable_hw_lro); + cmd.create_rx_queue.packet_buffer_size = + htobe16(priv->rx_buf_size_dqo); } return (gve_adminq_execute_cmd(priv, &cmd)); diff --git a/sys/dev/gve/gve_dqo.h b/sys/dev/gve/gve_dqo.h index 212bfa1a6ad3..542f8ff7d888 100644 --- a/sys/dev/gve/gve_dqo.h +++ b/sys/dev/gve/gve_dqo.h @@ -59,8 +59,6 @@ */ #define GVE_RX_DQO_MIN_PENDING_BUFS 128 -#define GVE_DQ_NUM_FRAGS_IN_PAGE (PAGE_SIZE / GVE_DEFAULT_RX_BUFFER_SIZE) - /* * gve_rx_qpl_buf_id_dqo's 11 bit wide buf_id field limits the total * number of pages per QPL to 2048. @@ -330,4 +328,10 @@ struct gve_rx_compl_desc_dqo { _Static_assert(sizeof(struct gve_rx_compl_desc_dqo) == 32, "gve: bad dqo desc struct length"); + +static inline uint8_t +gve_get_dq_num_frags_in_page(struct gve_priv *priv) +{ + return (PAGE_SIZE / priv->rx_buf_size_dqo); +} #endif /* _GVE_DESC_DQO_H_ */ diff --git a/sys/dev/gve/gve_main.c b/sys/dev/gve/gve_main.c index 2abd9d1aa698..10197a8e15f8 100644 --- a/sys/dev/gve/gve_main.c +++ b/sys/dev/gve/gve_main.c @@ -35,7 +35,7 @@ #define GVE_DRIVER_VERSION "GVE-FBSD-1.3.4\n" #define GVE_VERSION_MAJOR 1 #define GVE_VERSION_MINOR 3 -#define GVE_VERSION_SUB 4 +#define GVE_VERSION_SUB 5 #define GVE_DEFAULT_RX_COPYBREAK 256 @@ -382,12 +382,27 @@ gve_adjust_ring_sizes(struct gve_priv *priv, uint16_t new_desc_cnt, bool is_rx) return (0); } +static int +gve_get_dqo_rx_buf_size(struct gve_priv *priv, uint16_t mtu) +{ + /* + * Use 4k buffers only if mode is DQ, 4k buffers flag is on, + * and either hw LRO is enabled or mtu is greater than 2048 + */ + if (!gve_is_gqi(priv) && gve_allow_4k_rx_buffers && + (!gve_disable_hw_lro || mtu > GVE_DEFAULT_RX_BUFFER_SIZE)) + return (GVE_4K_RX_BUFFER_SIZE_DQO); + + return (GVE_DEFAULT_RX_BUFFER_SIZE); +} + static int gve_set_mtu(if_t ifp, uint32_t new_mtu) { struct gve_priv *priv = if_getsoftc(ifp); const uint32_t max_problem_range = 8227; const uint32_t min_problem_range = 7822; + uint16_t new_rx_buf_size = gve_get_dqo_rx_buf_size(priv, new_mtu); int err; if ((new_mtu > priv->max_mtu) || (new_mtu < ETHERMIN)) { @@ -402,9 +417,10 @@ gve_set_mtu(if_t ifp, uint32_t new_mtu) * in throughput. */ if (!gve_is_gqi(priv) && !gve_disable_hw_lro && - new_mtu >= min_problem_range && new_mtu <= max_problem_range) { + new_mtu >= min_problem_range && new_mtu <= max_problem_range && + new_rx_buf_size != GVE_4K_RX_BUFFER_SIZE_DQO) { device_printf(priv->dev, - "Cannot set to MTU to %d within the range [%d, %d] while hardware LRO is enabled\n", + "Cannot set to MTU to %d within the range [%d, %d] while HW LRO is enabled and not using 4k RX Buffers\n", new_mtu, min_problem_range, max_problem_range); return (EINVAL); } @@ -414,6 +430,13 @@ gve_set_mtu(if_t ifp, uint32_t new_mtu) if (bootverbose) device_printf(priv->dev, "MTU set to %d\n", new_mtu); if_setmtu(ifp, new_mtu); + /* Need to re-alloc RX queues if RX buffer size changed */ + if (!gve_is_gqi(priv) && + new_rx_buf_size != priv->rx_buf_size_dqo) { + gve_free_rx_rings(priv, 0, priv->rx_cfg.num_queues); + priv->rx_buf_size_dqo = new_rx_buf_size; + gve_alloc_rx_rings(priv, 0, priv->rx_cfg.num_queues); + } } else { device_printf(priv->dev, "Failed to set MTU to %d\n", new_mtu); } @@ -1064,6 +1087,7 @@ gve_attach(device_t dev) if (err != 0) goto abort; + priv->rx_buf_size_dqo = gve_get_dqo_rx_buf_size(priv, priv->max_mtu); err = gve_alloc_rings(priv); if (err != 0) goto abort; diff --git a/sys/dev/gve/gve_rx_dqo.c b/sys/dev/gve/gve_rx_dqo.c index 11b2c7ea0c55..cf914913da09 100644 --- a/sys/dev/gve/gve_rx_dqo.c +++ b/sys/dev/gve/gve_rx_dqo.c @@ -140,15 +140,17 @@ gve_rx_alloc_ring_dqo(struct gve_priv *priv, int i) return (0); } + bus_size_t max_seg_size = gve_rx_dqo_mbuf_segment_size(priv); + err = bus_dma_tag_create( bus_get_dma_tag(priv->dev), /* parent */ 1, 0, /* alignment, bounds */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - MCLBYTES, /* maxsize */ + max_seg_size, /* maxsize */ 1, /* nsegments */ - MCLBYTES, /* maxsegsize */ + max_seg_size, /* maxsegsize */ 0, /* flags */ NULL, /* lockfunc */ NULL, /* lockarg */ @@ -317,7 +319,8 @@ gve_rx_post_new_mbuf_dqo(struct gve_rx_ring *rx, int how) } SLIST_REMOVE_HEAD(&rx->dqo.free_bufs, slist_entry); - buf->mbuf = m_getcl(how, MT_DATA, M_PKTHDR); + bus_size_t segment_size = gve_rx_dqo_mbuf_segment_size(rx->com.priv); + buf->mbuf = m_getjcl(how, MT_DATA, M_PKTHDR, segment_size); if (__predict_false(!buf->mbuf)) { err = ENOMEM; counter_enter(); @@ -325,7 +328,7 @@ gve_rx_post_new_mbuf_dqo(struct gve_rx_ring *rx, int how) counter_exit(); goto abort_with_buf; } - buf->mbuf->m_len = MCLBYTES; + buf->mbuf->m_len = segment_size; err = bus_dmamap_load_mbuf_sg(rx->dqo.buf_dmatag, buf->dmamap, buf->mbuf, segs, &nsegs, BUS_DMA_NOWAIT); @@ -371,7 +374,7 @@ gve_rx_post_qpl_buf_dqo(struct gve_rx_ring *rx, struct gve_rx_buf_dqo *buf, bus_dmamap_sync(page_dma_handle->tag, page_dma_handle->map, BUS_DMASYNC_PREREAD); desc->buf_addr = htole64(page_dma_handle->bus_addr + - frag_num * GVE_DEFAULT_RX_BUFFER_SIZE); + frag_num * rx->com.priv->rx_buf_size_dqo); buf->num_nic_frags++; gve_rx_advance_head_dqo(rx); @@ -430,7 +433,7 @@ gve_rx_post_new_dqo_qpl_buf(struct gve_rx_ring *rx) } gve_rx_post_qpl_buf_dqo(rx, buf, buf->next_idx); - if (buf->next_idx == GVE_DQ_NUM_FRAGS_IN_PAGE - 1) + if (buf->next_idx == gve_get_dq_num_frags_in_page(rx->com.priv) - 1) buf->next_idx = 0; else buf->next_idx++; @@ -742,7 +745,7 @@ gve_get_cpu_addr_for_qpl_buf(struct gve_rx_ring *rx, int page_idx = buf - rx->dqo.bufs; void *va = rx->com.qpl->dmas[page_idx].cpu_addr; - va = (char *)va + (buf_frag_num * GVE_DEFAULT_RX_BUFFER_SIZE); + va = (char *)va + (buf_frag_num * rx->com.priv->rx_buf_size_dqo); return (va); } @@ -753,15 +756,16 @@ gve_rx_add_clmbuf_to_ctx(struct gve_rx_ring *rx, { void *va = gve_get_cpu_addr_for_qpl_buf(rx, buf, buf_frag_num); struct mbuf *mbuf; + bus_size_t segment_size = gve_rx_dqo_mbuf_segment_size(rx->com.priv); if (ctx->mbuf_tail == NULL) { - mbuf = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); + mbuf = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, segment_size); if (mbuf == NULL) return (ENOMEM); ctx->mbuf_head = mbuf; ctx->mbuf_tail = mbuf; } else { - mbuf = m_getcl(M_NOWAIT, MT_DATA, 0); + mbuf = m_getjcl(M_NOWAIT, MT_DATA, 0, segment_size); if (mbuf == NULL) return (ENOMEM); ctx->mbuf_tail->m_next = mbuf; @@ -809,7 +813,7 @@ gve_rx_add_extmbuf_to_ctx(struct gve_rx_ring *rx, page_idx = buf - rx->dqo.bufs; page = rx->com.qpl->pages[page_idx]; page_addr = rx->com.qpl->dmas[page_idx].cpu_addr; - va = (char *)page_addr + (buf_frag_num * GVE_DEFAULT_RX_BUFFER_SIZE); + va = (char *)page_addr + (buf_frag_num * rx->com.priv->rx_buf_size_dqo); /* * Grab an extra ref to the page so that gve_mextadd_free @@ -855,7 +859,7 @@ gve_rx_dqo_qpl(struct gve_priv *priv, struct gve_rx_ring *rx, } buf = &rx->dqo.bufs[buf_id]; if (__predict_false(buf->num_nic_frags == 0 || - buf_frag_num > GVE_DQ_NUM_FRAGS_IN_PAGE - 1)) { + buf_frag_num > gve_get_dq_num_frags_in_page(priv) - 1)) { device_printf(priv->dev, "Spurious compl for buf id %d on rxq %d " "with buf_frag_num %d and num_nic_frags %d, issuing reset\n", buf_id, rx->com.id, buf_frag_num, buf->num_nic_frags); diff --git a/sys/dev/gve/gve_sysctl.c b/sys/dev/gve/gve_sysctl.c index 661f61918853..a3874cc921ee 100644 --- a/sys/dev/gve/gve_sysctl.c +++ b/sys/dev/gve/gve_sysctl.c @@ -37,6 +37,10 @@ bool gve_disable_hw_lro = false; SYSCTL_BOOL(_hw_gve, OID_AUTO, disable_hw_lro, CTLFLAG_RDTUN, &gve_disable_hw_lro, 0, "Controls if hardware LRO is used"); +bool gve_allow_4k_rx_buffers = false; +SYSCTL_BOOL(_hw_gve, OID_AUTO, allow_4k_rx_buffers, CTLFLAG_RDTUN, + &gve_allow_4k_rx_buffers, 0, "Controls if 4K RX Buffers are allowed"); + char gve_queue_format[8]; SYSCTL_STRING(_hw_gve, OID_AUTO, queue_format, CTLFLAG_RD, &gve_queue_format, 0, "Queue format being used by the iface"); From nobody Fri Jun 13 19:13:32 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJpvx02YSz50ylG; Fri, 13 Jun 2025 19:13:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJpvw5yvJz422K; Fri, 13 Jun 2025 19:13:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749842012; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Zr2+5dOpFngYxqCTGGp2C0kqwmr6Svm75LcWr5SrjYc=; b=tBesbDSTYrntyreiXsGOh3HDHjXnFtKpSaxTFmPddosgAJfhr5zZ8vd9yaYWj902EnZhUN RptOcrP0XOX8ptjyLde/Vwr1Fo/i0SvQZV/YSvHpvDl6LBIU8TVWYka7rH7y5e4/J9U556 XBaWGlan/Ib7IIWDtzKgCYDT6IQ7WYngkI+knjsVLFjVQMLsGgolaCaC8uv4d3n/dtFWSy tzn5499YF+sAqDlUH1KwTqNf11kOBG0bb9VienJaaqon6WiX1plXQtL/tGvcspNoRE1RFo 4JapB2IPB4+Y+w+1kGn433171h2BHos5aBqX5omJVNwUHO4fldihLGiWg6i7uQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749842012; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Zr2+5dOpFngYxqCTGGp2C0kqwmr6Svm75LcWr5SrjYc=; b=OjoxlKLJ7nN88v9nKRBhdSgoZUV2Jd1YQ9Z2f5DPQZIvrys/NbgmzBIGa0TFkFvkG7PiV4 xkdSEI3rjNsS0VWUhp+nRTmc/3fEwuMnK3spZENXL1mSzGmnuV44inAIiSGA5WNFZhITG7 XBkOKii16QxrvUzdJPh2Bfkao49huTM4m/ffz7ERh6ZtvxzKflj9rdLCvCZJWVRSFT50Br jNlU3yj4qNBrOWlQoG/pu6zZ/ONtrTrbZwT3YCKNJwMtz33DvJ+TGs3jcx407uVOlQokdR N7FxU5WdHpArF/PqbgRJwvND72YNi9Q2Taunx04cem79V3ms455oxVSOViV2lQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749842012; a=rsa-sha256; cv=none; b=goQWImeYLwRi7bSiM8cFJVhR7GWPSKZ+vuljskQg+yeukTQ8AAmyZGkTF0W1CEkM11sOcM IIBiiQJbH0XsmmdUKXx3+Hsf36o5BvC6I7cDwsm8hC6nBToOfw61bDtUUw56rZsl+LQfgK hWKvvY4BIFsjHRgHm6Y00tKEAheOPwj3gqgaqLfDMc8YV3V7kaz+lbyZZ/qZIEa2OHFdjR YXP0kME/nDDVJXBG/1WNTL6wPdrKBPSEAx5ySZ9OWZkbSfyiRaWFeS6gr7VckOwJ01v2Zv ZoZRyLs3RhviMWIrgapUu0QpQxocMrjuFpzqfT8O4MAc68yhgsljrLFbyaszzg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJpvw5VKRz19K2; Fri, 13 Jun 2025 19:13:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55DJDWVU097378; Fri, 13 Jun 2025 19:13:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55DJDWaO097375; Fri, 13 Jun 2025 19:13:32 GMT (envelope-from git) Date: Fri, 13 Jun 2025 19:13:32 GMT Message-Id: <202506131913.55DJDWaO097375@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: 54d2737e7fe4 - main - bectl: Use SPDX only license List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 54d2737e7fe48226c908dcccfbda2ca1c08e07fc Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=54d2737e7fe48226c908dcccfbda2ca1c08e07fc commit 54d2737e7fe48226c908dcccfbda2ca1c08e07fc Author: Alexander Ziaee AuthorDate: 2025-02-19 19:44:57 +0000 Commit: Alexander Ziaee CommitDate: 2025-06-13 19:09:22 +0000 bectl: Use SPDX only license bectl.8 had a truncated license without the required disclaimer. Correct it consistently by converting all bectl licenses to SPDX form. Approved by: kevans Approved by: Kyle Kneitinger Approved by: Wes Maag Approved by: mhorne (mentor, implicit) Differential Revision: https://reviews.freebsd.org/D49066 --- lib/libbe/be.c | 25 ++----------------------- lib/libbe/be.h | 25 ++----------------------- lib/libbe/be_access.c | 25 ++----------------------- lib/libbe/be_error.c | 25 ++----------------------- lib/libbe/be_impl.h | 25 ++----------------------- lib/libbe/be_info.c | 25 ++----------------------- sbin/bectl/bectl.8 | 12 +----------- sbin/bectl/bectl.c | 25 ++----------------------- sbin/bectl/bectl.h | 25 ++----------------------- sbin/bectl/bectl_jail.c | 25 ++----------------------- sbin/bectl/bectl_list.c | 25 ++----------------------- sbin/bectl/tests/bectl_test.sh | 23 +---------------------- 12 files changed, 22 insertions(+), 263 deletions(-) diff --git a/lib/libbe/be.c b/lib/libbe/be.c index e0ced1c5bcfc..613235d5e908 100644 --- a/lib/libbe/be.c +++ b/lib/libbe/be.c @@ -1,28 +1,7 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * +/* * Copyright (c) 2017 Kyle J. Kneitinger * - * 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 REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * SPDX-License-Identifier: BSD-2-Clause */ #include diff --git a/lib/libbe/be.h b/lib/libbe/be.h index 0e4486fbb6d2..01ee94fd03ca 100644 --- a/lib/libbe/be.h +++ b/lib/libbe/be.h @@ -1,28 +1,7 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * +/* * Copyright (c) 2017 Kyle J. Kneitinger * - * 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 REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * SPDX-License-Identifier: BSD-2-Clause */ #ifndef _LIBBE_H diff --git a/lib/libbe/be_access.c b/lib/libbe/be_access.c index 44e7eb1e651c..a7eb6b703cda 100644 --- a/lib/libbe/be_access.c +++ b/lib/libbe/be_access.c @@ -1,30 +1,9 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * +/* * Copyright (c) 2017 Kyle J. Kneitinger * Copyright (c) 2018 Kyle Evans * Copyright (c) 2019 Wes Maag * - * 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 REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * SPDX-License-Identifier: BSD-2-Clause */ #include diff --git a/lib/libbe/be_error.c b/lib/libbe/be_error.c index f515fe136f12..bb1e1ed88c5d 100644 --- a/lib/libbe/be_error.c +++ b/lib/libbe/be_error.c @@ -1,28 +1,7 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * +/* * Copyright (c) 2017 Kyle J. Kneitinger * - * 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 REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * SPDX-License-Identifier: BSD-2-Clause */ #include diff --git a/lib/libbe/be_impl.h b/lib/libbe/be_impl.h index 0327f8abaa0a..11d1e0ddca28 100644 --- a/lib/libbe/be_impl.h +++ b/lib/libbe/be_impl.h @@ -1,28 +1,7 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * +/* * Copyright (c) 2017 Kyle J. Kneitinger * - * 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 REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * SPDX-License-Identifier: BSD-2-Clause */ #ifndef _LIBBE_IMPL_H diff --git a/lib/libbe/be_info.c b/lib/libbe/be_info.c index 509b56cb8cf5..4b0f611ce421 100644 --- a/lib/libbe/be_info.c +++ b/lib/libbe/be_info.c @@ -1,29 +1,8 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * +/* * Copyright (c) 2017 Kyle J. Kneitinger * Copyright (c) 2018 Kyle Evans * - * 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 REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * SPDX-License-Identifier: BSD-2-Clause */ #include diff --git a/sbin/bectl/bectl.8 b/sbin/bectl/bectl.8 index 3014576cad4c..cc88c7019d13 100644 --- a/sbin/bectl/bectl.8 +++ b/sbin/bectl/bectl.8 @@ -1,17 +1,7 @@ .\" -.\" SPDX-License-Identifier: BSD-2-Clause -.\" .\" Copyright (c) 2017 Kyle J. Kneitinger .\" -.\" 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. -.\" +.\" SPDX-License-Identifier: BSD-2-Clause .\" .Dd April 9, 2024 .Dt BECTL 8 diff --git a/sbin/bectl/bectl.c b/sbin/bectl/bectl.c index f4359750a8d7..2ed365f93ad3 100644 --- a/sbin/bectl/bectl.c +++ b/sbin/bectl/bectl.c @@ -1,28 +1,7 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * +/* * Copyright (c) 2017 Kyle J. Kneitinger * - * 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 REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * SPDX-License-Identifier: BSD-2-Clause */ #include diff --git a/sbin/bectl/bectl.h b/sbin/bectl/bectl.h index b8b824b18010..355110bcd6d3 100644 --- a/sbin/bectl/bectl.h +++ b/sbin/bectl/bectl.h @@ -1,28 +1,7 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * +/* * Copyright (c) 2018 Kyle Evans * - * 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 ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * SPDX-License-Identifier: BSD-2-Clause */ int usage(bool explicit); diff --git a/sbin/bectl/bectl_jail.c b/sbin/bectl/bectl_jail.c index fa063962dada..050d46b627b4 100644 --- a/sbin/bectl/bectl_jail.c +++ b/sbin/bectl/bectl_jail.c @@ -1,28 +1,7 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * +/* * Copyright (c) 2018 Kyle Evans * - * 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 ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * SPDX-License-Identifier: BSD-2-Clause */ #include diff --git a/sbin/bectl/bectl_list.c b/sbin/bectl/bectl_list.c index c158aa9b1600..bd724b7bf012 100644 --- a/sbin/bectl/bectl_list.c +++ b/sbin/bectl/bectl_list.c @@ -1,28 +1,7 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause - * +/* * Copyright (c) 2018 Kyle Evans * - * 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 ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * SPDX-License-Identifier: BSD-2-Clause */ #include diff --git a/sbin/bectl/tests/bectl_test.sh b/sbin/bectl/tests/bectl_test.sh index 00c71e11de09..8084b0a173f4 100755 --- a/sbin/bectl/tests/bectl_test.sh +++ b/sbin/bectl/tests/bectl_test.sh @@ -1,28 +1,7 @@ # -# SPDX-License-Identifier: BSD-2-Clause -# # Copyright (c) 2018 Kyle Evans # -# 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. +# SPDX-License-Identifier: BSD-2-Clause # ZPOOL_NAME_FILE=zpool_name From nobody Fri Jun 13 19:20:14 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJq3f5xzfz51045; Fri, 13 Jun 2025 19:20:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJq3f52kZz42q5; Fri, 13 Jun 2025 19:20:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749842414; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J2FbB8BPiZ6E1atbOFGSppV4+Wjd4ynBH4k6swxr9rU=; b=yPlqfpXHWilg6S35rqozY+RxByo6G5W3k2J8suuxQnQhyFeaVMZqw3LfKyBckUaOiWJRn3 orDUHMfuTdT3B1EJhDN9/U1+4aml6hwAdG6fwzb3KFsvLMvGsY9N0zikfL0V4WyhRQzpxM z/Rgr1uhIizglwVt5xAjGwi2QA7gg+t9oV8onHyoPU5Ngw/cjlYQrtNeRuVKiAeQnrehpf fSZ3SWE3NXdRTqyQHbcMIK8hjgx9uD21tZity6dYfjJdLqKjIWvl/drFldWWCT7xdNTFe7 66cYQH2br6V+v9qoQXtRaIz8Ahhgz1J5O8fJD4pqcBmnf0KnOuE6/CcV30ZF5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749842414; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J2FbB8BPiZ6E1atbOFGSppV4+Wjd4ynBH4k6swxr9rU=; b=dGi6guYOmBzGhJUUWsmMhda+pIrpmVv/lEeyreLJkDG8C+1ay5rXI9XGJctPrbSKSftgk2 ENl7GQBGJeZhiAYmr9AgY7cGKoxghbQ7bU+UawarNGgf4ixuT6SeGLLb3vP/jKJbvqna2g WzhuhxXwaqGrqoQnU7tvqu2CryugQTDJRsKMMdRwlvNvZiefjXFpFBrXRVtKW3jirtyYBa WV+dtquZtTRrl3kqyL1sRFYwk1pa5VpG9TnO/zcso+xKCdjMiMa8GIX7wKBbMvNiVtwqYw a6YccKPoXFyvmBdS3nK2S3BlSSmiMgwkUjb0ws8Ms4khk6NjCaKmJ+K7Bj06EQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749842414; a=rsa-sha256; cv=none; b=X9a/pKjvoQqWTISIHeqTtULI7ywf2cLfZoPfaLfGz/o1d/VRx+5sheGU9tAfRhm4Myn/zh HNm0W5lW7ZJtolBa7WmJhNih74m+LHRjtbbJZ5P9WcJBeP5g3eVfith0fs5qfBsCEQ6uJp MPwtQL9/Z+40lZLt1/XGhSvX2XG3+h6kGjjMFSodz8CFCq+R+j0IgSZC5ExdiOdLc+ds5D CcfqVQU14C86b4YPNIdwBFcIhb+qXPL3BF6o13KWTS5UO2Y2As2QntdFz+K6lz2w1f5L7s QmTp3QIFIAzwpasaUUFjwLxBAtKQDB8n2BUH3H2ZVtZavVdY/jVhrVGLUNnIoQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJq3f49X7z19GG; Fri, 13 Jun 2025 19:20:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55DJKE50006187; Fri, 13 Jun 2025 19:20:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55DJKEGT006179; Fri, 13 Jun 2025 19:20:14 GMT (envelope-from git) Date: Fri, 13 Jun 2025 19:20:14 GMT Message-Id: <202506131920.55DJKEGT006179@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 48a656c588f9 - main - linux: Fix usage of ptrace(PT_GET_SC_ARGS) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 48a656c588f9fb995b9c524b57dd5febd9f69168 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=48a656c588f9fb995b9c524b57dd5febd9f69168 commit 48a656c588f9fb995b9c524b57dd5febd9f69168 Author: Mark Johnston AuthorDate: 2025-06-13 19:03:03 +0000 Commit: Mark Johnston CommitDate: 2025-06-13 19:19:59 +0000 linux: Fix usage of ptrace(PT_GET_SC_ARGS) The native handler expects the argument to be a pointer to an array of 8 syscall arguments, whereas the emulation provided an array that holds up to 6. Handle this by adding a new range of Linuxulator-specific ptrace commands. In particular, introduce PTLINUX_GET_SC_ARGS, which always copies exactly six arguments. This fixes the problem and removes the hack of checking the target thread ABI to decide whether to apply a Linux-specific quirk to PT_GET_SC_ARGS. Reviewed by: kib MFC after: 2 weeks Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D50758 --- sys/compat/freebsd32/freebsd32_misc.c | 3 +++ sys/compat/linux/linux_ptrace.c | 18 ++++-------------- sys/kern/sys_process.c | 27 +++++++++++++++++++++------ sys/sys/ptrace.h | 8 ++++++++ 4 files changed, 36 insertions(+), 20 deletions(-) diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c index cc777f2bf830..75fdb1f544ca 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -1177,6 +1177,9 @@ freebsd32_ptrace(struct thread *td, struct freebsd32_ptrace_args *uap) pscr_args[i] = pscr_args32[i]; r.sr.pscr_args = pscr_args; break; + case PTLINUX_FIRST ... PTLINUX_LAST: + error = EINVAL; + break; default: addr = uap->addr; break; diff --git a/sys/compat/linux/linux_ptrace.c b/sys/compat/linux/linux_ptrace.c index 421760eab2a9..0dbfd2177122 100644 --- a/sys/compat/linux/linux_ptrace.c +++ b/sys/compat/linux/linux_ptrace.c @@ -386,21 +386,11 @@ linux_ptrace_get_syscall_info(struct thread *td, pid_t pid, if (lwpinfo.pl_flags & PL_FLAG_SCE) { si.op = LINUX_PTRACE_SYSCALL_INFO_ENTRY; si.entry.nr = lwpinfo.pl_syscall_code; - /* - * The use of PT_GET_SC_ARGS there is special, - * implementation of PT_GET_SC_ARGS for Linux-ABI - * callers emulates Linux bug which strace(1) depends - * on: at initialization it tests whether ptrace works - * by calling close(2), or some other single-argument - * syscall, _with six arguments_, and then verifies - * whether it can fetch them all using this API; - * otherwise it bails out. - */ - error = kern_ptrace(td, PT_GET_SC_ARGS, pid, - &si.entry.args, sizeof(si.entry.args)); + error = kern_ptrace(td, PTLINUX_GET_SC_ARGS, pid, + si.entry.args, sizeof(si.entry.args)); if (error != 0) { - linux_msg(td, "PT_GET_SC_ARGS failed with error %d", - error); + linux_msg(td, + "PT_LINUX_GET_SC_ARGS failed with error %d", error); return (error); } } else if (lwpinfo.pl_flags & PL_FLAG_SCX) { diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index 8b382cb3048e..821c537065b3 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -690,6 +690,9 @@ sys_ptrace(struct thread *td, struct ptrace_args *uap) break; r.sr.pscr_args = pscr_args; break; + case PTLINUX_FIRST ... PTLINUX_LAST: + error = EINVAL; + break; default: addr = uap->addr; break; @@ -1166,7 +1169,9 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) break; case PT_GET_SC_ARGS: - CTR1(KTR_PTRACE, "PT_GET_SC_ARGS: pid %d", p->p_pid); + case PTLINUX_GET_SC_ARGS: + CTR2(KTR_PTRACE, "%s: pid %d", req == PT_GET_SC_ARGS ? + "PT_GET_SC_ARGS" : "PT_LINUX_GET_SC_ARGS", p->p_pid); if (((td2->td_dbgflags & (TDB_SCE | TDB_SCX)) == 0 && td2->td_sa.code == 0) #ifdef COMPAT_FREEBSD32 @@ -1176,11 +1181,21 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) error = EINVAL; break; } - bzero(addr, sizeof(td2->td_sa.args)); - /* See the explanation in linux_ptrace_get_syscall_info(). */ - bcopy(td2->td_sa.args, addr, SV_PROC_ABI(td->td_proc) == - SV_ABI_LINUX ? sizeof(td2->td_sa.args) : - td2->td_sa.callp->sy_narg * sizeof(syscallarg_t)); + if (req == PT_GET_SC_ARGS) { + bzero(addr, sizeof(td2->td_sa.args)); + bcopy(td2->td_sa.args, addr, td2->td_sa.callp->sy_narg * + sizeof(syscallarg_t)); + } else { + /* + * Emulate a Linux bug which which strace(1) depends on: + * at initialization it tests whether ptrace works by + * calling close(2), or some other single-argument + * syscall, _with six arguments_, and then verifies + * whether it can fetch them all using this API; + * otherwise it bails out. + */ + bcopy(td2->td_sa.args, addr, 6 * sizeof(syscallarg_t)); + } break; case PT_GET_SC_RET: diff --git a/sys/sys/ptrace.h b/sys/sys/ptrace.h index 3a7b87bfc85f..13291cd31cf5 100644 --- a/sys/sys/ptrace.h +++ b/sys/sys/ptrace.h @@ -87,8 +87,16 @@ #define PT_SC_REMOTE 44 /* Execute a syscall */ #define PT_FIRSTMACH 64 /* for machine-specific requests */ +#define PT_LASTMACH 127 #include /* machine-specific requests, if any */ +#ifdef _KERNEL +/* Space for Linux ptrace emulation. */ +#define PTLINUX_FIRST 128 +#define PTLINUX_LAST 191 +#define PTLINUX_GET_SC_ARGS (PTLINUX_FIRST + 0) +#endif + /* Events used with PT_GET_EVENT_MASK and PT_SET_EVENT_MASK */ #define PTRACE_EXEC 0x0001 #define PTRACE_SCE 0x0002 From nobody Fri Jun 13 19:20:15 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJq3g6B4Gz510HJ; Fri, 13 Jun 2025 19:20:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJq3g4SnTz42sT; Fri, 13 Jun 2025 19:20:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749842415; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zysqLbJc95nn4gCpzTnL7ICPitnycC5ADF6m8stlGj0=; b=E/Re4+9vcySSQqQtrZJX3jzsWUIN7kfXGf4kcj7owMxCqnnzsJZnuXKe8R8zpnd+pwX9na MSDg/ZyNPLjpn6e/iIFAzxbHZg/mnWchTnF/3tdu2zQk+cb+7pEZylAJ5l7d70uNMWf0tY hEIj0b07kQii13w2CliWoI9D050apHONOQwieobxlef0jAMh06gfUi++pJKaQsaxO06Ypo Oi4dNro9FK0Swp4vDjvNJtPuK93EfL+Xe+uXSjzFVwHMZtQtETBpTSFyZup/xOsakFx3q0 FO81+5M9cQAubFJT2+lcNCz/61EHOBggPzndRXm1hbFHRYgaLjIcOukPySTWJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749842415; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zysqLbJc95nn4gCpzTnL7ICPitnycC5ADF6m8stlGj0=; b=dSyMKZmU0ue7dw9tGBl3Lv8b7xO2SqXMn2IBs8Ltgkt8uirfveVKlXYVXjBweXDcPqzsX2 Ga6oFwgo03D+PBE2qb7MN5MSEW1vhMbeQanUg/3XuhUL3yvPSJ0X8Upm7HiJ7EcS5xhSJc CU/PUmHltxPV2lsdLNH99zOCAQbq5UOJy8zeXyB1QiPuEudvrU2Fi+sInduS8+bm9JAFQX FkgxSAoXJNDsi4lnX1rsi719qKYOwV+m4Rnvux0MxvK86cfaZRV6R2cC6yzc9dNAIOGJ4O o1DhzBUGsvTvYXHw3f7nCcB1D4OawgkNdxAn/YZSTIgEbqxN+zaYt6dFxCEc9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749842415; a=rsa-sha256; cv=none; b=Woc6FDu1puRyzTGZAMnzHLFA+3gc22dD2r3E3V9ja4hgukITdZw0/IFkC+BEgLr9g0bvDT oc7ej5p3TmYL4rh12w5WB4UL+OhE9In4Qq3mnTHbBBdEflLmaVi6Ip9aB6GxMe7ggBCwyv 4zJP+NJsqfcM6Kzwdmx4wccqqAUAdnN9OOjSmQIo8jSHvFslUWsiWdD0arnDmqVZrAw6oV 3jBfbqPU8ov+kyL3kgk1xr67+U64l+M88Qb1xzeVSiZpqof51avDDxPOG1kq48LKbXOUSr aipp/q4cmaIGhioBjak2dPFmho5CgmIuccf9r/cejaQTr5AsozemVWPucHmP+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 4bJq3g3vqcz19GH; Fri, 13 Jun 2025 19:20:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55DJKFOG006884; Fri, 13 Jun 2025 19:20:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55DJKFLD006877; Fri, 13 Jun 2025 19:20:15 GMT (envelope-from git) Date: Fri, 13 Jun 2025 19:20:15 GMT Message-Id: <202506131920.55DJKFLD006877@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 5defdd5342c3 - main - p9fs: Call VN_LOCK_ASHARE on new vnodes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5defdd5342c392880e3917ba0873fb49ddafc4c6 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5defdd5342c392880e3917ba0873fb49ddafc4c6 commit 5defdd5342c392880e3917ba0873fb49ddafc4c6 Author: Mark Johnston AuthorDate: 2025-06-13 19:08:09 +0000 Commit: Mark Johnston CommitDate: 2025-06-13 19:19:59 +0000 p9fs: Call VN_LOCK_ASHARE on new vnodes We set MNTK_LOOKUP_SHARED on p9fs mounts, but disable shared locking of vnodes (i.e., LK_SHARED requests are automatically translated to LK_EXCLUSIVE. Reviewed by: kib Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D50759 --- sys/fs/p9fs/p9fs_vfsops.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/fs/p9fs/p9fs_vfsops.c b/sys/fs/p9fs/p9fs_vfsops.c index f674c866ce9d..3451bc052187 100644 --- a/sys/fs/p9fs/p9fs_vfsops.c +++ b/sys/fs/p9fs/p9fs_vfsops.c @@ -345,6 +345,8 @@ p9fs_vget_common(struct mount *mp, struct p9fs_node *np, int flags, P9FS_SET_LINKS(inode); lockmgr(vp->v_vnlock, LK_EXCLUSIVE, NULL); + if (vp->v_type != VFIFO) + VN_LOCK_ASHARE(vp); error = insmntque(vp, mp); if (error != 0) { /* From nobody Fri Jun 13 19:21:06 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJq4f5Bmwz510FR; Fri, 13 Jun 2025 19:21:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJq4f4jRgz43Q8; Fri, 13 Jun 2025 19:21:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749842466; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YHKsoxqckt/FIQycNcSXGEXp1SRWLsjRIRhZh4A4toI=; b=bRisuPUags8+93zXnKwcA2a2YdDn5dIjkL4GWYuvQPm4qUs0IeHiZHz58iDmz5ZTlFNknc OrohRlxLsVV2kkU9Rhgop2DpRUwid0kCAQ25FD44kPyLQQELeTfgLactPLTzIZExAPIrFi ECl0CaNq20rMjbNbraxaNhhwQfaaAFxIbycRnJo0HcBYhHhD0Cye+bZu+i9+V1ngj2qqq8 ec56+OaPSEx6MVjGPWhI6STLuhlTvh8TMQeslWNdlnscvScHzL8xXKI+oCEDn2EOoGV+j/ 8vxMSAHYo/q2xFUjipgjvkU/15t3JjrHFsocI80KyEVJ2CWUkDel/RnkhpZmrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749842466; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YHKsoxqckt/FIQycNcSXGEXp1SRWLsjRIRhZh4A4toI=; b=Z//vFR47eGatOuWJ1XEzut7isdptyIX+MpkZWRaeyzy5yQGQkkJXmZXIKcREdxiUX/CCZm NCLQiPah+Yc+T0NrS5m8aKvc53StQBfHATGou6CwTsJQdjb7Grto78PBUhDBZAT8QvjPi2 4B+P9lVfQSz60KrftPXi3a/5AGig4BBVtIe+pxw39ayCnbEuAWmdoUoJCQD9UhhclI3rVT 4KLUXv/Uxo+h9uPv7UMNeo7iFCPQ+c9L9dp8cgf0HFpEF0LZ98fnl6z6n8+TiVE0x56sTV uFqxIY0VmurQIAoPVnMqZIp3n7R100uJ7l+JVYRmwa0oDaH+HSBn0uCyegkI/g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749842466; a=rsa-sha256; cv=none; b=pjmY4kXs8BWHjLrRpNmWsxv2hbn/uzxCa4QUpHaJ6KoNOIu69n4h8p1c4oYD8Ws4Y1Ng2N ImWd6BM4QUk8OEeUz8NPooceCfd3jnP12jPfBY6AvdW1TQQqbkh6IVXtGn9rP+2uqjuZTe pgK7VvX90f3YtbBDnRPcnNp82YI9u+7PE4KrFJOtfUz45gEeH3OurLX7Ez2jdhSrfeQB5H ky97Vo0y28wQ3MzPPjB171jNkTdu8HMHAYbSwUGto07tOSLvhJSojnGggzIMQDPd/cgxHO aW3s5sS43HXemfI8SsucW5drf+FtELuR2ZGGMcPAVsaSdWf3GFJmFCdaa92fYA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJq4f4DNyz197h; Fri, 13 Jun 2025 19:21:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55DJL6WH013423; Fri, 13 Jun 2025 19:21:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55DJL69Y013420; Fri, 13 Jun 2025 19:21:06 GMT (envelope-from git) Date: Fri, 13 Jun 2025 19:21:06 GMT Message-Id: <202506131921.55DJL69Y013420@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 9eb6cafe377e - main - src.conf.5: Update MALLOC_PRODUCTION diag options List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9eb6cafe377e11d4fe8cbeb22f3cd64909a44ce9 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=9eb6cafe377e11d4fe8cbeb22f3cd64909a44ce9 commit 9eb6cafe377e11d4fe8cbeb22f3cd64909a44ce9 Author: Ed Maste AuthorDate: 2025-06-13 14:35:38 +0000 Commit: Ed Maste CommitDate: 2025-06-13 19:20:59 +0000 src.conf.5: Update MALLOC_PRODUCTION diag options PR: 287502 Reviewed by: kbowling, ziaee Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50834 --- share/man/man5/src.conf.5 | 9 +++++++-- tools/build/options/WITHOUT_MALLOC_PRODUCTION | 7 ++++++- tools/build/options/WITH_MALLOC_PRODUCTION | 7 ++++++- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index 3afc79516366..81bdb54c0f62 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1,5 +1,5 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. -.Dd June 6, 2025 +.Dd June 13, 2025 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1191,7 +1191,12 @@ for more details. .It Va WITH_MALLOC_PRODUCTION Disable assertions and statistics gathering in .Xr malloc 3 . -It also defaults the A and J runtime options to off. +The run-time options +.Dv opt.abort , +.Dv opt.abort_conf , +and +.Dv opt.junk +also default to false. .It Va WITHOUT_MAN Do not build manual pages. When set, these options are also in effect: diff --git a/tools/build/options/WITHOUT_MALLOC_PRODUCTION b/tools/build/options/WITHOUT_MALLOC_PRODUCTION index 57b8ab574f93..90efc200fd54 100644 --- a/tools/build/options/WITHOUT_MALLOC_PRODUCTION +++ b/tools/build/options/WITHOUT_MALLOC_PRODUCTION @@ -1,3 +1,8 @@ Enable assertions and statistics gathering in .Xr malloc 3 . -It also defaults the A and J runtime options to on. +The run-time options +.Dv opt.abort , +.Dv opt.abort_conf , +and +.Dv opt.junk +also default to true. diff --git a/tools/build/options/WITH_MALLOC_PRODUCTION b/tools/build/options/WITH_MALLOC_PRODUCTION index 1a214ff805be..ac267bdc48a6 100644 --- a/tools/build/options/WITH_MALLOC_PRODUCTION +++ b/tools/build/options/WITH_MALLOC_PRODUCTION @@ -1,3 +1,8 @@ Disable assertions and statistics gathering in .Xr malloc 3 . -It also defaults the A and J runtime options to off. +The run-time options +.Dv opt.abort , +.Dv opt.abort_conf , +and +.Dv opt.junk +also default to false. From nobody Fri Jun 13 19:21:28 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJq543Psbz510LJ; Fri, 13 Jun 2025 19:21:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJq5420Yjz43lY; Fri, 13 Jun 2025 19:21:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749842488; h=from:from:reply-to:subject:subject: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+yXDN+ZIPP9gTNFD/AqKo4a30JuoIFxLgguMOx2Xvg=; b=LVdUakWiXOpCkWTWW6S4J5WlZQtcyvZXfKFsPevZpjU+fluy3jOclRntOud6Z7PLwCHX+Y 3cOzboNLxZLURgDjXlXeOmFVHUsFwsZKGVke77ez3xi44ZiNl6Nct12OL62QzOyVhEdwRj NsuTS2ZQQd6kmeTzRXSQiYAV1aiofDOpE6T5Rv3AYvS9pxJaGr6UyZQOGBZ08wjqweN5ts Yj6MOjaV/kCEZJjqbWRfwqA5yU4M/rVaKg6+ALEqpbT3Z8mUaQ/bNGJxbA1XohsF7C5nFC 0ay5MMs/slVCMw7tDN9XBDLhod2xorqLTPJB2d3PwvseP8CdktsLwtlhoc7Mvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749842488; h=from:from:reply-to:subject:subject: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+yXDN+ZIPP9gTNFD/AqKo4a30JuoIFxLgguMOx2Xvg=; b=P3OYqoLW31QsX1erznNU0O4g4UyxMjYdpmbxlyYNHOaK0VCe6PHfBon8MyeCqvFSvfYYED 0v/kvclPxyCJPaDf6Ytxi8UQP55FD/ZJCm7oL1a2B5eebyVMvW3XMEwJ6lx/pUkRHb4Dmg budPnFCIVfg0FXLpzoL158nIWtDYI/ZA3RHMxdMkICu4yIZWcN2yUMBZvSJO1WKCjWmgKl /jB2DLlDEOQcsCpqq/LJvQkU7vmoKqKU6ySFQ+m5u+iVZJabyF8DFQUI3CFCvdpTBfIzYW sseF4tT+EiaIVQPG2958Cfb2SYUonWsZPOVT60NL6VwBf7EY7iwx8HLvgNhWYw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749842488; a=rsa-sha256; cv=none; b=VBOPt39ilUOo1YGit7abcw+VygLbpZ4zkvTfmIwL1djk6LiAPCA4SeaFcGAkWnXMxzt36o +ZCsAO0vyb/AMTP8kwefu81yfs5dIVP35MqXEI3DX0HNY8sGEjASqM7dZ79G72jY+SkDeN SSwhQ69DsjG8QllTiKdzSs/p+sUeinARBzoPUTH4pSKyWyccEQTNx4qTT/1IiBj58cc81P KSFtrQVKgdmZzfKuS9bO4xlc40DjtsVPs6xlTigIcCZtiBCy0Q3yPEdtca//Gtgtiknr7Q 7NcbbgIhbs9p5Gk1i7Xxu7zwtaJKNGisiu4rBWSejlP3vyk2CfpMME3iCs2+Cw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJq541bD7z193K; Fri, 13 Jun 2025 19:21:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55DJLS11013641; Fri, 13 Jun 2025 19:21:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55DJLSDb013638; Fri, 13 Jun 2025 19:21:28 GMT (envelope-from git) Date: Fri, 13 Jun 2025 19:21:28 GMT Message-Id: <202506131921.55DJLSDb013638@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: 7b34c48e036e - main - snd_hda.4: Improve HARDWARE for HW Relnotes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7b34c48e036e209321174100ab9d7fef19b4932a Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=7b34c48e036e209321174100ab9d7fef19b4932a commit 7b34c48e036e209321174100ab9d7fef19b4932a Author: Alexander Ziaee AuthorDate: 2025-01-17 14:31:04 +0000 Commit: Alexander Ziaee CommitDate: 2025-06-13 19:21:24 +0000 snd_hda.4: Improve HARDWARE for HW Relnotes Rewrite the HARDWARE section to improve the hardware release notes. Move the section to achieve the structure in mdoc(7). Tag SPDX. MFC after: 3 days Discussed with: mav Reviewed by: christos Approved by: mhorne (mentor, implicit) Differential Revision: https://reviews.freebsd.org/D48503 --- share/man/man4/snd_hda.4 | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/share/man/man4/snd_hda.4 b/share/man/man4/snd_hda.4 index 45ad2ee132ca..93bac0e5b3b9 100644 --- a/share/man/man4/snd_hda.4 +++ b/share/man/man4/snd_hda.4 @@ -1,3 +1,6 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2006-2008 Joel Dahl .\" Copyright (c) 2008 Alexander Motin .\" All rights reserved. @@ -23,7 +26,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 16, 2019 +.Dd January 20, 2025 .Dt SND_HDA 4 .Os .Sh NAME @@ -384,6 +387,15 @@ Run-time equivalent of the .Va hint.pcm.%d.rec.autosrc tunable. .El +.Sh HARDWARE +The +.Nm +driver supports PCI class 04h +.Pq multimedia , +subclass 03h +.Pq HDA +audio controllers and codecs compatible with the +Intel High Definition Audio 1.0 specification. .Sh EXAMPLES Taking HP Compaq DX2300 with Realtek ALC888 HDA codec for example. This system has two audio connectors on a front side, three audio connectors @@ -583,17 +595,6 @@ other random inputs Controls have different precision. Some could be just an on/off triggers. Most of controls use logarithmic scale. -.Sh HARDWARE -The -.Nm -driver supports controllers having PCI class 4 (multimedia) and -subclass 3 (HDA), compatible with Intel HDA specification. -.Pp -The -.Nm -driver supports more than two hundred different controllers and CODECs. -There is no sense to list all of them here, as in most cases specific CODEC -configuration and wiring are more important then type of the CODEC itself. .Sh SEE ALSO .Xr snd_ich 4 , .Xr sound 4 , From nobody Fri Jun 13 19:27:56 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJqDX3VkBz510f5; Fri, 13 Jun 2025 19:27:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJqDX2JSzz44Zg; Fri, 13 Jun 2025 19:27:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749842876; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y3kPvJ8E5t/LORnEO8+AydxWzcc1t1SMvB0u7Cwh/gc=; b=TEbXKt5Ics9Otl5/UXRMObgVtf2NlsO1V6yhei3J4mFbMFBavzFy1xNXWTXNqueZfUWu5R FbYw605ogDA4mA3ev7VF64HdaT8IjuHhAmMg2iqgpbv/qaaA+kkJgw4nnBwbRXB4bmUTBp Taw6zWUHBr7zrSBxcAuZESHgODd/HQQKdTVA3fHfIeypnroy+Jyh7jH5e8/xD3Occ3JJJV ZMee2bBW6sEzIiivYQZ5huT19UMyXy4wcZMpZ78miN/yDWeCEPzbLSkdZKESLdyMQS731E z63wmZkdEAsDZJ/27HtZ4nvEDqgMA6Ph5+w78BiagpOI2FjCDiK2cuzvU0Kzzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749842876; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y3kPvJ8E5t/LORnEO8+AydxWzcc1t1SMvB0u7Cwh/gc=; b=euYsnm7jKs7vySs0tGDR2w0oUb35xe4OvJn8OpktMqFIEiQze69v4xhhSWgNCx1DknJ5oW YPLv1/UkkqAe/nvlZqPXzUjIQVKlX+6iD3LggabzwvVBKPck0bkmn28xRcUGJxWlpZxu6X jzUaeI4WGzGyLlzH9++yEzpCU+PM87lfWyqS+Q7GqVb0ZwOW1kestTDMty7QpkNHnLXtX6 rbouZaYrRSmx3vSCuFy0LGrkDYaswy/fRcLdPivzJ26rcRS5J3Fao7vTAq2DDJsES3ZY8L G+P/wnHAW/Nn7nzKFfRc+w3djwYE1WpQKOkWLAmhNovBkizFE8V2V86527rKUQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749842876; a=rsa-sha256; cv=none; b=LUPQeYhgvD0AnjG2k29BQM3ZDyT7wRPj3L8ytzKtWQFu0W9FNPA2xW7gHSegpd+LozvFPo brMaafcM96ezoBInKIgCjdzjPBXDkIdzRoK78gT+z+xvh9bSkBGvE/kF+T+gZZ04sIUyje yX5d6XBc+yG4n2NzDYi13V12Y5d4+kAw4MDXcdxB68U4sziJKNQa0AhjWwZaJMlWg5dOI+ 3iK8dMOJ0NN+B3fVU1gDk+e0V2UkJWL7q9a7xBNgq5R0fFjqxs4tkvCjC45VDxar3tCVXB 9EM7MWjB6IQ/3CZRbIZY+U5+RkDHOhJgpSmrE8ZLZ5VNpbxwCODvbXGR80J61Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJqDX1bqlz19JM; Fri, 13 Jun 2025 19:27:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55DJRuVP018241; Fri, 13 Jun 2025 19:27:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55DJRux0018238; Fri, 13 Jun 2025 19:27:56 GMT (envelope-from git) Date: Fri, 13 Jun 2025 19:27:56 GMT Message-Id: <202506131927.55DJRux0018238@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: 3fd42db26c3d - main - ctfconvert.1: Minor cleanup List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3fd42db26c3dd0882cf69c54850a59e79b027e33 Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=3fd42db26c3dd0882cf69c54850a59e79b027e33 commit 3fd42db26c3dd0882cf69c54850a59e79b027e33 Author: Alexander Ziaee AuthorDate: 2025-04-18 00:41:29 +0000 Commit: Alexander Ziaee CommitDate: 2025-06-13 19:24:12 +0000 ctfconvert.1: Minor cleanup Alphabetize option table to improve first glance access. Markup semantics to differentiate them and add them to apropos. MFC after: 3 days Reviewed by: Pau Amma Approved by: mhorne (mentor, implicit) Differential Revision: https://reviews.freebsd.org/D49883 --- cddl/usr.bin/ctfconvert/ctfconvert.1 | 40 +++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/cddl/usr.bin/ctfconvert/ctfconvert.1 b/cddl/usr.bin/ctfconvert/ctfconvert.1 index 7697513d0740..8baf9895b0e1 100644 --- a/cddl/usr.bin/ctfconvert/ctfconvert.1 +++ b/cddl/usr.bin/ctfconvert/ctfconvert.1 @@ -1,4 +1,6 @@ .\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2010 The FreeBSD Foundation .\" All rights reserved. .\" @@ -31,44 +33,48 @@ .Os .Sh NAME .Nm ctfconvert -.Nd convert debug data to CTF data +.Nd convert debug data to Compact C Type Format data .Sh SYNOPSIS .Nm .Op Fl gis -.Fl l Ar label .Fl L Ar labelenv +.Fl l Ar label .Op Fl o Ar outfile object_file .Sh DESCRIPTION The .Nm -utility converts debug information from a binary file to CTF (Compact C Type -Format) data and replaces the debug section of that file with a CTF section +utility converts debug information from a binary file to CTF +.Pq Compact C Type Format +data and replaces the debug section of that file with a CTF section called SUNW_ctf. -This new section is added to the input file, unless the -o +This new section is added to the input file, unless the +.Fl o option is present. You can also opt to keep the original debugging section with the --g option. +.Fl g +option. .Pp The following options are available: -.Bl -tag -width indent -.It Fl l Ar label -Sets the label as -.Ar label . -.It Fl L Ar labelenv -Instructs -.Nm -to read the label from the environment variable -.Ar labelenv . +.Bl -tag -width "-L labelenv" .It Fl g Don't delete the original debugging section. .It Fl i Ignore object files built from other languages than C. -.It Fl s -Use the .dynsym ELF section instead of the .symtab ELF section. +.It Fl L Ar labelenv +Instructs +.Nm +to read the label from the +.Ev labelenv +environment variable. +.It Fl l Ar label +Sets the label as +.Ar label . .It Fl o Ar outfile Write the output to file in .Ar outfile . +.It Fl s +Use the .dynsym ELF section instead of the .symtab ELF section. .El .Sh EXIT STATUS .Ex -std From nobody Fri Jun 13 19:40:29 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJqW232Tkz511jP; Fri, 13 Jun 2025 19:40:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJqW127Z2z45VS; Fri, 13 Jun 2025 19:40:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749843630; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZbNWc/FC1uziSb4pxGq54IZzQd0dgaf6TtX+AJMzLnI=; b=iWoOrqKIHzgiFMMHVxT738Wnka0FrIatNK1XuUVQCQN6fK186PGOqjqh48ZiTcUQmBAU1Q y6Gh7sJCw3ho/0EtTbri5KMyam+qi7ITSBMTdYc/l/nfLwt8FOdBfReEEadSFL94+KU2PI kvk29GKiFKdRofAqTNncoeX4XzEjrqncXcmLQLboWdDYzx0iRC0LwMYtVZJxnF1lvzKUEl 8IoSonWozOvuAUmWrd1dP4IgM0pwzd58YD6DrZI0dzPwiSOpxhcRAP+b64+tCHCgOPUmfX Tw0e8sj6eOTYWCZhszSVRlCGd6ceayEWNbBerCkGMvxIVob/FytqRk3Iy1R+qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749843629; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZbNWc/FC1uziSb4pxGq54IZzQd0dgaf6TtX+AJMzLnI=; b=XXDyc/7IJqrm5e4QeFNvxcQOBZwwzAc6rddRnZmwoGbgUuO7WIhLcDiNqGacjA7JlDsp8T r+LZ3fP6KfylLd+w5iHzi3HWiUYX23cXrEDY3BpWYxsrt4b7CxL7jtYKWNAcI45WKD3VgW l7cXJeU9F8PekZlse9uLetuwc8QKGZwv/FWfID+qTZe9vEdnNSCgMWqrMKZ0ilMCSyDwZ6 jVU6/UKXzH2h7RhulmhT7UUtH3qpkgB9pWkHe3XGpQmeRhnQVGMlqXjRIHTa75hGaAsFHZ wTk2CQn5OPrsQR7wpP3RoLcCqwqX/SsLSHwE7GogB8RMG46uZy/nOeSkFlWxLw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749843629; a=rsa-sha256; cv=none; b=uNjNyGJ8tiQFMIHMcdli+haG0wjvGkCDbNFDkxS6v0rVPjFgeqR/e/T5O19ET4AUdS87JH T41W9fwkSYBg7hvCbaq43z8B4oJHjTMI03JFGoWa8Qit9PyxLY2NwxFiR+nKi7FNmhlF2v JTqtW1xNtyl+w3mH3WR0pbGOmGxprWLS9BstK5n8nz8FtM34c85Pf7LGWfLXfNoEoJardE p4yfVwRP7yRMZwmFctfhBVrQaJE8EXTJ1ABLGBsfaOFQgLnSokHX1IVsSSUCRs6iFIjkbI aG7hWvHhg7UeDGt0TlDT4DflqAwdH8Zn0P8DZ5wxt+A4KIaSwfdRlUQ8DVcEaA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJqW11gfSz19NZ; Fri, 13 Jun 2025 19:40:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55DJeTCW046743; Fri, 13 Jun 2025 19:40:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55DJeTa1046740; Fri, 13 Jun 2025 19:40:29 GMT (envelope-from git) Date: Fri, 13 Jun 2025 19:40:29 GMT Message-Id: <202506131940.55DJeTa1046740@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 4e207e3849d4 - main - exterr: make SET_ERRORX() macros an expression evaluating to the errno List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4e207e3849d47648ced17da16aad39355b99d9b2 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=4e207e3849d47648ced17da16aad39355b99d9b2 commit 4e207e3849d47648ced17da16aad39355b99d9b2 Author: Konstantin Belousov AuthorDate: 2025-06-13 17:32:50 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-13 19:39:55 +0000 exterr: make SET_ERRORX() macros an expression evaluating to the errno And move the actual td_kexterr fill code into the function, saving some text. Suggested and reviewed by: markj Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D50836 --- sys/kern/sys_generic.c | 20 ++++++++++++++++++++ sys/sys/exterrvar.h | 22 +++++++--------------- 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index ec61d0bdc541..d31ff3b939cc 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -2281,3 +2281,23 @@ sys_exterrctl(struct thread *td, struct exterrctl_args *uap) return (EINVAL); } } + +int +exterr_set(int eerror, int category, const char *mmsg, uintptr_t pp1, + uintptr_t pp2, int line) +{ + struct thread *td; + + td = curthread; + if ((td->td_pflags2 & TDP2_UEXTERR) != 0) { + td->td_pflags2 |= TDP2_EXTERR; + td->td_kexterr.error = eerror; + td->td_kexterr.cat = category; + td->td_kexterr.msg = mmsg; + td->td_kexterr.p1 = pp1; + td->td_kexterr.p2 = pp2; + td->td_kexterr.src_line = line; + ktrexterr(td); + } + return (eerror); +} diff --git a/sys/sys/exterrvar.h b/sys/sys/exterrvar.h index 4b168446e23b..d3c2c7c92d06 100644 --- a/sys/sys/exterrvar.h +++ b/sys/sys/exterrvar.h @@ -31,27 +31,19 @@ #endif #ifdef BLOAT_KERNEL_WITH_EXTERR -#define SET_ERROR_MSG(mmsg) _Td->td_kexterr.msg = mmsg +#define SET_ERROR_MSG(mmsg) (mmsg) #else -#define SET_ERROR_MSG(mmsg) _Td->td_kexterr.msg = NULL +#define SET_ERROR_MSG(mmsg) NULL #endif -#define SET_ERROR2(eerror, mmsg, pp1, pp2) do { \ - struct thread *_Td = curthread; \ - if ((_Td->td_pflags2 & TDP2_UEXTERR) != 0) { \ - _Td->td_pflags2 |= TDP2_EXTERR; \ - _Td->td_kexterr.error = eerror; \ - _Td->td_kexterr.cat = EXTERR_CATEGORY; \ - SET_ERROR_MSG(mmsg); \ - _Td->td_kexterr.p1 = (uintptr_t)pp1; \ - _Td->td_kexterr.p2 = (uintptr_t)pp2; \ - _Td->td_kexterr.src_line = __LINE__; \ - ktrexterr(_Td); \ - } \ -} while (0) +#define SET_ERROR2(eerror, mmsg, pp1, pp2) \ + exterr_set(eerror, EXTERR_CATEGORY, SET_ERROR_MSG(mmsg), \ + (uintptr_t)(pp1), (uintptr_t)(pp2), __LINE__) #define SET_ERROR0(eerror, mmsg) SET_ERROR2(eerror, mmsg, 0, 0) #define SET_ERROR1(eerror, mmsg, pp1) SET_ERROR2(eerror, mmsg, pp1, 0) +int exterr_set(int eerror, int category, const char *mmsg, uintptr_t pp1, + uintptr_t pp2, int line); int exterr_to_ue(struct thread *td, struct uexterror *ue); void ktrexterr(struct thread *td); From nobody Fri Jun 13 19:40:30 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJqW24Y0Xz511YC; Fri, 13 Jun 2025 19:40:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJqW22jFjz45Sv; Fri, 13 Jun 2025 19:40:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749843630; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9RJJAhKQ7BvZNZxgedQZXeAuKaYkDC5xm1MMDJdno3g=; b=ZG6mJtgh5RDSEaOLqQkB/I+iVQ2H9iCS5ngI4vESCGg70zEjdzBSin/qLIMWsv3jlTnZsy tDpv4l/5yRT0zv49uNsp2HhZw8yejtlTnUfVSzBjIySIyK1zdeN1fqxdrNIuJMMjIwQ5FU U6ieoC4GH1ZKb+4wj6X6asW3exDTlSfUo8fXuqSWyQGN+c3/6JFYyq5NvbMWmx4PnCQd4e GiaItFkMKK1Et2RJl4kWjBNz2RbfOrEsimvwpT9DcRaOaogBB5ygKANarhTL366zrbEUGp PuJwfC2Bd108AL1tnO/v2nCNR1x/jvM7untT/QDAWITGS6YFbzYgHzEBGmY2TQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749843630; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9RJJAhKQ7BvZNZxgedQZXeAuKaYkDC5xm1MMDJdno3g=; b=XbyI+8OHaYwsm1CuCXCAYqA/jQM/yrFXgU+Fh+T+fbqfCyT4GUZEq1nLb8aHZVbxYOZO9Z JlQeMHrdRoatfODzyJg6/NuF7+aADMgZp2IiqbH/xwiKPwxKjLVWzulOS3N/3ycAdZEhKv Nd7U8Gc4/AJMMP5z84sYXZ3AE0RB6vRSwPzX2MEf6Ni+g+5pEQq0kBPnevDqBHNUdGNHiO b5+McS8nPFd4cG/yItKn6tTeR11+LFk1KR+sRJPsHesCI6kHWVaotUn98cFQ5SxZDCSyqV KOTo5ya/ka3hgBoctDvJiGRwrV7JRiH+7Rq5A88lxECb54E91ZNXALgvuApfaw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749843630; a=rsa-sha256; cv=none; b=majgH2t19GOdB5z4sETjHLtMrYGbJ3Gd7N2yRncRk52qysLpT97FQmZ48IIb9AbfU8VBnG 2fGK+ybQH+jOdgYf0oUbSuewPx8feIqNbuizMhaL+6Y7oz9TC7c0T7AqP5D4omSA8TqCok yfk/2VFM9FpjQcMN3BQSLT7jxWuxxA2TtKPI6VSL0ycHFQXPwpDFicoLlGOP9Y3YWwM4KM nv0Dizi4NZT9pOXIz8d0vJk3rZJTrc/F0OB9/4YcQozUHC0f1eY/4Gcm9UhfZor2Adzt8D SOcFwndvxc3kQRjAzX0ga8AJ+82NKR3GRinJsQYn2OhsfqKvpSLGld+ffTueEA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJqW22JHBz19hm; Fri, 13 Jun 2025 19:40:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55DJeURZ046779; Fri, 13 Jun 2025 19:40:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55DJeUBY046776; Fri, 13 Jun 2025 19:40:30 GMT (envelope-from git) Date: Fri, 13 Jun 2025 19:40:30 GMT Message-Id: <202506131940.55DJeUBY046776@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 947bff6a04ed - main - vm/vm_mmap.c: simplify code by using the SET_ERRNOX() values List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 947bff6a04ed9f508d8fd0e5e1d8ac56d8888e80 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=947bff6a04ed9f508d8fd0e5e1d8ac56d8888e80 commit 947bff6a04ed9f508d8fd0e5e1d8ac56d8888e80 Author: Konstantin Belousov AuthorDate: 2025-06-13 17:33:49 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-13 19:39:55 +0000 vm/vm_mmap.c: simplify code by using the SET_ERRNOX() values to avoid duplicating the error values. Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D50836 --- sys/vm/vm_mmap.c | 79 +++++++++++++++++++++++--------------------------------- 1 file changed, 32 insertions(+), 47 deletions(-) diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c index 8444a8cbf021..9ba2ec426d7f 100644 --- a/sys/vm/vm_mmap.c +++ b/sys/vm/vm_mmap.c @@ -192,14 +192,12 @@ kern_mmap(struct thread *td, const struct mmap_req *mrp) check_fp_fn = mrp->mr_check_fp_fn; if ((prot & ~(_PROT_ALL | PROT_MAX(_PROT_ALL))) != 0) { - SET_ERROR0(EINVAL, "unknown PROT bits"); - return (EINVAL); + return (SET_ERROR0(EINVAL, "unknown PROT bits")); } max_prot = PROT_MAX_EXTRACT(prot); prot = PROT_EXTRACT(prot); if (max_prot != 0 && (max_prot & prot) != prot) { - SET_ERROR0(ENOTSUP, "prot is not subset of max_prot"); - return (ENOTSUP); + return (SET_ERROR0(ENOTSUP, "prot is not subset of max_prot")); } p = td->td_proc; @@ -232,10 +230,9 @@ kern_mmap(struct thread *td, const struct mmap_req *mrp) if (!SV_CURPROC_FLAG(SV_AOUT)) { if ((len == 0 && p->p_osrel >= P_OSREL_MAP_ANON) || ((flags & MAP_ANON) != 0 && (fd != -1 || pos != 0))) { - SET_ERROR2(EINVAL, + return (SET_ERROR2(EINVAL, "offset not zero/fd not -1 for MAP_ANON", - fd, pos); - return (EINVAL); + fd, pos)); } } else { if ((flags & MAP_ANON) != 0) @@ -245,8 +242,8 @@ kern_mmap(struct thread *td, const struct mmap_req *mrp) if (flags & MAP_STACK) { if ((fd != -1) || ((prot & (PROT_READ | PROT_WRITE)) != (PROT_READ | PROT_WRITE))) { - SET_ERROR1(EINVAL, "MAP_STACK with prot < rw", prot); - return (EINVAL); + return (SET_ERROR1(EINVAL, "MAP_STACK with prot < rw", + prot)); } flags |= MAP_ANON; pos = 0; @@ -255,28 +252,23 @@ kern_mmap(struct thread *td, const struct mmap_req *mrp) MAP_STACK | MAP_NOSYNC | MAP_ANON | MAP_EXCL | MAP_NOCORE | MAP_PREFAULT_READ | MAP_GUARD | MAP_32BIT | MAP_ALIGNMENT_MASK)) != 0) { - SET_ERROR0(EINVAL, "reserved flag set"); - return (EINVAL); + return (SET_ERROR0(EINVAL, "reserved flag set")); } if ((flags & (MAP_EXCL | MAP_FIXED)) == MAP_EXCL) { - SET_ERROR0(EINVAL, "EXCL without FIXED"); - return (EINVAL); + return (SET_ERROR0(EINVAL, "EXCL without FIXED")); } if ((flags & (MAP_SHARED | MAP_PRIVATE)) == (MAP_SHARED | MAP_PRIVATE)) { - SET_ERROR0(EINVAL, "both SHARED and PRIVATE set"); - return (EINVAL); + return (SET_ERROR0(EINVAL, "both SHARED and PRIVATE set")); } if (prot != PROT_NONE && (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC)) != 0) { - SET_ERROR1(EINVAL, "invalid prot", prot); - return (EINVAL); + return (SET_ERROR1(EINVAL, "invalid prot", prot)); } if ((flags & MAP_GUARD) != 0 && (prot != PROT_NONE || fd != -1 || pos != 0 || (flags & ~(MAP_FIXED | MAP_GUARD | MAP_EXCL | MAP_32BIT | MAP_ALIGNMENT_MASK)) != 0)) { - SET_ERROR0(EINVAL, "GUARD with wrong parameters"); - return (EINVAL); + return (SET_ERROR0(EINVAL, "GUARD with wrong parameters")); } /* @@ -298,8 +290,7 @@ kern_mmap(struct thread *td, const struct mmap_req *mrp) if (align != 0 && align != MAP_ALIGNED_SUPER && (align >> MAP_ALIGNMENT_SHIFT >= sizeof(void *) * NBBY || align >> MAP_ALIGNMENT_SHIFT < PAGE_SHIFT)) { - SET_ERROR1(EINVAL, "bad alignment", align); - return (EINVAL); + return (SET_ERROR1(EINVAL, "bad alignment", align)); } /* @@ -314,8 +305,8 @@ kern_mmap(struct thread *td, const struct mmap_req *mrp) */ addr -= pageoff; if ((addr & PAGE_MASK) != 0) { - SET_ERROR1(EINVAL, "fixed mapping not aligned", addr); - return (EINVAL); + return (SET_ERROR1(EINVAL, "fixed mapping not aligned", + addr)); } /* Address range must be all in user VM space. */ @@ -324,9 +315,8 @@ kern_mmap(struct thread *td, const struct mmap_req *mrp) return (EINVAL); } if (flags & MAP_32BIT && addr + size > MAP_32BIT_MAX_ADDR) { - SET_ERROR0(EINVAL, - "fixed 32bit mapping does not fit into 4G"); - return (EINVAL); + return (SET_ERROR0(EINVAL, + "fixed 32bit mapping does not fit into 4G")); } } else if (flags & MAP_32BIT) { /* @@ -1324,8 +1314,7 @@ vm_mmap_vnode(struct thread *td, vm_size_t objsize, vm_pager_update_writecount(obj, 0, objsize); } } else { - SET_ERROR0(EINVAL, "non-reg file"); - error = EINVAL; + error = SET_ERROR0(EINVAL, "non-reg file"); goto done; } if ((error = VOP_GETATTR(vp, &va, cred))) @@ -1416,8 +1405,7 @@ vm_mmap_cdev(struct thread *td, vm_size_t objsize, vm_prot_t prot, (prot & VM_PROT_WRITE) != 0) return (EACCES); if ((flags & (MAP_PRIVATE | MAP_COPY)) != 0) { - SET_ERROR0(EINVAL, "cdev mapping must be shared"); - return (EINVAL); + return (SET_ERROR0(EINVAL, "cdev mapping must be shared")); } /* @@ -1444,8 +1432,8 @@ vm_mmap_cdev(struct thread *td, vm_size_t objsize, vm_prot_t prot, obj = vm_pager_allocate(OBJT_DEVICE, cdev, objsize, prot, *foff, td->td_ucred); if (obj == NULL) { - SET_ERROR0(EINVAL, "cdev driver does not support mmap"); - return (EINVAL); + return (SET_ERROR0(EINVAL, + "cdev driver does not support mmap")); } *objp = obj; *flagsp = flags; @@ -1464,8 +1452,7 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, vm_size_t size, vm_prot_t prot, boolean_t writecounted; if (size == 0) { - SET_ERROR0(EINVAL, "zero-sized req"); - return (EINVAL); + return (SET_ERROR0(EINVAL, "zero-sized req")); } size = round_page(size); @@ -1492,8 +1479,8 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, vm_size_t size, vm_prot_t prot, handle, &foff, &object, &writecounted); break; default: - SET_ERROR1(EINVAL, "unsupported backing obj type", handle_type); - error = EINVAL; + error = SET_ERROR1(EINVAL, "unsupported backing obj type", + handle_type); break; } if (error) @@ -1575,8 +1562,7 @@ vm_mmap_object(vm_map_t map, vm_offset_t *addr, vm_size_t size, vm_prot_t prot, * exec). */ if ((foff & PAGE_MASK) != 0) { - SET_ERROR1(EINVAL, "offset not page-aligned", foff); - return (EINVAL); + return (SET_ERROR1(EINVAL, "offset not page-aligned", foff)); } if ((flags & MAP_FIXED) == 0) { @@ -1584,21 +1570,20 @@ vm_mmap_object(vm_map_t map, vm_offset_t *addr, vm_size_t size, vm_prot_t prot, *addr = round_page(*addr); } else { if (*addr != trunc_page(*addr)) { - SET_ERROR1(EINVAL, - "non-fixed mapping address not aligned", *addr); - return (EINVAL); + return (SET_ERROR1(EINVAL, + "non-fixed mapping address not aligned", *addr)); } fitit = false; } if (flags & MAP_ANON) { if (object != NULL) { - SET_ERROR0(EINVAL, "anon mapping backed by an object"); - return (EINVAL); + return (SET_ERROR0(EINVAL, + "anon mapping backed by an object")); } if (foff != 0) { - SET_ERROR0(EINVAL, "anon mapping with non-zero offset"); - return (EINVAL); + return (SET_ERROR0(EINVAL, + "anon mapping with non-zero offset")); } docow = 0; } else if (flags & MAP_PREFAULT_READ) @@ -1619,8 +1604,8 @@ vm_mmap_object(vm_map_t map, vm_offset_t *addr, vm_size_t size, vm_prot_t prot, docow |= MAP_WRITECOUNT; if (flags & MAP_STACK) { if (object != NULL) { - SET_ERROR0(EINVAL, "stack mapping backed by an object"); - return (EINVAL); + return (SET_ERROR0(EINVAL, + "stack mapping backed by an object")); } docow |= MAP_STACK_AREA; } From nobody Fri Jun 13 20:33:25 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJrh53bw0z515R9; Fri, 13 Jun 2025 20:33:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJrh530H2z3DLr; Fri, 13 Jun 2025 20:33:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749846805; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6soknWcKvLCHdOztET5rFZCpaOJ1/eB5WXdNeWdvv9k=; b=USKEsxqop8SVgI4D3o9V+jJoRSSVT6MNbOjkMFtSj0wiAN4DaSlDzk5M2nBX+vwjh0exGU Gj10Z70BGCsP5/5pNryO2ifXTqOlkRdhTDth5CJVSSZVlV552t+JNVEggaHgqD/olcPIbB NAgE3HjPcbNRqCYGLmxOxND49HuGdiRHhzEvnzAqiQe5CjG7sGrLo9EHn/sfEJPxJWyFo4 2fLmVWf2Jftf9BTOFd7eyoDXVJegC6quty31IaP/cYJ0eX0A4D6fCpWSQKexUWUny8KXms g2JgJ/8/SaZAoIhyzoWB+CFvfILEjVIAP1o8Pges5J068u9d5e5CDTXj512eEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749846805; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6soknWcKvLCHdOztET5rFZCpaOJ1/eB5WXdNeWdvv9k=; b=tNnUHczn1rl3jOeAeGW47/NYg7kAzlss5zWspNbU1ro/tnaFMYFFadzQUfsdJkxrh8HlpB sWroHsNTSg79NCZvJhozJuhKA0tEfjZ78VHh7ynTw4npNwYozHUPD/8gxuU0XQQUREIPA9 hw41XuOiHt+RVsxhDYODb2JUlr3SPZwf9OKp5+deZ5TQXqcDcnsHOHP6LZ5UXGiSz4Ce7Z KElwyXB2NE9rplsNRXa2Q8DPRhi7CHlUYHP8PYesHUHQVBgBRfHayaN8dQqrwQRmCT344D kWaPXTtZZbYj0RXWHHJQGr2KjFlCsLttGGLvOE8EokdTvnW7EyR8kCB5ZXxGhA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749846805; a=rsa-sha256; cv=none; b=DC19soakV904c8q42hd2+9tMlEEEyz1MQd4QobG7gypRrEbjUIMHToQgFiT6TIKfFlVzi2 C78jrvpMQ1msgKvcKZhZNxYi6FjPZLu4Ued80/pF5UVIPugYuoMRAD+hlZeiH0zmO0u9Xh 7Oxgqn/dhXDFqtRKfbvj9cWNcqiydFQ+vFsz2IC7UhSPXxDLMN3ojdXIxi4NAWHwHnofqT n0CCQYLy/13IGpl997oI1wEdIj+ae1v4lNG4cm31dPfxLFWBk0wYGINNk6p2A4ihh2NdYJ Hwp9m644Hm7Tw80VkMQGIM3n9KIhVsVHFHXSCqLh94NgbbiePrqWozRc26bguA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJrh52YMgz1BjY; Fri, 13 Jun 2025 20:33:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55DKXPvX047614; Fri, 13 Jun 2025 20:33:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55DKXPkE047611; Fri, 13 Jun 2025 20:33:25 GMT (envelope-from git) Date: Fri, 13 Jun 2025 20:33:25 GMT Message-Id: <202506132033.55DKXPkE047611@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: b3168306a13b - main - fstat: identify kqueue, mqueue, and procdesc file descriptors List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b3168306a13b9d95c2b01bf7a483c1af9ec0d797 Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=b3168306a13b9d95c2b01bf7a483c1af9ec0d797 commit b3168306a13b9d95c2b01bf7a483c1af9ec0d797 Author: Alan Somers AuthorDate: 2025-01-28 17:59:41 +0000 Commit: Alan Somers CommitDate: 2025-06-13 20:33:02 +0000 fstat: identify kqueue, mqueue, and procdesc file descriptors When displaying kqueue, mqueue, and procdesc file descriptors, identify them as such. There aren't any details, but it's better than a scary warning like "unknown file type 15 for file 6 of pid 26393". Sponsored by: ConnectWise Differential Revision: https://reviews.freebsd.org/D48706 MFC after: 2 weeks --- usr.bin/fstat/fstat.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/usr.bin/fstat/fstat.c b/usr.bin/fstat/fstat.c index e5d0755062d0..e93385a5b0f6 100644 --- a/usr.bin/fstat/fstat.c +++ b/usr.bin/fstat/fstat.c @@ -299,14 +299,26 @@ print_file_info(struct procstat *procstat, struct filestat *fst, case PS_FST_TYPE_PTS: print_pts_info(procstat, fst); break; + case PS_FST_TYPE_KQUEUE: + printf(" [kqueue]"); + break; + case PS_FST_TYPE_MQUEUE: + printf(" [mqueue]"); + break; case PS_FST_TYPE_SHM: print_shm_info(procstat, fst); break; case PS_FST_TYPE_SEM: print_sem_info(procstat, fst); break; + case PS_FST_TYPE_PROCDESC: + printf(" [procdesc]"); + break; case PS_FST_TYPE_DEV: break; + case PS_FST_TYPE_EVENTFD: + printf(" [eventfd]"); + break; default: if (vflg) fprintf(stderr, From nobody Fri Jun 13 20:43:52 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJrw90nFgz515c5; Fri, 13 Jun 2025 20:43:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJrw86b48z3FQ5; Fri, 13 Jun 2025 20:43:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749847432; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+hQDE9o8aRy5gxoK/wn4l6wGyZ+XeQXbNQYDUsxO56c=; b=KjTWBg2UW4HC6Ad7PYSkr5bDe3DQaLNGhjr0g9ebZDcG/yHI6OlY2PBsZPQelt4fD0sXFv wz9mSwuLKRnyQpMO7dtauM5dhpZ/oilzLAMtkvIZ9/QQrhzx6t+y1kl3w8gXAVuSX1KqmC PA7/4rJqXlDlOEfh3gKrGmhnp5TbLJ9FsuZ9+tUzScm37PHKCNW/kpCEsX4BYKhEYV6Z4S qDFYwbkyh1LvcidHg8dAAwjBQz/PNi+OVvCcF18UBgAOEVYDnItrS6n7xKDZO/yHeoodGo B0U3Z60TrNqyyvsx1CyDJYka2G0BK5HfZFswc08leEY4A220/grr2VYPFl0gVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749847432; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+hQDE9o8aRy5gxoK/wn4l6wGyZ+XeQXbNQYDUsxO56c=; b=nZCsZm6qBxWRPsGzlKltzdRZn3A5xD6XsKuacn6rcAI4ETs5Ld3A0GRZlKGJ3LIKeQThdu QkVeSgEBkVuDr7udBPHJRyPkjygQYWpu4Lhot4eBrQ6OQEvYveQs72BxFj5fpKDsdHINu2 Xmk8P2b+ckZhNlIeXZV7yGi3NXqZOELM1XhN6616x2uTJEsVCakCcjA57OKHPtpAYbmX1b pmaHFIlQ1XxzP5hwDBoFK242cAjMB3F/lWRXJKZQFdfGqfBGPff6xQ/wKf04HcQYtgI3ki +bLwu8KX7MVz0yPLOt/AQvfd6geLnH7QADdtercZr3HoETCF8/Xn0c9KXak22Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749847432; a=rsa-sha256; cv=none; b=SGbcHBqG11zXUEli8c8PagdBVngEnDIE+TBunkewZTQa6v2esH9XVOmSEEmgXy7nbc/X26 39mYITsnr7U87sWZgKUm7V18WMoZpIyTSHv3TL0vWFE1hze3FvfS0Uqtf6kNoEndPsd7pE /WVXaztQua7IRO17zke7frSqQSa8UWHaUjmmmOolnm+/tgLWwJt3tnZQfocV8CM6t3AiGK UxoFBk6Ac97nCNfRhjiaWgfz05+jTmx8TZARYjxWfp6gBIBAga2jrHP4ybHvr6SYFNvKaE r0pAXm/OtEoYnJnSsbbSOkTX4LEfx5fyIWPPPDfqXBauHvHnhNyR4a2iLYMoxQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJrw86BHXz1C2X; Fri, 13 Jun 2025 20:43:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55DKhq1d067543; Fri, 13 Jun 2025 20:43:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55DKhq9q067540; Fri, 13 Jun 2025 20:43:52 GMT (envelope-from git) Date: Fri, 13 Jun 2025 20:43:52 GMT Message-Id: <202506132043.55DKhq9q067540@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christian Brueffer Subject: git: 3353f39cfcad - main - wsp.4: fix style warnings. No content changes. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brueffer X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3353f39cfcad4015e5741cd4976c650080828482 Auto-Submitted: auto-generated The branch main has been updated by brueffer: URL: https://cgit.FreeBSD.org/src/commit/?id=3353f39cfcad4015e5741cd4976c650080828482 commit 3353f39cfcad4015e5741cd4976c650080828482 Author: Christian Brueffer AuthorDate: 2025-06-13 20:42:56 +0000 Commit: Christian Brueffer CommitDate: 2025-06-13 20:42:56 +0000 wsp.4: fix style warnings. No content changes. --- share/man/man4/wsp.4 | 72 ++++++++++++++++++++++++++++++++-------------------- 1 file changed, 45 insertions(+), 27 deletions(-) diff --git a/share/man/man4/wsp.4 b/share/man/man4/wsp.4 index b08449f9e71f..50ada937e104 100644 --- a/share/man/man4/wsp.4 +++ b/share/man/man4/wsp.4 @@ -55,51 +55,58 @@ A single-finger press generates a left button click. A two-finger press maps to the right button; whereas a three-finger press gets treated as a middle button click. .Pp -The trackpad functions with presses and taps. A press is a full-forced -press which causes a physical lowering of the trackpad. A tap is a +The trackpad functions with presses and taps. +A press is a full-forced +press which causes a physical lowering of the trackpad. +A tap is a touch of the trackpad which does not depress the physical trackpad. .Pp The .Nm -driver supports receiving evdev input device data if enabled. This data +driver supports receiving evdev input device data if enabled. +This data is used for extended usage of the touchpad like multi-finger support, -pressure detection, tap support, and gestures. At least the second bit -of the +pressure detection, tap support, and gestures. +At least the second bit of the .Xr sysctl 8 tunable .Va kern.evdev.rcpt_mask -must be set. This can be enabled with +must be set. +This can be enabled with .Va kern.evdev.rcpt_mask=3 . .Pp Vertical scrolling (z-axis) is enabled by default with a two-finger tap and the movement of a finger up and down. Horizontal scrolling (t-axis) is not natively supported by the sysmouse -protocol, therefore must be enabled with evdev data. This can be enabled -with the +protocol, therefore must be enabled with evdev data. +This can be enabled with the .Xr sysctl 8 tunable -.Va kern.evdev.sysmouse_t_axis=3. +.Va kern.evdev.sysmouse_t_axis=3 . Horizontal scrolling can be used with a two-finger tap and the movement -of a finger from side to side. The +of a finger from side to side. +The .Xr sysctl 8 tunable .Va hw.usb.wsp.t_factor must be greater than 0 for horizontal scrolling to be enabled, too. .Pp Horizontal swiping with a three-finger tap is registered as mouse buttons -8 and 9, depending on the direction. These buttons default to backwards -and forwards keyboard events. +8 and 9, depending on the direction. +These buttons default to backwards and forwards keyboard events. .Sh SYSCTL VARIABLES The following variables are available as .Xr sysctl 8 tunables: .Bl -tag -width indent .It Va hw.usb.wsp.scale_factor -Controls the pointer sensitivity. Default is 12. +Controls the pointer sensitivity. +Default is 12. .El .Bl -tag -width indent .It Va hw.usb.wsp.enable_single_tap_clicks -Enables single-tap to register as a left-click. Default is 1 (enabled). +Enables single-tap to register as a left-click. +Default is 1 (enabled). .El .Bl -tag -width indent .It Va hw.usb.wsp.enable_single_tap_movement @@ -114,45 +121,55 @@ finger (a lower value is used for palm detection). Default is 1900. .Bl -tag -width indent .It Va max_scroll_finger_distance Specifies the maximum distance between two fingers where z-axis -and t-axis movements are registered. Z-axis and T-axis movements +and t-axis movements are registered. +Z-axis and T-axis movements are vertical and horizontal movements with more than one finger -tapped (not clicked), respectively. Default is 8192. +tapped (not clicked), respectively. +Default is 8192. .El .Bl -tag -width indent .It Va hw.usb.wsp.max_double_tap_distance Specifies the maximum distance between two fingers that a two-finger -click will be registered as a right-click. Default is 2500. +click will be registered as a right-click. +Default is 2500. .El .Bl -tag -width indent .It Va hw.usb.wsp.scr_threshold Specifies the minimum horizontal or vertical distance required to -register as a scrolling gesture. Default is 20. +register as a scrolling gesture. +Default is 20. .El .Bl -tag -width indent .It Va hw.usb.wsp.z_factor -Z-axis sensitivity. Default is 5. +Z-axis sensitivity. +Default is 5. .El .Bl -tag -width indent .It Va hw.usb.wsp.z_invert -Z-axis inversion. Default is 0 (disabled). +Z-axis inversion. +Default is 0 (disabled). .El .Bl -tag -width indent .It Va hw.usb.wsp.t_factor -T-axis sensitivity. Default is 0 (disabled). +T-axis sensitivity. +Default is 0 (disabled). .El .Bl -tag -width indent .It Va hw.usb.wsp.t_invert -T-axis inversion. Default is 0 (disabled). +T-axis inversion. +Default is 0 (disabled). .El .Bl -tag -width indent .It Va hw.usb.wsp.scroll_finger_count Specifies the number of tapped fingers which registers as a scrolling -movement. Default is 2. +movement. +Default is 2. .El .Bl -tag -width indent .It Va hw.usb.wsp.horizontal_swipe_finger_count Speifies the number of tapped fingers which registers as a swipe -gesture. Default is 3. +gesture. +Default is 3. .El .Bl -tag -width indent .It Va hw.usb.wsp.pressure_touch_threshold @@ -173,7 +190,9 @@ Default is 120. .It Va hw.usb.wsp.debug Specifies the .Nm -driver debugging level (0-3). Default is 1. +driver debugging level (0-3). +Default is 1. +.El .Sh FILES .Nm creates a blocking pseudo-device file, @@ -184,8 +203,7 @@ or .Em mousesystems type device--see .Xr moused 8 -for an explanation of these mouse -types. +for an explanation of these mouse types. .Sh SEE ALSO .Xr sysmouse 4 , .Xr usb 4 , From nobody Fri Jun 13 20:56:08 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJsBJ3s87z51663; Fri, 13 Jun 2025 20:56:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJsBJ24G3z3GSw; Fri, 13 Jun 2025 20:56:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749848168; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g30ych3VPRHVfa/BiOz4zCwkMfXe07TkHe8RN/PB5bs=; b=xOQM/+mu+WLPr7Iua0oImEn9GzuuCnSwXP/MmZjHHp8kE7zqYh5yz8tWOQ6+wN37lYxFMS x60wKXw+PrLLR+t7WDUFZObFJYXizwri5RJ4/T32nBv0eYV4lr3jg7uWS8RvChKA65W4Ex CLLsk9ycxYD/u6njfx7DPlFzA5Az1DUgnjUSUDVPDWdIFHJ4qg5xVZrybjG0zGRWLcZVpu 66HnhEcLu4xrOMX0HuFNUBP0m4n/kFVTww+rqkM2wBeaSbeUqcNzrCGq5Uzsl9OXV995ZE lo8tILPDQg9Hsp3a+y8fx/NrfGFSkm8CfQv1V6Gi9bYP22votfWlyTrprfIZfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749848168; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g30ych3VPRHVfa/BiOz4zCwkMfXe07TkHe8RN/PB5bs=; b=NHNSvmmn2vut8ZAGjHf1hh/Xpkq2xFRj3ee39hQcRllLstVxUJYPgAVM908Kz/yPlkV1AG QjT3mLmK4gD5zfTOadHsJVbRfZJEtR9UAu/JVchNDDryGwRUs11YIZ9P/z6Osh09Dc98y3 OaRIGWMtodxPQGF8lWo3WtMC0X599/nqnylrrIITFZ+F1w3S/I5rFxj6uX8075wpWVXF/c NpE7C6A5pj1MqBDXu+A9iZkuUBFKFf8yMsUcmfLJy+JutEWPc/MURmp2CF3anUXlUOKxxo sow4XuizzzjtYYS+sxvhlhpXFET3znI9vrk+kIA9EhKAptKJsrbUbaNHkcIMGg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749848168; a=rsa-sha256; cv=none; b=rcoJCjcAyVbYEsrUgTgUzA6dbDq2CvIHzRn2mjPxi6I+aWxgoMh20kkzOtGs3tjlY2QGL8 ncLGKx5tS3JP8b7PJCmxX0pMbl9cgX+7vy2vXaP7Yiy218tX7tJ/GJtkY3aA9HKqfg0NDE FVaQR47w3W7amCzLqdMD193ObQ4Ew3r2RLtpHxwJyNnCVULiUwoCNYea8khfWyPiyXlYPB ZdG4QMr0B0puGhd80bAHPUDvA6oAjUmGQFWIlo+exOrjXqovS33LtBkCSiqPb6Y9ro0oJp rlfsRiRAjYrH3E36WIoCDz5kPKPDys6zFlg/xG5LdqrpBrWKrgbCbV2S/azmsg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJsBJ1gx9z1CmL; Fri, 13 Jun 2025 20:56:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55DKu8r6086304; Fri, 13 Jun 2025 20:56:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55DKu8vg086301; Fri, 13 Jun 2025 20:56:08 GMT (envelope-from git) Date: Fri, 13 Jun 2025 20:56:08 GMT Message-Id: <202506132056.55DKu8vg086301@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: de8fb1b38357 - main - tcp: fix local blackholing List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: de8fb1b3835758998a53d772deeebcdb71bbb823 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=de8fb1b3835758998a53d772deeebcdb71bbb823 commit de8fb1b3835758998a53d772deeebcdb71bbb823 Author: Michael Tuexen AuthorDate: 2025-06-13 20:53:42 +0000 Commit: Michael Tuexen CommitDate: 2025-06-13 20:53:42 +0000 tcp: fix local blackholing The sysctl-variable net.inet.tcp.blackhole_local should affect TCP segments from an IPv6 address of the local host, not of a host on the local area network. Thanks to cc@ for pointing me to the issue. Reviewed by: cc MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D50828 --- sys/netinet/tcp_input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index c00a102e8520..1c617b85ef89 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1385,7 +1385,7 @@ dropwithreset: ((V_blackhole == 1 && (thflags & TH_SYN)) || V_blackhole > 1))) && (V_blackhole_local || ( #ifdef INET6 - isipv6 ? !in6_localaddr(&ip6->ip6_src) : + isipv6 ? !in6_localip(&ip6->ip6_src) : #endif #ifdef INET !in_localip(ip->ip_src) From nobody Fri Jun 13 20:58:13 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJsDk0D4mz516d7; Fri, 13 Jun 2025 20:58:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJsDj6kkzz3Grq; Fri, 13 Jun 2025 20:58:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749848294; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=es2cHdQ6cOfG08PsrJcBljuai4y+w7x/9Ft1LGZWamY=; b=w08p3ljQF3TF78R+aSf02uujfLNxJzIyKSqrZO7V6NEsHXbaoCwGkynY+UOUSOhM40lBxy HUZLxACLPJPrAd7QiIOKn5clRjjq0ou0xrfHo6Xh9cFlZCEe7uQocIiXcLmJLVqT/BkX9i sp7uuX8HgLdixUKa0GGSFu2q+G4j4EmB/bBmYSUxtBorTx0gIW9veZLBB+ZKyVcUusfWYP G6/0hvT2EkLYoCMhbMVq8ETraHk7z3jbLghHirTyR9DORDFA6WAeTLNOm1WwDR7R/iC12o ls1jg5x7cRzY9kdF2yBPCxt0hMIRytRokhu7OeoCUFxUcpeN2JnDwUCLDNgOcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749848293; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=es2cHdQ6cOfG08PsrJcBljuai4y+w7x/9Ft1LGZWamY=; b=NJuOd4tTVRuS6ZhRNpwZnSX0AO+vXqq+ZBoHoOM2pxfr79/zl4dsEed4lXgdugBRTTxZcu ur9Yv4vJSn3bT4l908jTglB9plIFRM8HSTn2s3oN+R1/CF7nGugt57OHLXrZ5I1jhW2Utz TUQmUWOcOyLTem8NCnadNEt22tXq+gMqedYPvmL64HiO3Su/R+QNn2P1v5hadOoKqZTi+P 9dtVwadoPxVOarSKBr9fm0z+DkGUKnEt6hi/jvdWkfGTWtxdK4o3nV8OAl3ZfKkChW9u3B L5uoEcT62+yOu64YwCjys+OVLMjWj8LUdZ9MKPRQtk70g1SiPwe+29PABQBJhA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749848294; a=rsa-sha256; cv=none; b=LQ3SC8i+/aZxKRWx1PYTGZb8Ks3iWlOXOH7ogKuLlfIR5XLHHLOBcht6N5LoCPSa9ZE6Mb Etab7YjYF8MzQZRUpKEDDt7c847O4c6EDRSVaaK5fpFdvzMmrMcpMeHFMWT20WQY8PulCP ctKUEhoGgpwnEVpIVMkUYFq70ZRRFFZ39gbbCz8wDZGStVp71AfvfCl8Yqx2WtQexWhYgg WadA1BM/hMrNauiT98w9K2HmWNsh1yjXwhiGqRhMBTBnfIUg+inLYhTmblnUVLWciZic52 tPeq0GOkJFObqhmqsQqnDN2BzGqsovyvv25k+qLE27Y94kmB9e9sb+Oaxpw+2A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJsDj6Bwhz1CY8; Fri, 13 Jun 2025 20:58:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55DKwD2T087077; Fri, 13 Jun 2025 20:58:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55DKwDQR087074; Fri, 13 Jun 2025 20:58:13 GMT (envelope-from git) Date: Fri, 13 Jun 2025 20:58:13 GMT Message-Id: <202506132058.55DKwDQR087074@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: 1bdf1b818635 - main - config.5: Document CONF_CFLAGS under 'makeoptions' List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1bdf1b8186359d4ea26e26de03e03b7c1543b707 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=1bdf1b8186359d4ea26e26de03e03b7c1543b707 commit 1bdf1b8186359d4ea26e26de03e03b7c1543b707 Author: Olivier Certner AuthorDate: 2025-05-27 07:41:19 +0000 Commit: Olivier Certner CommitDate: 2025-06-13 20:57:51 +0000 config.5: Document CONF_CFLAGS under 'makeoptions' This variable serves to tweak CFLAGS from the kernel configuration file, easing some custom kernel builds. It was introduced by bde@ in 1999. The description has been kept simple on purpose. It does not completely reflect reality as the build infrastructure actually appends variables to CFLAGS after CONF_CFLAGS has been processed in a few cases. However, these cases do not collide with expected common uses of CONF_CFLAGS, so have not been mentioned. Reviewed by: markj (older version) MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50544 --- usr.sbin/config/config.5 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/usr.sbin/config/config.5 b/usr.sbin/config/config.5 index 93d65819d1d8..134afb17f9a4 100644 --- a/usr.sbin/config/config.5 +++ b/usr.sbin/config/config.5 @@ -316,11 +316,28 @@ variable is specified, .Ar value is assumed to be the empty string. .Pp +Note that, as the common makefiles overwrite the +.Va CFLAGS +variable after having processed the configuration file, +customizing +.Va CFLAGS +directly via +.Ic makeoptions +is not possible. +Nonetheless, custom compiler flags can be specified using the +.Va CONF_CFLAGS +variable instead. +Its content is appended to +.Va CFLAGS +after the common makefiles have set the latter, allowing to override their +compilation flags. +.Pp Example: .Bd -literal -offset indent -compact makeoptions MYMAKEOPTION="foo" makeoptions MYMAKEOPTION+="bar" makeoptions MYNULLMAKEOPTION +makeoptions CONF_CFLAGS+="-DSOME_CONTROLLING_MACRO" .Ed .\" -------- MAXUSERS -------- .Pp From nobody Fri Jun 13 21:00:06 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJsGt2cQGz516dM; Fri, 13 Jun 2025 21:00:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJsGt1fCYz3HFY; Fri, 13 Jun 2025 21:00:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749848406; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1dGa/NuqcFSvL0Hoe3qheexVVNOydn+4Rgs1uTqRc/E=; b=pfgzXvBPSFI81WDharXMsZxoMZ6GHg1a1Aon0ZobkfTOKN0OKiPClLKf2K0WSmZ1IrZ8QR FMVR/BHn4YrM3/s7D278p508P/6fUbPZc4XZCJuNLFtw8PHZJJlhTfIvvQZRznMOSQ2FpC jW+JB2FH7iGZXThfe4ZL695chASRJTcHHY5mUwbQyDPvMUcmi4Zf2nINTAS4EEgPtl1BzE r8n2WeFsqYRJj4DaN+9x2w53CCxStkXhznKc94UxxECfjX8IzgZ/2umUGDmck9ZtMjJdL7 adYNN/2Q05A/788s/h3wuCiE8NA3cgSwJjI2gjv5R4OrzYNq2iUUfMWwIS/tEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749848406; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1dGa/NuqcFSvL0Hoe3qheexVVNOydn+4Rgs1uTqRc/E=; b=SD8yk2y15DIqKtEcQMRwlznb8HbAZ2idJL+zfwTVggd88UOQgVGAZV+b/BrK2GA9ENnd3P Ub+D8QOqVi6RR3xGcdkcG/RBbeKjsywQsweO81U3USvrOmjLVB+MRLjMfSdV1EjxK5CPwO ApSSOE9zdY3ULMRG8o4Lr2jVUcUz1X3vf8OfA97NAlZn4PQSviSI2Dt6B9Zbx9UGbBZIz0 e4zC0SppWJlZRzmCmLHof+Htd0ZTHZdtzSd6vWuzDwEEit8hRJOndV60w07CfYxADUfZEB /NWp9nGVV0ZjoN9ni/JpFv7JhtYhMLtDKqjphLz5/UTdhLec91PMLnT9UOBUtg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749848406; a=rsa-sha256; cv=none; b=nntJRJTmltH1ipPZorysQjlsJ0RvXMpA+8QxCnsyi217UnfIxdKKfDiXeu8kaqhNkaWVAL 0scxT8kZNiC4HYSrCOXG2zvdLFLfvBFuhKgOWrYnJtZq3HnyYsmB6NI2/ql220Wuhr16WC rPWaHlmDoe1zWhbTbYKfWHbvXbEOueYeuPH+4MKZBmQDfijm5ngHrY4MbWoWIjRdkIYOYx p4jgJoVBv8+ZHtcDg2sGbMDNdmy/guzfB+JJ1baha3Cp14W9NIooAn8tVNCo2ZZfehswYO /kGKMuuJn1u9EocQZYsWmQS+v1HdQMWA4IUOEkP8bNecw7GNFvJATjmWWaoWNA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJsGt18hLz1CMt; Fri, 13 Jun 2025 21:00:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55DL06wi091655; Fri, 13 Jun 2025 21:00:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55DL06aC091651; Fri, 13 Jun 2025 21:00:06 GMT (envelope-from git) Date: Fri, 13 Jun 2025 21:00:06 GMT Message-Id: <202506132100.55DL06aC091651@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 16587f60a698 - main - udp: fix local blackholing List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 16587f60a69820f1a319644da4ec1a40efbcbdf0 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=16587f60a69820f1a319644da4ec1a40efbcbdf0 commit 16587f60a69820f1a319644da4ec1a40efbcbdf0 Author: Michael Tuexen AuthorDate: 2025-06-13 20:57:16 +0000 Commit: Michael Tuexen CommitDate: 2025-06-13 20:59:50 +0000 udp: fix local blackholing The sysctl-variable net.inet.udp.blackhole_local should affect UDP packets from an IPv6 address of the local host, not of a host on the local area network. Thanks to cc@ for pointing me to the issue. Reviewed by: cc MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D50829 --- sys/netinet6/udp6_usrreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c index c8f91fff2b76..304effa26e01 100644 --- a/sys/netinet6/udp6_usrreq.c +++ b/sys/netinet6/udp6_usrreq.c @@ -517,7 +517,7 @@ skip_checksum: goto badunlocked; } if (V_udp_blackhole && (V_udp_blackhole_local || - !in6_localaddr(&ip6->ip6_src))) + !in6_localip(&ip6->ip6_src))) goto badunlocked; icmp6_error(m, ICMP6_DST_UNREACH, ICMP6_DST_UNREACH_NOPORT, 0); *mp = NULL; From nobody Fri Jun 13 21:00:29 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJsHK5WmKz516lp; Fri, 13 Jun 2025 21:00:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJsHK3p6Zz3HdJ; Fri, 13 Jun 2025 21: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=1749848429; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j9s9OvD99ig3k5oJyZvDMO6sOiti2oRGaOx9sSAVXcA=; b=QqXSl/NSJNd0n/670Z7K0saTZj6FWPkeFA+/aEZx5N1TX3njvt/Hc9444admh3idMcyNQI qxR2mJIQsZXYClnciK2sn9oCbkS0Jt5Yys1483PnldEUy3txj7Sg1bA5D9Ze3fIIbCIjWz T+P3snK6de3kXA4vGyHfM7Ja7mwHv0mxEqEiQr6lAYdqKiF42HdfiR7q6RwgwpUTM9HUW0 zsIi67rQp6NURDrlygiAp2N+BK2Bn2e0VSHpojLmpZ5Po1JPINe3qoJYwE2Ci1gXncI3Kj tLuZc53SOkt8d8bhfnC575aToww4a0CxPdsynRpDcqCX7qGIV+F6baBCHbx80g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749848429; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j9s9OvD99ig3k5oJyZvDMO6sOiti2oRGaOx9sSAVXcA=; b=azvORPk7oD5eL3hNa3djTd4Tng1DaRLPj3IplbwphcKF6f1AC/W1xwob6pY3VPvdbhpTCo iQfYxRD1J4pUlj3AxTnm3hOeW13usxF9nhVtKdEcFbBKV3snSPZPPYxtULIhRclANPdQ4y bvaFcU/LpKaO4VNVGWm2hP4vy6jwGxO9zGQcWYoRObFR3ZjKFh399HainklBPK1HaqRCX2 4qn4l1rT6leM8SIO4Xr0w4VdV2ewFVRoPei2Ti1LnJ9YknzXNwN8oHH9nvNeiNV7vTDQF7 9tVj4tQ3mCk7dVyf5yv/p2idaQjgDNse2qXzxm4lwbtqv6TvnAO2em/maZ+hqQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749848429; a=rsa-sha256; cv=none; b=DiF6LdNBzeP3jt5uM9nn5XdID4WxZCn8TNLwBN6TS2tlmFeDSa+djp53TJIzOptgR/AD+N /J85Uve/pDxkq62rnO3UsgZQ88GFwhdrBO8rGWyjItdpOOMZLF4P/RIe+N3EJoG7+XE4vt 4/B7YfOfxAtOzL9hk+ETYtFDONxVCGsyv6BEdo9B4GN1HrMRnWr/r+CrJiydDY5H30SB3c DaUhV5LGFAjwkySZ9xubSzgN08IobsCZs5VuD7dnHxtJagR8c2VYy3TruUvPEOs1vOGp0I nhOk3QDtRYPzS8OE2Cd16yy09k9eo8DpjSppFlJPfKhPMlDgTWGVjJMjCxyysw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJsHK3CdMz1CMv; Fri, 13 Jun 2025 21:00:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55DL0TAS097706; Fri, 13 Jun 2025 21:00:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55DL0TmP097703; Fri, 13 Jun 2025 21:00:29 GMT (envelope-from git) Date: Fri, 13 Jun 2025 21:00:29 GMT Message-Id: <202506132100.55DL0TmP097703@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: f1ec3bc06ed2 - main - fusefs: add more checks for buggy FUSE servers List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f1ec3bc06ed276e6e24996515bdce729d51e11d8 Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=f1ec3bc06ed276e6e24996515bdce729d51e11d8 commit f1ec3bc06ed276e6e24996515bdce729d51e11d8 Author: Alan Somers AuthorDate: 2025-01-15 19:25:34 +0000 Commit: Alan Somers CommitDate: 2025-06-13 21:00:25 +0000 fusefs: add more checks for buggy FUSE servers * If a FUSE file system is NFS-exported (either by a kernel or userspace NFS server), then it must support FUSE_LOOKUP operations for ".". But if the response reports a different nodeid than the request, that's very bad. Fail the operation and warn the operator. * In general, a FUSE file may have a distinct "nodeid" and "inode number". But it the file system is NFS-exported (either by a kernel or userspace NFS server), then those two must match, because the NFS server will do VFS_VGET operations using the inode number. If they don't match, warn the operator. MFC after: 2 weeks Sponsored by: ConnectWise Differential Revision: https://reviews.freebsd.org/D48471 --- sys/fs/fuse/fuse_ipc.h | 2 + sys/fs/fuse/fuse_node.c | 19 ++++++ sys/fs/fuse/fuse_vfsops.c | 13 ++++ tests/sys/fs/fusefs/last_local_modify.cc | 5 +- tests/sys/fs/fusefs/lookup.cc | 7 ++ tests/sys/fs/fusefs/nfs.cc | 106 +++++++++++++++++++++++++++++++ 6 files changed, 149 insertions(+), 3 deletions(-) diff --git a/sys/fs/fuse/fuse_ipc.h b/sys/fs/fuse/fuse_ipc.h index 5648624f4c63..3bfc859dbac9 100644 --- a/sys/fs/fuse/fuse_ipc.h +++ b/sys/fs/fuse/fuse_ipc.h @@ -238,6 +238,8 @@ struct fuse_data { #define FSESS_WARN_WB_CACHE_INCOHERENT 0x400000 /* WB cache incoherent */ #define FSESS_WARN_ILLEGAL_INODE 0x800000 /* Illegal inode for new file */ #define FSESS_WARN_READLINK_EMBEDDED_NUL 0x1000000 /* corrupt READLINK output */ +#define FSESS_WARN_DOT_LOOKUP 0x2000000 /* Inconsistent . LOOKUP response */ +#define FSESS_WARN_INODE_MISMATCH 0x4000000 /* ino != nodeid */ #define FSESS_MNTOPTS_MASK ( \ FSESS_DAEMON_CAN_SPY | FSESS_PUSH_SYMLINKS_IN | \ FSESS_DEFAULT_PERMISSIONS | FSESS_INTR) diff --git a/sys/fs/fuse/fuse_node.c b/sys/fs/fuse/fuse_node.c index 0a24d0da4fac..742dc66bcafc 100644 --- a/sys/fs/fuse/fuse_node.c +++ b/sys/fs/fuse/fuse_node.c @@ -297,6 +297,8 @@ fuse_vnode_get(struct mount *mp, __enum_uint8(vtype) vtyp) { struct thread *td = curthread; + bool exportable = fuse_get_mpdata(mp)->dataflags & FSESS_EXPORT_SUPPORT; + /* * feo should only be NULL for the root directory, which (when libfuse * is used) always has generation 0 @@ -309,6 +311,23 @@ fuse_vnode_get(struct mount *mp, "Assigned same inode to both parent and child."); return EIO; } + if (feo && feo->nodeid != feo->attr.ino && exportable) { + /* + * NFS servers (both kernelspace and userspace) rely on + * VFS_VGET to lookup inodes. But that's only possible if the + * file's inode number matches its nodeid, which isn't + * necessarily the case for FUSE. If they don't match, then we + * can complete the current operation, but future VFS_VGET + * operations will almost certainly return spurious results. + * Warn the operator. + * + * But only warn the operator if the file system reports + * NFS-compatibility, because that's the only time that this + * matters, and dumb fuse servers abound. + */ + fuse_warn(fuse_get_mpdata(mp), FSESS_WARN_INODE_MISMATCH, + "file has different inode number and nodeid."); + } err = fuse_vnode_alloc(mp, td, nodeid, vtyp, vpp); if (err) { diff --git a/sys/fs/fuse/fuse_vfsops.c b/sys/fs/fuse/fuse_vfsops.c index 0da51b865873..48b84d3c75af 100644 --- a/sys/fs/fuse/fuse_vfsops.c +++ b/sys/fs/fuse/fuse_vfsops.c @@ -568,12 +568,25 @@ fuse_vfsop_vget(struct mount *mp, ino_t ino, int flags, struct vnode **vpp) goto out; feo = (struct fuse_entry_out *)fdi.answ; + if (feo->nodeid == 0) { /* zero nodeid means ENOENT and cache it */ error = ENOENT; goto out; } + if (feo->nodeid != nodeid) { + /* + * Something is very wrong with the server if "foo/." has a + * different inode number than "foo". + */ + fuse_warn(data, FSESS_WARN_DOT_LOOKUP, + "Inconsistent LOOKUP response: \"FILE/.\" has a different " + "inode number than \"FILE\"."); + error = EIO; + goto out; + } + vtyp = IFTOVT(feo->attr.mode); error = fuse_vnode_get(mp, feo, nodeid, NULL, vpp, NULL, vtyp); if (error) diff --git a/tests/sys/fs/fusefs/last_local_modify.cc b/tests/sys/fs/fusefs/last_local_modify.cc index 495bfd8aa959..5fcd3c36c892 100644 --- a/tests/sys/fs/fusefs/last_local_modify.cc +++ b/tests/sys/fs/fusefs/last_local_modify.cc @@ -233,7 +233,6 @@ TEST_P(LastLocalModify, lookup) SET_OUT_HEADER_LEN(out, entry); out.body.entry.nodeid = ino; out.body.entry.attr.size = oldsize; - out.body.entry.nodeid = ino; out.body.entry.attr_valid_nsec = NAP_NS / 2; out.body.entry.attr.ino = ino; out.body.entry.attr.mode = S_IFREG | 0644; @@ -277,6 +276,7 @@ TEST_P(LastLocalModify, lookup) SET_OUT_HEADER_LEN(*out0, entry); out0->body.entry.attr.mode = S_IFREG | 0644; out0->body.entry.nodeid = ino; + out0->body.entry.attr.ino = ino; out0->body.entry.entry_valid = UINT64_MAX; out0->body.entry.attr_valid = UINT64_MAX; out0->body.entry.attr.size = oldsize; @@ -392,7 +392,6 @@ TEST_P(LastLocalModify, vfs_vget) SET_OUT_HEADER_LEN(out, entry); out.body.entry.nodeid = ino; out.body.entry.attr.size = oldsize; - out.body.entry.nodeid = ino; out.body.entry.attr_valid_nsec = NAP_NS / 2; out.body.entry.attr.ino = ino; out.body.entry.attr.mode = S_IFREG | 0644; @@ -414,7 +413,6 @@ TEST_P(LastLocalModify, vfs_vget) SET_OUT_HEADER_LEN(out, entry); out.body.entry.nodeid = ino; out.body.entry.attr.size = oldsize; - out.body.entry.nodeid = ino; out.body.entry.attr_valid_nsec = NAP_NS / 2; out.body.entry.attr.ino = ino; out.body.entry.attr.mode = S_IFREG | 0644; @@ -439,6 +437,7 @@ TEST_P(LastLocalModify, vfs_vget) SET_OUT_HEADER_LEN(*out0, entry); out0->body.entry.attr.mode = S_IFREG | 0644; out0->body.entry.nodeid = ino; + out0->body.entry.attr.ino = ino; out0->body.entry.entry_valid = UINT64_MAX; out0->body.entry.attr_valid = UINT64_MAX; out0->body.entry.attr.size = oldsize; diff --git a/tests/sys/fs/fusefs/lookup.cc b/tests/sys/fs/fusefs/lookup.cc index 6d506c1ab700..2cfe888b6b08 100644 --- a/tests/sys/fs/fusefs/lookup.cc +++ b/tests/sys/fs/fusefs/lookup.cc @@ -560,6 +560,7 @@ TEST_F(LookupExportable, dotdot_entry_cache_timeout) SET_OUT_HEADER_LEN(out, entry); out.body.entry.attr.mode = S_IFDIR | 0755; out.body.entry.nodeid = foo_ino; + out.body.entry.attr.ino = foo_ino; out.body.entry.attr_valid = UINT64_MAX; out.body.entry.entry_valid = 0; // immediate timeout }))); @@ -568,6 +569,7 @@ TEST_F(LookupExportable, dotdot_entry_cache_timeout) SET_OUT_HEADER_LEN(out, entry); out.body.entry.attr.mode = S_IFDIR | 0755; out.body.entry.nodeid = bar_ino; + out.body.entry.attr.ino = bar_ino; out.body.entry.attr_valid = UINT64_MAX; out.body.entry.entry_valid = UINT64_MAX; }))); @@ -577,6 +579,7 @@ TEST_F(LookupExportable, dotdot_entry_cache_timeout) SET_OUT_HEADER_LEN(out, entry); out.body.entry.attr.mode = S_IFDIR | 0755; out.body.entry.nodeid = FUSE_ROOT_ID; + out.body.entry.attr.ino = FUSE_ROOT_ID; out.body.entry.attr_valid = UINT64_MAX; out.body.entry.entry_valid = UINT64_MAX; }))); @@ -607,6 +610,7 @@ TEST_F(LookupExportable, dotdot_no_parent_nid) SET_OUT_HEADER_LEN(out, entry); out.body.entry.attr.mode = S_IFDIR | 0755; out.body.entry.nodeid = foo_ino; + out.body.entry.attr.ino = foo_ino; out.body.entry.attr_valid = UINT64_MAX; out.body.entry.entry_valid = UINT64_MAX; }))); @@ -615,6 +619,7 @@ TEST_F(LookupExportable, dotdot_no_parent_nid) SET_OUT_HEADER_LEN(out, entry); out.body.entry.attr.mode = S_IFDIR | 0755; out.body.entry.nodeid = bar_ino; + out.body.entry.attr.ino = bar_ino; out.body.entry.attr_valid = UINT64_MAX; out.body.entry.entry_valid = UINT64_MAX; }))); @@ -632,6 +637,7 @@ TEST_F(LookupExportable, dotdot_no_parent_nid) SET_OUT_HEADER_LEN(out, entry); out.body.entry.attr.mode = S_IFDIR | 0755; out.body.entry.nodeid = foo_ino; + out.body.entry.attr.ino = foo_ino; out.body.entry.attr_valid = UINT64_MAX; out.body.entry.entry_valid = UINT64_MAX; }))); @@ -640,6 +646,7 @@ TEST_F(LookupExportable, dotdot_no_parent_nid) SET_OUT_HEADER_LEN(out, entry); out.body.entry.attr.mode = S_IFDIR | 0755; out.body.entry.nodeid = FUSE_ROOT_ID; + out.body.entry.attr.ino = FUSE_ROOT_ID; out.body.entry.attr_valid = UINT64_MAX; out.body.entry.entry_valid = UINT64_MAX; }))); diff --git a/tests/sys/fs/fusefs/nfs.cc b/tests/sys/fs/fusefs/nfs.cc index 27ffc8f5cbc1..2fa2b290f383 100644 --- a/tests/sys/fs/fusefs/nfs.cc +++ b/tests/sys/fs/fusefs/nfs.cc @@ -84,6 +84,7 @@ TEST_F(Fhstat, estale) SET_OUT_HEADER_LEN(out, entry); out.body.entry.attr.mode = mode; out.body.entry.nodeid = ino; + out.body.entry.attr.ino = ino; out.body.entry.generation = 1; out.body.entry.attr_valid = UINT64_MAX; out.body.entry.entry_valid = 0; @@ -95,6 +96,7 @@ TEST_F(Fhstat, estale) SET_OUT_HEADER_LEN(out, entry); out.body.entry.attr.mode = mode; out.body.entry.nodeid = ino; + out.body.entry.attr.ino = ino; out.body.entry.generation = 2; out.body.entry.attr_valid = UINT64_MAX; out.body.entry.entry_valid = 0; @@ -121,6 +123,7 @@ TEST_F(Fhstat, lookup_dot) SET_OUT_HEADER_LEN(out, entry); out.body.entry.attr.mode = mode; out.body.entry.nodeid = ino; + out.body.entry.attr.ino = ino; out.body.entry.generation = 1; out.body.entry.attr.uid = uid; out.body.entry.attr_valid = UINT64_MAX; @@ -132,6 +135,7 @@ TEST_F(Fhstat, lookup_dot) SET_OUT_HEADER_LEN(out, entry); out.body.entry.attr.mode = mode; out.body.entry.nodeid = ino; + out.body.entry.attr.ino = ino; out.body.entry.generation = 1; out.body.entry.attr.uid = uid; out.body.entry.attr_valid = UINT64_MAX; @@ -160,6 +164,7 @@ TEST_F(Fhstat, lookup_dot_error) SET_OUT_HEADER_LEN(out, entry); out.body.entry.attr.mode = mode; out.body.entry.nodeid = ino; + out.body.entry.attr.ino = ino; out.body.entry.generation = 1; out.body.entry.attr.uid = uid; out.body.entry.attr_valid = UINT64_MAX; @@ -189,6 +194,7 @@ TEST_F(Fhstat, cached) SET_OUT_HEADER_LEN(out, entry); out.body.entry.attr.mode = mode; out.body.entry.nodeid = ino; + out.body.entry.attr.ino = ino; out.body.entry.generation = 1; out.body.entry.attr.ino = ino; out.body.entry.attr_valid = UINT64_MAX; @@ -215,6 +221,7 @@ TEST_F(Fhstat, cache_expired) SET_OUT_HEADER_LEN(out, entry); out.body.entry.attr.mode = mode; out.body.entry.nodeid = ino; + out.body.entry.attr.ino = ino; out.body.entry.generation = 1; out.body.entry.attr.ino = ino; out.body.entry.attr_valid = UINT64_MAX; @@ -226,6 +233,7 @@ TEST_F(Fhstat, cache_expired) SET_OUT_HEADER_LEN(out, entry); out.body.entry.attr.mode = mode; out.body.entry.nodeid = ino; + out.body.entry.attr.ino = ino; out.body.entry.generation = 1; out.body.entry.attr.ino = ino; out.body.entry.attr_valid = UINT64_MAX; @@ -243,6 +251,99 @@ TEST_F(Fhstat, cache_expired) EXPECT_EQ(ino, sb.st_ino); } +/* + * If the server returns a FUSE_LOOKUP response for a nodeid that we didn't + * lookup, it's a bug. But we should handle it gracefully. + */ +TEST_F(Fhstat, inconsistent_nodeid) +{ + const char FULLPATH[] = "mountpoint/some_dir/."; + const char RELDIRPATH[] = "some_dir"; + fhandle_t fhp; + struct stat sb; + const uint64_t ino_in = 42; + const uint64_t ino_out = 43; + const mode_t mode = S_IFDIR | 0755; + const uid_t uid = 12345; + + EXPECT_LOOKUP(FUSE_ROOT_ID, RELDIRPATH) + .WillOnce(Invoke(ReturnImmediate([=](auto in __unused, auto& out) { + SET_OUT_HEADER_LEN(out, entry); + out.body.entry.nodeid = ino_in; + out.body.entry.attr.ino = ino_in; + out.body.entry.attr.mode = mode; + out.body.entry.generation = 1; + out.body.entry.attr.uid = uid; + out.body.entry.attr_valid = UINT64_MAX; + out.body.entry.entry_valid = 0; + }))); + + EXPECT_LOOKUP(ino_in, ".") + .WillOnce(Invoke(ReturnImmediate([=](auto in __unused, auto& out) { + SET_OUT_HEADER_LEN(out, entry); + out.body.entry.nodeid = ino_out; + out.body.entry.attr.ino = ino_out; + out.body.entry.attr.mode = mode; + out.body.entry.generation = 1; + out.body.entry.attr.uid = uid; + out.body.entry.attr_valid = UINT64_MAX; + out.body.entry.entry_valid = 0; + }))); + + ASSERT_EQ(0, getfh(FULLPATH, &fhp)) << strerror(errno); + EXPECT_NE(0, fhstat(&fhp, &sb)) << strerror(errno); + EXPECT_EQ(EIO, errno); +} + +/* + * If the server returns a FUSE_LOOKUP response where the nodeid doesn't match + * the inode number, and the file system is exported, it's a bug. But we + * should handle it gracefully. + */ +TEST_F(Fhstat, inconsistent_ino) +{ + const char FULLPATH[] = "mountpoint/some_dir/."; + const char RELDIRPATH[] = "some_dir"; + fhandle_t fhp; + struct stat sb; + const uint64_t nodeid = 42; + const uint64_t ino = 711; // Could be anything that != nodeid + const mode_t mode = S_IFDIR | 0755; + const uid_t uid = 12345; + + EXPECT_LOOKUP(FUSE_ROOT_ID, RELDIRPATH) + .WillOnce(Invoke(ReturnImmediate([=](auto in __unused, auto& out) { + SET_OUT_HEADER_LEN(out, entry); + out.body.entry.nodeid = nodeid; + out.body.entry.attr.ino = nodeid; + out.body.entry.attr.mode = mode; + out.body.entry.generation = 1; + out.body.entry.attr.uid = uid; + out.body.entry.attr_valid = UINT64_MAX; + out.body.entry.entry_valid = 0; + }))); + + EXPECT_LOOKUP(nodeid, ".") + .WillOnce(Invoke(ReturnImmediate([=](auto in __unused, auto& out) { + SET_OUT_HEADER_LEN(out, entry); + out.body.entry.nodeid = nodeid; + out.body.entry.attr.ino = ino; + out.body.entry.attr.mode = mode; + out.body.entry.generation = 1; + out.body.entry.attr.uid = uid; + out.body.entry.attr_valid = UINT64_MAX; + out.body.entry.entry_valid = 0; + }))); + + ASSERT_EQ(0, getfh(FULLPATH, &fhp)) << strerror(errno); + /* + * The fhstat operation will actually succeed. But future operations + * will likely fail. + */ + ASSERT_EQ(0, fhstat(&fhp, &sb)) << strerror(errno); + EXPECT_EQ(ino, sb.st_ino); +} + /* * If the server doesn't set FUSE_EXPORT_SUPPORT, then we can't do NFS-style * lookups @@ -260,6 +361,7 @@ TEST_F(FhstatNotExportable, lookup_dot) SET_OUT_HEADER_LEN(out, entry); out.body.entry.attr.mode = mode; out.body.entry.nodeid = ino; + out.body.entry.attr.ino = ino; out.body.entry.generation = 1; out.body.entry.attr_valid = UINT64_MAX; out.body.entry.entry_valid = 0; @@ -282,6 +384,7 @@ TEST_F(Getfh, eoverflow) SET_OUT_HEADER_LEN(out, entry); out.body.entry.attr.mode = S_IFDIR | 0755; out.body.entry.nodeid = ino; + out.body.entry.attr.ino = ino; out.body.entry.generation = (uint64_t)UINT32_MAX + 1; out.body.entry.attr_valid = UINT64_MAX; out.body.entry.entry_valid = UINT64_MAX; @@ -304,6 +407,7 @@ TEST_F(Getfh, ok) SET_OUT_HEADER_LEN(out, entry); out.body.entry.attr.mode = S_IFDIR | 0755; out.body.entry.nodeid = ino; + out.body.entry.attr.ino = ino; out.body.entry.attr_valid = UINT64_MAX; out.body.entry.entry_valid = UINT64_MAX; }))); @@ -335,6 +439,7 @@ TEST_F(Readdir, getdirentries) SET_OUT_HEADER_LEN(out, entry); out.body.entry.attr.mode = mode; out.body.entry.nodeid = ino; + out.body.entry.attr.ino = ino; out.body.entry.generation = 1; out.body.entry.attr_valid = UINT64_MAX; out.body.entry.entry_valid = 0; @@ -345,6 +450,7 @@ TEST_F(Readdir, getdirentries) SET_OUT_HEADER_LEN(out, entry); out.body.entry.attr.mode = mode; out.body.entry.nodeid = ino; + out.body.entry.attr.ino = ino; out.body.entry.generation = 1; out.body.entry.attr_valid = UINT64_MAX; out.body.entry.entry_valid = 0; From nobody Fri Jun 13 21:03:09 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJsLP2gStz516sv; Fri, 13 Jun 2025 21:03:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJsLP1YXkz3JLV; Fri, 13 Jun 2025 21:03:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749848589; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UwDn2o4Gt1CdUNTJOdPzegghdqfCobTU3JNtkDXDznQ=; b=jj/H2gMKujp7disdriboI1F5G0slNvyQpdm09jV1eDtYqpZDjMDeZVeLhNv/EGaL+PAk0D 2Vz7bVWYUU0486Urt15rZqNd94wjWlzt1sDY/p8Mq0OIWu6GA9ApUxWJGwy4369y3irrZ+ 43WFdQ4QP1GhVJFFUahZ09iiRPASVrak0iE5KYFuMUnz0k9qKcpKcGr1tqQ1/PsDDleDRi dp5SmxH8HM+yIJxeA2+VgX5ui5PF1NLt5zIYNopUxjqcnquvDqfCGYNEsinW/1Ml+GYow1 fRltuV5nuOjzRGxcaDWe3Wjtim213CTSOsxNrzVx+Ykx+nOAGcgCCt5Gvj0ouw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749848589; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UwDn2o4Gt1CdUNTJOdPzegghdqfCobTU3JNtkDXDznQ=; b=YznWUuF0H9Lr6sGQ991YJm0u/6/K/moN4W23HPUMmRlALGp0oiCTwkfe/uA/qbKqkEsIf9 4TfCuqq2/d9F9NV9gew0pd9qu+CuIphCDTTQxAnm69SE4vcakuUTi8rK+Q5O1SMv7k63z5 rfo7cq6hR8zjn+D87cvLixS9L2Y5ib0ilePb6ALPEv16NH6guM5jYECVGxqGo+mSz7uLZM k44V2VgXcNWWln5axcdimeGQsbQtBdjpoRWDSMi0MzdvNLQvu/u09vb2+Vmf8eNEZZKL4V hHwcw/w9IknBBktM86dSO9ZaIg053yB0kRA13OAWgkoEj2DhQMuRhhurQRcnbw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749848589; a=rsa-sha256; cv=none; b=sH1k62yyBiNCzhSCVbtke3U7JX5I9YpPqMe9jLX5+ZMlAkIol5UGJZZTkqe9TQZE4GW593 VXji2kugg9N9EXGaCG6KOklhLoFQ7UUmY7OIT8xy91yyj87DCc13a/f7UyDjvYNoYPD6Q2 VxILOCG5rsI9Dj+T5IR+2qouxzqA9+uCeTVimgAMBHxo8wHT+xrjxaPBcNKUgwgAkAqXZE PuyC1dS+n4k9zxwHu2bngLXYdqPC6vo/W1anlDXZAylpo293/UxXO8h1JCOJl9ZHzBkYii fB26OUZRnNZZ5PBcSpyjdFbRlU3br7LMiZPjDWWlGchBToAUzxJY79Vx9wW1EA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJsLP14yqz1CZ2; Fri, 13 Jun 2025 21:03:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55DL398r005463; Fri, 13 Jun 2025 21:03:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55DL39TB005460; Fri, 13 Jun 2025 21:03:09 GMT (envelope-from git) Date: Fri, 13 Jun 2025 21:03:09 GMT Message-Id: <202506132103.55DL39TB005460@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 49eabd405f66 - main - tcp: fix handling of TIME WAIT for local TCP connections List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 49eabd405f661fa3a9f0a005c2e54dc4cad07e48 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=49eabd405f661fa3a9f0a005c2e54dc4cad07e48 commit 49eabd405f661fa3a9f0a005c2e54dc4cad07e48 Author: Michael Tuexen AuthorDate: 2025-06-13 21:00:36 +0000 Commit: Michael Tuexen CommitDate: 2025-06-13 21:03:02 +0000 tcp: fix handling of TIME WAIT for local TCP connections The sysctl-variable net.inet.tcp.nolocaltimewait should affect TCP connections where the remote endpoint is on the local host and not on the local area network. Reported by: cc Reviewed by: cc MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D50830 --- sys/netinet/tcp_timewait.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c index 8d77db275310..2b4ae462af89 100644 --- a/sys/netinet/tcp_timewait.c +++ b/sys/netinet/tcp_timewait.c @@ -127,7 +127,7 @@ tcp_twstart(struct tcpcb *tp) if (V_nolocaltimewait && ( #ifdef INET6 - isipv6 ? in6_localaddr(&inp->in6p_faddr) : + isipv6 ? in6_localip(&inp->in6p_faddr) : #endif #ifdef INET in_localip(inp->inp_faddr) From nobody Fri Jun 13 21:54:50 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bJtV22RzTz5MStv; Fri, 13 Jun 2025 21:54:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bJtV21MH7z3P45; Fri, 13 Jun 2025 21:54:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749851690; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ttj6LWAPbItBGcV2oDIuRHVzY+u6egK0IISrHDsvS+U=; b=iBTb6+UrfIsiO4fNA4SnWrAHJfU+VxgaZjn2SY4nJZ9tUA3k4UwZS4PVc1RciTU81/ymUh BIApCTGRGsPlDqJFvxhqx9ul0V2SWADeeieZA2N2ycrlmWygVgQGr1tXXb6qYDEmcyrzkh lzyUzbTB7UdNlI07NTzU2qJTmc0GjupGPzQREQLfP2bPBp+/JwzIAroBFUB20WU3LNCirT SeN63H44362N6Wt5bmCB0qBx+KdlkKBWSMCSW+hYl1+0E0+DUJPWcszN6A5mhYTHT+clky pSQ/ktEs8CGbFqTycNjdyxTqe5/w9XDN+CZqgm8Fq82URbzbefw6xv4ow73afA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749851690; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ttj6LWAPbItBGcV2oDIuRHVzY+u6egK0IISrHDsvS+U=; b=omY9DWZT5YsDNVQjZDNIbvnhs+neZxaagmrFfrx5qFbmPn4ZBjd5OzX/sgNTg7W6BiU7TQ I4LGtiyIz/PwYsObU0dfb7RML8rRblRZDOZwUvThXVx3b/6MHGt18Y6klN24g6nvJTqSQO 3UUXcxiX5o3C6TXUBQqXIuMkCGoI81l67cyzC4pHH6BerIIHiEvBw3VjLk7qr25FRY/EOv GwZXezwWYC/HcVVmTNisgoJ4Hj3w4ufKgAWmb2KoW/1P+gqhVbqV0v2ifSGKutw2+ygRkW YSp9YfC9FRV778az9bLbYsmoKZT3fffUg5VgAOj7qb/NFAuCFf9ZIdE954BX0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749851690; a=rsa-sha256; cv=none; b=nkc3aUnN7ePRlSQDQpEBpmdSJGLpMCGvQfAFYb0R0Fc0t38BdKVaQWfcoxT3NBVT9wDQn+ U4ly5vvoUOSPftHpNOjPFk+LvtjsJqDxJN0yt+FfSHpvqbSiVHQY5PnN6QCnkUTyPf5csg 6NBxtukagxRcHDO7NxH9GdZjplSXSxLHGZKRZljK+SHkCYclkJQnJpWKbgjXhemFAfX8o5 sgCz9PiJ3lh7bvDtfJ7xpoKPtRKNxiaSowk+yMpMROOCA+L0mxeS/1sz9xuP5hqT2j8vWg MlQYTzShwDN/FGTjJtm8ReFsgVwT3C3MMLTULKrn/ZE1U1Xm+LtCtbNk/zc4CA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bJtV20sQNz1Dnp; Fri, 13 Jun 2025 21:54:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55DLso7Y098375; Fri, 13 Jun 2025 21:54:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55DLso8w098370; Fri, 13 Jun 2025 21:54:50 GMT (envelope-from git) Date: Fri, 13 Jun 2025 21:54:50 GMT Message-Id: <202506132154.55DLso8w098370@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Cox Subject: git: c82662dc7123 - main - arm pmap: fix CTASSERT List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c82662dc71237660f48b15164b34378cab1da25d Auto-Submitted: auto-generated The branch main has been updated by alc: URL: https://cgit.FreeBSD.org/src/commit/?id=c82662dc71237660f48b15164b34378cab1da25d commit c82662dc71237660f48b15164b34378cab1da25d Author: Alan Cox AuthorDate: 2025-06-13 21:41:21 +0000 Commit: Alan Cox CommitDate: 2025-06-13 21:53:59 +0000 arm pmap: fix CTASSERT Use the native spelling, PDR_SHIFT, instead of the x86 spelling, PDRSHIFT, that used to be defined by vm_page.h. Fixes: 330b17e1cf5c ("vm: remove pa_index from the machine-independent layer") --- sys/arm/arm/pmap-v6.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/arm/arm/pmap-v6.c b/sys/arm/arm/pmap-v6.c index a0e0b007ffaa..a0158bb128e7 100644 --- a/sys/arm/arm/pmap-v6.c +++ b/sys/arm/arm/pmap-v6.c @@ -563,7 +563,7 @@ CTASSERT(PAGE_SIZE == PTE2_SIZE); * so some things, which depend on other ones, are defined independently. * Now, it is time to check that we don't screw up something. */ -CTASSERT(PDRSHIFT == PTE1_SHIFT); +CTASSERT(PDR_SHIFT == PTE1_SHIFT); /* * Check L1 and L2 page table entries definitions consistency. */ From nobody Sat Jun 14 06:29:06 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bK5vT2Dxvz5VqKJ; Sat, 14 Jun 2025 06:29:09 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta004.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bK5vS6whCz4NBt; Sat, 14 Jun 2025 06:29:08 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4001a.ext.cloudfilter.net ([10.228.9.142]) by cmsmtp with ESMTPS id Q7K3uKk1S5MqyQKO4uN5ZX; Sat, 14 Jun 2025 06:29:08 +0000 Received: from spqr.komquats.com ([70.66.136.217]) by cmsmtp with ESMTPSA id QKO2unGwdWX70QKO3utb05; Sat, 14 Jun 2025 06:29:08 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=d71WygjE c=1 sm=1 tr=0 ts=684d16b4 a=h7br+8Ma+Xn9xscxy5znUg==:117 a=h7br+8Ma+Xn9xscxy5znUg==:17 a=kj9zAlcOel0A:10 a=6IFa9wvqVegA:10 a=6I5d2MoRAAAA:8 a=NEAV23lmAAAA:8 a=EkcXrb_YAAAA:8 a=YxBL1-UpAAAA:8 a=uWdJWRGJ4nZafTbHZh0A:9 a=CjuIK1q_8ugA:10 a=LK5xJRSDVpKd5WXXoEvA:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 498FF874; Fri, 13 Jun 2025 23:29:06 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 169EA113; Fri, 13 Jun 2025 23:29:06 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Warner Losh cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 900bc0206348 - main - rc.d/zpool: change mountcritlocal dep from BEFORE to REQUIRE In-reply-to: <202506131548.55DFmqnu004627@gitrepo.freebsd.org> References: <202506131548.55DFmqnu004627@gitrepo.freebsd.org> Comments: In-reply-to Warner Losh message dated "Fri, 13 Jun 2025 15:48:52 +0000." List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 13 Jun 2025 23:29:06 -0700 Message-Id: <20250614062906.169EA113@slippy.cwsent.com> X-CMAE-Envelope: MS4xfIXwBE365SFZAXGffKb3S6ZyrGDbrkUKJ8tKhJ/INQTOFcQRukMTDM79JleOUKIXGQxuXDH/bKlnlXpcW9Dg33HoNitdfJ8h1SyBGsYQvFAPhUbKEEPx nqwPDw2nNWZ0SQ2JbbRzagOpKxOQ8vsqPRtfiOicYS7GcdqIZsS6peEqLjmEu/7RV+XxbvhKu4PpOfIyBr/frZuJgdkoHr8PiMVS0q6Br9mU0evwH3o52D3w gNyA7bmSFyZdyhae5ASKqkhwj739exoMrkT3nKhEy5udPu/R689e6AX/p+4mbGYrCncWTYV7sRPfDtkN3tqXXjeld0RCEKws8EbEnjaifzU= X-Rspamd-Queue-Id: 4bK5vS6whCz4NBt X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] In message <202506131548.55DFmqnu004627@gitrepo.freebsd.org>, Warner Losh write s: > The branch main has been updated by imp: > > URL: https://cgit.FreeBSD.org/src/commit/?id=900bc0206348a439b3a0625a7239cb87 > a2dc27c5 > > commit 900bc0206348a439b3a0625a7239cb87a2dc27c5 > Author: Siva Mahadevan > AuthorDate: 2025-03-14 15:52:12 +0000 > Commit: Warner Losh > CommitDate: 2025-06-13 15:47:25 +0000 > > rc.d/zpool: change mountcritlocal dep from BEFORE to REQUIRE > > In cases where the `/boot` directory is mounted from a different disk, > `/boot/zfs/zpool.cache` will not be found during a `rc.d/zpool` > run. This is because `/etc/fstab` mounts are mounted in > `rc.d/mountcritlocal`, which currently runs AFTER (i.e. `REQUIRE:`) > `rc.d/zpool`. > > This change swaps the `rcorder` of `rc.d/zpool`'s dependency on > `mountcritlocal` from `BEFORE:` to `REQUIRE:`. This will ensure that > `/boot` (or even `/etc/` in some configurations) to be visible while > searching for `zpool.cache`. > > Reviewed by: imp > Pull Request: https://github.com/freebsd/freebsd-src/pull/1614 > Closes: https://github.com/freebsd/freebsd-src/pull/1614 > --- > libexec/rc/rc.d/zpool | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/libexec/rc/rc.d/zpool b/libexec/rc/rc.d/zpool > index 94e107bd9ae0..63f040ad122b 100755 > --- a/libexec/rc/rc.d/zpool > +++ b/libexec/rc/rc.d/zpool > @@ -3,8 +3,7 @@ > # > > # PROVIDE: zpool > -# REQUIRE: hostid disks > -# BEFORE: mountcritlocal > +# REQUIRE: hostid disks mountcritlocal > # KEYWORD: nojail > > . /etc/rc.subr > This causes systems which boot off UFS with ZFS to fail boot. The machine drops into single user until one can /etc/rc.d/zpool start and hit control-d to continue the boot. The reason this fails is /etc/fstab with legacy ZFS will no longer boot into multiuser. slippy$ grep zfs /etc/fstab | head # tank/usr/lib/debug/amd64 /usr/lib/debug zfs rw,noatime 0 0 tank/sfw/modules /boot/modules zfs rw,noatime 0 0 tank/sfw/local /usr/local zfs rw,noatime 0 0 tank/sfw/compat /usr/compat zfs rw,noatime 0 0 tank/sfw/var/lib /var/lib zfs rw,noatime 0 0 tank/sfw/var/db/pkg /var/db/pkg zfs rw,noatime 0 0 tank/sfw/var/db/ports /var/db/ports zfs rw,noatime 0 0 tank/var/db/mysql /var/db/mysql zfs rw,noatime 0 0 tank/db/pgsql /var/db/postgres zfs rw,noatime 0 0 tank/var/db/local /var/db/local zfs rw,noatime 0 0 slippy$ Please revert this. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e**(i*pi)+1=0 From nobody Sat Jun 14 06:35:51 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bK63G3Kprz5pf1r; Sat, 14 Jun 2025 06:35:54 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta004.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bK63F6k8Zz3CbM; Sat, 14 Jun 2025 06:35:53 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of cy.schubert@cschubert.com designates 3.97.99.33 as permitted sender) smtp.mailfrom=cy.schubert@cschubert.com; dmarc=permerror reason="p tag has invalid value: quarantine rua=mailto:p[ostmaster@cschubert.com" header.from=cschubert.com (policy=permerror) Received: from shw-obgw-4004a.ext.cloudfilter.net ([10.228.9.227]) by cmsmtp with ESMTPS id QDlZuL8Gw5MqyQKUbuN6tC; Sat, 14 Jun 2025 06:35:53 +0000 Received: from spqr.komquats.com ([70.66.136.217]) by cmsmtp with ESMTPSA id QKUauzKS1JhBPQKUbuhoWp; Sat, 14 Jun 2025 06:35:53 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=QY3Fvdbv c=1 sm=1 tr=0 ts=684d1849 a=h7br+8Ma+Xn9xscxy5znUg==:117 a=h7br+8Ma+Xn9xscxy5znUg==:17 a=kj9zAlcOel0A:10 a=6IFa9wvqVegA:10 a=6I5d2MoRAAAA:8 a=NEAV23lmAAAA:8 a=EkcXrb_YAAAA:8 a=VxmjJ2MpAAAA:8 a=YxBL1-UpAAAA:8 a=p_swzlC-Ip9MJO2sFL4A:9 a=CjuIK1q_8ugA:10 a=LK5xJRSDVpKd5WXXoEvA:22 a=7gXAzLPJhVmCkEl4_tsf:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id CE9A087F; Fri, 13 Jun 2025 23:35:51 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id C8C40302; Fri, 13 Jun 2025 23:35:51 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Warner Losh cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 900bc0206348 - main - rc.d/zpool: change mountcritlocal dep from BEFORE to REQUIRE In-reply-to: <20250614062906.169EA113@slippy.cwsent.com> References: <202506131548.55DFmqnu004627@gitrepo.freebsd.org> <20250614062906.169EA113@slippy.cwsent.com> Comments: In-reply-to Cy Schubert message dated "Fri, 13 Jun 2025 23:29:06 -0700." List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 13 Jun 2025 23:35:51 -0700 Message-Id: <20250614063551.C8C40302@slippy.cwsent.com> X-CMAE-Envelope: MS4xfOrwexDGAGwKTFd+W0SN8eQaTbJbtRD23JAXsIJnexwZdTFUA8/jMr0Mqf1/XXXrxYEiblZowLi2JFeNn2jrleCgfIAOqVr8PnCBibnreCJfWnywIdc6 U9ZOjdzYrAt/n466+/4xBZ9CCXNV1c7FPxiMME6AWz5fGz9iCjCx5ZH1AJTtlM68SpQgwKTnlDzTgvkr9AwuSqGSC+1V3jpVd9TnbBBOCzdcecHXYa87TKBS Hx4U+ABpou650NMMmKYO0uN2HRsjy0rr3KBP0E7oNeh6jcHbcmUfGlvU0FhwWcXVaC01bhH+Zrc2UL5Ufh/q7uWujLoP18REAfdNva76wMU= X-Spamd-Result: default: False [-1.04 / 15.00]; NEURAL_HAM_SHORT(-0.99)[-0.991]; NEURAL_HAM_MEDIUM(-0.98)[-0.978]; NEURAL_SPAM_LONG(0.83)[0.826]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:3.97.99.32/31]; RCVD_IN_DNSWL_LOW(-0.10)[3.97.99.33:from]; MIME_GOOD(-0.10)[text/plain]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; REPLYTO_EQ_FROM(0.00)[]; DMARC_BAD_POLICY(0.00)[cschubert.com : p tag has invalid value: quarantine rua=mailto:p[ostmaster@cschubert.com]; R_DKIM_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; RCVD_TLS_LAST(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org,dev-commits-src-all@freebsd.org]; RCPT_COUNT_THREE(0.00)[4] X-Rspamd-Queue-Id: 4bK63F6k8Zz3CbM X-Spamd-Bar: - In message <20250614062906.169EA113@slippy.cwsent.com>, Cy Schubert writes: > In message <202506131548.55DFmqnu004627@gitrepo.freebsd.org>, Warner Losh > write > s: > > The branch main has been updated by imp: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=900bc0206348a439b3a0625a7239cb > 87 > > a2dc27c5 > > > > commit 900bc0206348a439b3a0625a7239cb87a2dc27c5 > > Author: Siva Mahadevan > > AuthorDate: 2025-03-14 15:52:12 +0000 > > Commit: Warner Losh > > CommitDate: 2025-06-13 15:47:25 +0000 > > > > rc.d/zpool: change mountcritlocal dep from BEFORE to REQUIRE > > > > In cases where the `/boot` directory is mounted from a different disk, > > `/boot/zfs/zpool.cache` will not be found during a `rc.d/zpool` > > run. This is because `/etc/fstab` mounts are mounted in > > `rc.d/mountcritlocal`, which currently runs AFTER (i.e. `REQUIRE:`) > > `rc.d/zpool`. > > > > This change swaps the `rcorder` of `rc.d/zpool`'s dependency on > > `mountcritlocal` from `BEFORE:` to `REQUIRE:`. This will ensure that > > `/boot` (or even `/etc/` in some configurations) to be visible while > > searching for `zpool.cache`. > > > > Reviewed by: imp > > Pull Request: https://github.com/freebsd/freebsd-src/pull/1614 > > Closes: https://github.com/freebsd/freebsd-src/pull/1614 > > --- > > libexec/rc/rc.d/zpool | 3 +-- > > 1 file changed, 1 insertion(+), 2 deletions(-) > > > > diff --git a/libexec/rc/rc.d/zpool b/libexec/rc/rc.d/zpool > > index 94e107bd9ae0..63f040ad122b 100755 > > --- a/libexec/rc/rc.d/zpool > > +++ b/libexec/rc/rc.d/zpool > > @@ -3,8 +3,7 @@ > > # > > > > # PROVIDE: zpool > > -# REQUIRE: hostid disks > > -# BEFORE: mountcritlocal > > +# REQUIRE: hostid disks mountcritlocal > > # KEYWORD: nojail > > > > . /etc/rc.subr > > > > This causes systems which boot off UFS with ZFS to fail boot. The machine > drops into single user until one can /etc/rc.d/zpool start and hit > control-d to continue the boot. > > The reason this fails is /etc/fstab with legacy ZFS will no longer boot > into multiuser. > > slippy$ grep zfs /etc/fstab | head > # tank/usr/lib/debug/amd64 /usr/lib/debug zfs rw,noatime > 0 0 > tank/sfw/modules /boot/modules zfs rw,noatime 0 0 > tank/sfw/local /usr/local zfs rw,noatime 0 0 > tank/sfw/compat /usr/compat zfs rw,noatime 0 0 > tank/sfw/var/lib /var/lib zfs rw,noatime 0 0 > tank/sfw/var/db/pkg /var/db/pkg zfs rw,noatime 0 0 > tank/sfw/var/db/ports /var/db/ports zfs rw,noatime 0 0 > tank/var/db/mysql /var/db/mysql zfs rw,noatime 0 0 > tank/db/pgsql /var/db/postgres zfs rw,noatime 0 0 > tank/var/db/local /var/db/local zfs rw,noatime 0 0 > slippy$ > > Please revert this. I left this comment in the pull request and reopened it. This causes systems with ZFS legacy filesystems, those specified in /etc/fstab to fail to enter multi-user because mountcritlocal cannot find fstyp zfs. BTW, this is the reason I specified BEFORE: mountcritlocal when I created this rc script. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e**(i*pi)+1=0 From nobody Sat Jun 14 07:00:47 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bK6c133qGz5pgMm; Sat, 14 Jun 2025 07:00:49 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta003.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bK6c125zGz3QLL; Sat, 14 Jun 2025 07:00:49 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4004a.ext.cloudfilter.net ([10.228.9.227]) by cmsmtp with ESMTPS id QKeyum4pa9JM2QKsiueUW9; Sat, 14 Jun 2025 07:00:48 +0000 Received: from spqr.komquats.com ([70.66.136.217]) by cmsmtp with ESMTPSA id QKshuzNnRJhBPQKsiuhpKK; Sat, 14 Jun 2025 07:00:48 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=QY3Fvdbv c=1 sm=1 tr=0 ts=684d1e20 a=h7br+8Ma+Xn9xscxy5znUg==:117 a=h7br+8Ma+Xn9xscxy5znUg==:17 a=kj9zAlcOel0A:10 a=6IFa9wvqVegA:10 a=6I5d2MoRAAAA:8 a=NEAV23lmAAAA:8 a=EkcXrb_YAAAA:8 a=VxmjJ2MpAAAA:8 a=YxBL1-UpAAAA:8 a=PH0U2CRh-xQMZSihrLQA:9 a=CjuIK1q_8ugA:10 a=LK5xJRSDVpKd5WXXoEvA:22 a=7gXAzLPJhVmCkEl4_tsf:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 703B1B6; Sat, 14 Jun 2025 00:00:47 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 67AD42A; Sat, 14 Jun 2025 00:00:47 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Cy Schubert cc: Warner Losh , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 900bc0206348 - main - rc.d/zpool: change mountcritlocal dep from BEFORE to REQUIRE In-reply-to: <20250614063551.C8C40302@slippy.cwsent.com> References: <202506131548.55DFmqnu004627@gitrepo.freebsd.org> <20250614062906.169EA113@slippy.cwsent.com> <20250614063551.C8C40302@slippy.cwsent.com> Comments: In-reply-to Cy Schubert message dated "Fri, 13 Jun 2025 23:35:51 -0700." List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 14 Jun 2025 00:00:47 -0700 Message-Id: <20250614070047.67AD42A@slippy.cwsent.com> X-CMAE-Envelope: MS4xfFMNulWjWBMsG4IBRgrV4LCHCwnV7EiE6upxAwCy2DUOzaA+mFflo9MUl0VMuacAzttHL/oHkVUGI94eBINuUjw18FhkbTP9+tiWIN3UFTRCX5mUKj1g FMjcWemVxzEFGgnlCCWxTqfeglGz/AU8DGHHd1FUw+dy9Heb//NNV72FkEuOjeZ/UKxHXrg3NioPgJBpfyKPOO3w3kxMe62V10pG1L3qo/pPAXOA/I08BkXF sd8nVQyYs6bCyPtN+KwS8SKrR779q776hsCoswlgoJ/do0UmUz8xwLswufmnpZ0kPuSpiA10Mqh8vSTfmTln1RE6mzRLzNbhvhk4EPSsT8c= X-Rspamd-Queue-Id: 4bK6c125zGz3QLL X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] In message <20250614063551.C8C40302@slippy.cwsent.com>, Cy Schubert writes: > In message <20250614062906.169EA113@slippy.cwsent.com>, Cy Schubert writes: > > In message <202506131548.55DFmqnu004627@gitrepo.freebsd.org>, Warner Losh > > write > > s: > > > The branch main has been updated by imp: > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=900bc0206348a439b3a0625a7239 > cb > > 87 > > > a2dc27c5 > > > > > > commit 900bc0206348a439b3a0625a7239cb87a2dc27c5 > > > Author: Siva Mahadevan > > > AuthorDate: 2025-03-14 15:52:12 +0000 > > > Commit: Warner Losh > > > CommitDate: 2025-06-13 15:47:25 +0000 > > > > > > rc.d/zpool: change mountcritlocal dep from BEFORE to REQUIRE > > > > > > In cases where the `/boot` directory is mounted from a different disk > , > > > `/boot/zfs/zpool.cache` will not be found during a `rc.d/zpool` > > > run. This is because `/etc/fstab` mounts are mounted in > > > `rc.d/mountcritlocal`, which currently runs AFTER (i.e. `REQUIRE:`) > > > `rc.d/zpool`. > > > > > > This change swaps the `rcorder` of `rc.d/zpool`'s dependency on > > > `mountcritlocal` from `BEFORE:` to `REQUIRE:`. This will ensure that > > > `/boot` (or even `/etc/` in some configurations) to be visible while > > > searching for `zpool.cache`. > > > > > > Reviewed by: imp > > > Pull Request: https://github.com/freebsd/freebsd-src/pull/1614 > > > Closes: https://github.com/freebsd/freebsd-src/pull/1614 > > > --- > > > libexec/rc/rc.d/zpool | 3 +-- > > > 1 file changed, 1 insertion(+), 2 deletions(-) > > > > > > diff --git a/libexec/rc/rc.d/zpool b/libexec/rc/rc.d/zpool > > > index 94e107bd9ae0..63f040ad122b 100755 > > > --- a/libexec/rc/rc.d/zpool > > > +++ b/libexec/rc/rc.d/zpool > > > @@ -3,8 +3,7 @@ > > > # > > > > > > # PROVIDE: zpool > > > -# REQUIRE: hostid disks > > > -# BEFORE: mountcritlocal > > > +# REQUIRE: hostid disks mountcritlocal > > > # KEYWORD: nojail > > > > > > . /etc/rc.subr > > > > > > > This causes systems which boot off UFS with ZFS to fail boot. The machine > > drops into single user until one can /etc/rc.d/zpool start and hit > > control-d to continue the boot. > > > > The reason this fails is /etc/fstab with legacy ZFS will no longer boot > > into multiuser. > > > > slippy$ grep zfs /etc/fstab | head > > # tank/usr/lib/debug/amd64 /usr/lib/debug zfs rw,noatime > > > 0 0 > > tank/sfw/modules /boot/modules zfs rw,noatime 0 0 > > tank/sfw/local /usr/local zfs rw,noatime 0 0 > > tank/sfw/compat /usr/compat zfs rw,noatime 0 0 > > tank/sfw/var/lib /var/lib zfs rw,noatime 0 0 > > tank/sfw/var/db/pkg /var/db/pkg zfs rw,noatime 0 0 > > tank/sfw/var/db/ports /var/db/ports zfs rw,noatime 0 0 > > tank/var/db/mysql /var/db/mysql zfs rw,noatime 0 0 > > tank/db/pgsql /var/db/postgres zfs rw,noatime 0 0 > > tank/var/db/local /var/db/local zfs rw,noatime 0 0 > > slippy$ > > > > Please revert this. > > I left this comment in the pull request and reopened it. > > This causes systems with ZFS legacy filesystems, those specified in > /etc/fstab to fail to enter multi-user because mountcritlocal cannot find > fstyp zfs. > > BTW, this is the reason I specified BEFORE: mountcritlocal when I created > this rc script. An alternative would be this: diff --git a/libexec/rc/rc.d/mountcritlocal b/libexec/rc/rc.d/mountcritlocal index f91eaf44457c..db6436f63eb8 100755 --- a/libexec/rc/rc.d/mountcritlocal +++ b/libexec/rc/rc.d/mountcritlocal @@ -27,6 +27,15 @@ mountcritlocal_start() ;; esac + while read a b fstype rest; do + if [ "$fstype" = "zfs" ]; then + # zpool is needed for legacy ZFS + echo 'Importing zpools for legacy ZFS' + /etc/rc.d/zpool start + break + fi + done < /etc/fstab + # Mount everything except nfs filesystems. startmsg -n 'Mounting local filesystems:' mount_excludes='no' -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e**(i*pi)+1=0 From nobody Sat Jun 14 12:23:00 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bKFln4L66z516hf; Sat, 14 Jun 2025 12:23:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bKFlm6DfPz449r; Sat, 14 Jun 2025 12:23:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749903780; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oCTvmP8wgBHF/Oehm7QVhNZb8VT2CmfDL3D4fpr/3/I=; b=xXHwzcb1ovhE01XmLNLCYW+HyCN9uu/NFUlGuxdDXylE1pq1mHOPH89ajq7YIcrQPrHeH4 VnHxphF3zEgYp28k6veUhqpn093shGT3LCoA6SQo7VAjtmjmSmJkJvZ8MpMQmt5xVW+dJY meW5tDmRYrmTcF6k93czUU7WX6bf7HRieAOEdqBRIbZmDeZbrBVKSjzcycTqMl4KXZsyb9 Wm760tp8Fc7ymf4WNguQOnEFPGxXLuo46eHRLDKd68xDhe1ONvFEd7ficTu35+ZUeNbq3e W7KAZLEoa+gO87twAJxwjYX+qdOPitvdwl4WByOEmzMOEezYEhnF5rnhps37PA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749903780; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oCTvmP8wgBHF/Oehm7QVhNZb8VT2CmfDL3D4fpr/3/I=; b=ZzhJmMPv/PdsPqOEni0DJhr6zZHVm+8Hx7Sf9XUwrOVBlGc7dcW45ZbgWngXlhoVQhukFD vNHOh3B9Un9oiKIgflYpVZSGajqkrorZ1z7V6Q+QmIXHeC6dFfiQN4Nb6y5eQ24RBi4b8q mg8/cz9ehPnZOa2haBQwHC8l3vqkZA/LvuYoiUCktjRqZN/3qX7KHtgG08HGCUDm6kNPiD bePppKKtjU1WMu0DlUkPgj2f0HoW+oXzv+9d+tk2Mp4BVrtojUJwZSoR/D5SmYOa5zy6R9 FtO/OtvAIjl+dPMuZXDmqJjildJkp6GKGv32de6LgfBxBjcrfqrYfOT9kT7Z6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749903780; a=rsa-sha256; cv=none; b=QITaYUvJHTIDdB8bhKJFDUfFhk+KJcZeHoeW8P2Dy/0JYXXzfm9VJSMD+mlLbXXI17D5/u gYfYhSWOAMhqC8KrvcHUbtpr0e/zCffiq837YscCvfK4bZL23WCepZkYtpE0nk9xw/3ABZ vNk6TpoX0lMkvACA5dNd4J9FZszthC8aBLzDOmQnqkDaPA/DV5aINDUY1DemqwN5GWz49u K3xyVlS37HKwNZnVTmdWHuc0NhQNXT2qEiHwAgC8yR6M7YPdoB++tvLx5m/2bscS1W+CuC oAe2B6NYGRlBKiQ9+Mjj98oWtIdAfdy/oQAtrKEumXxt/wvPJh23MFWRD6ZeKQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bKFlm5cgczBPD; Sat, 14 Jun 2025 12:23:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55ECN0t6028829; Sat, 14 Jun 2025 12:23:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55ECN0cG028826; Sat, 14 Jun 2025 12:23:00 GMT (envelope-from git) Date: Sat, 14 Jun 2025 12:23:00 GMT Message-Id: <202506141223.55ECN0cG028826@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 3b4bc5d70e1c - main - gve: Relax a static assertion List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3b4bc5d70e1c2066fcb6e8535941258c88999fa2 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3b4bc5d70e1c2066fcb6e8535941258c88999fa2 commit 3b4bc5d70e1c2066fcb6e8535941258c88999fa2 Author: Mark Johnston AuthorDate: 2025-06-14 12:17:49 +0000 Commit: Mark Johnston CommitDate: 2025-06-14 12:17:49 +0000 gve: Relax a static assertion It's okay if MCLBYTES is larger than the default receive buffer size. Fixes: 71702df61262 ("gve: Add support for 4k RX Buffers when using DQO queue formats") --- sys/dev/gve/gve.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/gve/gve.h b/sys/dev/gve/gve.h index dd432dc0eb45..64c2a0481817 100644 --- a/sys/dev/gve/gve.h +++ b/sys/dev/gve/gve.h @@ -85,7 +85,7 @@ static MALLOC_DEFINE(M_GVE, "gve", "gve allocations"); -_Static_assert(MCLBYTES == GVE_DEFAULT_RX_BUFFER_SIZE, +_Static_assert(MCLBYTES >= GVE_DEFAULT_RX_BUFFER_SIZE, "gve: bad MCLBYTES length"); _Static_assert(MJUMPAGESIZE >= GVE_4K_RX_BUFFER_SIZE_DQO, "gve: bad MJUMPAGESIZE length"); From nobody Sat Jun 14 12:42:40 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bKGBS6wglz5189b; Sat, 14 Jun 2025 12:42:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bKGBS4LpLz3GPD; Sat, 14 Jun 2025 12:42:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749904960; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Qcbxu13zGTvrrpGYQM+MUFCsXE2p73Ah6Vp0+Zju72A=; b=JKtxB+8Pmd35J7c6zb1ECf9Cep0yHUG97XDdHqlq5ocS/9vKoIlRb22QbgYGYKiaLpHffI Aus1CD8dXktadBwuTHvKzLd/vownD/dhUpMm8t/bxS6DZSXFXo2tMrkbbSTsXfk8YPYJzQ tUDh49yXKtDp4uVRRRDuvhLjAdHRk2CI5AxZfXZcnlDHGZc/Vbt5pvwtmb2IMxrTmPrNmU cRPGvD+wG8Nxi0z94NdDpfBSHBZKQl+ByNcVb57TWOd2hF+HYbf8C4CWvqRU6/wqMepEKd b6uVGnKBAwT7QL73PjadYrbj5PHtBX0dCKLYsEF5rQveAinsIX9QGQrWweiVFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749904960; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Qcbxu13zGTvrrpGYQM+MUFCsXE2p73Ah6Vp0+Zju72A=; b=dU49Z3J6uzLJTzQdU734910w9Yv2bStOCP588HEXrsnxG9RyfunlO0W/nyaXuwIgn9oPQU lQiobIRqIC7RM5S6/x2pGg0L05AJu48L17cgbiFxwb5Tk4tAHkfhLlMtQzhLVJXaVfNUF3 IR9ggzpujq2F4DMiFGo7PWmxMrIeJE8D3pNxAca2X04NH2AnP+/bacGh9nJT+Ab+7p0zE/ twgtPTBsePcNI9q3vurK92xphlwum9qoGfmq2KDnvKIlbMyTW5sTVhnURSSpzQcX0Yjcqe MqKlG0aaiQCJeDSlgfPO0K/0talFhWLRoPSBDIg3237t1Caq7LAZufeBuC4JcA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749904960; a=rsa-sha256; cv=none; b=A8AP7qyor/zU9JJBfmxjhaNwXATV8mF+jxNT0gVFkSW6dmuneXVKgKanN4/Jz2i3GdqBXf DlIhUGsoXcSiWrUP+yQg/eNj7CQwgD4iY2bED0jCO4hjykBooFZ7Q0xwAuccp4krHHIb3O yTO//yz77MspDCDslXTu1vGm4Ye3vKZLjFJavGIMMJiJQ4mPOhOzd4RSajEKzrNMVLq2Mm uQQuawevmhqaQ7ArqdzMLXukSl7YoSgfYuP4eg8PMeWnV/pb4G/5w8v+gDVZ1hiKyLafvS JFnri0MD0p93w97ZUmBZxOKn1SR03TdjdZ/NGqlOUh0PyDk5EZ6mLAPBTt++Bw== Received: from [10.201.5.108] (unknown [216.191.123.182]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bKGBS315MzMkW; Sat, 14 Jun 2025 12:42:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <50830604-3bd8-47d6-920c-fd099a96a08e@FreeBSD.org> Date: Sat, 14 Jun 2025 08:42:40 -0400 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: aae67a2c2b66 - main - mfiutil: Fix unsafe assumptions of snprintf(3) return value Content-Language: en-US To: Warner Losh , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202506130121.55D1LhXF086456@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: <202506130121.55D1LhXF086456@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 6/12/25 21:21, Warner Losh wrote: > The branch main has been updated by imp: > > URL: https://cgit.FreeBSD.org/src/commit/?id=aae67a2c2b663a6bce8fbc087ff8490336b8618f > > commit aae67a2c2b663a6bce8fbc087ff8490336b8618f > Author: WHR > AuthorDate: 2024-09-03 10:19:04 +0000 > Commit: Warner Losh > CommitDate: 2025-06-13 01:21:44 +0000 > > mfiutil: Fix unsafe assumptions of snprintf(3) return value > > PR: 281160 > Reviewed by: imp > Pull Request: https://github.com/freebsd/freebsd-src/pull/1405 > Closes: https://github.com/freebsd/freebsd-src/pull/1405 > --- > usr.sbin/mfiutil/mfi_bbu.c | 17 +++++++++++++++-- > 1 file changed, 15 insertions(+), 2 deletions(-) > > diff --git a/usr.sbin/mfiutil/mfi_bbu.c b/usr.sbin/mfiutil/mfi_bbu.c > index 9075c4d0ddd0..e97227d47c70 100644 > --- a/usr.sbin/mfiutil/mfi_bbu.c > +++ b/usr.sbin/mfiutil/mfi_bbu.c > @@ -50,10 +50,23 @@ mfi_autolearn_period(uint32_t period, char *buf, size_t sz) > > tmp = buf; > if (d != 0) { > - tmp += snprintf(buf, sz, "%u day%s", d, d == 1 ? "" : "s"); > + int fmt_len; > + fmt_len = snprintf(buf, sz, "%u day%s", d, d == 1 ? "" : "s"); > + if (fmt_len < 0) { > + *buf = 0; > + return; > + } > + if ((size_t)fmt_len >= sz) { > + return; > + } > + tmp += fmt_len; > sz -= tmp - buf; > if (h != 0) { > - tmp += snprintf(tmp, sz, ", "); > + fmt_len = snprintf(tmp, sz, ", "); > + if (fmt_len < 0 || (size_t)fmt_len >= sz) { > + return; > + } > + tmp += fmt_len; > sz -= 2; > } > } It seems like using a string builder like fmemopen() or sbuf() would be better here than fragile dances with snprintf(). -- John Baldwin From nobody Sat Jun 14 12:46:47 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bKGHD0xPLz51877; Sat, 14 Jun 2025 12:46:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bKGHC7115z3KBR; Sat, 14 Jun 2025 12:46:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749905208; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yCsunvavzTaxApotM+YhNiOr+tTosIl+GrcT9EwdvzA=; b=tcSBDw8TmFJ+mP3YXz6osdGCQkZ4gr2rQo3HLfHyqpO0abFW0lrPPto7XxOnJ+RNJqJzLA 25HpwiQlpN51p6RgRuL2OjjTJD9uTzRBRdmgNIbyt50+L+3p4G0/JU/eYe9Adm6RXsMqeY A+xPVAA564e4mBG8DONewZ6bJ2yxKzo+ANBED5F/0UQkqLPRV55E89ofNSnUQJG18uXZ60 DjlUIyDMhJo50XfxnHM2JlR6HgJBWlXwisBtE+5Y+1dKlpX8pFshbbMUYN4X9P/RvnaB7+ 4Y/HGgSKX0q7GThgVZEeMB9BNa/4HdWmBw+75hoBfwUzESkKm7DSnG0To13XMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749905208; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yCsunvavzTaxApotM+YhNiOr+tTosIl+GrcT9EwdvzA=; b=LAL8GivCK91igpS+FMmvk32QeEg6AOD1R0bIGq5IBL5ZH2YD8Lowu4ALxOoWYA7cXPLeN7 Rr7qEL4NXXBy+yzYHB6N/ZNNiv4MTSEryGEKfdA3Ys6MTBCo2Qv1pbyoTKEFe661Re64LQ 9Jlj1WAr7ZHMyg8QZoo5eMSQaD4mzck5nndDJ+1l+EkqHmqU/VW4jAYMFXK/fjFC3zn7+D huTkEmNmGPidT+wCAwSx3rZt0Rhv2qzILuQT2z6/eXRNGXYWpyRr6pXKI4jc8TtjitNRgO BfJclZDBGh7kjnj5sOfttouesCteKSUMfkbSV3afaVL7xmuwAawHGCyRAjF+TA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749905208; a=rsa-sha256; cv=none; b=EYn0b47zrgyqrxSxRn7UTx4dU/9zetBzYSnMR8DqGKKX/AZrAB1aahRErqqgtQ3xnMLHY8 df99LgTOCCVRKFpaCV9kxxUYa1KssQHO2bZRSTCUYgp60ZmRHsomflLHw1EHNV0pI33Ozx wn9nzE5lAUkrfsB4AyNHEjKMhbmKNVpmwDJqu4+gc2teuACez9H4WmAmA/mgghaImG6ZDw +LSRgIc4UH2k1pDtWTA+lm4lIwm3cTvtrFQHoYWdmOLjs1sD5M+WXc2tn3z8fV43dU0LSg bhl/1bF5O4PTa9UElmusdVik6jHb5hAMiJs1rl7GFnvTYdwW52ksHZu744xqXA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bKGHC6Y7dzCGS; Sat, 14 Jun 2025 12:46:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55ECkl8K067137; Sat, 14 Jun 2025 12:46:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55ECklG6067133; Sat, 14 Jun 2025 12:46:47 GMT (envelope-from git) Date: Sat, 14 Jun 2025 12:46:47 GMT Message-Id: <202506141246.55ECklG6067133@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: f3c25bf955d5 - main - pf: Fix the prototype for pf_match_rule() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f3c25bf955d5c2660b5f15ae38af56fa6bf02f5e Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f3c25bf955d5c2660b5f15ae38af56fa6bf02f5e commit f3c25bf955d5c2660b5f15ae38af56fa6bf02f5e Author: Mark Johnston AuthorDate: 2025-06-14 12:44:16 +0000 Commit: Mark Johnston CommitDate: 2025-06-14 12:44:58 +0000 pf: Fix the prototype for pf_match_rule() Fixes: fe96610ba943 ("pf: rework anchor handling to recurse") --- sys/net/pfvar.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 65debf53e5ff..24095ea28b24 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -2719,7 +2719,7 @@ int pf_osfp_match(struct pf_osfp_enlist *, pf_osfp_t); void pf_print_host(struct pf_addr *, u_int16_t, sa_family_t); enum pf_test_status pf_step_into_anchor(struct pf_test_ctx *, struct pf_krule *); -int pf_match_rule(struct pf_test_ctx *, struct pf_kruleset *); +enum pf_test_status pf_match_rule(struct pf_test_ctx *, struct pf_kruleset *); void pf_step_into_keth_anchor(struct pf_keth_anchor_stackframe *, int *, struct pf_keth_ruleset **, struct pf_keth_rule **, struct pf_keth_rule **, From nobody Sat Jun 14 12:50:54 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bKGMz1qjMz5MQnt; Sat, 14 Jun 2025 12:50:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bKGMy666rz3MYV; Sat, 14 Jun 2025 12:50:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749905454; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+p0JlRm/1skfgYGlyj4eIdvOyK/n9ORGzvMe5rqN8zQ=; b=Qg2JeZqEyVeMhFG4+V/XBzieMSP0Lu+HLHfbcyyeCAWHuP1DfJse8LXpUzqaussjrRJOyj 6JxVID+XsweAbyxcvb9ZPdpdl8sqS2KipPINSUtrc1C8ABpukoS3BlzkQBROqJB5hcXFe1 J48PlT29fJMjM8/q22wR/UMcABTAaVyYXGYIRb311jgCP4+jh7Xpqeg2YfNdrhabWsopDA fjw6Eu1XvfDDd8BIMJikQfVmfIdnwVhy9sA0ynpr2VgvUe7npjECBASeiFj69RyidQE5C2 X6kAbYTDzBf0rMNVHs8Mr2oTrceGnly1aGzVPn2ppRWRBvOMfYcOmz3B7CPGww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749905454; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+p0JlRm/1skfgYGlyj4eIdvOyK/n9ORGzvMe5rqN8zQ=; b=GBEYFKzQAYnVVm9qUvLoFpNFasqhNjeyYD0CTaeng0CSK6lc4vqcoQotAWXoJQ6+vbK54c hyQcVj5pMZDcV1OxMmyzDY2mYHw8bgsnc5yurN6TU3r8EDxFe4suZQOlNCXYGbqr3U7Zqe fMrglI3qMvSIKFq0RiMQkRGKz/cSbZd4JR1oawzLRDrctyNylCBwpdLM6TbQjcr7+msLUd ruJwIUBoq5lJeM+e33viaXrwSRHQ1VY5oa/UEKSL4psTesm4HZ1NmYPX9NWDH5DbObl+6D hsgzAWPlb1C2eWlW3U1qSi+YghGny4Ux0y8GcbNUvEoLvAamOWgnLAloyVCCOQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749905454; a=rsa-sha256; cv=none; b=L0hwqR026NdBl1wK/oQPMSfjPKlq/4C40LtVqw9bPiyqZmTENO0hLaKGSPu8LIH+LQ1nhQ 6V3tJfx4qFFGcRu/qWglho33ofGpxldwns3qbMIkyvMn5Es843oiP+lu9wOJ/VhwdUTxkK 9tkfIKgZERfMDGxk1RntcvafeHLYUDjq7lK2yc4OAjI7IVCQcT1jYCn2kRDkfwYIPKQWlS iZVqExKDJc9pODkbeBULBy3IyDZYIEKGRL03ufqA1izBvimHy4wpVTOXRirxPHFbQTVzNZ kqVlVVT4pEL5LpI06amQEHg7p2q1Y+ivgZR/NsiObDJTNWSEn3kfyuzgwgc9iQ== Received: from [10.201.5.108] (unknown [216.191.123.182]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bKGMy3fLwzMBc; Sat, 14 Jun 2025 12:50:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <0003a97e-60ed-4868-8844-0a0346bc97ee@FreeBSD.org> Date: Sat, 14 Jun 2025 08:50:54 -0400 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 4e207e3849d4 - main - exterr: make SET_ERRORX() macros an expression evaluating to the errno Content-Language: en-US To: Konstantin Belousov , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202506131940.55DJeTa1046740@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: <202506131940.55DJeTa1046740@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 6/13/25 15:40, Konstantin Belousov wrote: > The branch main has been updated by kib: > > URL: https://cgit.FreeBSD.org/src/commit/?id=4e207e3849d47648ced17da16aad39355b99d9b2 > > commit 4e207e3849d47648ced17da16aad39355b99d9b2 > Author: Konstantin Belousov > AuthorDate: 2025-06-13 17:32:50 +0000 > Commit: Konstantin Belousov > CommitDate: 2025-06-13 19:39:55 +0000 > > exterr: make SET_ERRORX() macros an expression evaluating to the errno > > And move the actual td_kexterr fill code into the function, saving some > text. > > Suggested and reviewed by: markj > Sponsored by: The FreeBSD Foundation > Differential revision: https://reviews.freebsd.org/D50836 > --- > sys/kern/sys_generic.c | 20 ++++++++++++++++++++ > sys/sys/exterrvar.h | 22 +++++++--------------- > 2 files changed, 27 insertions(+), 15 deletions(-) > > diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c > index ec61d0bdc541..d31ff3b939cc 100644 > --- a/sys/kern/sys_generic.c > +++ b/sys/kern/sys_generic.c > @@ -2281,3 +2281,23 @@ sys_exterrctl(struct thread *td, struct exterrctl_args *uap) > return (EINVAL); > } > } > + > +int > +exterr_set(int eerror, int category, const char *mmsg, uintptr_t pp1, > + uintptr_t pp2, int line) > +{ > + struct thread *td; > + > + td = curthread; > + if ((td->td_pflags2 & TDP2_UEXTERR) != 0) { > + td->td_pflags2 |= TDP2_EXTERR; > + td->td_kexterr.error = eerror; > + td->td_kexterr.cat = category; > + td->td_kexterr.msg = mmsg; > + td->td_kexterr.p1 = pp1; > + td->td_kexterr.p2 = pp2; > + td->td_kexterr.src_line = line; > + ktrexterr(td); > + } > + return (eerror); > +} > diff --git a/sys/sys/exterrvar.h b/sys/sys/exterrvar.h > index 4b168446e23b..d3c2c7c92d06 100644 > --- a/sys/sys/exterrvar.h > +++ b/sys/sys/exterrvar.h > @@ -31,27 +31,19 @@ > #endif > > #ifdef BLOAT_KERNEL_WITH_EXTERR > -#define SET_ERROR_MSG(mmsg) _Td->td_kexterr.msg = mmsg > +#define SET_ERROR_MSG(mmsg) (mmsg) > #else > -#define SET_ERROR_MSG(mmsg) _Td->td_kexterr.msg = NULL > +#define SET_ERROR_MSG(mmsg) NULL > #endif > > -#define SET_ERROR2(eerror, mmsg, pp1, pp2) do { \ > - struct thread *_Td = curthread; \ > - if ((_Td->td_pflags2 & TDP2_UEXTERR) != 0) { \ > - _Td->td_pflags2 |= TDP2_EXTERR; \ > - _Td->td_kexterr.error = eerror; \ > - _Td->td_kexterr.cat = EXTERR_CATEGORY; \ > - SET_ERROR_MSG(mmsg); \ > - _Td->td_kexterr.p1 = (uintptr_t)pp1; \ > - _Td->td_kexterr.p2 = (uintptr_t)pp2; \ > - _Td->td_kexterr.src_line = __LINE__; \ > - ktrexterr(_Td); \ > - } \ > -} while (0) > +#define SET_ERROR2(eerror, mmsg, pp1, pp2) \ > + exterr_set(eerror, EXTERR_CATEGORY, SET_ERROR_MSG(mmsg), \ > + (uintptr_t)(pp1), (uintptr_t)(pp2), __LINE__) > #define SET_ERROR0(eerror, mmsg) SET_ERROR2(eerror, mmsg, 0, 0) > #define SET_ERROR1(eerror, mmsg, pp1) SET_ERROR2(eerror, mmsg, pp1, 0) > > +int exterr_set(int eerror, int category, const char *mmsg, uintptr_t pp1, > + uintptr_t pp2, int line); > int exterr_to_ue(struct thread *td, struct uexterror *ue); > void ktrexterr(struct thread *td); BTW, you could have a single SET_ERROR(eerror, mmsg, ...) wrapper around SET_ERRORx following what is done for CTR() (vs CTRx()). -- John Baldwin From nobody Sat Jun 14 12:59:39 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bKGZG05ZCz5MRPS; Sat, 14 Jun 2025 12:59:50 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bKGZF4BJwz3SCn; Sat, 14 Jun 2025 12:59:49 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qt1-x832.google.com with SMTP id d75a77b69052e-4a44e94f0b0so37436201cf.1; Sat, 14 Jun 2025 05:59:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1749905983; x=1750510783; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=WGuVc1+ue+garrAKOEnSG+bKKApRE/alKUxlrHy5sXI=; b=Nbw7bNXNjhCchXaobpn9+3MYAJ3Y5Fz0Miil78AZhq43wVvgKpRdJdo8vFIEc14iOA lh3YSSd+KnN/+xTImYvpfo1BZpe7joAYkgMzsoqIf5OMc7LNxJKpsmwkUiwcY0kgGWve Ln4sWZVSWKp2McBH1CENbUdHnrDa81OxCILz3wxLG//f5NzamsVMqs0zKLWqfm217hMn FvgEdK5J9+ukl8elhiGqrHyYyk6EWrXpM7mNIz1/2Q+c+gFi3NwhaAYQ42lgedkMeUYP hf/i7W+WJlEp0mVPZU1vrpoqIusvu6fvjr0ZHNP5D7tu0Hiidx5gFsbYZYmCodjO1xqI I6ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749905983; x=1750510783; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WGuVc1+ue+garrAKOEnSG+bKKApRE/alKUxlrHy5sXI=; b=Y17tg3qnFPMBgL9Est+9A/BI1ZBCiRkpppa97UExuc+p4jdwvvOTcJC/iB9oCHciCW icoSp8zJS0j5aSgThEXjN1QqbicVkfW9TjjYbauQgGx+VCyWyrzQd5o+KLDXSiZb5M7A HGtAt2ZTWF2nJrDKJr/zEVab1xO+JQ2LYUNaDquoiIayrnCCiW9aB73wFnit1srxq9GM EtdLCuTVaIAx1bu1UsMb7wZqQOJo8B/Q7NBrArlvzfGcIPRsps+eT9+cBwJrm35Xunp+ 2fkCLwFWXBeeiZFhyc8OI3j7mohvywWXUmiA2wc4kZkUY1HzAb5u5HHueBAiB/perZkK NCPA== X-Forwarded-Encrypted: i=1; AJvYcCUJHvJ4WS/1saEjcS8Ofw2HEQBPvNYbMEI5PuirQN2m+IkpAOa917eB+UPqzX33Kou/zjpHvdGyLzAtHYIRHobu+ni/@freebsd.org, AJvYcCUanbqZrYRyLluB2pd9vDwGMgfOhN+us5wTcraXTVk5I+ruy2G3WMM9Va8iGYrTBFD4XvLMpnwVLDhlADEtBpg=@freebsd.org, AJvYcCWkt1fYrkMV+U5r+LXw6Y1VOIfO5XWlEkq5IZyhF5owB/WEpqZFeo5PDa8R0PAaOuobCGIoWd7AzeQfqd/P4iwhQBGQk+M=@freebsd.org X-Gm-Message-State: AOJu0YyqEvX4JbJ0toPUFJq4Gze1Oo/VC6KXRdKSgMCXNoFHAhG3oA1z RFGCybvwkzNFX9nXXneBZ4Y5pITkK8AQ991FUrkla3F/DgD1ulKpnMCYe/Eya6c/ X-Gm-Gg: ASbGnctTjgZUqzkp5ygLGgfVHo12KGoH3tfMiPcJMKoRmVKl1bZfkSg+QTqotdF+y7P g6EmLaSlHUr/iUJCfUQJGD+ut2V5unXu0yKo1tbbnZpjB8HFH8q2zSDFMtMxJCVTQtPM4dG0N9M czSfzl2aAtg56lL0D2cp/ra92qJbfrj3qduPw5OfcZNN0orJ7KTVGOM3byzH6jYnHa/YlD6ZwkD I1kovclucjoJSpEfenLKW53q9xyhSm7duOLY97+hdBupjC1uCzaaskw43ZCjpy5q6bXZiPBOh1K uFs0yGwGil3IO6hy5E+F9eEu/HtNmf3LZy9ww1Z9FZ2eJV5fIPsSgeEX0Uqs2Npnaw+FdC0zfh0 Q X-Google-Smtp-Source: AGHT+IFCWqthAN4Wpj6mR4+va9dZtPsIa86Kra8glueYtey8Ao48WlKXIWKPZjd0B+ohOtUXibBsRA== X-Received: by 2002:a05:622a:15ca:b0:494:959e:26a3 with SMTP id d75a77b69052e-4a73c5fc8f5mr48996271cf.34.1749905982529; Sat, 14 Jun 2025 05:59:42 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-4a72a5201basm27755491cf.78.2025.06.14.05.59.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Jun 2025 05:59:42 -0700 (PDT) Date: Sat, 14 Jun 2025 08:59:39 -0400 From: Mark Johnston To: John Baldwin Cc: Konstantin Belousov , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 4e207e3849d4 - main - exterr: make SET_ERRORX() macros an expression evaluating to the errno Message-ID: References: <202506131940.55DJeTa1046740@gitrepo.freebsd.org> <0003a97e-60ed-4868-8844-0a0346bc97ee@FreeBSD.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0003a97e-60ed-4868-8844-0a0346bc97ee@FreeBSD.org> X-Rspamd-Queue-Id: 4bKGZF4BJwz3SCn X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] On Sat, Jun 14, 2025 at 08:50:54AM -0400, John Baldwin wrote: > On 6/13/25 15:40, Konstantin Belousov wrote: > > The branch main has been updated by kib: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=4e207e3849d47648ced17da16aad39355b99d9b2 > > > > commit 4e207e3849d47648ced17da16aad39355b99d9b2 > > Author: Konstantin Belousov > > AuthorDate: 2025-06-13 17:32:50 +0000 > > Commit: Konstantin Belousov > > CommitDate: 2025-06-13 19:39:55 +0000 > > > > exterr: make SET_ERRORX() macros an expression evaluating to the errno > > And move the actual td_kexterr fill code into the function, saving some > > text. > > Suggested and reviewed by: markj > > Sponsored by: The FreeBSD Foundation > > Differential revision: https://reviews.freebsd.org/D50836 > > --- > > sys/kern/sys_generic.c | 20 ++++++++++++++++++++ > > sys/sys/exterrvar.h | 22 +++++++--------------- > > 2 files changed, 27 insertions(+), 15 deletions(-) > > > > diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c > > index ec61d0bdc541..d31ff3b939cc 100644 > > --- a/sys/kern/sys_generic.c > > +++ b/sys/kern/sys_generic.c > > @@ -2281,3 +2281,23 @@ sys_exterrctl(struct thread *td, struct exterrctl_args *uap) > > return (EINVAL); > > } > > } > > + > > +int > > +exterr_set(int eerror, int category, const char *mmsg, uintptr_t pp1, > > + uintptr_t pp2, int line) > > +{ > > + struct thread *td; > > + > > + td = curthread; > > + if ((td->td_pflags2 & TDP2_UEXTERR) != 0) { > > + td->td_pflags2 |= TDP2_EXTERR; > > + td->td_kexterr.error = eerror; > > + td->td_kexterr.cat = category; > > + td->td_kexterr.msg = mmsg; > > + td->td_kexterr.p1 = pp1; > > + td->td_kexterr.p2 = pp2; > > + td->td_kexterr.src_line = line; > > + ktrexterr(td); > > + } > > + return (eerror); > > +} > > diff --git a/sys/sys/exterrvar.h b/sys/sys/exterrvar.h > > index 4b168446e23b..d3c2c7c92d06 100644 > > --- a/sys/sys/exterrvar.h > > +++ b/sys/sys/exterrvar.h > > @@ -31,27 +31,19 @@ > > #endif > > #ifdef BLOAT_KERNEL_WITH_EXTERR > > -#define SET_ERROR_MSG(mmsg) _Td->td_kexterr.msg = mmsg > > +#define SET_ERROR_MSG(mmsg) (mmsg) > > #else > > -#define SET_ERROR_MSG(mmsg) _Td->td_kexterr.msg = NULL > > +#define SET_ERROR_MSG(mmsg) NULL > > #endif > > -#define SET_ERROR2(eerror, mmsg, pp1, pp2) do { \ > > - struct thread *_Td = curthread; \ > > - if ((_Td->td_pflags2 & TDP2_UEXTERR) != 0) { \ > > - _Td->td_pflags2 |= TDP2_EXTERR; \ > > - _Td->td_kexterr.error = eerror; \ > > - _Td->td_kexterr.cat = EXTERR_CATEGORY; \ > > - SET_ERROR_MSG(mmsg); \ > > - _Td->td_kexterr.p1 = (uintptr_t)pp1; \ > > - _Td->td_kexterr.p2 = (uintptr_t)pp2; \ > > - _Td->td_kexterr.src_line = __LINE__; \ > > - ktrexterr(_Td); \ > > - } \ > > -} while (0) > > +#define SET_ERROR2(eerror, mmsg, pp1, pp2) \ > > + exterr_set(eerror, EXTERR_CATEGORY, SET_ERROR_MSG(mmsg), \ > > + (uintptr_t)(pp1), (uintptr_t)(pp2), __LINE__) > > #define SET_ERROR0(eerror, mmsg) SET_ERROR2(eerror, mmsg, 0, 0) > > #define SET_ERROR1(eerror, mmsg, pp1) SET_ERROR2(eerror, mmsg, pp1, 0) > > +int exterr_set(int eerror, int category, const char *mmsg, uintptr_t pp1, > > + uintptr_t pp2, int line); > > int exterr_to_ue(struct thread *td, struct uexterror *ue); > > void ktrexterr(struct thread *td); > > BTW, you could have a single SET_ERROR(eerror, mmsg, ...) wrapper around SET_ERRORx > following what is done for CTR() (vs CTRx()). Note that this would collide with an OpenZFS macro of the same name (which exists to make it easy to insert dtrace probes into error paths). If your suggestion is implemented, then it would be sensible to use a different name to avoid collisions, maybe SET_EXTERROR() or just EXTERROR(). From nobody Sat Jun 14 13:12:17 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bKGrz1wkqz5MSvq for ; Sat, 14 Jun 2025 13:12:35 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bKGry6JTHz3YVJ for ; Sat, 14 Jun 2025 13:12:34 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pj1-x102b.google.com with SMTP id 98e67ed59e1d1-3138d31e40aso3069965a91.1 for ; Sat, 14 Jun 2025 06:12:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1749906748; x=1750511548; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=4husOKAZTdenR4dTY7R6+2F368XC82t/F0SJemMOk68=; b=ai2RqHEXCx746ZrlRUm2fSsTgOCO8zzOuMT47pEPeG0eYD0x6uFJGobyDDgsdIZEOa ANTpXBZ1wtj8hcOCa4nGuaI2tfe7Ia1MM9xXHOBNK5KwTK0jhYgP7QOdrgI5v7BxxiBv 1kH9y9K1b3icGGnpi0RP9qwDp0ZE0m6F5V8979D39rpb4Ka1f+ntmx+lOtXfmGtpiPIA 0hA+AJ36GuvnQpjahcZFX/4iFfIPk1VHAsMjaHuP5XQ4IVe2zT3jC6T+CIW9hHlzcnTr CMYs7u0U32K8Z9m0IYzMG5eJxyoz1kPj1lgAUBEkodNzNu9sXw06/9SDipjJeRjMeCo+ D6XA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749906748; x=1750511548; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4husOKAZTdenR4dTY7R6+2F368XC82t/F0SJemMOk68=; b=EQIGXlk7aPCprR0BHg7iRkIr0mYE0hEqBUlZUOQIgSkyJFz4AJ1USfC7XI61WG9vyY SVYFr2tY0Vo0T7JvAUUM5UIojVoRDt5dZmF0tV6FTqwwTFJVPwQETMQJmfCOmU2952oH Y9vzwpG8dJpe39wUexa0NrxnX4gMVhSJ0HhxNKwO7qDw3x8zbUZmgFcsMCy1bDG+P9Uz 66zHU8ydCK3pBzci3ANp9Qe9uvBCAufNTIn64k+M1chgWcYzJCNN6FBxnT4ZqKJKacO8 jnX8MVALah17pVFH2vzlBlF2dFbBaDj5aEiHt3FmLuslshLC6QJTxyONoVp0RKQFB8nS yy4g== X-Forwarded-Encrypted: i=1; AJvYcCXtejP/87UrkRQ/mpKcfOF1AGukxI1238IvMboPkyjOrV+5+1ap7qSl/ZhF0FFrrGITirJiyZnjVg51tjFmMoaxlO32xg==@freebsd.org X-Gm-Message-State: AOJu0Yz1k9JmMX5lOWFY4zr44x7wmo3jG6eMCdupibRqoj9c8zAnouo1 5LCqrNmqeMvYCPF2A8eG9t4RCJ1tOCy5dJTjBnWwdS5uel4PCL0ZT0IwspbZfbJEqJlBHjMP4Hn +N7jveuSbbImSEznLMpxIGV5Duy+9c/rTIqC9GF8e5Q== X-Gm-Gg: ASbGncsuuS4twKzRqSs9fMaV/stjO/8BHhDBU2hdPObPfjn6JWOLulmX58bVp0q4CiE EBK2eUApHjtr0IF9gFTJAZxgY4rdaekkrtxKCHAm6NAt3DLpDX/xCAoWMKmGT3tlnAhImD9Awvp vjDuqj50dyAATiesBe4uelpmCbwxCF/oNTQlZx1rxKfB8= X-Google-Smtp-Source: AGHT+IGIBOExcCinRXlMeezWAMnwN35V+g8jhyYGPOYcL8TL+/Bz/KqBlApFQ3R1y+sE07aHvNaX41kp2mJgTuaq0HY= X-Received: by 2002:a17:90b:4cc8:b0:311:c939:c859 with SMTP id 98e67ed59e1d1-313f1e316cfmr4616193a91.30.1749906748502; Sat, 14 Jun 2025 06:12:28 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202506130121.55D1LhXF086456@gitrepo.freebsd.org> <50830604-3bd8-47d6-920c-fd099a96a08e@FreeBSD.org> In-Reply-To: <50830604-3bd8-47d6-920c-fd099a96a08e@FreeBSD.org> From: Warner Losh Date: Sat, 14 Jun 2025 07:12:17 -0600 X-Gm-Features: AX0GCFsU4kzLSCspF-0pPe_Eh40OnZtUIotUWV9SvdRWzE6pRPIhjYANKCzLEGc Message-ID: Subject: Re: git: aae67a2c2b66 - main - mfiutil: Fix unsafe assumptions of snprintf(3) return value To: John Baldwin Cc: Warner Losh , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4bKGry6JTHz3YVJ X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] On Sat, Jun 14, 2025 at 6:42=E2=80=AFAM John Baldwin wrot= e: > > On 6/12/25 21:21, Warner Losh wrote: > > The branch main has been updated by imp: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3Daae67a2c2b663a6bce8fbc08= 7ff8490336b8618f > > > > commit aae67a2c2b663a6bce8fbc087ff8490336b8618f > > Author: WHR > > AuthorDate: 2024-09-03 10:19:04 +0000 > > Commit: Warner Losh > > CommitDate: 2025-06-13 01:21:44 +0000 > > > > mfiutil: Fix unsafe assumptions of snprintf(3) return value > > > > PR: 281160 > > Reviewed by: imp > > Pull Request: https://github.com/freebsd/freebsd-src/pull/1405 > > Closes: https://github.com/freebsd/freebsd-src/pull/1405 > > --- > > usr.sbin/mfiutil/mfi_bbu.c | 17 +++++++++++++++-- > > 1 file changed, 15 insertions(+), 2 deletions(-) > > > > diff --git a/usr.sbin/mfiutil/mfi_bbu.c b/usr.sbin/mfiutil/mfi_bbu.c > > index 9075c4d0ddd0..e97227d47c70 100644 > > --- a/usr.sbin/mfiutil/mfi_bbu.c > > +++ b/usr.sbin/mfiutil/mfi_bbu.c > > @@ -50,10 +50,23 @@ mfi_autolearn_period(uint32_t period, char *buf, si= ze_t sz) > > > > tmp =3D buf; > > if (d !=3D 0) { > > - tmp +=3D snprintf(buf, sz, "%u day%s", d, d =3D=3D 1 ? ""= : "s"); > > + int fmt_len; > > + fmt_len =3D snprintf(buf, sz, "%u day%s", d, d =3D=3D 1 ?= "" : "s"); > > + if (fmt_len < 0) { > > + *buf =3D 0; > > + return; > > + } > > + if ((size_t)fmt_len >=3D sz) { > > + return; > > + } > > + tmp +=3D fmt_len; > > sz -=3D tmp - buf; > > if (h !=3D 0) { > > - tmp +=3D snprintf(tmp, sz, ", "); > > + fmt_len =3D snprintf(tmp, sz, ", "); > > + if (fmt_len < 0 || (size_t)fmt_len >=3D sz) { > > + return; > > + } > > + tmp +=3D fmt_len; > > sz -=3D 2; > > } > > } > > It seems like using a string builder like fmemopen() or sbuf() would be > better here than fragile dances with snprintf(). True. This is better than what was there, but either of those would be bett= er. Warner From nobody Sat Jun 14 13:42:46 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bKHWq1YjLz5MVxF; Sat, 14 Jun 2025 13:42:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bKHWp6rs5z3rFY; Sat, 14 Jun 2025 13:42:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749908567; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t1gYTrI8Lwi32k43aApUuy3GBuPza25zHcI8jzuArk8=; b=CeedG+N+u0whMmcCGddvhWPCaqPzgYFyWlDYPouLF3psQvfFIR7+32fQQk6NmglQ37Cwf6 Z8sKgn7l17Kijbp1B6X2Rhr9vs1he07uZNWX3aDrJzj9qN73tXlXFPlW2uqZ4CSaVsGriK 69jGMG73dNxGI2vTq1jHSC+BB6ADLzYkpA4TZ8seauL7Q5eDtzOhiD41a2uV/pPuo+3Qty 5r+TOK8Ro/bEBVQPPXOecOFiNko+f4cj/uCs620DU1CbWToyyVBYyv08B00yI1YS93V21W lSTv7yDcYS15vjuIFtYTjax7CoCnT6a7FtFUNkPTC9VC1vyaF51DpPOvZtW2jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749908567; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t1gYTrI8Lwi32k43aApUuy3GBuPza25zHcI8jzuArk8=; b=VWulkIWUT31y8RmBvoLNFbXpMPKh6oYiX+SnqMgdSNdYyJf5NiR0gAT41pGY4tsyg9pCgA Hyi2Jkv4Ia1JXZr0YYnUJqE1vGT0fvwcjRQ7zlzr8bC7HMDXkv2opzsNNQjJtTDIqWYzhq 3YzAn+q95AKC1p0+moHBeidQWfFvI3Pw/fL8l31+37Qvkho9HgnzlGB3bEjpVWewUiUPTN IUKUfH+xewjBWksXB/HIe/zoZy8Jt+A1Uu/AQPo89w9/2qVintfYAJH+a1OQ9qKH4p1Ext VTYi5j0GFNab/Af9eqkdCgpYnd+euHCy1J/fQ8DjEa72RNh2g8FB0TWna0etxg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749908567; a=rsa-sha256; cv=none; b=ZgtIWdKp1dwXopQLDU1kNmhtj7gqM5YTLYKKqEYOJctM0HDwEjCvBNfw8bESntHEcHUmWZ OO73IknpjYftoASQw8hkH9IijBxLdIA6b+p+HMeLCNKEyzs8i7Go81x/quFlyaR2OStKh1 lEvLKppvv/T/2QoalTynOwjRqWIHOK+TK9LFaGgeJ44kunjJMXmVRgeHTmKd1d9VJDgtxR B7AItxAccnDeCDR4O2hZjPZGnMylLZc6K6LTCpqomQPk3Bio4PhUSYA53SGDrjYeeSh2br es1GNdf2kIX2/1SHGZWrG9DK5R8tbUr+yDTpILP/cBNzXsYCR0KEkWeudKYMGA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bKHWp6FGbzDSY; Sat, 14 Jun 2025 13:42:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55EDgkeV079056; Sat, 14 Jun 2025 13:42:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55EDgkXI079053; Sat, 14 Jun 2025 13:42:46 GMT (envelope-from git) Date: Sat, 14 Jun 2025 13:42:46 GMT Message-Id: <202506141342.55EDgkXI079053@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Li-Wen Hsu Subject: git: 8b399d613f54 - main - linuxkpi.4, linuxkpi_wlan.4: build and install on all architectures List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8b399d613f5420bb7e57be94806e156e4c1579fb Auto-Submitted: auto-generated The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=8b399d613f5420bb7e57be94806e156e4c1579fb commit 8b399d613f5420bb7e57be94806e156e4c1579fb Author: Li-Wen Hsu AuthorDate: 2025-06-14 13:40:55 +0000 Commit: Li-Wen Hsu CommitDate: 2025-06-14 13:40:55 +0000 linuxkpi.4, linuxkpi_wlan.4: build and install on all architectures Reported by: bz Fixes: 1563b306d19d linuxkpi.4, linuxkpi_wlan.4: connect to build Sponsored by: The FreeBSD Foundation --- share/man/man4/Makefile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index a12493de4280..16faf4bf5de4 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -290,8 +290,8 @@ MAN= aac.4 \ linprocfs.4 \ linsysfs.4 \ ${_linux.4} \ - ${_linuxkpi.4} \ - ${_linuxkpi_wlan.4} \ + linuxkpi.4 \ + linuxkpi_wlan.4 \ liquidio.4 \ lm75.4 \ lo.4 \ @@ -931,8 +931,6 @@ _gve.4= gve.4 _if_vmx.4= if_vmx.4 _ipmi.4= ipmi.4 _linux.4= linux.4 -_linuxkpi.4= linuxkpi.4 -_linuxkpi_wlan.4= linuxkpi_wlan.4 _ossl.4= ossl.4 _pvscsi.4= pvscsi.4 _vmx.4= vmx.4 From nobody Sat Jun 14 13:45:59 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bKHbn0g3bz5MW2C; Sat, 14 Jun 2025 13:46:13 +0000 (UTC) (envelope-from lwhsu@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bKHbm6ywJz3tVG; Sat, 14 Jun 2025 13:46:12 +0000 (UTC) (envelope-from lwhsu@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749908773; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=U3r9Wqor3xkb9b7tVJVagvtkj3iX72kVYghcI6oOeRE=; b=OBsTf/MH/7MJUoJbj7W9EXq4Yg7mK4WNfVpWN9xNwvW/XFjEjRKbKa/7/Nai9BfT4VVKBx A2Z4oXiqRtK9g9NT7W6gXlw5XTCmtqEI7pQu8abLw5r4pvWffP69c2KelGO1QTDCyJfiNl AQDQ08rHq0YCgi6CfsGWpd+sMAnme59aoBXGIeeVyKYfcPGiiGdiCpRCXXxq1Cyqj/w46u 0Ps48djLjyQBi+DBUD6dqPn/mulFKuCSb105+jO7p1ApgkZ7RY7RkInzdDPJsjym5Ijipx i0KldEUI3c+6RLW9E0k+PIOTX3OHD2BYAJsf897CjZosRXJCz8kWIx4d7Zv0/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749908773; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=U3r9Wqor3xkb9b7tVJVagvtkj3iX72kVYghcI6oOeRE=; b=mlZnbODv0+yLm3Ui4ItuBdcAJ5Xt3TSSWcJud9T2oIBmzau6FxIezxAxEOGNhXqRNd81pc PsC1z9C5K7S+EbzmTESkVYbINfAE/u000gScSJmilyMmrOgsryaOxc1/TX0bkDhzVBA4Sz 00t6LOULmT91Wvpjh5wxGhArs3DmQY0pxQxufVCSWoovrh+wstiwYYarQMUTkxexKd6fkb VwUHmyuj+RBrwsQVLwV+e85s5omfnKocxd3/RB44QPyPeif9Sg1DKYEtaduO9RsgaSUHIB Vv61wxvo/h3TsDM06dedsyHT2BIAsB3lmeQi9Bp/2PNaz4fI1xL3yZHKkropKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749908773; a=rsa-sha256; cv=none; b=K6RCP30ab/bgjmw24lDLqkssCbP0CjCxo6o83hVx0KgEUk5gDm2UjgU+GR5yrt8j9Aasoz g4medA03gIXiKXwTbCmqcZS5DKKY9Q1kk+OLaB6/7N2F0tpq5EXvBPneA/omDPlgxd5pKR sxuvpijCSDzFl6czyuqcJdvs+/w0w65LDeur+x/jm7dSli6JtUzz2tQ2K15frdPKDSfeZv Vgc/Qqt8Wx7XHuCOPuXXESwVrPTa+KG1nQFG8lk1QVcFBin0IfgSFS1tAyY2ysVWNZU6+O hoZKPm4rk8BObWSHIFvv+eh0GuFaU/353BoORz327VYzVjek31WD1oZ5QBC0zA== Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) (Authenticated sender: lwhsu/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bKHbm5V91zNrb; Sat, 14 Jun 2025 13:46:12 +0000 (UTC) (envelope-from lwhsu@freebsd.org) Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-addda47ebeaso594315466b.1; Sat, 14 Jun 2025 06:46:12 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCV6SLQooU1E1EjcDJsnCbrTmQy+aUtSxk5OzJsYSIE3y5UDip2cU+4hbTWsxSthaJHRJNq4FjLisn6FfIUYKal8jdQYDw0=@freebsd.org, AJvYcCXbml8C59J81g/IXCQmdBg/x+fLVnAkg6yhB3TolEu+bbdn2dH6f4ouG46bxqEfo/VJV4cqlYZkqPHFfWXHFkARZ+OC@freebsd.org X-Gm-Message-State: AOJu0Yx7VEsPNuxO5nih0fBTLuuXwLoCMoDlAiS6DiFt+yFCvQo9zAXU D1SzX4Yd5mOgsrlKxrhX7ho9qnN6fQhATl4OnAumBRGxvX6mcWp2Y1+n/uykbE1/PdEtic4CQr3 uwE3FRHHQZfL6icA5FCdt8QtvsTmxWnE= X-Google-Smtp-Source: AGHT+IHX/p7dvUcOAQKYtg8VTrbQtQusNc6nolG3/jKvf8DX7F7z9SKVLzYyyVljWJc3PC2zSot8WscQS9j6L3t69+w= X-Received: by 2002:a17:907:3c86:b0:ad8:a329:b490 with SMTP id a640c23a62f3a-adfad396ef2mr239005666b.23.1749908771425; Sat, 14 Jun 2025 06:46:11 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202506131550.55DFoZhL013829@gitrepo.freebsd.org> <2210n12s-244r-8p53-262q-o2ps9n815s4q@SerrOFQ.bet> In-Reply-To: <2210n12s-244r-8p53-262q-o2ps9n815s4q@SerrOFQ.bet> From: Li-Wen Hsu Date: Sat, 14 Jun 2025 09:45:59 -0400 X-Gmail-Original-Message-ID: X-Gm-Features: AX0GCFsoNhmf3lg42Jrcd_sINCwnCkfkw92TpgZHvsreHhK8UmWs0iYOTgliIZk Message-ID: Subject: Re: git: 1563b306d19d - main - linuxkpi.4, linuxkpi_wlan.4: connect to build To: "Bjoern A. Zeeb" Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Jun 13, 2025 at 1:53=E2=80=AFPM Bjoern A. Zeeb wro= te: > > On Fri, 13 Jun 2025, Li-Wen Hsu wrote: > > > The branch main has been updated by lwhsu: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D1563b306d19db25f5bbf0718= 97b60429b192040c > > > > commit 1563b306d19db25f5bbf071897b60429b192040c > > Author: Li-Wen Hsu > > AuthorDate: 2025-06-13 15:50:30 +0000 > > Commit: Li-Wen Hsu > > CommitDate: 2025-06-13 15:50:30 +0000 > > > > linuxkpi.4, linuxkpi_wlan.4: connect to build > > > > Fixes: bfaec3e64741 linuxkpi.4, linuxkpi_wlan.4: add short man page= s > > Sponsored by: The FreeBSD Foundation > > --- > > share/man/man4/Makefile | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile > > index ed39aafebbc3..a12493de4280 100644 > > --- a/share/man/man4/Makefile > > +++ b/share/man/man4/Makefile > > @@ -290,6 +290,8 @@ MAN=3D aac.4 \ > > linprocfs.4 \ > > linsysfs.4 \ > > ${_linux.4} \ > > + ${_linuxkpi.4} \ > > + ${_linuxkpi_wlan.4} \ > > liquidio.4 \ > > lm75.4 \ > > lo.4 \ > > @@ -929,6 +931,8 @@ _gve.4=3D gve.4 > > _if_vmx.4=3D if_vmx.4 > > _ipmi.4=3D ipmi.4 > > _linux.4=3D linux.4 > > +_linuxkpi.4=3D linuxkpi.4 > > +_linuxkpi_wlan.4=3D linuxkpi_wlan.4 > > Thanks but those are not correct. We do build the modules for both > unconditionally. Oh, right, I should also check sys/modules/Makefile, thanks for pointing this out. > Please remind me to see if I need to put them on the release notes > template and copes for 15.0 if I forget. I am not very sure, I suppose they should come with when they were introduced, but mentioning them still seems a good idea to me. > > > _ossl.4=3D ossl.4 > > _pvscsi.4=3D pvscsi.4 > > _vmx.4=3D vmx.4 > > > > -- > Bjoern A. Zeeb r15:7 From nobody Sat Jun 14 17:50:27 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bKP1c18Q4z5Vlj1; Sat, 14 Jun 2025 17:50:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bKP1b4xXdz3SXm; Sat, 14 Jun 2025 17:50:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749923427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V+SJ/eD3jFZ5NvDXAmtvzfDIdZsF7bfBPPoz6SwD7yc=; b=jvwqVBzr35YiMmLBVqsHIaWaa3+YUXe7Co/p70I4HJTS+8GvGi6qrhPsz4CJYvygF9ub6K NbFQMiongr24XWnEw+wT/oKtTRsCTyLsv/ygQpkmOBhDXxasq56OlcSWTIlSPbcJrJXar4 Vr03+IJyQQXJF6BUsLQjILH7L0CO9fCKToxxKzBT0LrlRqJwGobB1e9Q+mpk6ORopZWcUK 9dgg4EOGmamK8q87vvBW08SC9Gfkk6tYMHR5txvXYxPqJOfvBodlZ4nTQfMMOSBIm+xbgD DYAYdlwhSA8MZDS19dzWFJo7pynAQGvtTWjfA50j/BnlpYHIUP7yXEDdANSD0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749923427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V+SJ/eD3jFZ5NvDXAmtvzfDIdZsF7bfBPPoz6SwD7yc=; b=p0sMuSKClLa0EaajW5rHRGBhduMMdwBXvbEmahQUvo14Ce/eOmxybAAU5HyeCmP4V1yXV3 AULAt60NfilkRb/iPjIz4B/lY8ufkiH+vmRz9Qyh9hkN3nbQrKNgpXSS44y7RW6HotrYkp LxyX3y8biMlf3vICb+ZIJHbxHi5MUY+lytWPERWPA2f6gpLFGuTokPt4nweqNH5NfyWUbZ ey7kT38bitytSp7S4bXIbj6K+3ena4cHBo0Iml0ip9ZbjGvC/3hmzvx2LeXr8gOUKFQmW8 dLh4g5KIMIT8Luj+vXoL8GVnWLEjHum1qFdu/VgmrV+9xyQt366fhY6DSjISEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749923427; a=rsa-sha256; cv=none; b=Lf3fG7u7I1+19SyX25ZbyvIShlcQy5EINByd0eAdmuQpUKk49VZyEd0knJ2gTzHoB5eRnu tQbTfVcXLqvHn3p73S8pXvXfuA/kSdbEqFCjnZ9Pry5FDzqNs2oQWjRe2So40nAgzxZBzw vZh9i1qJTiJDrT11OZqoaSHCrlW3v41mIiARD+1QcCB3ou96AluioYy4x+0Rpjw/FXjI68 FEWdvfTGarze/IqrQHFjhsa0WR1cBpxCF9gysUQJ8XWFDtGQZmVjvcokdfpCUGdByVgSmR 2c6TYqb1QYii+FmZdTkuvlEMbeDlugoGBksBKTJbKsN7Y16RhD4AQpvbLH/5Mg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bKP1b4V3NzdSB; Sat, 14 Jun 2025 17:50:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55EHoRw9040978; Sat, 14 Jun 2025 17:50:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55EHoRMH040975; Sat, 14 Jun 2025 17:50:27 GMT (envelope-from git) Date: Sat, 14 Jun 2025 17:50:27 GMT Message-Id: <202506141750.55EHoRMH040975@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 177471148a61 - main - dtrace.1: Mention providers in SEE ALSO List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 177471148a6111537e84912fb9a033b6ac5ecb17 Auto-Submitted: auto-generated The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=177471148a6111537e84912fb9a033b6ac5ecb17 commit 177471148a6111537e84912fb9a033b6ac5ecb17 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2025-06-14 17:24:03 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2025-06-14 17:49:56 +0000 dtrace.1: Mention providers in SEE ALSO Reviewed by: bnovkov, christos, markj Approved by: bnovkov (mentor), christos (mentor), markj (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D50852 --- cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 index ab8c672a95a1..1836707d72df 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 +++ b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 @@ -20,7 +20,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 8, 2023 +.Dd June 14, 2025 .Dt DTRACE 1 .Os .Sh NAME @@ -1221,6 +1221,17 @@ Invalid command line options or arguments were specified. .El .Sh SEE ALSO .Xr cpp 1 , +.Xr dtrace_audit 4 , +.Xr dtrace_io 4 , +.Xr dtrace_ip 4 , +.Xr dtrace_kinst 4 , +.Xr dtrace_lockstat 4 , +.Xr dtrace_proc 4 , +.Xr dtrace_sched 4 , +.Xr dtrace_sctp 4 , +.Xr dtrace_tcp 4 , +.Xr dtrace_udp 4 , +.Xr dtrace_udplite 4 , .Xr elf 5 , .Xr SDT 9 .Rs From nobody Sat Jun 14 18:57:02 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bKQVQ5gMcz5pfKh; Sat, 14 Jun 2025 18:57:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bKQVQ3sn9z4K77; Sat, 14 Jun 2025 18:57:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749927422; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6g33ywo/4w2botSkGFnBQS9E3IzSH6m+0k1dPIZdGrQ=; b=HHqlpErdlPlefv7L3GfOf8zGf3FRCJpUM2ie+KWUX3hFyITt9C5kUVe71fDpU5pdVZFQDp wjqJ1/bynk06k8Ty77u0Jpo/V3rVdRMeu5ZjxroL0cs4IpI/+w54/SvA/HQEDxdOpdxDbC 1XzLQ1mXXZtQJONmwPvmgX0GRCxtxkvG2zBRv2Jzbkvvj+ciwQ7rqh0Khu2As0DUlTJcXu +kRIkrx2aGhH5xQClrpDXf6sE2jgG8YTTO2GhFrnTZY0ncXLT3+OKnQ/B8maFgkOqmDtWg pXfxig29pwENamdbFeG8CcrryLVFQHuBqKD+xt5dkr6WIYOm14vmvEzxvIP27g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749927422; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6g33ywo/4w2botSkGFnBQS9E3IzSH6m+0k1dPIZdGrQ=; b=x8/69xA5/xkiJoh7s7uXnnug4drw4y8CDPmpUyXIe/eweRAxN4duk7f6P8IStB7MBKGrMB S/Y6AvekDH6RHdTlEqvoRUe3jBO7ntI5FCYe7g2udU2oNVSwqNrWcsQLjwhA+/oXLOKJc/ bPTFDPQaPhHiRmWouuodjIqwuCZmzXW/hFBW9MeDXx4vG1IAszj0fow2+D1vv488h0BKq8 0KfzhmbxZwdZIGYDP9MoFCrcchyKaPC9twNfIfkhVO2apCOxmVR9QG9CpMz0WuOqBLX4FS PFSnCGAkXsf62BYNE/1ONMXFD9QnCeKIOW0l/LwSLT6WnEHxtkE4UEtjii5QnQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749927422; a=rsa-sha256; cv=none; b=puSrTo0IR6Uy30aGJhj/1UB+ySUI4+QKJCOIfIO6HzRUsLCsjqfI/8QRdSxwhHz29AjBTF T/9enNEQ0Fw0WCnrmK1LxAi54pKxIIG9s9e7kbUtHVZlHtOOfis7nxeopF9TqrLEzaRbAK O122PCSbTAOMFN/2sDBlRzOFI4vDwl3vaArRLtj/+tJm9km3Ywjy8yuZx0t/LmsVNbQz8k sopo32lBKs5EXowh7zfziEnw5acONjeAomwjqmQpl1JN7v8xJqbPYoRTeJ5A0Pb+8HvNce MrlV3nFpZV7kuYE4Um94MREDk4m+kgYPkCJw+pBg6MmGurfs6NRFQXi2OkrdUA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bKQVQ3SzqzgGJ; Sat, 14 Jun 2025 18:57:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55EIv2OF062952; Sat, 14 Jun 2025 18:57:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55EIv2hP062949; Sat, 14 Jun 2025 18:57:02 GMT (envelope-from git) Date: Sat, 14 Jun 2025 18:57:02 GMT Message-Id: <202506141857.55EIv2hP062949@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: f1dd507b2c44 - main - nuageinit: support "fqdn" and "hostname" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f1dd507b2c44f16c94395e67f82125c491ebddf2 Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=f1dd507b2c44f16c94395e67f82125c491ebddf2 commit f1dd507b2c44f16c94395e67f82125c491ebddf2 Author: Baptiste Daroussin AuthorDate: 2025-06-14 18:49:44 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-14 18:56:59 +0000 nuageinit: support "fqdn" and "hostname" --- libexec/nuageinit/nuageinit | 6 ++++++ libexec/nuageinit/tests/nuageinit.sh | 22 ++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit index c874f40b38a8..c1026aa2afee 100755 --- a/libexec/nuageinit/nuageinit +++ b/libexec/nuageinit/nuageinit @@ -249,6 +249,12 @@ if line == "#cloud-config" then if not obj then nuage.err("error parsing cloud-config file: " .. ud) end + -- always prefer fqdn is specified over hostname + if obj.fqdn then + nuage.sethostname(obj.fqdn) + elseif obj.hostname then + nuage.sethostname(obj.hostname) + end if obj.groups then for n, g in pairs(obj.groups) do if (type(g) == "string") then diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index 3d0033a648de..edcc80346b5d 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -28,6 +28,7 @@ atf_test_case config2_userdata_packages atf_test_case config2_userdata_update_packages atf_test_case config2_userdata_upgrade_packages atf_test_case config2_userdata_shebang +atf_test_case config2_userdata_fqdn_and_hostname setup_test_adduser() { @@ -837,6 +838,26 @@ EOF fi } +config2_userdata_fqdn_and_hostname_body() +{ + mkdir -p media/nuageinit + setup_test_adduser + printf "{}" > media/nuageinit/meta_data.json + cat > media/nuageinit/user_data < media/nuageinit/user_data < To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: 7458fac87831 - main - pctrie: simplify lookup_node List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7458fac87831d922c25b981097bfc428f6256faa Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=7458fac87831d922c25b981097bfc428f6256faa commit 7458fac87831d922c25b981097bfc428f6256faa Author: Doug Moore AuthorDate: 2025-06-14 19:32:08 +0000 Commit: Doug Moore CommitDate: 2025-06-14 19:32:08 +0000 pctrie: simplify lookup_node Change _pctrie_lookup_node to simplify it, avoiding lookup up the root node when it's already been traversed. Reviewed by: alc Differential Revision: https://reviews.freebsd.org/D50750 --- sys/kern/subr_pctrie.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/sys/kern/subr_pctrie.c b/sys/kern/subr_pctrie.c index cb813cfbd847..e8098c6052e3 100644 --- a/sys/kern/subr_pctrie.c +++ b/sys/kern/subr_pctrie.c @@ -489,29 +489,28 @@ _pctrie_lookup_node(struct pctrie *ptree, struct pctrie_node *node, struct pctrie_node *parent; int slot; + parent = node; + if (parent == NULL) + node = pctrie_root_load(ptree, smr, access); + /* * Climb the search path to find the lowest node from which to start the * search for a value matching 'index'. */ - while (node != NULL) { - KASSERT(access == PCTRIE_SMR || !powerof2(node->pn_popmap), + while (parent != NULL) { + KASSERT(access == PCTRIE_SMR || !powerof2(parent->pn_popmap), ("%s: freed node in iter path", __func__)); + node = parent; if (!pctrie_keybarr(node, index, &slot)) break; - node = pctrie_parent(node); - } - - if (node == NULL) { - parent = NULL; - node = pctrie_root_load(ptree, smr, access); - } else { - parent = node; - node = pctrie_node_load(&node->pn_child[slot], smr, access); + parent = pctrie_parent(node); } /* Seek a node that matches index. */ while (!pctrie_isleaf(node) && !pctrie_keybarr(node, index, &slot)) { parent = node; + KASSERT(access == PCTRIE_SMR || !powerof2(parent->pn_popmap), + ("%s: freed node in iter path", __func__)); node = pctrie_node_load(&node->pn_child[slot], smr, access); } *parent_out = parent; @@ -527,9 +526,9 @@ pctrie_iter_lookup(struct pctrie_iter *it, uint64_t index) { struct pctrie_node *node; - it->index = index; node = _pctrie_lookup_node(it->ptree, it->node, index, &it->node, NULL, PCTRIE_LOCKED); + it->index = index; return (pctrie_match_value(node, index)); } @@ -543,9 +542,9 @@ pctrie_iter_insert_lookup(struct pctrie_iter *it, uint64_t *val) { struct pctrie_node *node; - it->index = *val; node = _pctrie_lookup_node(it->ptree, it->node, *val, &it->node, NULL, PCTRIE_LOCKED); + it->index = *val; if (node == PCTRIE_NULL) { if (it->node == NULL) pctrie_node_store(pctrie_root(it->ptree), From nobody Sat Jun 14 20:26:40 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bKSTr5xYQz5plhn; Sat, 14 Jun 2025 20:26:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bKSTr4v3dz42K8; Sat, 14 Jun 2025 20:26:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749932800; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=F9xNoWQOkIL5/Lqgne1qGOosy1XZ+Gefj27RHqeU5bA=; b=q8R8w2KrC7g3RrWeYDg233NmLW9pRgcBnbw733qUR7zJMc5E6V+EUyPmS2L4d5lnCz3ADk xHhp/xlO3fPms1OwxKPe2W6Wk5ZxzIUxltwFHG0bd+S1KQvkfycfhlQo3FxP8vPti8GE2e j5KL6HTOAsNIKTO1iThBpWk8Px/bXWnynDoTg6cMFyxuPj1Ks4USg9iQyYbCqwHib4b6e7 zM98Yv6Zf+fEcObXvw+6iWbFcqUxoe+7lCIhjD5g/gnvbOoHNDKVLm7r8+2GpAd9OMIllC ChqD5MAC3RYgdTR/cnqvFOan+K7zlXcMmPrAAJxVRln0OQWLrifiirIws0ehAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749932800; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=F9xNoWQOkIL5/Lqgne1qGOosy1XZ+Gefj27RHqeU5bA=; b=tB48wZJ8oBwKUY2sEqi3K4QjtRVrfzqdKLgzol8dYumt80GcTcIUMlE6A6Z2liZzApDLj+ 361O64J36cHbgzRYoY0iZVAL83+i3outlMp7F8TuSgXBDcV1jWQCz0zVSZUUkjtSS9mZj6 6A31HhQx6f0II5yPrY4rJ0FmC+X13hvLrBBfNJCUVP2uYnwDqsOfZyewhmYcgepnCGQQG/ wulk6N2CfXoiN1NmJD2RWXhSPeere9X3IxrAG0F6/2zWti49d+ctol4BziyaVay+gnJjeq /+jRusQm5LExc+bSMK4FJ0+4UajcKmVKJU529ZCGjMPdPZSIyZ+k/KfXGiC2Hw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749932800; a=rsa-sha256; cv=none; b=D7jsQa+oaFFOOrnMnx+Nxj837qcuGnE7JgJ3OL9IKJOvFI8hEqcKRp4XNOo9dciU41lCxD mYWmfAELUhkm34iq1FgjepYxcqDgWKHbNiVK7dfzSNWzrsqPf0KA8GLVIQdHNXKdO0t/6L qaa9oo7keBTZT4EX9bqrYhSdG8ADInyc9Omf2Zo23XutiI47C3OVsEgn/1NavnpQYkRdXY w7pBSP/Kfn/AocdMzoD6TkftBPlRpYVbNm+zT+p077W7NLWWL9XdyiYGesOBqWPgD+SWjl 0S1LTn3I2ogB8MvVDGyOx1egJGUSAbqzEZLKrRMeLhNcpQWIOK8zRAewhWCYJw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bKSTr3ybszjgv; Sat, 14 Jun 2025 20:26:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55EKQeak032228; Sat, 14 Jun 2025 20:26:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55EKQeGM032225; Sat, 14 Jun 2025 20:26:40 GMT (envelope-from git) Date: Sat, 14 Jun 2025 20:26:40 GMT Message-Id: <202506142026.55EKQeGM032225@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hiroki Sato Subject: git: 7faddeb395b7 - main - rc: Fix scripts that need pathname expansion List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hrs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7faddeb395b7976b44393db24f48ec47040eff07 Auto-Submitted: auto-generated The branch main has been updated by hrs: URL: https://cgit.FreeBSD.org/src/commit/?id=7faddeb395b7976b44393db24f48ec47040eff07 commit 7faddeb395b7976b44393db24f48ec47040eff07 Author: Hiroki Sato AuthorDate: 2025-06-14 20:24:41 +0000 Commit: Hiroki Sato CommitDate: 2025-06-14 20:24:41 +0000 rc: Fix scripts that need pathname expansion Reported by: Kenneth Raplee Differential Revision: https://reviews.freebsd.org/D45855 --- libexec/rc/rc.d/moused | 2 +- libexec/rc/rc.d/syscons | 4 ++-- libexec/rc/rc.subr | 24 ++++++++++++++++++++---- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/libexec/rc/rc.d/moused b/libexec/rc/rc.d/moused index 6f1b95af0f0a..9bb1a5cedc31 100755 --- a/libexec/rc/rc.d/moused +++ b/libexec/rc/rc.d/moused @@ -69,7 +69,7 @@ moused_start() ;; esac - for ttyv in /dev/ttyv* ; do + for ttyv in $(expandpath "/dev/ttyv*"); do vidcontrol < ${ttyv} ${mousechar_arg} -m on done } diff --git a/libexec/rc/rc.d/syscons b/libexec/rc/rc.d/syscons index 325628a83d8c..7ad9b720e454 100755 --- a/libexec/rc/rc.d/syscons +++ b/libexec/rc/rc.d/syscons @@ -237,7 +237,7 @@ syscons_configure_keyboard() if [ -n "${allscreens_kbdflags}" ]; then sc_init echo -n ' allscreens_kbd' - for ttyv in /dev/ttyv*; do + for ttyv in $(expandpath "/dev/ttyv*"); do kbdcontrol ${allscreens_kbdflags} < ${ttyv} > ${ttyv} 2>&1 done fi @@ -381,7 +381,7 @@ syscons_start() if [ -n "${allscreens_flags}" ]; then sc_init echo -n ' allscreens' - for ttyv in /dev/ttyv*; do + for ttyv in $(expandpath "/dev/ttyv*"); do vidcontrol ${allscreens_flags} < ${ttyv} > ${ttyv} 2>&1 done fi diff --git a/libexec/rc/rc.subr b/libexec/rc/rc.subr index 359eebd1d342..d760b75a15a3 100644 --- a/libexec/rc/rc.subr +++ b/libexec/rc/rc.subr @@ -223,10 +223,11 @@ rc_trace() list_vars() { # Localize 'set' option below. - local - + local - _s local IFS=$'\n' line varname - # Disable path expansion in unquoted 'for' parameters below. + # Disable path expansion temporarily in unquoted 'for' parameters below. + _s=$(set +o) set -o noglob for line in $(set); do @@ -241,6 +242,7 @@ list_vars() ;; esac done + eval $_s } # set_rcvar [var] [defval] [desc] @@ -292,6 +294,19 @@ set_rcvar_obsolete() eval ${_var}_obsolete_msg=\"$*\" } +# expandpath str +# Apply pathname expansion to str. +# +expandpath() +{ + local _s + + _s=$(set +o) + set +o noglob + echo $1 + eval $_s +} + # # force_depend script [rcvar] # Force a service to start. Intended for use by services @@ -1783,18 +1798,19 @@ _run_rc_setup() _run_rc_doit() { - local _m + local _m _s debug "run_rc_command: doit: $*" _m=$(umask) ${_umask:+umask ${_umask}} # Disable pathname expansion temporarily for run_rc_command. + _s=$(set +o) set -o noglob eval "$@" - set +o noglob _return=$? umask ${_m} + eval $_s # If command failed and force isn't set, request exit. if [ $_return -ne 0 ] && [ -z "$rc_force" ]; then From nobody Sat Jun 14 20:59:37 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bKTCt2m0Gz5ppGT; Sat, 14 Jun 2025 20:59:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bKTCt18w6z3VPX; Sat, 14 Jun 2025 20:59:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749934778; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OPNTbuHcps6U/QSfyN0fmHVlUNL00EHlBaj1J13Yygo=; b=QoN9IB/LVO1e8O3WI1CKolV22UMfK6xWC0fcpT4ee5idDAh2ncwjIdbhX52Czut2jj3+vT K2su/P6yl2Yuisrdqz57Gv855Z9ucTcOJ2X3MDkGW8foRejWW5vA/mzmZW+uGamq5hC4Cp 9H1bnM5VSi3mLJoGE3pobfZ93TCXoVEcNQwToj2jZNZru5g9ghkWrQ0eekxb+UGM0N1x8h 8IrGuZ2CeqFT0CH3ftqrcbZJ+7fSQ8/GSIAaNIfEszqGwA085WOJzEYMSHt3d7OHbKNbTh Alns80W/pN7CnZaDQ5Y/hMzPMSuCdGz+PnV3gNBqRMtcNwib606PkxCuE0w89Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749934778; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OPNTbuHcps6U/QSfyN0fmHVlUNL00EHlBaj1J13Yygo=; b=v3KzuH9LT9KQ5UVjb5VsfdRiuBrort/WYo5TWa9T0LMKQ4feJv9NuI3H7MuXB7kC6bgep5 VJQmlh/F9yOTruyhbf2KeIn6K0AcPtmzs1JIvxKGPq1vhKnQMZFnqui9m2g1YS48vGAFgJ eJQtegyL3dlqVhMvrDo6G2Ddc/VVPRsMf5i26POk7wFWBFk9CyiJuz/voalsuFhCVILjF7 etZJ0ItTo9CjxzsD3f1L2B7Pp40ZFJqJBJ5AmeZQVq4Oe1YnUQrm/i26YGvYaOPHWTXYjC kyFr0F20ekZHMrCmfDFkl+X68TINTgIkFT3Wte55yR3huA3uNn5rksCU+nGTBw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749934778; a=rsa-sha256; cv=none; b=sajeMbws60B6Z6e2uXy2l3dwOVtVrcd0JBzUAACG5c7U5N9HQlHQERhsG9QEefBQoHlBbR 8xJkyLGpUBXRZ/oO4hlBdVBKEtEfvfi3jfOWupptGydPtXXQxsuYKrd3oQOg7A2PALPSiw BYZ36Hw5EeyCknD/QTo0p3b5P9gAa+o+0zIfh2DrW8x8MghtaY5MoM4TjTEKMD7q9lmzRZ d/iN+3GiKZypk22dfEcxieOgqq9j5Ta6sZxFFejHBDz3mKjyuN3ds+htb4V4rDJXFAaFAB gJz3aIbg7h1lyR1FSmpiPtu1NbVFrCZpf24HyNjPQHlJSJUfYrt8FXz17eL0UQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bKTCt0hpSzjjQ; Sat, 14 Jun 2025 20:59:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55EKxbSY088973; Sat, 14 Jun 2025 20:59:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55EKxbDA088970; Sat, 14 Jun 2025 20:59:37 GMT (envelope-from git) Date: Sat, 14 Jun 2025 20:59:37 GMT Message-Id: <202506142059.55EKxbDA088970@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: 63e98e05fcdb - main - mlx.4: Improve HARDWARE List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 63e98e05fcdbcf3a34113a2e6acab2f8cc23bba9 Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=63e98e05fcdbcf3a34113a2e6acab2f8cc23bba9 commit 63e98e05fcdbcf3a34113a2e6acab2f8cc23bba9 Author: Alexander Ziaee AuthorDate: 2025-06-14 20:54:59 +0000 Commit: Alexander Ziaee CommitDate: 2025-06-14 20:58:58 +0000 mlx.4: Improve HARDWARE These are paralel scsi adapters, list what kind the hardware supports. MFC after: 3 days Fixes: e3307d05311e8c (mlx.4: Improve specificity) Reported by: kbowling Reviewed by: kbowling Approved by: mhorne (mentor, implicit) Differential Revision: https://reviews.freebsd.org/D50654 --- share/man/man4/mlx.4 | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/share/man/man4/mlx.4 b/share/man/man4/mlx.4 index a5443f308088..4b9ab7070d72 100644 --- a/share/man/man4/mlx.4 +++ b/share/man/man4/mlx.4 @@ -30,7 +30,7 @@ .Os .Sh NAME .Nm mlx -.Nd Mylex DAC-family Ultra-SCSI RAID driver +.Nd Mylex DAC-family Parallel SCSI RAID driver .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -54,29 +54,29 @@ including versions relabeled by Digital/Compaq. .Sh HARDWARE The .Nm -driver supports the following Ultra-SCSI RAID controllers: +driver supports the following Parallel SCSI RAID controllers: .Pp .Bl -bullet -compact .It -Mylex DAC960P +Mylex DAC960P (Wide Fast SCSI-2) .It -Mylex DAC960PD / DEC KZPSC (Fast Wide) +Mylex DAC960PD / DEC KZPSC (Wide Fast SCSI-2) .It -Mylex DAC960PDU +Mylex DAC960PDU (Ultra SCSI-3) .It -Mylex DAC960PL +Mylex DAC960PL (Wide Fast SCSI-2) .It -Mylex DAC960PJ +Mylex DAC960PJ (Wide Ultra SCSI-3) .It -Mylex DAC960PG +Mylex DAC960PG (Wide Ultra SCSI-3) .It -Mylex DAC960PU / DEC PZPAC (Ultra Wide) +Mylex DAC960PU / DEC PZPAC (Wide Ultra SCSI-3) .It -Mylex AcceleRAID 150 (DAC960PRL) +Mylex AcceleRAID 150 (DAC960PRL) (Wide Ultra2 SCSI) .It -Mylex AcceleRAID 250 (DAC960PTL1) +Mylex AcceleRAID 250 (DAC960PTL1) (Wide Ultra2 SCSI) .It -Mylex eXtremeRAID 1100 (DAC1164P) +Mylex eXtremeRAID 1100 (DAC1164P) (Wide Ultra2 SCSI) .It RAIDarray 230 controllers, aka the Ultra-SCSI DEC KZPAC-AA (1-ch, 4MB cache), KZPAC-CA (3-ch, 4MB), KZPAC-CB (3-ch, 8MB cache) From nobody Sat Jun 14 22:44:18 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bKWXf2RqCz5Vdwr; Sat, 14 Jun 2025 22:44:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bKWXf1hM1z3m7R; Sat, 14 Jun 2025 22:44:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749941058; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Iq+txi0dN75ESA7WM5d6nWtTC6WgBRIQB1IIJWv/JBU=; b=CCeUdwC82nEiiOYlmyOI5qOAAdpLm1AtL3PAQv8gzZfvY9tmnMDlBK8Hrj4djTwO1F81d3 DijT7OJru3ZffhcgJ/bTmPB+J1YfaJSx3kWs2Zwdl8urVTyAw5MUsY99XJ967JOBETj8Hs gIbE9DHSB/udZQ6q42rNeozRoblI7M3UYM2IVZXxE/QCli1bXLLZdnKWJ/tbj4s5/lcL6p QSiUpFjRfMAB3XXeWHyloZChXbKg23GX4SFURI4vyMR5rCelfT1Z1hcpJxLj6jZdDgKJgm DZok/BcmyGA95bLjPmaljXN8fmKFSwE1s69+vcEFouyKjaxt/CcTZp55TCO4YQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749941058; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Iq+txi0dN75ESA7WM5d6nWtTC6WgBRIQB1IIJWv/JBU=; b=PaVRugEh69PRJE+cKSBj6w3ZG+QmqXxcflizYsSMdKdZ3aNZV/qXes25Eo1OPMZyVK1Z8m EqlFrSj3KCmvxs+ga0TbG8qqKKT6Lnq+Q5ctl1y8vTVKFlgKy1L+mbjgzUgIjTzhJex1Ms it1iCJfpP2+Wzh0rgql7CTM0qmAtAc6bLpkATylaT2EqDHNOZIme2Mirk60W4+F/8/Hv+p nN0zL4vWHExiFEs6xCttfZMXotnoAuL5HNxKotP2OUHZMvYDVtcfzWPKblySs17qtBqkbu /xAzrUNv8fM1sZrPjnvBURXbG7MEFpbu7a+lQevVyk8H1EzW3/nygVFyYzRTMQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749941058; a=rsa-sha256; cv=none; b=NOBn5z7sDpfAT2oSZI3qXtfkjmF95BMvNrVSbUDVvAT1nB7h4QTT4TMq4i7N9JOH57ggS5 gsMnjREEqcGGrmbk1IEo4050jwC8L3B7HSQhcaJ9KQ5NQJKh0JQaTchvEuN0YQq3fxeBIg ZuvUv/MORhJfrI0SC52xKjn8opMf4/tjA/N6hhGTrVfO0QcdDeOZDwyx9ovIYN/p7Y+B1X Ml0qN3tN4ttnIn6yJtqV4CSx6Nw/fJjqhYI+5eUtWlyJaeWKOXQ0R1pBX3q17Z+7cyFQwd Dp7oQzFphaIqh7vAt1OdnKydS8h4dbF7vT4/C+rVTjQPqRthtYHi+xphjXzxiQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bKWXf17q1zmyq; Sat, 14 Jun 2025 22:44:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55EMiI0m094192; Sat, 14 Jun 2025 22:44:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55EMiIQW094189; Sat, 14 Jun 2025 22:44:18 GMT (envelope-from git) Date: Sat, 14 Jun 2025 22:44:18 GMT Message-Id: <202506142244.55EMiIQW094189@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: efcef5cec8d7 - main - wlan_gcmp.4: hook up to the build List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: efcef5cec8d7de982080d0b1d29b5eed60aec65a Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=efcef5cec8d7de982080d0b1d29b5eed60aec65a commit efcef5cec8d7de982080d0b1d29b5eed60aec65a Author: Bjoern A. Zeeb AuthorDate: 2025-06-14 22:42:55 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-14 22:42:55 +0000 wlan_gcmp.4: hook up to the build Sponsored by: The FreeBSD Foundation MFC after: 3 days Fixes: ca6d68a06317 --- share/man/man4/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 16faf4bf5de4..4f12e70f2ae4 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -627,6 +627,7 @@ MAN= aac.4 \ wlan_acl.4 \ wlan_amrr.4 \ wlan_ccmp.4 \ + wlan_gcmp.4 \ wlan_tkip.4 \ wlan_wep.4 \ wlan_xauth.4 \ From nobody Sat Jun 14 23:54:33 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bKY5k0fzRz5Vl0h; Sat, 14 Jun 2025 23:54:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bKY5j5qTSz3km7; Sat, 14 Jun 2025 23:54:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749945273; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ni+TkU+Nw+0BIbx9vYCWBO2/psM+z9x9lGl/Y06ktlo=; b=CyXSTcG3numYSm0FS/fiULImBqv5dKD3Kv3QIiyBslG3pPROVm+mbxtefmPbEe5Ek4MaxJ LdOQDSdt5+3YqfTEvqjz9psKXFsTC1wz4Tc25sCz1eNHDRfr6Up+vz3/7y6/9JvfwDvnY1 UhhreDBZ/KPw4EnVogCQBkJJoAviDBZVgrbFjBaxAbcpJWQaWwovAtXxg27FigV8TA95Wj z8ELQgfwriZA8R6AXqpiEBzc5qRsn/F44CGru+oxZcpwQg0BRXme8oPcAyNvqoitt+LJLh GDp1gaSiSpeg5f58fYddD5JNZKm40tlhPgWmH0QRnh5Y6zQbt9KbfdfvxUIqLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749945273; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ni+TkU+Nw+0BIbx9vYCWBO2/psM+z9x9lGl/Y06ktlo=; b=P0ESpeYjmdSidlj73+ovxthOmlqDCt9A/rV1eIVzcZpxQ/TSgU4GYXjGuXFfit1H1zitbX UYw7Y7u72y+zQvPKQNrdxaJEaTwB5FiBzE9ymLIOzz6JOIDTubBA6omCSog9YfP5Kr+Ws5 MZE8UjeAD/12AfA9LVYJEyukYx+NAhRFIY6x25+VeQvIWvssMbRZfwV9exLGu98hsJI8jH 6ysswkdcVu2ZDLLmSaEcwwV/R+oOHfMbOohZrnJM+AyAyr33YgYeVBb7VdrrVof5V78xlB rp02Hq+JytkmbBRxxYGjzhbsdT6SkXR5I48lWXx4fRryfd5Cz+xVC20+6ut9HA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749945273; a=rsa-sha256; cv=none; b=tokUSyHaiAQrEJIt3o2fG4hXz5/it+UmNSnwEPr//AQWc6uTPP/Q706BtfOpz0jlUbxeMC CRJ6VsaYMBIV8SqDnBwc/csm7g5AT6pAMtoYYaFIg4KSfQD8xtYxcD35OQi7p1wFcrXu+a gWSrLZ9qPcwY0DZwf1r9WfM39Fc4ZIQpTXTXtgpbKz1v+LQcb5vDuH14F46P0ZVT6WXgkB 0AD27xIqO3EmZFImtdxDWw9PvEPavUYZFmWAuOWCDGzSUq/NidRo0iXDLniOvgaMRfEr2C u6keZTXXBqy5Gga0P8useQBCguHEyPNrqc/RpRKxr3NelO5OTaZwa+0fE9eYqQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bKY5j51mlzpx8; Sat, 14 Jun 2025 23:54:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55ENsX5h024605; Sat, 14 Jun 2025 23:54:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55ENsXdm024602; Sat, 14 Jun 2025 23:54:33 GMT (envelope-from git) Date: Sat, 14 Jun 2025 23:54:33 GMT Message-Id: <202506142354.55ENsXdm024602@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 5e6e4f752833 - main - bnxt: Fix BASE-T, 40G AOC, 1G-CX, autoneg and unknown media lists List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5e6e4f752833acc96f1efc893318d3f6b74b9689 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=5e6e4f752833acc96f1efc893318d3f6b74b9689 commit 5e6e4f752833acc96f1efc893318d3f6b74b9689 Author: Kevin Bowling AuthorDate: 2025-06-14 23:46:05 +0000 Commit: Kevin Bowling CommitDate: 2025-06-14 23:54:22 +0000 bnxt: Fix BASE-T, 40G AOC, 1G-CX, autoneg and unknown media lists This was broken in c63d67e137f3, the early returns prevent building the media lists as expected. The BASE-T parts of the patch were suggested by "cyric@mm.st", while I am adding the additional 40G AOC, 1CX, autoneg and unknown PHY fixes based on code inspection. There may be additional work left here for Broadcom but this is certainly better than the returns. PR: 287395 Reported by: mickael.maillot@gmail.com, cyric@mm.st Tested by: Einar Bjarni Halldórsson MFC after: 1 week --- sys/dev/bnxt/bnxt_en/if_bnxt.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/dev/bnxt/bnxt_en/if_bnxt.c b/sys/dev/bnxt/bnxt_en/if_bnxt.c index 0e5bb6a736ae..feac3ce54a29 100644 --- a/sys/dev/bnxt/bnxt_en/if_bnxt.c +++ b/sys/dev/bnxt/bnxt_en/if_bnxt.c @@ -4608,34 +4608,34 @@ bnxt_add_media_types(struct bnxt_softc *softc) case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_40G_ACTIVE_CABLE: media_type = BNXT_MEDIA_AC; - return; + break; case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASECX: media_type = BNXT_MEDIA_BASECX; - return; + break; case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_1G_BASET: case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASET: case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASETE: media_type = BNXT_MEDIA_BASET; - return; + break; case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKX: media_type = BNXT_MEDIA_BASEKX; - return; + break; case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_SGMIIEXTPHY: media_type = BNXT_MEDIA_BASESGMII; - return; + break; case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_UNKNOWN: /* Only Autoneg is supported for TYPE_UNKNOWN */ - return; + break; default: /* Only Autoneg is supported for new phy type values */ device_printf(softc->dev, "phy type %d not supported by driver\n", phy_type); - return; + break; } switch (link_info->sig_mode) { From nobody Sun Jun 15 05:08:20 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bKh3n0c6Mz5q1KW; Sun, 15 Jun 2025 05:08:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bKh3m736jz4Nw2; Sun, 15 Jun 2025 05:08:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749964101; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K4rV8JNGz4yvCcVBIgITkfouFTfl2h3Fpomp/kH+l34=; b=J3f8j4TzBF1LS+abXo2xDMabeH64bfSfSbOs4l7lJAq45bBZkyTHa3g2f/chzWDzSIWxfe IAmZu64N6AiTO85iSwj2Pefrkup3PMdV45rnRki2OoUC/OdzFO2SWWFiKvVbVfgX35o7RN 2CvFEbWgfNtxPtvMCTc4nit9Ds3AbNLoVKVp5zEwvW0sDknQhG6tkJJjqeXQU/N3o/twFW 2dMIK1TgsFx3pRs6nmgW+wpW3aNW3zmqUBi2r+AztqwVtSL0V1OjNktrK0zrdYbR7moRUE 76qu9rUCoMYkrwm44t/r+2h9Pu0QLadFMYv7km9XmGZDGejWq8TxsxUzCUnngA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749964101; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K4rV8JNGz4yvCcVBIgITkfouFTfl2h3Fpomp/kH+l34=; b=VYlnAy4PfnYvhlQKMBLlVRUjBZ1zB8sbnmgm979uMm1OyP6VjKiuBvt8u+yXdxbFC5oEkS DILtMTYjl3kRGNAulnronZEKJCwuANEspuZ9FDuR424mIYNH2pwFZyN5AqdZ+dHk2ysO6R pw1ngFYstJNrLGkDpPMaK3u9XkspKXkheJQr52JcjJOvJznsw44eYtrYk3MlLMvAa/BTIp +97pwjiYQfElVhPbBb1HvlqMWT3+Y1CF7Q4JWGgsoRlKuU+EfTRsG/daQhnbGUyRt69ceR T9a0hsH6gqbBG/xTDVz4z9kXRFF2y9Rr66BsINhl0zXqAeq0HVXrTSwc7xXlFw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749964101; a=rsa-sha256; cv=none; b=b5jX0SwN0sBbJnIMq9SpmnkAwyGnzbmRSos2O2m+uP8DzNKvd2BKLbbvOxFXggQ25DbUuA KNHiRL3HqGc4qgQv1wGiVYS5RpCrXqBdIF25r6Jzp+0cN3FFXBIt6agWntcGVww0cMPAlF A+MjpW6i/ujXDcEIYmzPlEUUJhKLNjFbR12bJ28F7U784JQOE/67KWE9QRHyRq3gqXjjPm QgH7nfAZDgoys+benWckd4F2BfytRrbGwJ4whoI7F3QGqe2VpzrpypXDdKaiAavCWEckyn A45n9cgggx0NNEJckAktUqIiFmVPT4U0EB+mW8UL3SCWKOHgLG8HDxPD0tS+ew== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bKh3m6b8lzyXl; Sun, 15 Jun 2025 05:08:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55F58Kgm008595; Sun, 15 Jun 2025 05:08:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55F58KLU008592; Sun, 15 Jun 2025 05:08:20 GMT (envelope-from git) Date: Sun, 15 Jun 2025 05:08:20 GMT Message-Id: <202506150508.55F58KLU008592@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: b6e33f0cd536 - main - rc.d/mountcritlocal: Make sure zpools are imported for legacy ZFS List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b6e33f0cd53683e06570606d5bd88fc04a4b76fe Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=b6e33f0cd53683e06570606d5bd88fc04a4b76fe commit b6e33f0cd53683e06570606d5bd88fc04a4b76fe Author: Cy Schubert AuthorDate: 2025-06-14 13:16:16 +0000 Commit: Cy Schubert CommitDate: 2025-06-15 04:39:36 +0000 rc.d/mountcritlocal: Make sure zpools are imported for legacy ZFS Legacy ZFS uses fstab to mount its datasets. In an attempt to fix another problem 900bc0206348 broke legacy ZFS in fstab(5). This comit works around the problem by mountcritlocal scanning /etc/fstab for zfs mountpoint and if any are found invoke /etc/rc.d/zpool start. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D50844 --- libexec/rc/rc.d/mountcritlocal | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libexec/rc/rc.d/mountcritlocal b/libexec/rc/rc.d/mountcritlocal index f91eaf44457c..6dce672657fc 100755 --- a/libexec/rc/rc.d/mountcritlocal +++ b/libexec/rc/rc.d/mountcritlocal @@ -27,6 +27,15 @@ mountcritlocal_start() ;; esac + while read a b vfstype rest; do + if [ "$vfstype" = "zfs" -a "$a" != "#" ]; then + # zpool is needed for legacy ZFS + echo 'Importing zpools for legacy ZFS' + /etc/rc.d/zpool start + break + fi + done < /etc/fstab + # Mount everything except nfs filesystems. startmsg -n 'Mounting local filesystems:' mount_excludes='no' From nobody Sun Jun 15 06:09:39 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bKjQX5G2Dz5q58g; Sun, 15 Jun 2025 06:09:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bKjQX3pqsz3cZL; Sun, 15 Jun 2025 06:09:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749967780; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LqW2p6kOT9NsJy7xCi5GBC338/n5yBb+NspuwIae4f0=; b=fBUnS+Mw/rbKJedHmCldZapUmdl9iM/1WiKHXJzQz2Rs9Nf7cZpZt2VX889iKPbTi6YWyJ AE+1oZ2cXnsD+ZUHAH4OCkqJv7znkqdVMuCtij4VAKJu2VSur5fSXLnBcd8an1QG3WUrCB I3cAk3P5hXKKHabCBhgYcyr41I63FINejqY/8MMIymkMMyrw/h3D3yH9E5ageVhw85BTw0 o8ID1oVFxdU7O7/z0+xkIe0TYcAwPvw+aFWxolnjPwq7aG90h9fjC3rWxkYR4d7DmmZ5IB jkWFCFzE/30moIAf63ME5qaViKyNw+9ruZ7O8gYrtIiqBKvh7bjbHj6srnaa3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749967780; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LqW2p6kOT9NsJy7xCi5GBC338/n5yBb+NspuwIae4f0=; b=c9TYlackHSUAPSWIwZ+i86GStAT5J8RfaLvWnFJfesRIhR/McVMiwKcs+DNg3Dv03jo/A8 aE1ARIgR5PIrdItQkODquKmdescKDqAGARpOWahqQ1+QszWc3hSS1Lr8Nmgp48Q+709rrF yKwis+Rrl8gDk3EWR5bx8jqWZ8B7wqLhHXHZEVw9Kx0e+oOUQHEYukRqMVMBZzKSx6Ayl5 +VpJKr0bi1NcjQbc3XKvP55NlqSdYxEDYrVHASjiDF2WMF2h1WsjSV3RgwDSOWdu1IjQry hpWbIhVCTa6j4wgUAZk7IYzieEhWzenMtPcXAW+k+IGplHtpaVdMBJoexTAQQA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749967780; a=rsa-sha256; cv=none; b=pO3cxqV92RGzqmTNe1HmpqZuBTNJL/KyUfgupUmmj9FQFiCDgCxIAvY5/a+DS3Z681uBxO gB3CdQEDUudFeGHyzYFAf5eSZE4/RIeH9MWBD/3cc9L6e+efrU2hgO8wfcM8MjQSxF2Aug ygM7ty5Hc8IE9PPOV8AZrT1Kw51T+nUt6nBaqC36HHaEFbVFaEHf9Mlun31k7B5p4bbnj1 WszYV/xkh3ZyGxF2Nmtg4tyDsnFeZ6Y9JN32AquHfINoQNqUwCsgePxBSmpYcSf6AMr8OT pk2na/AZxY7seFtfd9tCdBS4RSZf/l1Q3zm+Q6DH0QlLxgYV/1U9zeNvFJNwDQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bKjQX3DHgz116w; Sun, 15 Jun 2025 06:09:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55F69dLv021409; Sun, 15 Jun 2025 06:09:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55F69dn3021406; Sun, 15 Jun 2025 06:09:39 GMT (envelope-from git) Date: Sun, 15 Jun 2025 06:09:39 GMT Message-Id: <202506150609.55F69dn3021406@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 1349a733cf28 - main - ufshci: Introduce the ufshci(4) driver List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1349a733cf2828e0040cabef89eeadc3ff00c40b Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=1349a733cf2828e0040cabef89eeadc3ff00c40b commit 1349a733cf2828e0040cabef89eeadc3ff00c40b Author: Jaeyoon Choi AuthorDate: 2025-06-13 18:33:01 +0000 Commit: Warner Losh CommitDate: 2025-06-15 06:08:56 +0000 ufshci: Introduce the ufshci(4) driver This commit adds a storage driver that supports the Universal Flash Storage Host Controller Interface (UFSHCI) on FreeBSD. Universal Flash Storage (UFS) is a flash-based mobile storage device that replaces eMMC, aiming for high performance with low power. The UFS Host Controller Interface (UFSHCI) is the host side controller and connects UFS device to a system bus, such as PCIe. The code targets the latest standards: - UFS 4.1: https://www.jedec.org/standards-documents/docs/jesd220g - UFSHCI 4.1: https://www.jedec.org/standards-documents/docs/jesd223f The ufshci(4) driver implements controller/device initialization, interrupt, single-doorbell(SDB) queue based IO requests. Support for multi-queue (MCQ) IO requests is planned for a later commit. Implemented features: - PCIe bus support - legacy(INTx) Interrupt Handling - UIC command support - UTP Transfer Request (UTR) support - UTP Task Management Request (UTMR) support - single doorbell queue (SDB) with multiple queue depth - SCSI command set support - sysctl Work in progress: - multi-Circular Queue (per-CPU IO queues) - MSI-X interrupt Support - write booster - write Protect - Host Performance Booster (HPB) - interrupt aggregation - ARM based system bus support - ufs-utils port Tests were performed on QEMU and an Intel-based laptop. Since QEMU has an emulated UFS device, I tested on QEMU. How to test on QEMU: 1. Run QEMU $ qemu-system-x86_64 ... -device ufs -drive file=blk1g.bin,format=raw,if=none,id=luimg -device ufs-lu,drive=luimg,lun=0 2. Loading/unloading the ufshci module on QEMU $ kldload /usr/obj/usr/src/amd64.amd64/sys/modules/ufshci/ufshci.ko $ kldunload ufshci Testing on real hardware: - Samsung Galaxy Book S (Intel Lakefield) with UFS 3.0 - Lenovo duet 3 11ian8 (Intel N100) with UFS 2.1 Sponsored by: Samsung Electronics Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D50370 --- sbin/camcontrol/camcontrol.c | 13 + sys/cam/cam_ccb.h | 20 + sys/cam/scsi/scsi_xpt.c | 1 + sys/dev/ufshci/ufshci.c | 76 +++ sys/dev/ufshci/ufshci.h | 939 ++++++++++++++++++++++++++++++++++++++ sys/dev/ufshci/ufshci_ctrlr.c | 503 ++++++++++++++++++++ sys/dev/ufshci/ufshci_ctrlr_cmd.c | 53 +++ sys/dev/ufshci/ufshci_dev.c | 428 +++++++++++++++++ sys/dev/ufshci/ufshci_pci.c | 260 +++++++++++ sys/dev/ufshci/ufshci_private.h | 508 +++++++++++++++++++++ sys/dev/ufshci/ufshci_reg.h | 469 +++++++++++++++++++ sys/dev/ufshci/ufshci_req_queue.c | 490 ++++++++++++++++++++ sys/dev/ufshci/ufshci_req_sdb.c | 427 +++++++++++++++++ sys/dev/ufshci/ufshci_sim.c | 372 +++++++++++++++ sys/dev/ufshci/ufshci_sysctl.c | 233 ++++++++++ sys/dev/ufshci/ufshci_uic_cmd.c | 224 +++++++++ sys/modules/ufshci/Makefile | 22 + 17 files changed, 5038 insertions(+) diff --git a/sbin/camcontrol/camcontrol.c b/sbin/camcontrol/camcontrol.c index a2e65055fcaa..19684c044ef5 100644 --- a/sbin/camcontrol/camcontrol.c +++ b/sbin/camcontrol/camcontrol.c @@ -5400,6 +5400,19 @@ cts_print(struct cam_device *device, struct ccb_trans_settings *cts) nvmf_transport_type(nvmf->trtype)); } } + if (cts->transport == XPORT_UFSHCI) { + struct ccb_trans_settings_ufshci *ufshci = + &cts->xport_specific.ufshci; + + if (ufshci->valid & CTS_UFSHCI_VALID_MODE) { + fprintf(stdout, "%sHigh Speed Gear: %d (%d max)\n", + pathstr, ufshci->hs_gear, ufshci->max_hs_gear); + fprintf(stdout, "%sUnipro TX lanes: %d (%d max)\n", pathstr, + ufshci->tx_lanes, ufshci->max_tx_lanes); + fprintf(stdout, "%sUnipro RX lanes: %d (%d max)\n", pathstr, + ufshci->rx_lanes, ufshci->max_rx_lanes); + } + } if (cts->protocol == PROTO_ATA) { struct ccb_trans_settings_ata *ata= &cts->proto_specific.ata; diff --git a/sys/cam/cam_ccb.h b/sys/cam/cam_ccb.h index 15e136e8a072..da98b98ba7d1 100644 --- a/sys/cam/cam_ccb.h +++ b/sys/cam/cam_ccb.h @@ -298,6 +298,7 @@ typedef enum { XPORT_NVME, /* NVMe over PCIe */ XPORT_MMCSD, /* MMC, SD, SDIO card */ XPORT_NVMF, /* NVMe over Fabrics */ + XPORT_UFSHCI, /* Universal Flash Storage Host Interface */ } cam_xport; #define XPORT_IS_NVME(t) ((t) == XPORT_NVME || (t) == XPORT_NVMF) @@ -1065,6 +1066,24 @@ struct ccb_trans_settings_nvmf uint8_t trtype; }; +struct ccb_trans_settings_ufshci +{ + u_int valid; /* Which fields to honor */ + /* + * Ensure the validity of the information for the Unipro link + * (GEAR, SPEED, LANE) + */ +#define CTS_UFSHCI_VALID_LINK 0x01 + uint32_t speed; + uint8_t hs_gear; /* High Speed Gear (G1, G2, G3...) */ + uint8_t tx_lanes; + uint8_t rx_lanes; + uint8_t max_hs_gear; /* Maximum HS Gear */ + uint8_t max_tx_lanes; + uint8_t max_rx_lanes; +}; + + #include struct ccb_trans_settings_mmc { struct mmc_ios ios; @@ -1138,6 +1157,7 @@ struct ccb_trans_settings { struct ccb_trans_settings_sata sata; struct ccb_trans_settings_nvme nvme; struct ccb_trans_settings_nvmf nvmf; + struct ccb_trans_settings_ufshci ufshci; } xport_specific; }; diff --git a/sys/cam/scsi/scsi_xpt.c b/sys/cam/scsi/scsi_xpt.c index 2bb59cb2d92b..439dd2050a95 100644 --- a/sys/cam/scsi/scsi_xpt.c +++ b/sys/cam/scsi/scsi_xpt.c @@ -618,6 +618,7 @@ SCSI_XPT_XPORT(usb, USB); SCSI_XPT_XPORT(iscsi, ISCSI); SCSI_XPT_XPORT(srp, SRP); SCSI_XPT_XPORT(ppb, PPB); +SCSI_XPT_XPORT(ufshci, UFSHCI); #undef SCSI_XPORT_XPORT diff --git a/sys/dev/ufshci/ufshci.c b/sys/dev/ufshci/ufshci.c new file mode 100644 index 000000000000..84a9629e74b0 --- /dev/null +++ b/sys/dev/ufshci/ufshci.c @@ -0,0 +1,76 @@ +/*- + * Copyright (c) 2025, Samsung Electronics Co., Ltd. + * Written by Jaeyoon Choi + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include +#include +#include +#include + +#include "ufshci_private.h" + +MALLOC_DEFINE(M_UFSHCI, "ufshci", "ufshci(4) memory allocations"); + +int +ufshci_attach(device_t dev) +{ + struct ufshci_controller *ctrlr = device_get_softc(dev); + int status; + + status = ufshci_ctrlr_construct(ctrlr, dev); + if (status != 0) { + ufshci_ctrlr_destruct(ctrlr, dev); + return (status); + } + + ctrlr->config_hook.ich_func = ufshci_ctrlr_start_config_hook; + ctrlr->config_hook.ich_arg = ctrlr; + + if (config_intrhook_establish(&ctrlr->config_hook) != 0) + return (ENOMEM); + + return (0); +} + +int +ufshci_detach(device_t dev) +{ + struct ufshci_controller *ctrlr = device_get_softc(dev); + + config_intrhook_drain(&ctrlr->config_hook); + + ufshci_ctrlr_destruct(ctrlr, dev); + + return (0); +} + +void +ufshci_completion_poll_cb(void *arg, const struct ufshci_completion *cpl, + bool error) +{ + struct ufshci_completion_poll_status *status = arg; + + /* + * Copy status into the argument passed by the caller, so that the + * caller can check the status to determine if the the request passed + * or failed. + */ + memcpy(&status->cpl.response_upiu, &cpl->response_upiu, cpl->size); + status->error = error; + atomic_store_rel_int(&status->done, 1); +} + +static int +ufshci_modevent(module_t mod __unused, int type __unused, void *argp __unused) +{ + return (0); +} + +static moduledata_t ufshci_mod = { "ufshci", ufshci_modevent, 0 }; + +DECLARE_MODULE(ufshci, ufshci_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST); +MODULE_VERSION(ufshci, 1); +MODULE_DEPEND(ufshci, cam, 1, 1, 1); diff --git a/sys/dev/ufshci/ufshci.h b/sys/dev/ufshci/ufshci.h new file mode 100644 index 000000000000..9f0faaadeb57 --- /dev/null +++ b/sys/dev/ufshci/ufshci.h @@ -0,0 +1,939 @@ +/*- + * Copyright (c) 2025, Samsung Electronics Co., Ltd. + * Written by Jaeyoon Choi + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#ifndef __UFSHCI_H__ +#define __UFSHCI_H__ + +#include +#include + +/* + * Note: This driver currently assumes a little-endian architecture. + * Big-endian support is not yet implemented. + */ + +/* MIPI UniPro spec 2.0, section 5.8.1 "PHY Adapter Common Attributes" */ +#define PA_AvailTxDataLanes 0x1520 +#define PA_AvailRxDataLanes 0x1540 + +/* + * MIPI UniPro spec 2.0, section 5.8.2 "PHY Adapter M-PHY-Specific + * Attributes" + */ +#define PA_ConnectedTxDataLanes 0x1561 +#define PA_ConnectedRxDataLanes 0x1581 +#define PA_MaxRxHSGear 0x1587 +#define PA_Granularity 0x15AA +#define PA_TActivate 0x15A8 + +#define PA_RemoteVerInfo 0x15A0 +#define PA_LocalVerInfo 0x15A9 + +/* UFSHCI spec 4.1, section 7.4 "UIC Power Mode Change" */ +#define PA_ActiveTxDataLanes 0x1560 +#define PA_ActiveRxDataLanes 0x1580 +#define PA_TxGear 0x1568 +#define PA_RxGear 0x1583 +#define PA_TxTermination 0x1569 +#define PA_RxTermination 0x1584 +#define PA_HSSeries 0x156A +#define PA_PWRModeUserData0 0x15B0 +#define PA_PWRModeUserData1 0x15B1 +#define PA_PWRModeUserData2 0x15B2 +#define PA_PWRModeUserData3 0x15B3 +#define PA_PWRModeUserData4 0x15B4 +#define PA_PWRModeUserData5 0x15B5 + +#define PA_TxHsAdaptType 0x15D4 +#define PA_PWRMode 0x1571 + +#define DME_LocalFC0ProtectionTimeOutVal 0xD041 +#define DME_LocalTC0ReplayTimeOutVal 0xD042 +#define DME_LocalAFC0ReqTimeOutVal 0xD043 + +/* Currently, UFS uses TC0 only. */ +#define DL_FC0ProtectionTimeOutVal_Default 8191 +#define DL_TC0ReplayTimeOutVal_Default 65535 +#define DL_AFC0ReqTimeOutVal_Default 32767 + +/* UFS Spec 4.1, section 6.4 "Reference Clock" */ +enum ufshci_attribute_reference_clock { + UFSHCI_REF_CLK_19_2MHz = 0x0, + UFSHCI_REF_CLK_26MHz = 0x1, + UFSHCI_REF_CLK_38_4MHz = 0x2, + UFSHCI_REF_CLK_OBSOLETE = 0x3, +}; + +/* UFS spec 4.1, section 9 "UFS UIC Layer: MIPI Unipro" */ +enum ufshci_uic_cmd_opcode { + /* Configuration */ + UFSHCI_DME_GET = 0x01, + UFSHCI_DME_SET = 0x02, + UFSHCI_DME_PEER_GET = 0x03, + UFSHCI_DME_PEER_SET = 0x04, + /* Controll */ + UFSHCI_DME_POWER_ON = 0x10, + UFSHCI_DME_POWER_OFF = 0x11, + UFSHCI_DME_ENABLE = 0x12, + UFSHCI_DME_RESET = 0x14, + UFSHCI_DME_ENDPOINT_RESET = 0x15, + UFSHCI_DME_LINK_STARTUP = 0x16, + UFSHCI_DME_HIBERNATE_ENTER = 0x17, + UFSHCI_DME_HIBERNATE_EXIT = 0x18, + UFSHCI_DME_TEST_MODE = 0x1a, +}; + +/* UFSHCI spec 4.1, section 5.6.3 "Offset 98h: UICCMDARG2 – UIC Command + * Argument" */ +enum ufshci_uic_cmd_attr_set_type { + UFSHCI_ATTR_SET_TYPE_NORMAL = 0, /* volatile value */ + UFSHCI_ATTR_SET_TYPE_STATIC = 1, /* non-volatile reset value */ +}; + +struct ufshci_uic_cmd { + uint8_t opcode; + uint32_t argument1; + uint32_t argument2; + uint32_t argument3; +}; + +/* UFS spec 4.1, section 10.5 "UPIU Transactions" */ +enum transaction_code { + UFSHCI_UPIU_TRANSACTION_CODE_NOP_OUT = 0x00, + UFSHCI_UPIU_TRANSACTION_CODE_COMMAND = 0x01, + UFSHCI_UPIU_TRANSACTION_CODE_DATA_OUT = 0x02, + UFSHCI_UPIU_TRANSACTION_CODE_TASK_MANAGEMENT_REQUEST = 0x04, + UFSHCI_UPIU_TRANSACTION_CODE_QUERY_REQUEST = 0x16, + UFSHCI_UPIU_TRANSACTION_CODE_NOP_IN = 0x20, + UFSHCI_UPIU_TRANSACTION_CODE_RESPONSE = 0x21, + UFSHCI_UPIU_TRANSACTION_CODE_DATA_IN = 0x22, + UFSHCI_UPIU_TRANSACTION_CODE_TASK_MANAGEMENT_RESPONSE = 0x24, + UFSHCI_UPIU_TRANSACTION_CODE_READY_TO_TRANSFER = 0x31, + UFSHCI_UPIU_TRANSACTION_CODE_QUERY_RESPONSE = 0x36, + UFSHCI_UPIU_TRANSACTION_CODE_REJECT_UPIU = 0x3f, +}; + +enum overall_command_status { + UFSHCI_DESC_SUCCESS = 0x0, + UFSHCI_DESC_INVALID_COMMAND_TABLE_ATTRIBUTES = 0x01, + UFSHCI_DESC_INVALID_PRDT_ATTRIBUTES = 0x02, + UFSHCI_DESC_MISMATCH_DATA_BUFFER_SIZE = 0x03, + UFSHCI_DESC_MISMATCH_RESPONSE_UPIU_SIZE = 0x04, + UFSHCI_DESC_COMMUNICATION_FAILURE_WITHIN_UIC_LAYERS = 0x05, + UFSHCI_DESC_ABORTED = 0x06, + UFSHCI_DESC_HOST_CONTROLLER_FATAL_ERROR = 0x07, + UFSHCI_DESC_DEVICEFATALERROR = 0x08, + UFSHCI_DESC_INVALID_CRYPTO_CONFIGURATION = 0x09, + UFSHCI_DESC_GENERAL_CRYPTO_ERROR = 0x0A, + UFSHCI_DESC_INVALID = 0x0F, +}; + +enum response_code { + UFSHCI_RESPONSE_CODE_TARGET_SUCCESS = 0x00, + UFSHCI_RESPONSE_CODE_TARGET_FAILURE = 0x01, + UFSHCI_RESPONSE_CODE_PARAMETER_NOTREADABLE = 0xF6, + UFSHCI_RESPONSE_CODE_PARAMETER_NOTWRITEABLE = 0xF7, + UFSHCI_RESPONSE_CODE_PARAMETER_ALREADYWRITTEN = 0xF8, + UFSHCI_RESPONSE_CODE_INVALID_LENGTH = 0xF9, + UFSHCI_RESPONSE_CODE_INVALID_VALUE = 0xFA, + UFSHCI_RESPONSE_CODE_INVALID_SELECTOR = 0xFB, + UFSHCI_RESPONSE_CODE_INVALID_INDEX = 0xFC, + UFSHCI_RESPONSE_CODE_INVALID_IDN = 0xFD, + UFSHCI_RESPONSE_CODE_INVALID_OPCODE = 0xFE, + UFSHCI_RESPONSE_CODE_GENERAL_FAILURE = 0xFF, +}; + +/* UFSHCI spec 4.1, section 6.1.1 "UTP Transfer Request Descriptor" */ +enum ufshci_command_type { + UFSHCI_COMMAND_TYPE_UFS_STORAGE = 0x01, + UFSHCI_COMMAND_TYPE_NULLIFIED_UTRD = 0x0F, +}; + +enum ufshci_data_direction { + UFSHCI_DATA_DIRECTION_NO_DATA_TRANSFER = 0x00, + UFSHCI_DATA_DIRECTION_FROM_SYS_TO_TGT = 0x01, + UFSHCI_DATA_DIRECTION_FROM_TGT_TO_SYS = 0x10, + UFSHCI_DATA_DIRECTION_RESERVED = 0b11, +}; + +enum ufshci_overall_command_status { + UFSHCI_OCS_SUCCESS = 0x0, + UFSHCI_OCS_INVALID_COMMAND_TABLE_ATTRIBUTES = 0x01, + UFSHCI_OCS_INVALID_PRDT_ATTRIBUTES = 0x02, + UFSHCI_OCS_MISMATCH_DATA_BUFFER_SIZE = 0x03, + UFSHCI_OCS_MISMATCH_RESPONSE_UPIU_SIZE = 0x04, + UFSHCI_OCS_COMMUNICATION_FAILURE_WITHIN_UIC_LAYERS = 0x05, + UFSHCI_OCS_ABORTED = 0x06, + UFSHCI_OCS_HOST_CONTROLLER_FATAL_ERROR = 0x07, + UFSHCI_OCS_DEVICE_FATAL_ERROR = 0x08, + UFSHCI_OCS_INVALID_CRYPTO_CONFIGURATION = 0x09, + UFSHCI_OCS_GENERAL_CRYPTO_ERROR = 0x0A, + UFSHCI_OCS_INVALID = 0xF, +}; + +struct ufshci_utp_xfer_req_desc { + /* dword 0 */ + uint32_t cci : 8; /* [7:0] */ + uint32_t total_ehs_length : 8; /* [15:8] */ + uint32_t reserved0 : 7; /* [22:16] */ + uint32_t ce : 1; /* [23] */ + uint32_t interrupt : 1; /* [24] */ + uint32_t data_direction : 2; /* [26:25] */ + uint32_t reserved1 : 1; /* [27] */ + uint32_t command_type : 4; /* [31:28] */ + + /* dword 1 */ + uint32_t data_unit_number_lower; /* [31:0] */ + + /* dword 2 */ + uint8_t overall_command_status; /* [7:0] */ + uint8_t common_data_size; /* [15:8] */ + uint16_t last_data_byte_count; /* [31:16] */ + + /* dword 3 */ + uint32_t data_unit_number_upper; /* [31:0] */ + + /* dword 4 */ + uint32_t utp_command_descriptor_base_address; /* [31:0] */ + + /* dword 5 */ + uint32_t utp_command_descriptor_base_address_upper; /* [31:0] */ + + /* dword 6 */ + uint16_t response_upiu_length; /* [15:0] */ + uint16_t response_upiu_offset; /* [31:16] */ + + /* dword 7 */ + uint16_t prdt_length; /* [15:0] */ + uint16_t prdt_offset; /* [31:16] */ +} __packed __aligned(8); + +_Static_assert(sizeof(struct ufshci_utp_xfer_req_desc) == 32, + "ufshci_utp_xfer_req_desc must be 32 bytes"); + +/* + * According to the UFSHCI specification, the size of the UTP command + * descriptor is as follows. The size of the transfer request is not limited, + * a transfer response can be as long as 65535 * dwords, and a PRDT can be as + * long as 65565 * PRDT entry size(16 bytes). However, for ease of use, this + * UFSHCI Driver imposes the following limits. The size of the transfer + * request and the transfer response is 1024 bytes or less. The PRDT region + * limits the number of scatter gathers to 256 + 1, using a total of 4096 + + * 16 bytes. Therefore, only 8KB size is allocated for the UTP command + * descriptor. + */ +#define UFSHCI_UTP_COMMAND_DESCRIPTOR_SIZE 8192 +#define UFSHCI_UTP_XFER_REQ_SIZE 512 +#define UFSHCI_UTP_XFER_RESP_SIZE 512 + +/* + * To reduce the size of the UTP Command Descriptor(8KB), we must use only + * 256 + 1 PRDT entries. The reason for adding the 1 is that if the data is + * not aligned, one additional PRDT_ENTRY is used. + */ +#define UFSHCI_MAX_PRDT_ENTRY_COUNT (256 + 1) + +/* UFSHCI spec 4.1, section 6.1.2 "UTP Command Descriptor" */ +struct ufshci_prdt_entry { + /* dword 0 */ + uint32_t data_base_address; /* [31:0] */ + + /* dword 1 */ + uint32_t data_base_address_upper; /* [31:0] */ + + /* dword 2 */ + uint32_t reserved; /* [31:0] */ + + /* dword 3 */ + uint32_t data_byte_count; /* [17:0] Maximum byte + * count is 256KB */ +} __packed __aligned(8); + +_Static_assert(sizeof(struct ufshci_prdt_entry) == 16, + "ufshci_prdt_entry must be 16 bytes"); + +struct ufshci_utp_cmd_desc { + uint8_t command_upiu[UFSHCI_UTP_XFER_REQ_SIZE]; + uint8_t response_upiu[UFSHCI_UTP_XFER_RESP_SIZE]; + uint8_t prd_table[sizeof(struct ufshci_prdt_entry) * + UFSHCI_MAX_PRDT_ENTRY_COUNT]; + uint8_t padding[3072 - sizeof(struct ufshci_prdt_entry)]; +} __packed __aligned(128); + +_Static_assert(sizeof(struct ufshci_utp_cmd_desc) == + UFSHCI_UTP_COMMAND_DESCRIPTOR_SIZE, + "ufshci_utp_cmd_desc must be 8192 bytes"); + +#define UFSHCI_UTP_TASK_MGMT_REQ_SIZE 32 +#define UFSHCI_UTP_TASK_MGMT_RESP_SIZE 32 + +/* UFSHCI spec 4.1, section 6.3.1 "UTP Task Management Request Descriptor" */ +struct ufshci_utp_task_mgmt_req_desc { + /* dword 0 */ + uint32_t reserved0 : 24; /* [23:0] */ + uint32_t interrupt : 1; /* [24] */ + uint32_t reserved1 : 7; /* [31:25] */ + + /* dword 1 */ + uint32_t reserved2; /* [31:0] */ + + /* dword 2 */ + uint8_t overall_command_status; /* [7:0] */ + uint8_t reserved3; /* [15:8] */ + uint16_t reserved4; /* [31:16] */ + + /* dword 3 */ + uint32_t reserved5; /* [31:0] */ + + /* dword 4-11 */ + uint8_t request_upiu[UFSHCI_UTP_TASK_MGMT_REQ_SIZE]; + + /* dword 12-19 */ + uint8_t response_upiu[UFSHCI_UTP_TASK_MGMT_RESP_SIZE]; + +} __packed __aligned(8); + +_Static_assert(sizeof(struct ufshci_utp_task_mgmt_req_desc) == 80, + "ufshci_utp_task_mgmt_req_desc must be 80 bytes"); + +/* UFS spec 4.1, section 10.6.2 "Basic Header Format" */ +struct ufshci_upiu_header { + /* dword 0 */ + union { + struct { + uint8_t trans_code : 6; /* [5:0] */ + uint8_t dd : 1; /* [6] */ + uint8_t hd : 1; /* [7] */ + }; + uint8_t trans_type; + }; + union { + struct { + uint8_t task_attribute : 2; /* [1:0] */ + uint8_t cp : 1; /* [2] */ + uint8_t retransmit_indicator : 1; /* [3] */ +#define UFSHCI_OPERATIONAL_FLAG_W 0x2 +#define UFSHCI_OPERATIONAL_FLAG_R 0x4 + uint8_t operational_flags : 4; /* [7:4] */ + }; + uint8_t flags; + }; + uint8_t lun; + uint8_t task_tag; + + /* dword 1 */ +#define UFSHCI_COMMAND_SET_TYPE_SCSI 0 + uint8_t cmd_set_type : 4; /* [3:0] */ + uint8_t iid : 4; /* [7:4] */ + uint8_t ext_iid_or_function; + uint8_t response; + uint8_t ext_iid_or_status; + + /* dword 2 */ + uint8_t ehs_length; + uint8_t device_infomation; + uint16_t data_segment_length; /* (Big-endian) */ +} __packed __aligned(4); + +_Static_assert(sizeof(struct ufshci_upiu_header) == 12, + "ufshci_upiu_header must be 12 bytes"); + +#define UFSHCI_MAX_UPIU_SIZE 512 +#define UFSHCI_UPIU_ALIGNMENT 8 /* UPIU requires 64-bit alignment. */ + +struct ufshci_upiu { + /* dword 0-2 */ + struct ufshci_upiu_header header; + /* dword 3-127 */ + uint8_t + reserved[UFSHCI_MAX_UPIU_SIZE - sizeof(struct ufshci_upiu_header)]; +} __packed __aligned(8); + +_Static_assert(sizeof(struct ufshci_upiu) == 512, + "ufshci_upiu must be 512 bytes"); + +struct ufshci_cmd_command_upiu { + /* dword 0-2 */ + struct ufshci_upiu_header header; + /* dword 3 */ + uint32_t expected_data_transfer_length; /* (Big-endian) */ + + /* dword 4-7 */ + uint8_t cdb[16]; + +} __packed __aligned(4); + +_Static_assert(sizeof(struct ufshci_cmd_command_upiu) == 32, + "bad size for ufshci_cmd_command_upiu"); +_Static_assert(sizeof(struct ufshci_cmd_command_upiu) <= + UFSHCI_UTP_XFER_REQ_SIZE, + "bad size for ufshci_cmd_command_upiu"); +_Static_assert(sizeof(struct ufshci_cmd_command_upiu) % UFSHCI_UPIU_ALIGNMENT == + 0, + "UPIU requires 64-bit alignment"); + +struct ufshci_cmd_response_upiu { + /* dword 0-2 */ + struct ufshci_upiu_header header; + /* dword 3 */ + uint32_t residual_transfer_count; /* (Big-endian) */ + + /* dword 4-7 */ + uint8_t reserved[16]; + + /* Sense Data */ + uint16_t sense_data_len; /* (Big-endian) */ + uint8_t sense_data[18]; + + /* Add padding to align the kUpiuAlignment. */ + uint8_t padding[4]; +} __packed __aligned(4); + +_Static_assert(sizeof(struct ufshci_cmd_response_upiu) == 56, + "bad size for ufshci_cmd_response_upiu"); +_Static_assert(sizeof(struct ufshci_cmd_response_upiu) <= + UFSHCI_UTP_XFER_RESP_SIZE, + "bad size for ufshci_cmd_response_upiu"); +_Static_assert(sizeof(struct ufshci_cmd_response_upiu) % + UFSHCI_UPIU_ALIGNMENT == + 0, + "UPIU requires 64-bit alignment"); + +/* UFS Spec 4.1, section 10.7.8 "QUERY REQUEST UPIU" */ +enum ufshci_query_function { + UFSHCI_QUERY_FUNC_STANDARD_READ_REQUEST = 0x01, + UFSHCI_QUERY_FUNC_STANDARD_WRITE_REQUEST = 0x81, +}; + +enum ufshci_query_opcode { + UFSHCI_QUERY_OPCODE_NOP = 0, + UFSHCI_QUERY_OPCODE_READ_DESCRIPTOR, + UFSHCI_QUERY_OPCODE_WRITE_DESCRIPTOR, + UFSHCI_QUERY_OPCODE_READ_ATTRIBUTE, + UFSHCI_QUERY_OPCODE_WRITE_ATTRIBUTE, + UFSHCI_QUERY_OPCODE_READ_FLAG, + UFSHCI_QUERY_OPCODE_SET_FLAG, + UFSHCI_QUERY_OPCODE_CLEAR_FLAG, + UFSHCI_QUERY_OPCODE_TOGGLE_FLAG, +}; + +struct ufshci_query_param { + enum ufshci_query_function function; + enum ufshci_query_opcode opcode; + uint8_t type; + uint8_t index; + uint8_t selector; + uint64_t value; + size_t desc_size; +}; + +struct ufshci_query_request_upiu { + /* dword 0-2 */ + struct ufshci_upiu_header header; + /* dword 3 */ + uint8_t opcode; + uint8_t idn; + uint8_t index; + uint8_t selector; + + /* dword 4-5 */ + union { + /* The Write Attribute opcode uses 64 - bit value. */ + uint64_t value_64; /* (Big-endian) */ + struct { + uint8_t reserved1[2]; + uint16_t length; /* (Big-endian) */ + uint32_t value_32; /* (Big-endian) */ + }; + } __packed __aligned(4); + + /* dword 6 */ + uint32_t reserved2; + + /* dword 7 */ + uint32_t reserved3; + + uint8_t command_data[256]; +} __packed __aligned(4); + +_Static_assert(sizeof(struct ufshci_query_request_upiu) == 288, + "bad size for ufshci_query_request_upiu"); +_Static_assert(sizeof(struct ufshci_query_request_upiu) <= + UFSHCI_UTP_XFER_REQ_SIZE, + "bad size for ufshci_query_request_upiu"); +_Static_assert(sizeof(struct ufshci_query_request_upiu) % + UFSHCI_UPIU_ALIGNMENT == + 0, + "UPIU requires 64-bit alignment"); + +/* UFS Spec 4.1, section 10.7.9 "QUERY RESPONSE UPIU" */ +enum ufshci_query_response_code { + UFSHCI_QUERY_RESP_CODE_SUCCESS = 0x00, + UFSHCI_QUERY_RESP_CODE_PARAMETER_NOT_READABLE = 0xf6, + UFSHCI_QUERY_RESP_CODE_PARAMETER_NOT_WRITEABLE = 0xf7, + UFSHCI_QUERY_RESP_CODE_PARAMETER_ALREADY_WRITTEN = 0xf8, + UFSHCI_QUERY_RESP_CODE_INVALID_LENGTH = 0xf9, + UFSHCI_QUERY_RESP_CODE_INVALID_VALUE = 0xfa, + UFSHCI_QUERY_RESP_CODE_INVALID_SELECTOR = 0xfb, + UFSHCI_QUERY_RESP_CODE_INVALID_INDEX = 0xfc, + UFSHCI_QUERY_RESP_CODE_INVALID_IDN = 0xfd, + UFSHCI_QUERY_RESP_CODE_INVALID_OPCODE = 0xfe, + UFSHCI_QUERY_RESP_CODE_GENERAL_FAILURE = 0xff, +}; + +struct ufshci_query_response_upiu { + /* dword 0-2 */ + struct ufshci_upiu_header header; + /* dword 3 */ + uint8_t opcode; + uint8_t idn; + uint8_t index; + uint8_t selector; + + /* dword 4-5 */ + union { + /* The Read / Write Attribute opcodes use 64 - bit value. */ + uint64_t value_64; /* (Big-endian) */ + struct { + uint8_t reserved1[2]; + uint16_t length; /* (Big-endian) */ + union { + uint32_t value_32; /* (Big-endian) */ + struct { + uint8_t reserved2[3]; + uint8_t flag_value; + }; + }; + }; + } __packed __aligned(4); + + /* dword 6 */ + uint8_t reserved3[4]; + + /* dword 7 */ + uint8_t reserved4[4]; + + uint8_t command_data[256]; +} __packed __aligned(4); + +_Static_assert(sizeof(struct ufshci_query_response_upiu) == 288, + "bad size for ufshci_query_response_upiu"); +_Static_assert(sizeof(struct ufshci_query_response_upiu) <= + UFSHCI_UTP_XFER_RESP_SIZE, + "bad size for ufshci_query_response_upiu"); +_Static_assert(sizeof(struct ufshci_query_response_upiu) % + UFSHCI_UPIU_ALIGNMENT == + 0, + "UPIU requires 64-bit alignment"); + +/* UFS 4.1, section 10.7.11 "NOP OUT UPIU" */ +struct ufshci_nop_out_upiu { + /* dword 0-2 */ + struct ufshci_upiu_header header; + /* dword 3-7 */ + uint8_t reserved[20]; +} __packed __aligned(8); +_Static_assert(sizeof(struct ufshci_nop_out_upiu) == 32, + "ufshci_upiu_nop_out must be 32 bytes"); + +/* UFS 4.1, section 10.7.12 "NOP IN UPIU" */ +struct ufshci_nop_in_upiu { + /* dword 0-2 */ + struct ufshci_upiu_header header; + /* dword 3-7 */ + uint8_t reserved[20]; +} __packed __aligned(8); +_Static_assert(sizeof(struct ufshci_nop_in_upiu) == 32, + "ufshci_upiu_nop_in must be 32 bytes"); + +union ufshci_reponse_upiu { + struct ufshci_upiu_header header; + struct ufshci_cmd_response_upiu cmd_response_upiu; + struct ufshci_query_response_upiu query_response_upiu; + struct ufshci_nop_in_upiu nop_in_upiu; +}; + +struct ufshci_completion { + union ufshci_reponse_upiu response_upiu; + size_t size; +}; + +typedef void (*ufshci_cb_fn_t)(void *, const struct ufshci_completion *, bool); + +/* + * UFS Spec 4.1, section 14.1 "UFS Descriptors" + * All descriptors use big-endian byte ordering. + */ +enum ufshci_descriptor_type { + UFSHCI_DESC_TYPE_DEVICE = 0x00, + UFSHCI_DESC_TYPE_CONFIGURATION = 0x01, + UFSHCI_DESC_TYPE_UNIT = 0x02, + UFSHCI_DESC_TYPE_INTERCONNECT = 0x04, + UFSHCI_DESC_TYPE_STRING = 0x05, + UFSHCI_DESC_TYPE_GEOMETRY = 0X07, + UFSHCI_DESC_TYPE_POWER = 0x08, + UFSHCI_DESC_TYPE_DEVICE_HEALTH = 0x09, + UFSHCI_DESC_TYPE_FBO_EXTENSION_SPECIFICATION = 0x0a, +}; + +/* + * UFS Spec 4.1, section 14.1.5.2 "Device Descriptor" + * DeviceDescriptor use big-endian byte ordering. + */ +struct ufshci_device_descriptor { + uint8_t bLength; + uint8_t bDescriptorIDN; + uint8_t bDevice; + uint8_t bDeviceClass; + uint8_t bDeviceSubClass; + uint8_t bProtocol; + uint8_t bNumberLU; + uint8_t bNumberWLU; + uint8_t bBootEnable; + uint8_t bDescrAccessEn; + uint8_t bInitPowerMode; + uint8_t bHighPriorityLUN; + uint8_t bSecureRemovalType; + uint8_t bSecurityLU; + uint8_t bBackgroundOpsTermLat; + uint8_t bInitActiveICCLevel; + /* 0x10 */ + uint16_t wSpecVersion; + uint16_t wManufactureDate; + uint8_t iManufacturerName; + uint8_t iProductName; + uint8_t iSerialNumber; + uint8_t iOemID; + uint16_t wManufacturerID; + uint8_t bUD0BaseOffset; + uint8_t bUDConfigPLength; + uint8_t bDeviceRTTCap; + uint16_t wPeriodicRTCUpdate; + uint8_t bUfsFeaturesSupport; + /* 0x20 */ + uint8_t bFFUTimeout; + uint8_t bQueueDepth; + uint16_t wDeviceVersion; + uint8_t bNumSecureWPArea; + uint32_t dPSAMaxDataSize; + uint8_t bPSAStateTimeout; + uint8_t iProductRevisionLevel; + uint8_t Reserved[5]; + /* 0x2a */ + /* 0x30 */ + uint8_t ReservedUME[16]; + /* 0x40 */ + uint8_t ReservedHpb[3]; + uint8_t Reserved2[12]; + uint32_t dExtendedUfsFeaturesSupport; + uint8_t bWriteBoosterBufferPreserveUserSpaceEn; + uint8_t bWriteBoosterBufferType; + uint32_t dNumSharedWriteBoosterBufferAllocUnits; +} __packed; + +_Static_assert(sizeof(struct ufshci_device_descriptor) == 89, + "bad size for ufshci_device_descriptor"); + +/* + * UFS Spec 4.1, section 14.1.5.3 "Configuration Descriptor" + * ConfigurationDescriptor use big-endian byte ordering. + */ +struct ufshci_unit_descriptor_configurable_parameters { + uint8_t bLUEnable; + uint8_t bBootLunID; + uint8_t bLUWriteProtect; + uint8_t bMemoryType; + uint32_t dNumAllocUnits; + uint8_t bDataReliability; + uint8_t bLogicalBlockSize; + uint8_t bProvisioningType; + uint16_t wContextCapabilities; + union { + struct { + uint8_t Reserved[3]; + uint8_t ReservedHpb[6]; + } __packed; + uint16_t wZoneBufferAllocUnits; + }; + uint32_t dLUNumWriteBoosterBufferAllocUnits; +} __packed; + +_Static_assert(sizeof(struct ufshci_unit_descriptor_configurable_parameters) == + 27, + "bad size for ufshci_unit_descriptor_configurable_parameters"); + +#define UFSHCI_CONFIGURATION_DESCEIPTOR_LU_NUM 8 + +struct ufshci_configuration_descriptor { + uint8_t bLength; + uint8_t bDescriptorIDN; + uint8_t bConfDescContinue; + uint8_t bBootEnable; + uint8_t bDescrAccessEn; + uint8_t bInitPowerMode; + uint8_t bHighPriorityLUN; + uint8_t bSecureRemovalType; + uint8_t bInitActiveICCLevel; + uint16_t wPeriodicRTCUpdate; + uint8_t Reserved; + uint8_t bRPMBRegionEnable; + uint8_t bRPMBRegion1Size; + uint8_t bRPMBRegion2Size; + uint8_t bRPMBRegion3Size; + uint8_t bWriteBoosterBufferPreserveUserSpaceEn; + uint8_t bWriteBoosterBufferType; + uint32_t dNumSharedWriteBoosterBufferAllocUnits; + /* 0x16 */ + struct ufshci_unit_descriptor_configurable_parameters + unit_config_params[UFSHCI_CONFIGURATION_DESCEIPTOR_LU_NUM]; +} __packed; + +_Static_assert(sizeof(struct ufshci_configuration_descriptor) == (22 + 27 * 8), + "bad size for ufshci_configuration_descriptor"); + +/* + * UFS Spec 4.1, section 14.1.5.4 "Geometry Descriptor" + * GeometryDescriptor use big-endian byte ordering. + */ +struct ufshci_geometry_descriptor { + uint8_t bLength; + uint8_t bDescriptorIDN; + uint8_t bMediaTechnology; + uint8_t Reserved; + uint64_t qTotalRawDeviceCapacity; + uint8_t bMaxNumberLU; + uint32_t dSegmentSize; + /* 0x11 */ + uint8_t bAllocationUnitSize; + uint8_t bMinAddrBlockSize; + uint8_t bOptimalReadBlockSize; + uint8_t bOptimalWriteBlockSize; + uint8_t bMaxInBufferSize; + uint8_t bMaxOutBufferSize; + uint8_t bRPMB_ReadWriteSize; + uint8_t bDynamicCapacityResourcePolicy; + uint8_t bDataOrdering; + uint8_t bMaxContexIDNumber; + uint8_t bSysDataTagUnitSize; + uint8_t bSysDataTagResSize; + uint8_t bSupportedSecRTypes; + uint16_t wSupportedMemoryTypes; + /* 0x20 */ + uint32_t dSystemCodeMaxNAllocU; + uint16_t wSystemCodeCapAdjFac; + uint32_t dNonPersistMaxNAllocU; + uint16_t wNonPersistCapAdjFac; + uint32_t dEnhanced1MaxNAllocU; + /* 0x30 */ + uint16_t wEnhanced1CapAdjFac; *** 4268 LINES SKIPPED *** From nobody Sun Jun 15 06:09:40 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bKjQY1DDpz5q54p; Sun, 15 Jun 2025 06:09:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bKjQX5mRSz3cWc; Sun, 15 Jun 2025 06:09:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749967780; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UJT3/buUsZS5FoL8vvuT+28AkZbFN3rwdf6hV/TcBro=; b=bA5fKkCiCDLo65A++HsCff6VnVgYDUs8qwAAUOW7tUvN1QGodCoBLiOXJvEI4zxBwFw5Nl 06tEbog160pXbgW3Qz50RAsYmhsJp/Ntoe7SeKyMeHP/Who85hhvfVZV+qwTK6XOqpgAYT ywBE22KAb99SuKZ+T0A3J4fpY8RpTEMOcWdPfVrbipQBIPc2j3ltC9uYMsI9CMA4VfipGJ KjurH1PKGi04EPdrK4OJm4BKD/PKdL4jr8qtZmWUwtEdfQY2VA8F8mY9HdzQde9L/9Yqhz oPXR+I62koHauOxTAToftcoc3vcWzjiFjfeiL3zmHVRY1S6QzGI2a71Ho5o8jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749967780; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UJT3/buUsZS5FoL8vvuT+28AkZbFN3rwdf6hV/TcBro=; b=v0n5Uzh6Dn2oN6XYP2hZd5AhwLXQpws0cL5v4k9MyjpANeexw6eOuwdnRxd0NYXRRNZ91t 3gOTQjI6HXtmRMhYCacFoPviMaTg0z1XcgneReos3EPVoZyHN4PAU7D6/ht8bAJpJnBC0s 6nFKF1kZGkGfDax0KiAXXEuEJuKVoJWmATNOyFbp8bECwLDz9zNBENTX5tPw2a+nQaa+AW 8+io1jN2MERx+u2mZw4miR/y1dmkWVCbcFrtkXSnZm5BhuYOAJGzY9JcitYqN0n2m7amUg IABDtB8LZtk0q8alE+uxF9JZ+mDIzX71IFqp0xI97rP5cF6/XkIFzPQIOsjMLg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749967780; a=rsa-sha256; cv=none; b=b1wE2Vr2LngX1hCuPFn0ys+FEHkf9v7tUHc8n6gEDdEKYMPO3yh5krvQLFD8Hd3IkZ6tAJ gGRjtbSoH6a0atTly0PBWO0EReTxidVYXaZ0r377VyafQ+uz8Y2f/jmolWlBQX/cO52lCz z0/PubaaOCerb/Tx/k01SKprJicWoaVDJZS8rY1HZ5UfpAJXvMs2GBL3iW4gGLapnxfP/6 BIMqEODGJAg6tljQpt451XoBMt38+g+2fpuVLMs31apDwbhyy9yoZb3/21XtKAGbI69lEz Y5yWGcvEOciBWOgQvdxU4eRscNgJajTnOTxRhEnCdXn1Cd2wAVVqnW7IAcDgOw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bKjQX5Jmcz116x; Sun, 15 Jun 2025 06:09:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55F69emd021443; Sun, 15 Jun 2025 06:09:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55F69emw021440; Sun, 15 Jun 2025 06:09:40 GMT (envelope-from git) Date: Sun, 15 Jun 2025 06:09:40 GMT Message-Id: <202506150609.55F69emw021440@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: c4bffce34f55 - main - ufshci: Add to build on arm64 and aarch64 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c4bffce34f55abb240087cc0bea17ebef1680fca Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=c4bffce34f55abb240087cc0bea17ebef1680fca commit c4bffce34f55abb240087cc0bea17ebef1680fca Author: Warner Losh AuthorDate: 2025-06-15 06:07:41 +0000 Commit: Warner Losh CommitDate: 2025-06-15 06:08:56 +0000 ufshci: Add to build on arm64 and aarch64 Add UFS Host Controller Itnerface driver to the build. Sponsored by: Netflix --- sys/modules/Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/modules/Makefile b/sys/modules/Makefile index d60f7352f58d..35cf17be109f 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -401,6 +401,7 @@ SUBDIR= \ udf \ udf_iconv \ ufs \ + ${_ufshci} \ uinput \ unionfs \ usb \ @@ -917,6 +918,10 @@ _bcm283x_pwm= bcm283x_pwm _malo= malo .endif +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "aarch64" +_ufshci=ufshci +.endif + SUBDIR+=${MODULES_EXTRA} .for reject in ${WITHOUT_MODULES} From nobody Sun Jun 15 08:18:05 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bKmGz6791z5sDxj; Sun, 15 Jun 2025 08:18:19 +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 4bKmGy53y1z3m2g; Sun, 15 Jun 2025 08:18:18 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=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 55F8I524012363; Sun, 15 Jun 2025 11:18:08 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 55F8I524012363 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 55F8I5E4012362; Sun, 15 Jun 2025 11:18:05 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 15 Jun 2025 11:18:05 +0300 From: Konstantin Belousov To: Mark Johnston Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 48a656c588f9 - main - linux: Fix usage of ptrace(PT_GET_SC_ARGS) Message-ID: References: <202506131920.55DJKEGT006179@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202506131920.55DJKEGT006179@gitrepo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Spamd-Result: default: False [0.14 / 15.00]; NEURAL_SPAM_LONG(1.00)[0.997]; NEURAL_HAM_SHORT(-0.92)[-0.918]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none]; MIME_GOOD(-0.10)[text/plain]; NEURAL_SPAM_MEDIUM(0.06)[0.064]; ARC_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_FROM(0.00)[gmail.com]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; TO_DN_SOME(0.00)[]; MISSING_XM_UA(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; RCPT_COUNT_THREE(0.00)[4]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; RCVD_TLS_LAST(0.00)[]; HAS_XAW(0.00)[] X-Rspamd-Queue-Id: 4bKmGy53y1z3m2g X-Spamd-Bar: / On Fri, Jun 13, 2025 at 07:20:14PM +0000, Mark Johnston wrote: > The branch main has been updated by markj: > > URL: https://cgit.FreeBSD.org/src/commit/?id=48a656c588f9fb995b9c524b57dd5febd9f69168 > > commit 48a656c588f9fb995b9c524b57dd5febd9f69168 > Author: Mark Johnston > AuthorDate: 2025-06-13 19:03:03 +0000 > Commit: Mark Johnston > CommitDate: 2025-06-13 19:19:59 +0000 > > linux: Fix usage of ptrace(PT_GET_SC_ARGS) > > The native handler expects the argument to be a pointer to an array of 8 > syscall arguments, whereas the emulation provided an array that holds up > to 6. > > Handle this by adding a new range of Linuxulator-specific ptrace > commands. In particular, introduce PTLINUX_GET_SC_ARGS, which always > copies exactly six arguments. This fixes the problem and removes the > hack of checking the target thread ABI to decide whether to apply a > Linux-specific quirk to PT_GET_SC_ARGS. > > Reviewed by: kib > MFC after: 2 weeks > Sponsored by: Klara, Inc. > Differential Revision: https://reviews.freebsd.org/D50758 > --- > sys/compat/freebsd32/freebsd32_misc.c | 3 +++ > sys/compat/linux/linux_ptrace.c | 18 ++++-------------- > sys/kern/sys_process.c | 27 +++++++++++++++++++++------ > sys/sys/ptrace.h | 8 ++++++++ > 4 files changed, 36 insertions(+), 20 deletions(-) > > diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c > index cc777f2bf830..75fdb1f544ca 100644 > --- a/sys/compat/freebsd32/freebsd32_misc.c > +++ b/sys/compat/freebsd32/freebsd32_misc.c > @@ -1177,6 +1177,9 @@ freebsd32_ptrace(struct thread *td, struct freebsd32_ptrace_args *uap) > pscr_args[i] = pscr_args32[i]; > r.sr.pscr_args = pscr_args; > break; > + case PTLINUX_FIRST ... PTLINUX_LAST: > + error = EINVAL; > + break; > default: > addr = uap->addr; > break; > diff --git a/sys/compat/linux/linux_ptrace.c b/sys/compat/linux/linux_ptrace.c > index 421760eab2a9..0dbfd2177122 100644 > --- a/sys/compat/linux/linux_ptrace.c > +++ b/sys/compat/linux/linux_ptrace.c > @@ -386,21 +386,11 @@ linux_ptrace_get_syscall_info(struct thread *td, pid_t pid, > if (lwpinfo.pl_flags & PL_FLAG_SCE) { > si.op = LINUX_PTRACE_SYSCALL_INFO_ENTRY; > si.entry.nr = lwpinfo.pl_syscall_code; > - /* > - * The use of PT_GET_SC_ARGS there is special, > - * implementation of PT_GET_SC_ARGS for Linux-ABI > - * callers emulates Linux bug which strace(1) depends > - * on: at initialization it tests whether ptrace works > - * by calling close(2), or some other single-argument > - * syscall, _with six arguments_, and then verifies > - * whether it can fetch them all using this API; > - * otherwise it bails out. > - */ > - error = kern_ptrace(td, PT_GET_SC_ARGS, pid, > - &si.entry.args, sizeof(si.entry.args)); > + error = kern_ptrace(td, PTLINUX_GET_SC_ARGS, pid, > + si.entry.args, sizeof(si.entry.args)); > if (error != 0) { > - linux_msg(td, "PT_GET_SC_ARGS failed with error %d", > - error); > + linux_msg(td, > + "PT_LINUX_GET_SC_ARGS failed with error %d", error); > return (error); > } > } else if (lwpinfo.pl_flags & PL_FLAG_SCX) { > diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c > index 8b382cb3048e..821c537065b3 100644 > --- a/sys/kern/sys_process.c > +++ b/sys/kern/sys_process.c > @@ -690,6 +690,9 @@ sys_ptrace(struct thread *td, struct ptrace_args *uap) > break; > r.sr.pscr_args = pscr_args; > break; > + case PTLINUX_FIRST ... PTLINUX_LAST: > + error = EINVAL; > + break; > default: > addr = uap->addr; > break; > @@ -1166,7 +1169,9 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) > break; > > case PT_GET_SC_ARGS: > - CTR1(KTR_PTRACE, "PT_GET_SC_ARGS: pid %d", p->p_pid); > + case PTLINUX_GET_SC_ARGS: > + CTR2(KTR_PTRACE, "%s: pid %d", req == PT_GET_SC_ARGS ? > + "PT_GET_SC_ARGS" : "PT_LINUX_GET_SC_ARGS", p->p_pid); > if (((td2->td_dbgflags & (TDB_SCE | TDB_SCX)) == 0 && > td2->td_sa.code == 0) > #ifdef COMPAT_FREEBSD32 > @@ -1176,11 +1181,21 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) > error = EINVAL; > break; > } > - bzero(addr, sizeof(td2->td_sa.args)); > - /* See the explanation in linux_ptrace_get_syscall_info(). */ > - bcopy(td2->td_sa.args, addr, SV_PROC_ABI(td->td_proc) == > - SV_ABI_LINUX ? sizeof(td2->td_sa.args) : > - td2->td_sa.callp->sy_narg * sizeof(syscallarg_t)); > + if (req == PT_GET_SC_ARGS) { > + bzero(addr, sizeof(td2->td_sa.args)); > + bcopy(td2->td_sa.args, addr, td2->td_sa.callp->sy_narg * > + sizeof(syscallarg_t)); > + } else { > + /* > + * Emulate a Linux bug which which strace(1) depends on: > + * at initialization it tests whether ptrace works by > + * calling close(2), or some other single-argument > + * syscall, _with six arguments_, and then verifies > + * whether it can fetch them all using this API; > + * otherwise it bails out. > + */ > + bcopy(td2->td_sa.args, addr, 6 * sizeof(syscallarg_t)); > + } > break; > > case PT_GET_SC_RET: > diff --git a/sys/sys/ptrace.h b/sys/sys/ptrace.h > index 3a7b87bfc85f..13291cd31cf5 100644 > --- a/sys/sys/ptrace.h > +++ b/sys/sys/ptrace.h > @@ -87,8 +87,16 @@ > #define PT_SC_REMOTE 44 /* Execute a syscall */ > > #define PT_FIRSTMACH 64 /* for machine-specific requests */ > +#define PT_LASTMACH 127 > #include /* machine-specific requests, if any */ > > +#ifdef _KERNEL > +/* Space for Linux ptrace emulation. */ > +#define PTLINUX_FIRST 128 As an after-thought, I think it is better to name them like PTINTERNAL_FIRST/LAST. > +#define PTLINUX_LAST 191 > +#define PTLINUX_GET_SC_ARGS (PTLINUX_FIRST + 0) > +#endif > + > /* Events used with PT_GET_EVENT_MASK and PT_SET_EVENT_MASK */ > #define PTRACE_EXEC 0x0001 > #define PTRACE_SCE 0x0002 From nobody Sun Jun 15 08:33:40 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bKmdL028Kz5sFfx; Sun, 15 Jun 2025 08:34:14 +0000 (UTC) (envelope-from freebsd@walstatt-de.de) Received: from smtp6.goneo.de (smtp6.goneo.de [85.220.129.31]) (using TLSv1.3 with cipher TLS_AES_256_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 4bKmdK10cbz3w4m; Sun, 15 Jun 2025 08:34:12 +0000 (UTC) (envelope-from freebsd@walstatt-de.de) Authentication-Results: mx1.freebsd.org; none Received: from hub2.goneo.de (hub2.goneo.de [IPv6:2001:1640:5::8:53]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp6.goneo.de (Postfix) with ESMTPS id E458E240754; Sun, 15 Jun 2025 10:34:10 +0200 (CEST) Received: from hub2.goneo.de (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by hub2.goneo.de (Postfix) with ESMTPS id 022D8240283; Sun, 15 Jun 2025 10:34:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walstatt-de.de; s=DKIM001; t=1749976449; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Y+Jxwgn5q/5AE9bOWM9QQzaq9OU3RTbijj4sPZDCjcY=; b=Asg6/qSoq8qnfLCacvBhegWe5gzRYuXwTYedPTLjVd+qvunJFdiJtPt6cE06O5smi5CiPl uknoNeaKkziyHYWIttPK3evzotoqyHHwSDJf+G84kOilPt/GSnInXXUoC2ws0uCn3Lkwm7 EfigsVXGKi4rmuYiQDP8GI/j7eBF+aH5un7tRzMMkOpii2GCOICWVEZo1Co7E8gOo0Vy31 Euhlap+pVbw4HUpXVZrsNg72PwZ/3QJi/3gOezD2czFZBMvDTNCCMxWeeuP6ItIyTAXCWQ BLdoKcuzl4k8cnpeC7KUzIkCo2pJPTH2rYRIsTT6npIEOx7MrHPpZNcAcmoWBQ== Received: from thor.sb211.local (dynamic-2a02-3100-2981-4302-1dbb-139c-3164-c63c.310.pool.telefonica.de [IPv6:2a02:3100:2981:4302:1dbb:139c:3164:c63c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by hub2.goneo.de (Postfix) with ESMTPSA id 97E51240280; Sun, 15 Jun 2025 10:34:08 +0200 (CEST) Date: Sun, 15 Jun 2025 10:33:40 +0200 From: A FreeBSD User To: Warner Losh Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 1349a733cf28 - main - ufshci: Introduce the ufshci(4) driver Message-ID: <20250615103251.2221265b@thor.sb211.local> In-Reply-To: <202506150609.55F69dn3021406@gitrepo.freebsd.org> References: <202506150609.55F69dn3021406@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/d+C.MFkEjFatYPxzhHiF3qA"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Rspamd-UID: d77423 X-Rspamd-UID: 0622be X-Rspamd-Queue-Id: 4bKmdK10cbz3w4m X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:25394, ipnet:85.220.128.0/17, country:DE] --Sig_/d+C.MFkEjFatYPxzhHiF3qA Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Am Tage des Herren Sun, 15 Jun 2025 06:09:39 GMT Warner Losh schrieb: > The branch main has been updated by imp: >=20 > URL: https://cgit.FreeBSD.org/src/commit/?id=3D1349a733cf2828e0040cabef89= eeadc3ff00c40b >=20 > commit 1349a733cf2828e0040cabef89eeadc3ff00c40b > Author: Jaeyoon Choi > AuthorDate: 2025-06-13 18:33:01 +0000 > Commit: Warner Losh > CommitDate: 2025-06-15 06:08:56 +0000 >=20 > ufshci: Introduce the ufshci(4) driver > =20 > This commit adds a storage driver that supports the Universal Flash > Storage Host Controller Interface (UFSHCI) on FreeBSD. > =20 > Universal Flash Storage (UFS) is a flash-based mobile storage device > that replaces eMMC, aiming for high performance with low power. The U= FS > Host Controller Interface (UFSHCI) is the host side controller and > connects UFS device to a system bus, such as PCIe. > =20 > The code targets the latest standards: > - UFS 4.1: https://www.jedec.org/standards-documents/docs/jesd220g > - UFSHCI 4.1: https://www.jedec.org/standards-documents/docs/jesd223f > =20 > The ufshci(4) driver implements controller/device initialization, > interrupt, single-doorbell(SDB) queue based IO requests. Support for > multi-queue (MCQ) IO requests is planned for a later commit. > =20 > Implemented features: > - PCIe bus support > - legacy(INTx) Interrupt Handling > - UIC command support > - UTP Transfer Request (UTR) support > - UTP Task Management Request (UTMR) support > - single doorbell queue (SDB) with multiple queue depth > - SCSI command set support > - sysctl > =20 > Work in progress: > - multi-Circular Queue (per-CPU IO queues) > - MSI-X interrupt Support > - write booster > - write Protect > - Host Performance Booster (HPB) > - interrupt aggregation > - ARM based system bus support > - ufs-utils port > =20 > Tests were performed on QEMU and an Intel-based laptop. > Since QEMU has an emulated UFS device, I tested on QEMU. > =20 > How to test on QEMU: > 1. Run QEMU > $ qemu-system-x86_64 ... -device ufs -drive > file=3Dblk1g.bin,format=3Draw,if=3Dnone,id=3Dluimg -device ufs-lu,drive= =3Dluimg,lun=3D0 2. > Loading/unloading the ufshci module on QEMU $ kldload > /usr/obj/usr/src/amd64.amd64/sys/modules/ufshci/ufshci.ko $ kldunload ufs= hci > =20 > Testing on real hardware: > - Samsung Galaxy Book S (Intel Lakefield) with UFS 3.0 > - Lenovo duet 3 11ian8 (Intel N100) with UFS 2.1 > =20 > Sponsored by: Samsung Electronics > Reviewed by: imp > Differential Revision: https://reviews.freebsd.org/D50370 > --- > sbin/camcontrol/camcontrol.c | 13 + It seems changes to sources breaks buildkernel (at least for me) on customi= zed kernel config: [...] --- camcontrol.pieo --- /usr/src/sbin/camcontrol/camcontrol.c:5407:23: error: use of undeclared ide= ntifier 'CTS_UFSHCI_VALID_MODE' --- all_subdir_bin --- --- all_subdir_bin/sleep --- =3D=3D=3D> bin/sleep (all) --- all_subdir_sbin --- 5407 | if (ufshci->valid & CTS_UFSHCI_VALID_MODE) { | ^ [...] Kind regards, oh > sys/cam/cam_ccb.h | 20 + > sys/cam/scsi/scsi_xpt.c | 1 + > sys/dev/ufshci/ufshci.c | 76 +++ > sys/dev/ufshci/ufshci.h | 939 ++++++++++++++++++++++++++++++++= ++++++ > sys/dev/ufshci/ufshci_ctrlr.c | 503 ++++++++++++++++++++ > sys/dev/ufshci/ufshci_ctrlr_cmd.c | 53 +++ > sys/dev/ufshci/ufshci_dev.c | 428 +++++++++++++++++ > sys/dev/ufshci/ufshci_pci.c | 260 +++++++++++ > sys/dev/ufshci/ufshci_private.h | 508 +++++++++++++++++++++ > sys/dev/ufshci/ufshci_reg.h | 469 +++++++++++++++++++ > sys/dev/ufshci/ufshci_req_queue.c | 490 ++++++++++++++++++++ > sys/dev/ufshci/ufshci_req_sdb.c | 427 +++++++++++++++++ > sys/dev/ufshci/ufshci_sim.c | 372 +++++++++++++++ > sys/dev/ufshci/ufshci_sysctl.c | 233 ++++++++++ > sys/dev/ufshci/ufshci_uic_cmd.c | 224 +++++++++ > sys/modules/ufshci/Makefile | 22 + > 17 files changed, 5038 insertions(+) >=20 > diff --git a/sbin/camcontrol/camcontrol.c b/sbin/camcontrol/camcontrol.c > index a2e65055fcaa..19684c044ef5 100644 > --- a/sbin/camcontrol/camcontrol.c > +++ b/sbin/camcontrol/camcontrol.c > @@ -5400,6 +5400,19 @@ cts_print(struct cam_device *device, struct ccb_tr= ans_settings *cts) > nvmf_transport_type(nvmf->trtype)); > } > } > + if (cts->transport =3D=3D XPORT_UFSHCI) { > + struct ccb_trans_settings_ufshci *ufshci =3D > + &cts->xport_specific.ufshci; > + > + if (ufshci->valid & CTS_UFSHCI_VALID_MODE) { > + fprintf(stdout, "%sHigh Speed Gear: %d (%d max)\n", > + pathstr, ufshci->hs_gear, ufshci->max_hs_gear); > + fprintf(stdout, "%sUnipro TX lanes: %d (%d max)\n", pathstr, > + ufshci->tx_lanes, ufshci->max_tx_lanes); > + fprintf(stdout, "%sUnipro RX lanes: %d (%d max)\n", pathstr, > + ufshci->rx_lanes, ufshci->max_rx_lanes); > + } > + } > if (cts->protocol =3D=3D PROTO_ATA) { > struct ccb_trans_settings_ata *ata=3D > &cts->proto_specific.ata; > diff --git a/sys/cam/cam_ccb.h b/sys/cam/cam_ccb.h > index 15e136e8a072..da98b98ba7d1 100644 > --- a/sys/cam/cam_ccb.h > +++ b/sys/cam/cam_ccb.h > @@ -298,6 +298,7 @@ typedef enum { > XPORT_NVME, /* NVMe over PCIe */ > XPORT_MMCSD, /* MMC, SD, SDIO card */ > XPORT_NVMF, /* NVMe over Fabrics */ > + XPORT_UFSHCI, /* Universal Flash Storage Host Interface */ > } cam_xport; > =20 > #define XPORT_IS_NVME(t) ((t) =3D=3D XPORT_NVME || (t) =3D=3D XPORT_NVMF) > @@ -1065,6 +1066,24 @@ struct ccb_trans_settings_nvmf > uint8_t trtype; > }; > =20 > +struct ccb_trans_settings_ufshci > +{ > + u_int valid; /* Which fields to honor */ > + /*=20 > + * Ensure the validity of the information for the Unipro link > + * (GEAR, SPEED, LANE) > + */ > +#define CTS_UFSHCI_VALID_LINK 0x01 > + uint32_t speed; > + uint8_t hs_gear; /* High Speed Gear (G1, G2, G3...) */ > + uint8_t tx_lanes; > + uint8_t rx_lanes; > + uint8_t max_hs_gear; /* Maximum HS Gear */ > + uint8_t max_tx_lanes; > + uint8_t max_rx_lanes; > +}; > + > + > #include > struct ccb_trans_settings_mmc { > struct mmc_ios ios; > @@ -1138,6 +1157,7 @@ struct ccb_trans_settings { > struct ccb_trans_settings_sata sata; > struct ccb_trans_settings_nvme nvme; > struct ccb_trans_settings_nvmf nvmf; > + struct ccb_trans_settings_ufshci ufshci; > } xport_specific; > }; > =20 > diff --git a/sys/cam/scsi/scsi_xpt.c b/sys/cam/scsi/scsi_xpt.c > index 2bb59cb2d92b..439dd2050a95 100644 > --- a/sys/cam/scsi/scsi_xpt.c > +++ b/sys/cam/scsi/scsi_xpt.c > @@ -618,6 +618,7 @@ SCSI_XPT_XPORT(usb, USB); > SCSI_XPT_XPORT(iscsi, ISCSI); > SCSI_XPT_XPORT(srp, SRP); > SCSI_XPT_XPORT(ppb, PPB); > +SCSI_XPT_XPORT(ufshci, UFSHCI); > =20 > #undef SCSI_XPORT_XPORT > =20 > diff --git a/sys/dev/ufshci/ufshci.c b/sys/dev/ufshci/ufshci.c > new file mode 100644 > index 000000000000..84a9629e74b0 > --- /dev/null > +++ b/sys/dev/ufshci/ufshci.c > @@ -0,0 +1,76 @@ > +/*- > + * Copyright (c) 2025, Samsung Electronics Co., Ltd. > + * Written by Jaeyoon Choi > + * > + * SPDX-License-Identifier: BSD-2-Clause > + */ > + > +#include > +#include > +#include > +#include > + > +#include "ufshci_private.h" > + > +MALLOC_DEFINE(M_UFSHCI, "ufshci", "ufshci(4) memory allocations"); > + > +int > +ufshci_attach(device_t dev) > +{ > + struct ufshci_controller *ctrlr =3D device_get_softc(dev); > + int status; > + > + status =3D ufshci_ctrlr_construct(ctrlr, dev); > + if (status !=3D 0) { > + ufshci_ctrlr_destruct(ctrlr, dev); > + return (status); > + } > + > + ctrlr->config_hook.ich_func =3D ufshci_ctrlr_start_config_hook; > + ctrlr->config_hook.ich_arg =3D ctrlr; > + > + if (config_intrhook_establish(&ctrlr->config_hook) !=3D 0) > + return (ENOMEM); > + > + return (0); > +} > + > +int > +ufshci_detach(device_t dev) > +{ > + struct ufshci_controller *ctrlr =3D device_get_softc(dev); > + > + config_intrhook_drain(&ctrlr->config_hook); > + > + ufshci_ctrlr_destruct(ctrlr, dev); > + > + return (0); > +} > + > +void > +ufshci_completion_poll_cb(void *arg, const struct ufshci_completion *cpl, > + bool error) > +{ > + struct ufshci_completion_poll_status *status =3D arg; > + > + /* > + * Copy status into the argument passed by the caller, so that the > + * caller can check the status to determine if the the request passed > + * or failed. > + */ > + memcpy(&status->cpl.response_upiu, &cpl->response_upiu, cpl->size); > + status->error =3D error; > + atomic_store_rel_int(&status->done, 1); > +} > + > +static int > +ufshci_modevent(module_t mod __unused, int type __unused, void *argp __u= nused) > +{ > + return (0); > +} > + > +static moduledata_t ufshci_mod =3D { "ufshci", ufshci_modevent, 0 }; > + > +DECLARE_MODULE(ufshci, ufshci_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST); > +MODULE_VERSION(ufshci, 1); > +MODULE_DEPEND(ufshci, cam, 1, 1, 1); > diff --git a/sys/dev/ufshci/ufshci.h b/sys/dev/ufshci/ufshci.h > new file mode 100644 > index 000000000000..9f0faaadeb57 > --- /dev/null > +++ b/sys/dev/ufshci/ufshci.h > @@ -0,0 +1,939 @@ > +/*- > + * Copyright (c) 2025, Samsung Electronics Co., Ltd. > + * Written by Jaeyoon Choi > + * > + * SPDX-License-Identifier: BSD-2-Clause > + */ > + > +#ifndef __UFSHCI_H__ > +#define __UFSHCI_H__ > + > +#include > +#include > + > +/* > + * Note: This driver currently assumes a little-endian architecture. > + * Big-endian support is not yet implemented. > + */ > + > +/* MIPI UniPro spec 2.0, section 5.8.1 "PHY Adapter Common Attributes" */ > +#define PA_AvailTxDataLanes 0x1520 > +#define PA_AvailRxDataLanes 0x1540 > + > +/* > + * MIPI UniPro spec 2.0, section 5.8.2 "PHY Adapter M-PHY-Specific > + * Attributes" > + */ > +#define PA_ConnectedTxDataLanes 0x1561 > +#define PA_ConnectedRxDataLanes 0x1581 > +#define PA_MaxRxHSGear 0x1587 > +#define PA_Granularity 0x15AA > +#define PA_TActivate 0x15A8 > + > +#define PA_RemoteVerInfo 0x15A0 > +#define PA_LocalVerInfo 0x15A9 > + > +/* UFSHCI spec 4.1, section 7.4 "UIC Power Mode Change" */ > +#define PA_ActiveTxDataLanes 0x1560 > +#define PA_ActiveRxDataLanes 0x1580 > +#define PA_TxGear 0x1568 > +#define PA_RxGear 0x1583 > +#define PA_TxTermination 0x1569 > +#define PA_RxTermination 0x1584 > +#define PA_HSSeries 0x156A > +#define PA_PWRModeUserData0 0x15B0 > +#define PA_PWRModeUserData1 0x15B1 > +#define PA_PWRModeUserData2 0x15B2 > +#define PA_PWRModeUserData3 0x15B3 > +#define PA_PWRModeUserData4 0x15B4 > +#define PA_PWRModeUserData5 0x15B5 > + > +#define PA_TxHsAdaptType 0x15D4 > +#define PA_PWRMode 0x1571 > + > +#define DME_LocalFC0ProtectionTimeOutVal 0xD041 > +#define DME_LocalTC0ReplayTimeOutVal 0xD042 > +#define DME_LocalAFC0ReqTimeOutVal 0xD043 > + > +/* Currently, UFS uses TC0 only. */ > +#define DL_FC0ProtectionTimeOutVal_Default 8191 > +#define DL_TC0ReplayTimeOutVal_Default 65535 > +#define DL_AFC0ReqTimeOutVal_Default 32767 > + > +/* UFS Spec 4.1, section 6.4 "Reference Clock" */ > +enum ufshci_attribute_reference_clock { > + UFSHCI_REF_CLK_19_2MHz =3D 0x0, > + UFSHCI_REF_CLK_26MHz =3D 0x1, > + UFSHCI_REF_CLK_38_4MHz =3D 0x2, > + UFSHCI_REF_CLK_OBSOLETE =3D 0x3, > +}; > + > +/* UFS spec 4.1, section 9 "UFS UIC Layer: MIPI Unipro" */ > +enum ufshci_uic_cmd_opcode { > + /* Configuration */ > + UFSHCI_DME_GET =3D 0x01, > + UFSHCI_DME_SET =3D 0x02, > + UFSHCI_DME_PEER_GET =3D 0x03, > + UFSHCI_DME_PEER_SET =3D 0x04, > + /* Controll */ > + UFSHCI_DME_POWER_ON =3D 0x10, > + UFSHCI_DME_POWER_OFF =3D 0x11, > + UFSHCI_DME_ENABLE =3D 0x12, > + UFSHCI_DME_RESET =3D 0x14, > + UFSHCI_DME_ENDPOINT_RESET =3D 0x15, > + UFSHCI_DME_LINK_STARTUP =3D 0x16, > + UFSHCI_DME_HIBERNATE_ENTER =3D 0x17, > + UFSHCI_DME_HIBERNATE_EXIT =3D 0x18, > + UFSHCI_DME_TEST_MODE =3D 0x1a, > +}; > + > +/* UFSHCI spec 4.1, section 5.6.3 "Offset 98h: UICCMDARG2 =E2=80=93 UIC = Command > + * Argument" */ > +enum ufshci_uic_cmd_attr_set_type { > + UFSHCI_ATTR_SET_TYPE_NORMAL =3D 0, /* volatile value */ > + UFSHCI_ATTR_SET_TYPE_STATIC =3D 1, /* non-volatile reset value */ > +}; > + > +struct ufshci_uic_cmd { > + uint8_t opcode; > + uint32_t argument1; > + uint32_t argument2; > + uint32_t argument3; > +}; > + > +/* UFS spec 4.1, section 10.5 "UPIU Transactions" */ > +enum transaction_code { > + UFSHCI_UPIU_TRANSACTION_CODE_NOP_OUT =3D 0x00, > + UFSHCI_UPIU_TRANSACTION_CODE_COMMAND =3D 0x01, > + UFSHCI_UPIU_TRANSACTION_CODE_DATA_OUT =3D 0x02, > + UFSHCI_UPIU_TRANSACTION_CODE_TASK_MANAGEMENT_REQUEST =3D 0x04, > + UFSHCI_UPIU_TRANSACTION_CODE_QUERY_REQUEST =3D 0x16, > + UFSHCI_UPIU_TRANSACTION_CODE_NOP_IN =3D 0x20, > + UFSHCI_UPIU_TRANSACTION_CODE_RESPONSE =3D 0x21, > + UFSHCI_UPIU_TRANSACTION_CODE_DATA_IN =3D 0x22, > + UFSHCI_UPIU_TRANSACTION_CODE_TASK_MANAGEMENT_RESPONSE =3D 0x24, > + UFSHCI_UPIU_TRANSACTION_CODE_READY_TO_TRANSFER =3D 0x31, > + UFSHCI_UPIU_TRANSACTION_CODE_QUERY_RESPONSE =3D 0x36, > + UFSHCI_UPIU_TRANSACTION_CODE_REJECT_UPIU =3D 0x3f, > +}; > + > +enum overall_command_status { > + UFSHCI_DESC_SUCCESS =3D 0x0, > + UFSHCI_DESC_INVALID_COMMAND_TABLE_ATTRIBUTES =3D 0x01, > + UFSHCI_DESC_INVALID_PRDT_ATTRIBUTES =3D 0x02, > + UFSHCI_DESC_MISMATCH_DATA_BUFFER_SIZE =3D 0x03, > + UFSHCI_DESC_MISMATCH_RESPONSE_UPIU_SIZE =3D 0x04, > + UFSHCI_DESC_COMMUNICATION_FAILURE_WITHIN_UIC_LAYERS =3D 0x05, > + UFSHCI_DESC_ABORTED =3D 0x06, > + UFSHCI_DESC_HOST_CONTROLLER_FATAL_ERROR =3D 0x07, > + UFSHCI_DESC_DEVICEFATALERROR =3D 0x08, > + UFSHCI_DESC_INVALID_CRYPTO_CONFIGURATION =3D 0x09, > + UFSHCI_DESC_GENERAL_CRYPTO_ERROR =3D 0x0A, > + UFSHCI_DESC_INVALID =3D 0x0F, > +}; > + > +enum response_code { > + UFSHCI_RESPONSE_CODE_TARGET_SUCCESS =3D 0x00, > + UFSHCI_RESPONSE_CODE_TARGET_FAILURE =3D 0x01, > + UFSHCI_RESPONSE_CODE_PARAMETER_NOTREADABLE =3D 0xF6, > + UFSHCI_RESPONSE_CODE_PARAMETER_NOTWRITEABLE =3D 0xF7, > + UFSHCI_RESPONSE_CODE_PARAMETER_ALREADYWRITTEN =3D 0xF8, > + UFSHCI_RESPONSE_CODE_INVALID_LENGTH =3D 0xF9, > + UFSHCI_RESPONSE_CODE_INVALID_VALUE =3D 0xFA, > + UFSHCI_RESPONSE_CODE_INVALID_SELECTOR =3D 0xFB, > + UFSHCI_RESPONSE_CODE_INVALID_INDEX =3D 0xFC, > + UFSHCI_RESPONSE_CODE_INVALID_IDN =3D 0xFD, > + UFSHCI_RESPONSE_CODE_INVALID_OPCODE =3D 0xFE, > + UFSHCI_RESPONSE_CODE_GENERAL_FAILURE =3D 0xFF, > +}; > + > +/* UFSHCI spec 4.1, section 6.1.1 "UTP Transfer Request Descriptor" */ > +enum ufshci_command_type { > + UFSHCI_COMMAND_TYPE_UFS_STORAGE =3D 0x01, > + UFSHCI_COMMAND_TYPE_NULLIFIED_UTRD =3D 0x0F, > +}; > + > +enum ufshci_data_direction { > + UFSHCI_DATA_DIRECTION_NO_DATA_TRANSFER =3D 0x00, > + UFSHCI_DATA_DIRECTION_FROM_SYS_TO_TGT =3D 0x01, > + UFSHCI_DATA_DIRECTION_FROM_TGT_TO_SYS =3D 0x10, > + UFSHCI_DATA_DIRECTION_RESERVED =3D 0b11, > +}; > + > +enum ufshci_overall_command_status { > + UFSHCI_OCS_SUCCESS =3D 0x0, > + UFSHCI_OCS_INVALID_COMMAND_TABLE_ATTRIBUTES =3D 0x01, > + UFSHCI_OCS_INVALID_PRDT_ATTRIBUTES =3D 0x02, > + UFSHCI_OCS_MISMATCH_DATA_BUFFER_SIZE =3D 0x03, > + UFSHCI_OCS_MISMATCH_RESPONSE_UPIU_SIZE =3D 0x04, > + UFSHCI_OCS_COMMUNICATION_FAILURE_WITHIN_UIC_LAYERS =3D 0x05, > + UFSHCI_OCS_ABORTED =3D 0x06, > + UFSHCI_OCS_HOST_CONTROLLER_FATAL_ERROR =3D 0x07, > + UFSHCI_OCS_DEVICE_FATAL_ERROR =3D 0x08, > + UFSHCI_OCS_INVALID_CRYPTO_CONFIGURATION =3D 0x09, > + UFSHCI_OCS_GENERAL_CRYPTO_ERROR =3D 0x0A, > + UFSHCI_OCS_INVALID =3D 0xF, > +}; > + > +struct ufshci_utp_xfer_req_desc { > + /* dword 0 */ > + uint32_t cci : 8; /* [7:0] */ > + uint32_t total_ehs_length : 8; /* [15:8] */ > + uint32_t reserved0 : 7; /* [22:16] */ > + uint32_t ce : 1; /* [23] */ > + uint32_t interrupt : 1; /* [24] */ > + uint32_t data_direction : 2; /* [26:25] */ > + uint32_t reserved1 : 1; /* [27] */ > + uint32_t command_type : 4; /* [31:28] */ > + > + /* dword 1 */ > + uint32_t data_unit_number_lower; /* [31:0] */ > + > + /* dword 2 */ > + uint8_t overall_command_status; /* [7:0] */ > + uint8_t common_data_size; /* [15:8] */ > + uint16_t last_data_byte_count; /* [31:16] */ > + > + /* dword 3 */ > + uint32_t data_unit_number_upper; /* [31:0] */ > + > + /* dword 4 */ > + uint32_t utp_command_descriptor_base_address; /* [31:0] */ > + > + /* dword 5 */ > + uint32_t utp_command_descriptor_base_address_upper; /* [31:0] */ > + > + /* dword 6 */ > + uint16_t response_upiu_length; /* [15:0] */ > + uint16_t response_upiu_offset; /* [31:16] */ > + > + /* dword 7 */ > + uint16_t prdt_length; /* [15:0] */ > + uint16_t prdt_offset; /* [31:16] */ > +} __packed __aligned(8); > + > +_Static_assert(sizeof(struct ufshci_utp_xfer_req_desc) =3D=3D 32, > + "ufshci_utp_xfer_req_desc must be 32 bytes"); > + > +/* > + * According to the UFSHCI specification, the size of the UTP command > + * descriptor is as follows. The size of the transfer request is not lim= ited, > + * a transfer response can be as long as 65535 * dwords, and a PRDT can = be as > + * long as 65565 * PRDT entry size(16 bytes). However, for ease of use, = this > + * UFSHCI Driver imposes the following limits. The size of the transfer > + * request and the transfer response is 1024 bytes or less. The PRDT reg= ion > + * limits the number of scatter gathers to 256 + 1, using a total of 409= 6 + > + * 16 bytes. Therefore, only 8KB size is allocated for the UTP command > + * descriptor. > + */ > +#define UFSHCI_UTP_COMMAND_DESCRIPTOR_SIZE 8192 > +#define UFSHCI_UTP_XFER_REQ_SIZE 512 > +#define UFSHCI_UTP_XFER_RESP_SIZE 512 > + > +/* > + * To reduce the size of the UTP Command Descriptor(8KB), we must use on= ly > + * 256 + 1 PRDT entries. The reason for adding the 1 is that if the data= is > + * not aligned, one additional PRDT_ENTRY is used. > + */ > +#define UFSHCI_MAX_PRDT_ENTRY_COUNT (256 + 1) > + > +/* UFSHCI spec 4.1, section 6.1.2 "UTP Command Descriptor" */ > +struct ufshci_prdt_entry { > + /* dword 0 */ > + uint32_t data_base_address; /* [31:0] */ > + > + /* dword 1 */ > + uint32_t data_base_address_upper; /* [31:0] */ > + > + /* dword 2 */ > + uint32_t reserved; /* [31:0] */ > + > + /* dword 3 */ > + uint32_t data_byte_count; /* [17:0] Maximum byte > + * count is 256KB */ > +} __packed __aligned(8); > + > +_Static_assert(sizeof(struct ufshci_prdt_entry) =3D=3D 16, > + "ufshci_prdt_entry must be 16 bytes"); > + > +struct ufshci_utp_cmd_desc { > + uint8_t command_upiu[UFSHCI_UTP_XFER_REQ_SIZE]; > + uint8_t response_upiu[UFSHCI_UTP_XFER_RESP_SIZE]; > + uint8_t prd_table[sizeof(struct ufshci_prdt_entry) * > + UFSHCI_MAX_PRDT_ENTRY_COUNT]; > + uint8_t padding[3072 - sizeof(struct ufshci_prdt_entry)]; > +} __packed __aligned(128); > + > +_Static_assert(sizeof(struct ufshci_utp_cmd_desc) =3D=3D > + UFSHCI_UTP_COMMAND_DESCRIPTOR_SIZE, > + "ufshci_utp_cmd_desc must be 8192 bytes"); > + > +#define UFSHCI_UTP_TASK_MGMT_REQ_SIZE 32 > +#define UFSHCI_UTP_TASK_MGMT_RESP_SIZE 32 > + > +/* UFSHCI spec 4.1, section 6.3.1 "UTP Task Management Request Descripto= r" */ > +struct ufshci_utp_task_mgmt_req_desc { > + /* dword 0 */ > + uint32_t reserved0 : 24; /* [23:0] */ > + uint32_t interrupt : 1; /* [24] */ > + uint32_t reserved1 : 7; /* [31:25] */ > + > + /* dword 1 */ > + uint32_t reserved2; /* [31:0] */ > + > + /* dword 2 */ > + uint8_t overall_command_status; /* [7:0] */ > + uint8_t reserved3; /* [15:8] */ > + uint16_t reserved4; /* [31:16] */ > + > + /* dword 3 */ > + uint32_t reserved5; /* [31:0] */ > + > + /* dword 4-11 */ > + uint8_t request_upiu[UFSHCI_UTP_TASK_MGMT_REQ_SIZE]; > + > + /* dword 12-19 */ > + uint8_t response_upiu[UFSHCI_UTP_TASK_MGMT_RESP_SIZE]; > + > +} __packed __aligned(8); > + > +_Static_assert(sizeof(struct ufshci_utp_task_mgmt_req_desc) =3D=3D 80, > + "ufshci_utp_task_mgmt_req_desc must be 80 bytes"); > + > +/* UFS spec 4.1, section 10.6.2 "Basic Header Format" */ > +struct ufshci_upiu_header { > + /* dword 0 */ > + union { > + struct { > + uint8_t trans_code : 6; /* [5:0] */ > + uint8_t dd : 1; /* [6] */ > + uint8_t hd : 1; /* [7] */ > + }; > + uint8_t trans_type; > + }; > + union { > + struct { > + uint8_t task_attribute : 2; /* [1:0] */ > + uint8_t cp : 1; /* [2] */ > + uint8_t retransmit_indicator : 1; /* [3] */ > +#define UFSHCI_OPERATIONAL_FLAG_W 0x2 > +#define UFSHCI_OPERATIONAL_FLAG_R 0x4 > + uint8_t operational_flags : 4; /* [7:4] */ > + }; > + uint8_t flags; > + }; > + uint8_t lun; > + uint8_t task_tag; > + > + /* dword 1 */ > +#define UFSHCI_COMMAND_SET_TYPE_SCSI 0 > + uint8_t cmd_set_type : 4; /* [3:0] */ > + uint8_t iid : 4; /* [7:4] */ > + uint8_t ext_iid_or_function; > + uint8_t response; > + uint8_t ext_iid_or_status; > + > + /* dword 2 */ > + uint8_t ehs_length; > + uint8_t device_infomation; > + uint16_t data_segment_length; /* (Big-endian) */ > +} __packed __aligned(4); > + > +_Static_assert(sizeof(struct ufshci_upiu_header) =3D=3D 12, > + "ufshci_upiu_header must be 12 bytes"); > + > +#define UFSHCI_MAX_UPIU_SIZE 512 > +#define UFSHCI_UPIU_ALIGNMENT 8 /* UPIU requires 64-bit alignment. */ > + > +struct ufshci_upiu { > + /* dword 0-2 */ > + struct ufshci_upiu_header header; > + /* dword 3-127 */ > + uint8_t > + reserved[UFSHCI_MAX_UPIU_SIZE - sizeof(struct ufshci_upiu_header)]; > +} __packed __aligned(8); > + > +_Static_assert(sizeof(struct ufshci_upiu) =3D=3D 512, > + "ufshci_upiu must be 512 bytes"); > + > +struct ufshci_cmd_command_upiu { > + /* dword 0-2 */ > + struct ufshci_upiu_header header; > + /* dword 3 */ > + uint32_t expected_data_transfer_length; /* (Big-endian) */ > + > + /* dword 4-7 */ > + uint8_t cdb[16]; > + > +} __packed __aligned(4); > + > +_Static_assert(sizeof(struct ufshci_cmd_command_upiu) =3D=3D 32, > + "bad size for ufshci_cmd_command_upiu"); > +_Static_assert(sizeof(struct ufshci_cmd_command_upiu) <=3D > + UFSHCI_UTP_XFER_REQ_SIZE, > + "bad size for ufshci_cmd_command_upiu"); > +_Static_assert(sizeof(struct ufshci_cmd_command_upiu) % UFSHCI_UPIU_ALIG= NMENT =3D=3D > + 0, > + "UPIU requires 64-bit alignment"); > + > +struct ufshci_cmd_response_upiu { > + /* dword 0-2 */ > + struct ufshci_upiu_header header; > + /* dword 3 */ > + uint32_t residual_transfer_count; /* (Big-endian) */ > + > + /* dword 4-7 */ > + uint8_t reserved[16]; > + > + /* Sense Data */ > + uint16_t sense_data_len; /* (Big-endian) */ > + uint8_t sense_data[18]; > + > + /* Add padding to align the kUpiuAlignment. */ > + uint8_t padding[4]; > +} __packed __aligned(4); > + > +_Static_assert(sizeof(struct ufshci_cmd_response_upiu) =3D=3D 56, > + "bad size for ufshci_cmd_response_upiu"); > +_Static_assert(sizeof(struct ufshci_cmd_response_upiu) <=3D > + UFSHCI_UTP_XFER_RESP_SIZE, > + "bad size for ufshci_cmd_response_upiu"); > +_Static_assert(sizeof(struct ufshci_cmd_response_upiu) % > + UFSHCI_UPIU_ALIGNMENT =3D=3D > + 0, > + "UPIU requires 64-bit alignment"); > + > +/* UFS Spec 4.1, section 10.7.8 "QUERY REQUEST UPIU" */ > +enum ufshci_query_function { > + UFSHCI_QUERY_FUNC_STANDARD_READ_REQUEST =3D 0x01, > + UFSHCI_QUERY_FUNC_STANDARD_WRITE_REQUEST =3D 0x81, > +}; > + > +enum ufshci_query_opcode { > + UFSHCI_QUERY_OPCODE_NOP =3D 0, > + UFSHCI_QUERY_OPCODE_READ_DESCRIPTOR, > + UFSHCI_QUERY_OPCODE_WRITE_DESCRIPTOR, > + UFSHCI_QUERY_OPCODE_READ_ATTRIBUTE, > + UFSHCI_QUERY_OPCODE_WRITE_ATTRIBUTE, > + UFSHCI_QUERY_OPCODE_READ_FLAG, > + UFSHCI_QUERY_OPCODE_SET_FLAG, > + UFSHCI_QUERY_OPCODE_CLEAR_FLAG, > + UFSHCI_QUERY_OPCODE_TOGGLE_FLAG, > +}; > + > +struct ufshci_query_param { > + enum ufshci_query_function function; > + enum ufshci_query_opcode opcode; > + uint8_t type; > + uint8_t index; > + uint8_t selector; > + uint64_t value; > + size_t desc_size; > +}; > + > +struct ufshci_query_request_upiu { > + /* dword 0-2 */ > + struct ufshci_upiu_header header; > + /* dword 3 */ > + uint8_t opcode; > + uint8_t idn; > + uint8_t index; > + uint8_t selector; > + > + /* dword 4-5 */ > + union { > + /* The Write Attribute opcode uses 64 - bit value. */ > + uint64_t value_64; /* (Big-endian) */ > + struct { > + uint8_t reserved1[2]; > + uint16_t length; /* (Big-endian) */ > + uint32_t value_32; /* (Big-endian) */ > + }; > + } __packed __aligned(4); > + > + /* dword 6 */ > + uint32_t reserved2; > + > + /* dword 7 */ > + uint32_t reserved3; > + > + uint8_t command_data[256]; > +} __packed __aligned(4); > + > +_Static_assert(sizeof(struct ufshci_query_request_upiu) =3D=3D 288, > + "bad size for ufshci_query_request_upiu"); > +_Static_assert(sizeof(struct ufshci_query_request_upiu) <=3D > + UFSHCI_UTP_XFER_REQ_SIZE, > + "bad size for ufshci_query_request_upiu"); > +_Static_assert(sizeof(struct ufshci_query_request_upiu) % > + UFSHCI_UPIU_ALIGNMENT =3D=3D > + 0, > + "UPIU requires 64-bit alignment"); > + > +/* UFS Spec 4.1, section 10.7.9 "QUERY RESPONSE UPIU" */ > +enum ufshci_query_response_code { > + UFSHCI_QUERY_RESP_CODE_SUCCESS =3D 0x00, > + UFSHCI_QUERY_RESP_CODE_PARAMETER_NOT_READABLE =3D 0xf6, > + UFSHCI_QUERY_RESP_CODE_PARAMETER_NOT_WRITEABLE =3D 0xf7, > + UFSHCI_QUERY_RESP_CODE_PARAMETER_ALREADY_WRITTEN =3D 0xf8, > + UFSHCI_QUERY_RESP_CODE_INVALID_LENGTH =3D 0xf9, > + UFSHCI_QUERY_RESP_CODE_INVALID_VALUE =3D 0xfa, > + UFSHCI_QUERY_RESP_CODE_INVALID_SELECTOR =3D 0xfb, > + UFSHCI_QUERY_RESP_CODE_INVALID_INDEX =3D 0xfc, > + UFSHCI_QUERY_RESP_CODE_INVALID_IDN =3D 0xfd, > + UFSHCI_QUERY_RESP_CODE_INVALID_OPCODE =3D 0xfe, > + UFSHCI_QUERY_RESP_CODE_GENERAL_FAILURE =3D 0xff, > +}; > + > +struct ufshci_query_response_upiu { > + /* dword 0-2 */ > + struct ufshci_upiu_header header; > + /* dword 3 */ > + uint8_t opcode; > + uint8_t idn; > + uint8_t index; > + uint8_t selector; > + > + /* dword 4-5 */ > + union { > + /* The Read / Write Attribute opcodes use 64 - bit value. */ > + uint64_t value_64; /* (Big-endian) */ > + struct { > + uint8_t reserved1[2]; > + uint16_t length; /* (Big-endian) */ > + union { > + uint32_t value_32; /* (Big-endian) */ > + struct { > + uint8_t reserved2[3]; > + uint8_t flag_value; > + }; > + }; > + }; > + } __packed __aligned(4); > + > + /* dword 6 */ > + uint8_t reserved3[4]; > + > + /* dword 7 */ > + uint8_t reserved4[4]; > + > + uint8_t command_data[256]; > +} __packed __aligned(4); > + > +_Static_assert(sizeof(struct ufshci_query_response_upiu) =3D=3D 288, > + "bad size for ufshci_query_response_upiu"); > +_Static_assert(sizeof(struct ufshci_query_response_upiu) <=3D > + UFSHCI_UTP_XFER_RESP_SIZE, > + "bad size for ufshci_query_response_upiu"); > +_Static_assert(sizeof(struct ufshci_query_response_upiu) % > + UFSHCI_UPIU_ALIGNMENT =3D=3D > + 0, > + "UPIU requires 64-bit alignment"); > + > +/* UFS 4.1, section 10.7.11 "NOP OUT UPIU" */ > +struct ufshci_nop_out_upiu { > + /* dword 0-2 */ > + struct ufshci_upiu_header header; > + /* dword 3-7 */ > + uint8_t reserved[20]; > +} __packed __aligned(8); > +_Static_assert(sizeof(struct ufshci_nop_out_upiu) =3D=3D 32, > + "ufshci_upiu_nop_out must be 32 bytes"); > + > +/* UFS 4.1, section 10.7.12 "NOP IN UPIU" */ > +struct ufshci_nop_in_upiu { > + /* dword 0-2 */ > + struct ufshci_upiu_header header; > + /* dword 3-7 */ > + uint8_t reserved[20]; > +} __packed __aligned(8); > +_Static_assert(sizeof(struct ufshci_nop_in_upiu) =3D=3D 32, > + "ufshci_upiu_nop_in must be 32 bytes"); > + > +union ufshci_reponse_upiu { > + struct ufshci_upiu_header header; > + struct ufshci_cmd_response_upiu cmd_response_upiu; > + struct ufshci_query_response_upiu query_response_upiu; > + struct ufshci_nop_in_upiu nop_in_upiu; > +}; > + > +struct ufshci_completion { > + union ufshci_reponse_upiu response_upiu; > + size_t size; > +}; > + > +typedef void (*ufshci_cb_fn_t)(void *, const struct ufshci_completion *,= bool); > + > +/* > + * UFS Spec 4.1, section 14.1 "UFS Descriptors" > + * All descriptors use big-endian byte ordering. > + */ > +enum ufshci_descriptor_type { > + UFSHCI_DESC_TYPE_DEVICE =3D 0x00, > + UFSHCI_DESC_TYPE_CONFIGURATION =3D 0x01, > + UFSHCI_DESC_TYPE_UNIT =3D 0x02, > + UFSHCI_DESC_TYPE_INTERCONNECT =3D 0x04, > + UFSHCI_DESC_TYPE_STRING =3D 0x05, > + UFSHCI_DESC_TYPE_GEOMETRY =3D 0X07, > + UFSHCI_DESC_TYPE_POWER =3D 0x08, > + UFSHCI_DESC_TYPE_DEVICE_HEALTH =3D 0x09, > + UFSHCI_DESC_TYPE_FBO_EXTENSION_SPECIFICATION =3D 0x0a, > +}; > + > +/* > + * UFS Spec 4.1, section 14.1.5.2 "Device Descriptor" > + * DeviceDescriptor use big-endian byte ordering. > + */ > +struct ufshci_device_descriptor { > + uint8_t bLength; > + uint8_t bDescriptorIDN; > + uint8_t bDevice; > + uint8_t bDeviceClass; > + uint8_t bDeviceSubClass; > + uint8_t bProtocol; > + uint8_t bNumberLU; > + uint8_t bNumberWLU; > + uint8_t bBootEnable; > + uint8_t bDescrAccessEn; > + uint8_t bInitPowerMode; > + uint8_t bHighPriorityLUN; > + uint8_t bSecureRemovalType; > + uint8_t bSecurityLU; > + uint8_t bBackgroundOpsTermLat; > + uint8_t bInitActiveICCLevel; > + /* 0x10 */ > + uint16_t wSpecVersion; > + uint16_t wManufactureDate; > + uint8_t iManufacturerName; > + uint8_t iProductName; > + uint8_t iSerialNumber; > + uint8_t iOemID; > + uint16_t wManufacturerID; > + uint8_t bUD0BaseOffset; > + uint8_t bUDConfigPLength; > + uint8_t bDeviceRTTCap; > + uint16_t wPeriodicRTCUpdate; > + uint8_t bUfsFeaturesSupport; > + /* 0x20 */ > + uint8_t bFFUTimeout; > + uint8_t bQueueDepth; > + uint16_t wDeviceVersion; > + uint8_t bNumSecureWPArea; > + uint32_t dPSAMaxDataSize; > + uint8_t bPSAStateTimeout; > + uint8_t iProductRevisionLevel; > + uint8_t Reserved[5]; > + /* 0x2a */ > + /* 0x30 */ > + uint8_t ReservedUME[16]; > + /* 0x40 */ > + uint8_t ReservedHpb[3]; > + uint8_t Reserved2[12]; > + uint32_t dExtendedUfsFeaturesSupport; > + uint8_t bWriteBoosterBufferPreserveUserSpaceEn; > + uint8_t bWriteBoosterBufferType; > + uint32_t dNumSharedWriteBoosterBufferAllocUnits; > +} __packed; > + > +_Static_assert(sizeof(struct ufshci_device_descriptor) =3D=3D 89, > + "bad size for ufshci_device_descriptor"); > + > +/* > + * UFS Spec 4.1, section 14.1.5.3 "Configuration Descriptor" > + * ConfigurationDescriptor use big-endian byte ordering. > + */ > +struct ufshci_unit_descriptor_configurable_parameters { > + uint8_t bLUEnable; > + uint8_t bBootLunID; > + uint8_t bLUWriteProtect; > + uint8_t bMemoryType; > + uint32_t dNumAllocUnits; > + uint8_t bDataReliability; > + uint8_t bLogicalBlockSize; > + uint8_t bProvisioningType; > + uint16_t wContextCapabilities; > + union { > + struct { > + uint8_t Reserved[3]; > + uint8_t ReservedHpb[6]; > + } __packed; > + uint16_t wZoneBufferAllocUnits; > + }; > + uint32_t dLUNumWriteBoosterBufferAllocUnits; > +} __packed; > + > +_Static_assert(sizeof(struct ufshci_unit_descriptor_configurable_paramet= ers) =3D=3D > + 27, > + "bad size for ufshci_unit_descriptor_configurable_parameters"); > + > +#define UFSHCI_CONFIGURATION_DESCEIPTOR_LU_NUM 8 > + > +struct ufshci_configuration_descriptor { > + uint8_t bLength; > + uint8_t bDescriptorIDN; > + uint8_t bConfDescContinue; > + uint8_t bBootEnable; > + uint8_t bDescrAccessEn; > + uint8_t bInitPowerMode; > + uint8_t bHighPriorityLUN; > + uint8_t bSecureRemovalType; > + uint8_t bInitActiveICCLevel; > + uint16_t wPeriodicRTCUpdate; > + uint8_t Reserved; > + uint8_t bRPMBRegionEnable; > + uint8_t bRPMBRegion1Size; > + uint8_t bRPMBRegion2Size; > + uint8_t bRPMBRegion3Size; > + uint8_t bWriteBoosterBufferPreserveUserSpaceEn; > + uint8_t bWriteBoosterBufferType; > + uint32_t dNumSharedWriteBoosterBufferAllocUnits; > + /* 0x16 */ > + struct ufshci_unit_descriptor_configurable_parameters > + unit_config_params[UFSHCI_CONFIGURATION_DESCEIPTOR_LU_NUM]; > +} __packed; > + > +_Static_assert(sizeof(struct ufshci_configuration_descriptor) =3D=3D (22= + 27 * 8), > + "bad size for ufshci_configuration_descriptor"); > + > +/* > + * UFS Spec 4.1, section 14.1.5.4 "Geometry Descriptor" > + * GeometryDescriptor use big-endian byte ordering. > + */ > +struct ufshci_geometry_descriptor { > + uint8_t bLength; > + uint8_t bDescriptorIDN; > + uint8_t bMediaTechnology; > + uint8_t Reserved; > + uint64_t qTotalRawDeviceCapacity; > + uint8_t bMaxNumberLU; > + uint32_t dSegmentSize; > + /* 0x11 */ > + uint8_t bAllocationUnitSize; > + uint8_t bMinAddrBlockSize; > + uint8_t bOptimalReadBlockSize; > + uint8_t bOptimalWriteBlockSize; > + uint8_t bMaxInBufferSize; > + uint8_t bMaxOutBufferSize; > + uint8_t bRPMB_ReadWriteSize; > + uint8_t bDynamicCapacityResourcePolicy; > + uint8_t bDataOrdering; > + uint8_t bMaxContexIDNumber; > + uint8_t bSysDataTagUnitSize; > + uint8_t bSysDataTagResSize; > + uint8_t bSupportedSecRTypes; > + uint16_t wSupportedMemoryTypes; > + /* 0x20 */ > + uint32_t dSystemCodeMaxNAllocU; > + uint16_t wSystemCodeCapAdjFac; > + uint32_t dNonPersistMaxNAllocU; > + uint16_t wNonPersistCapAdjFac; > + uint32_t dEnhanced1MaxNAllocU; > + /* 0x30 */ > + uint16_t wEnhanced1CapAdjFac; > *** 4268 LINES SKIPPED *** >=20 --=20 A FreeBSD user --Sig_/d+C.MFkEjFatYPxzhHiF3qA Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQRQheDybVktG5eW/1Kxzvs8OqokrwUCaE6FfwAKCRCxzvs8Oqok r99GAP0TtDjIBG0NWrVZVXE5PXvfqjGrVtD5AcLQzVvihxnpvQD/coKcT4mS5aHG w7dVkJ5YNhi4AJqmv1GD+/Vb5y084Qk= =eWj0 -----END PGP SIGNATURE----- --Sig_/d+C.MFkEjFatYPxzhHiF3qA-- From nobody Sun Jun 15 09:05:00 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bKnJr5hhWz5sHmT; Sun, 15 Jun 2025 09:05:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bKnJr3T0yz3D64; Sun, 15 Jun 2025 09:05:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749978300; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Seu+NURYkgQbZprIpMUnQPBviHXHYcMqu5Ni9pJ7qZ0=; b=fjeLXZb6biB6REtGVVNFNU0gRmTnU71i5K75XV4Z/2qnaIBOePdzVFNd2hzNwSgVamWAXD d3VdoctLcP3h4/bhww3F/0ItT4dA/yL104c3yZMqCRxp+nX21Bpvhcu5+AvoVA5WB9+PBN vIVj1ncWrBNYaWcHS2ZIB4eK7h8cEqifQaMIezdmmjQN7iCtGofDnBJUx9slnhWZ436xbU FZX0bGiJl0k5uGC1uZSEj2FfgSHSSLOtdvhHYC8AKhKZTTI+zJBkUB0uZKO/G4tAy3kYdE TByg9gqS7DxhU9YLsJP+Z/NF0nu7cxHaat1EVKtpzd/FQ72jTMMGVUsk/Fmf9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749978300; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Seu+NURYkgQbZprIpMUnQPBviHXHYcMqu5Ni9pJ7qZ0=; b=WlU61hHtsiRbLoa85lORMTk0LbnTSc88VYh95bDweUFFDkSd2m3bDzhowKZhWkGOvlJt1E 6NqBjkrhSAbUsCOb7s7DwwdiSl4xjB1G4ipvtGEwIcdi+NTfTeOWFaFZN7P0dxOHRoM4SK Jv3o2go8s1XFY4MVGiDmcfndnOQNpwoucs4qxd5hvo2lTiqGNTNkiKbGGLnPn6tCGnuD/6 LstcJQdVz21QKTNFDK9ihxG+mC4D/w9EqMyqUvlbvca71rpoaXqCeAvJlqkxMuShoGT8OG +ZfvscYQ2kg2JjdDjXZgEpjyn3MGpW1OWD/kh7mk5unopdYE/hTiffLVCkxq7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749978300; a=rsa-sha256; cv=none; b=MXaD3qw4q/Dcf6d8nlaikJ2Pcj9hUVUyjLaNVEDZ7CkuaQ0CnhjrN969373voL8TJ1LVeS Pac7f4FckCHnv2oBvcK6A9oC8xPihGYdiSBVBac7YoWcr6KfjS825pVbQL20Zu6YE+ZYeQ sEz69aWyFzCxsfi8Gqy+U2Hc7IMEHzciU+vn96OQkemTPRvtYjk+TlIwF3L36qJjSyzkX0 kNCl9CRPY34wMdxZ+WuWcxgVZqLWZSyxhnVRwo/+zhamXZ58u0wFLWT968caOFgu9ejbja QLpaQjaIrftV5/IWhtl9gLtTmZhx51zo9u8OZOLSRiNiZN36kfUCdGM0S0NcJA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bKnJr2n9Gz15dm; Sun, 15 Jun 2025 09:05:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55F950fH058955; Sun, 15 Jun 2025 09:05:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55F950EG058952; Sun, 15 Jun 2025 09:05:00 GMT (envelope-from git) Date: Sun, 15 Jun 2025 09:05:00 GMT Message-Id: <202506150905.55F950EG058952@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Randall Stewart Subject: git: f3bba8cd62f2 - main - TCP without LRO doing static pacing does not always pace as expected. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rrs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f3bba8cd62f2ddcacba7d9c36a2cc21b1fe11968 Auto-Submitted: auto-generated The branch main has been updated by rrs: URL: https://cgit.FreeBSD.org/src/commit/?id=f3bba8cd62f2ddcacba7d9c36a2cc21b1fe11968 commit f3bba8cd62f2ddcacba7d9c36a2cc21b1fe11968 Author: Randall Stewart AuthorDate: 2025-06-15 09:02:39 +0000 Commit: Randall Stewart CommitDate: 2025-06-15 09:02:39 +0000 TCP without LRO doing static pacing does not always pace as expected. cause a surprise extra packet i.e. the burst limit being overstepped and another one where the burst limit is under stepped. This patch fixes those errors. Reported by: tuexen Reviewed by: tuexen Differential Revision: --- sys/netinet/tcp_stacks/rack.c | 56 +++++++++++++++++++++++++++---------------- 1 file changed, 36 insertions(+), 20 deletions(-) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index cb4e22401c12..1d4bc3124058 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -17178,6 +17178,12 @@ rack_log_pacing_delay_calc (struct tcp_rack *rack, uint32_t len, uint32_t slot, log.u_bbr.cwnd_gain |= rack->rc_gp_saw_ss; log.u_bbr.cwnd_gain <<= 1; log.u_bbr.cwnd_gain |= rack->rc_gp_saw_ca; + log.u_bbr.cwnd_gain <<= 1; + log.u_bbr.cwnd_gain |= rack->use_fixed_rate; + log.u_bbr.cwnd_gain <<= 1; + log.u_bbr.cwnd_gain |= rack->rc_always_pace; + log.u_bbr.cwnd_gain <<= 1; + log.u_bbr.cwnd_gain |= rack->gp_ready; log.u_bbr.bbr_substate = quality; log.u_bbr.bbr_state = rack->dgp_on; log.u_bbr.bbr_state <<= 1; @@ -17539,8 +17545,8 @@ rack_get_pacing_delay(struct tcp_rack *rack, struct tcpcb *tp, uint32_t len, str rack->r_ctl.rc_last_us_rtt, 88, __LINE__, NULL, gain); } - if ((bw_est == 0) || (rate_wanted == 0) || - ((rack->gp_ready == 0) && (rack->use_fixed_rate == 0))) { + if (((bw_est == 0) || (rate_wanted == 0) || (rack->gp_ready == 0)) && + (rack->use_fixed_rate == 0)) { /* * No way yet to make a b/w estimate or * our raise is set incorrectly. @@ -19039,7 +19045,7 @@ rack_sndbuf_autoscale(struct tcp_rack *rack) static int rack_fast_output(struct tcpcb *tp, struct tcp_rack *rack, uint64_t ts_val, - uint32_t cts, uint32_t ms_cts, struct timeval *tv, long tot_len, int *send_err) + uint32_t cts, uint32_t ms_cts, struct timeval *tv, long *tot_len, int *send_err, int line) { /* * Enter to do fast output. We are given that the sched_pin is @@ -19212,7 +19218,7 @@ again: } if (rack->r_ctl.fsb.rfo_apply_push && (len == rack->r_ctl.fsb.left_to_send)) { - tcp_set_flags(th, flags | TH_PUSH); + flags |= TH_PUSH; add_flag |= RACK_HAD_PUSH; } if ((m->m_next == NULL) || (len <= 0)){ @@ -19391,11 +19397,11 @@ again: log.u_bbr.inflight = ctf_flight_size(rack->rc_tp, rack->r_ctl.rc_sacked); log.u_bbr.flex5 = log.u_bbr.inflight; log.u_bbr.lt_epoch = rack->r_ctl.cwnd_to_use; - log.u_bbr.delivered = 0; + log.u_bbr.delivered = rack->r_ctl.fsb.left_to_send; log.u_bbr.rttProp = 0; log.u_bbr.delRate = rack->r_must_retran; log.u_bbr.delRate <<= 1; - log.u_bbr.pkt_epoch = __LINE__; + log.u_bbr.pkt_epoch = line; /* For fast output no retrans so just inflight and how many mss we send */ log.u_bbr.flex5 = log.u_bbr.inflight; log.u_bbr.bbr_substate = (uint8_t)((len + segsiz - 1)/segsiz); @@ -19468,7 +19474,7 @@ again: tcp_account_for_send(tp, len, 0, 0, rack->r_ctl.fsb.hw_tls); rack->forced_ack = 0; /* If we send something zap the FA flag */ - tot_len += len; + *tot_len += len; if ((tp->t_flags & TF_GPUTINPROG) == 0) rack_start_gp_measurement(tp, rack, tp->snd_max, sb_offset); tp->snd_max += len; @@ -19504,6 +19510,7 @@ again: } if ((rack->r_ctl.fsb.left_to_send >= segsiz) && (max_val > len) && + (*tot_len < rack->r_ctl.rc_pace_max_segs) && (tso == 0)) { max_val -= len; len = segsiz; @@ -19515,14 +19522,14 @@ again: } tp->t_flags &= ~(TF_ACKNOW | TF_DELACK); counter_u64_add(rack_fto_send, 1); - slot = rack_get_pacing_delay(rack, tp, tot_len, NULL, segsiz, __LINE__); - rack_start_hpts_timer(rack, tp, cts, slot, tot_len, 0); + slot = rack_get_pacing_delay(rack, tp, *tot_len, NULL, segsiz, __LINE__); + rack_start_hpts_timer(rack, tp, cts, slot, *tot_len, 0); #ifdef TCP_ACCOUNTING crtsc = get_cyclecount(); if (tp->t_flags2 & TF2_TCP_ACCOUNTING) { tp->tcp_cnt_counters[SND_OUT_DATA] += cnt_thru; tp->tcp_proc_time[SND_OUT_DATA] += (crtsc - ts_val); - tp->tcp_cnt_counters[CNT_OF_MSS_OUT] += ((tot_len + segsiz - 1) / segsiz); + tp->tcp_cnt_counters[CNT_OF_MSS_OUT] += ((*tot_len + segsiz - 1) / segsiz); } sched_unpin(); #endif @@ -19884,20 +19891,36 @@ rack_output(struct tcpcb *tp) TCPS_HAVEESTABLISHED(tp->t_state)) { rack_set_state(tp, rack); } + segsiz = min(ctf_fixed_maxseg(tp), rack->r_ctl.rc_pace_min_segs); + minseg = segsiz; + if (rack->r_ctl.rc_pace_max_segs == 0) + pace_max_seg = rack->rc_user_set_max_segs * segsiz; + else + pace_max_seg = rack->r_ctl.rc_pace_max_segs; if ((rack->r_fast_output) && (doing_tlp == 0) && (tp->rcv_numsacks == 0)) { int ret; error = 0; - ret = rack_fast_output(tp, rack, ts_val, cts, ms_cts, &tv, tot_len_this_send, &error); - if (ret >= 0) + ret = rack_fast_output(tp, rack, ts_val, cts, ms_cts, &tv, &tot_len_this_send, &error, __LINE__); + if (ret > 0) return(ret); else if (error) { inp = rack->rc_inp; so = inp->inp_socket; sb = &so->so_snd; goto nomore; + } else { + /* Return == 0, if there is more we can send tot_len wise fall through and send */ + if (tot_len_this_send >= pace_max_seg) + return (ret); +#ifdef TCP_ACCOUNTING + /* We need to re-pin since fast_output un-pined */ + sched_pin(); + ts_val = get_cyclecount(); +#endif + /* Fall back out so we can send any more that may bring us to pace_max_seg */ } } inp = rack->rc_inp; @@ -20004,12 +20027,6 @@ again: ms_cts = tcp_tv_to_mssectick(&tv); tso = 0; mtu = 0; - segsiz = min(ctf_fixed_maxseg(tp), rack->r_ctl.rc_pace_min_segs); - minseg = segsiz; - if (rack->r_ctl.rc_pace_max_segs == 0) - pace_max_seg = rack->rc_user_set_max_segs * segsiz; - else - pace_max_seg = rack->r_ctl.rc_pace_max_segs; if (TCPS_HAVEESTABLISHED(tp->t_state) && (rack->r_ctl.pcm_max_seg == 0)) { /* @@ -21593,7 +21610,6 @@ send: flags |= TH_PUSH; add_flag |= RACK_HAD_PUSH; } - SOCK_SENDBUF_UNLOCK(so); } else { SOCK_SENDBUF_UNLOCK(so); @@ -22536,7 +22552,7 @@ enobufs: segsiz, pace_max_seg, hw_tls, flags); if (rack->r_fast_output) { error = 0; - ret = rack_fast_output(tp, rack, ts_val, cts, ms_cts, &tv, tot_len_this_send, &error); + ret = rack_fast_output(tp, rack, ts_val, cts, ms_cts, &tv, &tot_len_this_send, &error, __LINE__); if (ret >= 0) return (ret); else if (error) From nobody Sun Jun 15 09:28:38 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bKnrK4R8fz5sL1X; Sun, 15 Jun 2025 09:28:49 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bKnrK36CDz3R7w; Sun, 15 Jun 2025 09:28:49 +0000 (UTC) (envelope-from bz@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749979729; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=wGk6cYtTiHld/H/t7CeBSfEUh8MHOV5k93mNEwStOqI=; b=JRyIseeujP0Et/cCGd8VTQMhayunWqr2KoRxfMUocCBGc1wSM0XRRuzw+/ZOtkKNRi7xhm T+mTpFqtKjBXFSBKgENhRVsc2ilSy5r1V1snnf1liBBa4OlhFW24G4amCXuHQ19J3MsDdW 9oxPKhnbaEh307NZwJrk5+qICmQWnE4HNnKZEAhwgXQ173NSf8BxQqy8X17n79ab86o0Xs IO3JJWSL4W2+BNzYfAAj/htOjvv5ngRVXX2PsGT2qLHK+s6imSCeYT8aEmaBuOaB+1zeMZ KXwBfK5Rjuf8ZschGWv5VS/sohBewSavi/QpTJjqfcHZmdqbwEpw/luUwdMdrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749979729; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=wGk6cYtTiHld/H/t7CeBSfEUh8MHOV5k93mNEwStOqI=; b=PEUXWnnqJimKac+DFXluAvI1PRntQClFYPf7IwUkumnZMjHF/cNbPiXf5ukIDx/tRfOKWD oZmUJDwD2uucNub3ckFlvwjbopum0KQsjeWwoGzJ/uitwZmxhelwMSILD36d4i5X6VhtHU 5J2qDbNZzCVGC3PNp4xt6SXvKfF7xHx2HLSk88C0/Xmbet69jnbpWe4qp94zCzHI6nQUtS HNRQ8AlNY9O4cC3T2fEZb1GFqMCDndnP+zYvTbGUNIedGU1RybEQp+n9PKx61gX5+N6pD1 K/4x9QI1azPBY29boNzZrdDhrkOa9duNVubK9SJczwKVsNuI9lJxCTuiHXzfcg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749979729; a=rsa-sha256; cv=none; b=iIEkRu+YA/n7kx8bWiLpkaGeztMpxUYB515IRnHmkNizJOeyodiyvcQblCM0kuXejLJ6h6 bJ+46x5YaPZgkIqTsN/gMBmk21Bw5p66fZ4Yq7STQckHPcAmJ7N8V/NszpZX+DUA81hrxC QdBoDYqn+BYdyByVm13mtci3LS0JXcX/kKnXANAiZi7WbzJfAftECPOxUtoqjtGPlWGsn3 8kxw+vb3ou6erI/G9feAu3GTHTQahreTgyT6caFyc+MUjxXPk+VD/tERXiVzn3AKN9iZg2 ys8cNzRJFjIzKYqChoe9UGx3Lo9gN7Olq8iu43fWDYl2CMo2/K6+s7c/mnUkjg== Received: from mx-01.divo.sbone.de (mx-01.divo.sbone.de [IPv6:2003:a:140a:2200:6:594:fffe:19]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature ECDSA (prime256v1) client-digest SHA256) (Client CN "mx-01.divo.sbone.de", Issuer "E5" (verified OK)) (Authenticated sender: bz/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bKnrK0mvsz13Nf; Sun, 15 Jun 2025 09:28:49 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mx-01.divo.sbone.de (Postfix) with ESMTPS id C2391A64805; Sun, 15 Jun 2025 09:28:39 +0000 (UTC) Received: from content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 781C52D029E0; Sun, 15 Jun 2025 09:28:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) by content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (amavisd-new, port 10024) with ESMTP id RgM1O-GiKEkX; Sun, 15 Jun 2025 09:28:39 +0000 (UTC) Received: from strong-iwl0.sbone.de (strong-iwl0.sbone.de [IPv6:fde9:577b:c1a9:4902:a66b:b6ff:fe40:39a9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 953672D029D8; Sun, 15 Jun 2025 09:28:38 +0000 (UTC) Date: Sun, 15 Jun 2025 09:28:38 +0000 (UTC) From: "Bjoern A. Zeeb" To: A FreeBSD User cc: Warner Losh , Jaeyoon Choi , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 1349a733cf28 - main - ufshci: Introduce the ufshci(4) driver In-Reply-To: <20250615103251.2221265b@thor.sb211.local> Message-ID: <95r7ros1-5296-8orq-sqp5-s7p4935p6039@SerrOFQ.bet> References: <202506150609.55F69dn3021406@gitrepo.freebsd.org> <20250615103251.2221265b@thor.sb211.local> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed On Sun, 15 Jun 2025, A FreeBSD User wrote: > Am Tage des Herren Sun, 15 Jun 2025 06:09:39 GMT > Warner Losh schrieb: > >> The branch main has been updated by imp: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=1349a733cf2828e0040cabef89eeadc3ff00c40b >> >> commit 1349a733cf2828e0040cabef89eeadc3ff00c40b >> Author: Jaeyoon Choi >> AuthorDate: 2025-06-13 18:33:01 +0000 >> Commit: Warner Losh >> CommitDate: 2025-06-15 06:08:56 +0000 >> >> ufshci: Introduce the ufshci(4) driver >> >> This commit adds a storage driver that supports the Universal Flash >> Storage Host Controller Interface (UFSHCI) on FreeBSD. >> >> Universal Flash Storage (UFS) is a flash-based mobile storage device >> that replaces eMMC, aiming for high performance with low power. The UFS >> Host Controller Interface (UFSHCI) is the host side controller and >> connects UFS device to a system bus, such as PCIe. >> >> The code targets the latest standards: >> - UFS 4.1: https://www.jedec.org/standards-documents/docs/jesd220g >> - UFSHCI 4.1: https://www.jedec.org/standards-documents/docs/jesd223f >> >> The ufshci(4) driver implements controller/device initialization, >> interrupt, single-doorbell(SDB) queue based IO requests. Support for >> multi-queue (MCQ) IO requests is planned for a later commit. >> >> Implemented features: >> - PCIe bus support >> - legacy(INTx) Interrupt Handling >> - UIC command support >> - UTP Transfer Request (UTR) support >> - UTP Task Management Request (UTMR) support >> - single doorbell queue (SDB) with multiple queue depth >> - SCSI command set support >> - sysctl >> >> Work in progress: >> - multi-Circular Queue (per-CPU IO queues) >> - MSI-X interrupt Support >> - write booster >> - write Protect >> - Host Performance Booster (HPB) >> - interrupt aggregation >> - ARM based system bus support >> - ufs-utils port >> >> Tests were performed on QEMU and an Intel-based laptop. >> Since QEMU has an emulated UFS device, I tested on QEMU. >> >> How to test on QEMU: >> 1. Run QEMU >> $ qemu-system-x86_64 ... -device ufs -drive >> file=blk1g.bin,format=raw,if=none,id=luimg -device ufs-lu,drive=luimg,lun=0 2. >> Loading/unloading the ufshci module on QEMU $ kldload >> /usr/obj/usr/src/amd64.amd64/sys/modules/ufshci/ufshci.ko $ kldunload ufshci >> >> Testing on real hardware: >> - Samsung Galaxy Book S (Intel Lakefield) with UFS 3.0 >> - Lenovo duet 3 11ian8 (Intel N100) with UFS 2.1 >> >> Sponsored by: Samsung Electronics >> Reviewed by: imp >> Differential Revision: https://reviews.freebsd.org/D50370 >> --- >> sbin/camcontrol/camcontrol.c | 13 + > > It seems changes to sources breaks buildkernel (at least for me) on customized kernel config: > > [...] > --- camcontrol.pieo --- > /usr/src/sbin/camcontrol/camcontrol.c:5407:23: error: use of undeclared identifier > 'CTS_UFSHCI_VALID_MODE' --- all_subdir_bin --- > --- all_subdir_bin/sleep --- > ===> bin/sleep (all) > --- all_subdir_sbin --- > 5407 | if (ufshci->valid & CTS_UFSHCI_VALID_MODE) { > | ^ > [...] > > Kind regards, I am running a test build just to be sure but I think this should do: commit 78f12afc38eabea82fd247c157d340e289dceeb8 Author: Bjoern A. Zeeb AuthorDate: Sun Jun 15 09:25:56 2025 +0000 Commit: Bjoern A. Zeeb CommitDate: Sun Jun 15 09:25:56 2025 +0000 ufshci: camcontrol: use correct define to fix the build Fixes: 1349a733cf28 diff --git sbin/camcontrol/camcontrol.c sbin/camcontrol/camcontrol.c index 19684c044ef5..15a5d42a2ba5 100644 --- sbin/camcontrol/camcontrol.c +++ sbin/camcontrol/camcontrol.c @@ -5404,7 +5404,7 @@ cts_print(struct cam_device *device, struct ccb_trans_settings *cts) struct ccb_trans_settings_ufshci *ufshci = &cts->xport_specific.ufshci; - if (ufshci->valid & CTS_UFSHCI_VALID_MODE) { + if (ufshci->valid & CTS_UFSHCI_VALID_LINK) { fprintf(stdout, "%sHigh Speed Gear: %d (%d max)\n", pathstr, ufshci->hs_gear, ufshci->max_hs_gear); fprintf(stdout, "%sUnipro TX lanes: %d (%d max)\n", pathstr, -- Bjoern A. Zeeb r15:7 From nobody Sun Jun 15 10:31:33 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bKqDk3MlKz5xs9N; Sun, 15 Jun 2025 10:31:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bKqDk0jM9z3GXL; Sun, 15 Jun 2025 10:31:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749983494; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pIMh7PowpDEELD7QamL52vs76Y9ichNduIvLb/aeB4M=; b=lCYcYVC6WTOS/xbrZBCxnN7A2xPYx1o3OiuoGmlNvzYyYzwmK4oFfzRcNcClinc+4WJ9Hn HD9WHcRZheZ65mLdM+LS25Th8HCIYnc9EtoXfNtZPlEK2LjXcgmUvYZW3oJAIoiPHJyai8 TjdxoUrVFi/yZhSlB7I3sUapnjOmUqOJixfcIu2duVjHjDJOSH4k2MmWk8oKLZlwzawmOk RYxuLyKNaNwJOkhQEhP2TI7I33fOiXLn1Ji47VzOda7Y/D+ulZvVwK8anK6cfkW+yQjyDW RJKS3e4svMe95hQG9lww/+Z9JY7poOvq66ouv+t+re0ia/w9iKH6D/xr54MWxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749983494; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pIMh7PowpDEELD7QamL52vs76Y9ichNduIvLb/aeB4M=; b=c4h22ge4cGa7vblyYoMOZciAY0RXPs7s26RMQTGmIJpRBs0gk8ulpg0tMyr51uH1XaqseU x+7SM33KhQVW/PiubB5MR43UROKyR5flFCW5TgRq1V1RdYwnm+bsuM0nWNIZFgEkAlX05G DRQ9t9wdM4OUJoN+61a5c0IhkXeyAMLpFU2TKDqBE0MsMGx8nE6LPqCMnWN4Xy5z2zzHlm LCH///6odporN/6p1LE37Zu6aVoxyy1AWulrvtzGQEgPfIm9Ld9oPdGTAfyIjlEudiu2tt TKC7pquE/7nMeh/YwG7PsTk3sj5yjTq0girPkLKKalpW0RWaSuF+ugQ08erNHA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749983494; a=rsa-sha256; cv=none; b=SCRN/7EsQ5tTXjsCuTFTuCWJtGaL6CPnwCWXyJQPRfMD8sT8P1H+HCe8uXPdOhXbNG2bOv v7kwNMxVVcShsSPh/hgUjNvRs7La6TYfPL66GRMhWSem1eoKLH1bQMntLu/62juBW6/Hg5 nHBmTvli2ZUytOhxs55FQ21SlEuQs2h7WXhjU25rjiplagUN/LHF2pI5nR5r8amEX2et9s N91X8OgPQ0lkJMYa/6uAaSaICC9DHyFo4FzSi4wr5TdkdEvcYMZN6Gn31bl9/TIHVuEjCx rwpK17H9rBfBS1oUdKk9GcSAr4gM/nfM0g+TIA2Kct9Yq++7wfCK4NIRdIpiVQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bKqDk09wPz186G; Sun, 15 Jun 2025 10:31:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55FAVXxp025851; Sun, 15 Jun 2025 10:31:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55FAVXvM025825; Sun, 15 Jun 2025 10:31:33 GMT (envelope-from git) Date: Sun, 15 Jun 2025 10:31:33 GMT Message-Id: <202506151031.55FAVXvM025825@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 78f12afc38ea - main - ufshci: camcontrol: use correct define to fix the build List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 78f12afc38eabea82fd247c157d340e289dceeb8 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=78f12afc38eabea82fd247c157d340e289dceeb8 commit 78f12afc38eabea82fd247c157d340e289dceeb8 Author: Bjoern A. Zeeb AuthorDate: 2025-06-15 09:25:56 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-06-15 09:25:56 +0000 ufshci: camcontrol: use correct define to fix the build Fixes: 1349a733cf28 --- sbin/camcontrol/camcontrol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/camcontrol/camcontrol.c b/sbin/camcontrol/camcontrol.c index 19684c044ef5..15a5d42a2ba5 100644 --- a/sbin/camcontrol/camcontrol.c +++ b/sbin/camcontrol/camcontrol.c @@ -5404,7 +5404,7 @@ cts_print(struct cam_device *device, struct ccb_trans_settings *cts) struct ccb_trans_settings_ufshci *ufshci = &cts->xport_specific.ufshci; - if (ufshci->valid & CTS_UFSHCI_VALID_MODE) { + if (ufshci->valid & CTS_UFSHCI_VALID_LINK) { fprintf(stdout, "%sHigh Speed Gear: %d (%d max)\n", pathstr, ufshci->hs_gear, ufshci->max_hs_gear); fprintf(stdout, "%sUnipro TX lanes: %d (%d max)\n", pathstr, From nobody Sun Jun 15 11:53:41 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bKs471Xj8z5y16V; Sun, 15 Jun 2025 11:54:15 +0000 (UTC) (envelope-from freebsd@walstatt-de.de) Received: from smtp6.goneo.de (smtp6.goneo.de [85.220.129.31]) (using TLSv1.3 with cipher TLS_AES_256_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 4bKs462L6gz4Knr; Sun, 15 Jun 2025 11:54:14 +0000 (UTC) (envelope-from freebsd@walstatt-de.de) Authentication-Results: mx1.freebsd.org; none Received: from hub2.goneo.de (hub2.goneo.de [85.220.129.53]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp6.goneo.de (Postfix) with ESMTPS id D6C81240202; Sun, 15 Jun 2025 13:54:11 +0200 (CEST) Received: from hub2.goneo.de (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by hub2.goneo.de (Postfix) with ESMTPS id 01FF7240165; Sun, 15 Jun 2025 13:54:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walstatt-de.de; s=DKIM001; t=1749988450; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ik8pTO1oryJbHyq+R57e0bhZikjtsRcqkspKsyguMUE=; b=IXeI/AhOOSVqPjFX8y7SVsbef1jJvaR+61v23sIMEe9G7kWlTDPR9OQ6LtRTk19bSc7+iW boMvp5oMNtyAE1irzqYYH4o4C0VlWvBrVgkLhx3SGkXwl4IjBiCnFSI4np8umhbZAev37t OVods8bPs4j7UNLc9Zlxs2lB07bi3hAfqCJBZHYKyV0HEQ7GuSeQ+KSr5fmocKCJqTE+iS ULpUrx6aiXrQ4Bi4a3smhYoC3x8e31BKPi37j5tZb4yw3ZsUeX3ObSiOiXir9u+GDq5T0t XOpaEnPcVAPcHS6nqn/3RUFWSFYsHcLsiXikPO8yOqlm72gOwZH5jCAkYHD1jQ== Received: from thor.sb211.local (dynamic-2a02-3100-2981-4302-1dbb-139c-3164-c63c.310.pool.telefonica.de [IPv6:2a02:3100:2981:4302:1dbb:139c:3164:c63c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by hub2.goneo.de (Postfix) with ESMTPSA id 9B338240126; Sun, 15 Jun 2025 13:54:09 +0200 (CEST) Date: Sun, 15 Jun 2025 13:53:41 +0200 From: A FreeBSD User To: "Bjoern A. Zeeb" Cc: Warner Losh , Jaeyoon Choi , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 1349a733cf28 - main - ufshci: Introduce the ufshci(4) driver Message-ID: <20250615135324.2fa38fba@thor.sb211.local> In-Reply-To: <95r7ros1-5296-8orq-sqp5-s7p4935p6039@SerrOFQ.bet> References: <202506150609.55F69dn3021406@gitrepo.freebsd.org> <20250615103251.2221265b@thor.sb211.local> <95r7ros1-5296-8orq-sqp5-s7p4935p6039@SerrOFQ.bet> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/OtID_maiV.OnA.ILW47oRd8"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Rspamd-UID: 377ca1 X-Rspamd-UID: 9af511 X-Rspamd-Queue-Id: 4bKs462L6gz4Knr X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:25394, ipnet:85.220.128.0/17, country:DE] --Sig_/OtID_maiV.OnA.ILW47oRd8 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Am Tage des Herren Sun, 15 Jun 2025 09:28:38 +0000 (UTC) "Bjoern A. Zeeb" schrieb: > On Sun, 15 Jun 2025, A FreeBSD User wrote: >=20 > > Am Tage des Herren Sun, 15 Jun 2025 06:09:39 GMT > > Warner Losh schrieb: > > =20 > >> The branch main has been updated by imp: > >> > >> URL: https://cgit.FreeBSD.org/src/commit/?id=3D1349a733cf2828e0040cabe= f89eeadc3ff00c40b > >> > >> commit 1349a733cf2828e0040cabef89eeadc3ff00c40b > >> Author: Jaeyoon Choi > >> AuthorDate: 2025-06-13 18:33:01 +0000 > >> Commit: Warner Losh > >> CommitDate: 2025-06-15 06:08:56 +0000 > >> > >> ufshci: Introduce the ufshci(4) driver > >> > >> This commit adds a storage driver that supports the Universal Flash > >> Storage Host Controller Interface (UFSHCI) on FreeBSD. > >> > >> Universal Flash Storage (UFS) is a flash-based mobile storage devi= ce > >> that replaces eMMC, aiming for high performance with low power. Th= e UFS > >> Host Controller Interface (UFSHCI) is the host side controller and > >> connects UFS device to a system bus, such as PCIe. > >> > >> The code targets the latest standards: > >> - UFS 4.1: https://www.jedec.org/standards-documents/docs/jesd220g > >> - UFSHCI 4.1: https://www.jedec.org/standards-documents/docs/jesd2= 23f > >> > >> The ufshci(4) driver implements controller/device initialization, > >> interrupt, single-doorbell(SDB) queue based IO requests. Support f= or > >> multi-queue (MCQ) IO requests is planned for a later commit. > >> > >> Implemented features: > >> - PCIe bus support > >> - legacy(INTx) Interrupt Handling > >> - UIC command support > >> - UTP Transfer Request (UTR) support > >> - UTP Task Management Request (UTMR) support > >> - single doorbell queue (SDB) with multiple queue depth > >> - SCSI command set support > >> - sysctl > >> > >> Work in progress: > >> - multi-Circular Queue (per-CPU IO queues) > >> - MSI-X interrupt Support > >> - write booster > >> - write Protect > >> - Host Performance Booster (HPB) > >> - interrupt aggregation > >> - ARM based system bus support > >> - ufs-utils port > >> > >> Tests were performed on QEMU and an Intel-based laptop. > >> Since QEMU has an emulated UFS device, I tested on QEMU. > >> > >> How to test on QEMU: > >> 1. Run QEMU > >> $ qemu-system-x86_64 ... -device ufs -drive > >> file=3Dblk1g.bin,format=3Draw,if=3Dnone,id=3Dluimg -device ufs-lu,driv= e=3Dluimg,lun=3D0 2. > >> Loading/unloading the ufshci module on QEMU $ kldload > >> /usr/obj/usr/src/amd64.amd64/sys/modules/ufshci/ufshci.ko $ kldunload = ufshci > >> > >> Testing on real hardware: > >> - Samsung Galaxy Book S (Intel Lakefield) with UFS 3.0 > >> - Lenovo duet 3 11ian8 (Intel N100) with UFS 2.1 > >> > >> Sponsored by: Samsung Electronics > >> Reviewed by: imp > >> Differential Revision: https://reviews.freebsd.org/D50370 > >> --- > >> sbin/camcontrol/camcontrol.c | 13 + =20 > > > > It seems changes to sources breaks buildkernel (at least for me) on cus= tomized kernel > > config: > > > > [...] > > --- camcontrol.pieo --- > > /usr/src/sbin/camcontrol/camcontrol.c:5407:23: error: use of undeclared= identifier > > 'CTS_UFSHCI_VALID_MODE' --- all_subdir_bin --- > > --- all_subdir_bin/sleep --- =20 > > =3D=3D=3D> bin/sleep (all) =20 > > --- all_subdir_sbin --- > > 5407 | if (ufshci->valid & CTS_UFSHCI_VALID_MODE) { > > | ^ > > [...] > > > > Kind regards, =20 >=20 >=20 > I am running a test build just to be sure but I think this should do: >=20 > commit 78f12afc38eabea82fd247c157d340e289dceeb8 > Author: Bjoern A. Zeeb > AuthorDate: Sun Jun 15 09:25:56 2025 +0000 > Commit: Bjoern A. Zeeb > CommitDate: Sun Jun 15 09:25:56 2025 +0000 >=20 > ufshci: camcontrol: use correct define to fix the build >=20 > Fixes: 1349a733cf28 >=20 > diff --git sbin/camcontrol/camcontrol.c sbin/camcontrol/camcontrol.c > index 19684c044ef5..15a5d42a2ba5 100644 > --- sbin/camcontrol/camcontrol.c > +++ sbin/camcontrol/camcontrol.c > @@ -5404,7 +5404,7 @@ cts_print(struct cam_device *device, struct ccb_tra= ns_settings *cts) > struct ccb_trans_settings_ufshci *ufshci =3D > &cts->xport_specific.ufshci; >=20 > - if (ufshci->valid & CTS_UFSHCI_VALID_MODE) { > + if (ufshci->valid & CTS_UFSHCI_VALID_LINK) { > fprintf(stdout, "%sHigh Speed Gear: %d (%d max)\= n", > pathstr, ufshci->hs_gear, ufshci->max_hs= _gear); > fprintf(stdout, "%sUnipro TX lanes: %d (%d max)\= n", pathstr, >=20 >=20 >=20 >=20 Thank you very much, seems to work, at least, for me. Kind regards, oh --=20 A FreeBSD user --Sig_/OtID_maiV.OnA.ILW47oRd8 Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQRQheDybVktG5eW/1Kxzvs8OqokrwUCaE60YAAKCRCxzvs8Oqok r9CUAP9cWLJ7JqSN8dcfV50ElSVe11pb65pCcClM07c2BKFOBAEAtBYGrs2ZIDrL VLsyeSUF5RZuQ93spMUYoH0s5z55GwU= =WpPt -----END PGP SIGNATURE----- --Sig_/OtID_maiV.OnA.ILW47oRd8-- From nobody Sun Jun 15 14:21:20 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bKwL069tXz5VjhK; Sun, 15 Jun 2025 14:21:28 +0000 (UTC) (envelope-from SRS0=lH6/=Y6=klop.ws=ronald-lists@realworks.nl) Received: from smtp-relay-int-backup.realworks.nl (smtp-relay-int-backup.realworks.nl [87.255.56.188]) (using TLSv1.3 with cipher TLS_AES_256_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 4bKwL048JXz3T1N; Sun, 15 Jun 2025 14:21:28 +0000 (UTC) (envelope-from SRS0=lH6/=Y6=klop.ws=ronald-lists@realworks.nl) Authentication-Results: mx1.freebsd.org; none Received: from smtp-relay-int-backup.realworks.nl (crmpreview6.colo2.realworks.nl [10.2.52.36]) by mailrelayint1.colo2.realworks.nl (Postfix) with ESMTP id 4bKwKr5T1qzcd; Sun, 15 Jun 2025 16:21:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=klop.ws; s=rw2; t=1749997280; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to; bh=AY82MxxmfY0lV818jqUjaK9wTifLDF2Ms3GingOmqOM=; b=zkCEsRdnBGRnLqqgoxdgpUk7CUJ00VayTVin/E07BgbHlf39GePYc4IARLCv7rWPfysyWw lA1YyKzmR+rJ/6p+xB4JYiLDlGIFRsMB77o9IBvxoxOW45NMEmaYA3y/vZAXLnQGTxsQAE HwoNAvClHQj4WA1gOCOTjqmzvRCiwmkiz4pTtVG39uyNvbm5VxUeuNOYxKRdN3bOiR14tY +qhAGLuCaoMjNKHpeuEbEw9jdvpnMS6xlyUPXXOY8jSHGur/+o1OlNt+H9ERsTm5u5wMM5 uYWavCsdPlIcpzvKXbiCYMGqjDKbmyLA7tYuzdzSW/Gz3AiluGjkz+KA+JKkUg== Received: from crmpreview6.colo2.realworks.nl (localhost [127.0.0.1]) by crmpreview6.colo2.realworks.nl (Postfix) with ESMTP id AC54D20004D; Sun, 15 Jun 2025 16:21:20 +0200 (CEST) Date: Sun, 15 Jun 2025 16:21:20 +0200 (CEST) From: Ronald Klop To: Cy Schubert Cc: dev-commits-src-main@FreeBSD.org, dev-commits-src-all@FreeBSD.org, src-committers@FreeBSD.org Message-ID: <240137891.21754.1749997280448@localhost> In-Reply-To: <202506150508.55F58KLU008592@gitrepo.freebsd.org> Subject: Re: git: b6e33f0cd536 - main - rc.d/mountcritlocal: Make sure zpools are imported for legacy ZFS List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_21753_1823422774.1749997280446" X-Mailer: Realworks (753.34) X-Originating-Host: from (localhost [127.0.0.1]) by crmpreview6.colo2.realworks.nl [10.2.52.36] with HTTP; Sun, 15 Jun 2025 16:21:20 +0200 Importance: Normal X-Priority: 3 (Normal) X-Rspamd-Queue-Id: 4bKwL048JXz3T1N X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:38930, ipnet:87.255.32.0/19, country:NL] ------=_Part_21753_1823422774.1749997280446 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Van: Cy Schubert Datum: 15 juni 2025 07:08 Aan: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Onderwerp: git: b6e33f0cd536 - main - rc.d/mountcritlocal: Make sure zpools are imported for legacy ZFS > > > The branch main has been updated by cy: > > URL: https://cgit.FreeBSD.org/src/commit/?id=b6e33f0cd53683e06570606d5bd88fc04a4b76fe > > commit b6e33f0cd53683e06570606d5bd88fc04a4b76fe > Author: Cy Schubert > AuthorDate: 2025-06-14 13:16:16 +0000 > Commit: Cy Schubert > CommitDate: 2025-06-15 04:39:36 +0000 > > rc.d/mountcritlocal: Make sure zpools are imported for legacy ZFS > > Legacy ZFS uses fstab to mount its datasets. In an attempt to fix > another problem 900bc0206348 broke legacy ZFS in fstab(5). This > comit works around the problem by mountcritlocal scanning /etc/fstab > for zfs mountpoint and if any are found invoke /etc/rc.d/zpool start. > > Reviewed by: imp > Differential Revision: https://reviews.freebsd.org/D50844 > --- > libexec/rc/rc.d/mountcritlocal | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/libexec/rc/rc.d/mountcritlocal b/libexec/rc/rc.d/mountcritlocal > index f91eaf44457c..6dce672657fc 100755 > --- a/libexec/rc/rc.d/mountcritlocal > +++ b/libexec/rc/rc.d/mountcritlocal > @@ -27,6 +27,15 @@ mountcritlocal_start() > ;; > esac > > + while read a b vfstype rest; do > + if [ "$vfstype" = "zfs" -a "$a" != "#" ]; then > + # zpool is needed for legacy ZFS > + echo 'Importing zpools for legacy ZFS' > + /etc/rc.d/zpool start > + break > + fi > + done < /etc/fstab > + > # Mount everything except nfs filesystems. > startmsg -n 'Mounting local filesystems:' > mount_excludes='no' > > > > > Does this mean that a comment # must always be folllowed by a whitespace? Regards, Ronald ------=_Part_21753_1823422774.1749997280446 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit

Van: Cy Schubert <cy@FreeBSD.org>
Datum: 15 juni 2025 07:08
Aan: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Onderwerp: git: b6e33f0cd536 - main - rc.d/mountcritlocal: Make sure zpools are imported for legacy ZFS

The branch main has been updated by cy:

URL: https://cgit.FreeBSD.org/src/commit/?id=b6e33f0cd53683e06570606d5bd88fc04a4b76fe

commit b6e33f0cd53683e06570606d5bd88fc04a4b76fe
Author:     Cy Schubert
AuthorDate: 2025-06-14 13:16:16 +0000
Commit:     Cy Schubert
CommitDate: 2025-06-15 04:39:36 +0000

    rc.d/mountcritlocal: Make sure zpools are imported for legacy ZFS
    
    Legacy ZFS uses fstab to mount its datasets. In an attempt to fix
    another problem 900bc0206348 broke legacy ZFS in fstab(5). This
    comit works around the problem by mountcritlocal scanning /etc/fstab
    for zfs mountpoint and if any are found invoke /etc/rc.d/zpool start.
    
    Reviewed by:            imp
    Differential Revision:  https://reviews.freebsd.org/D50844
---
 libexec/rc/rc.d/mountcritlocal | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/libexec/rc/rc.d/mountcritlocal b/libexec/rc/rc.d/mountcritlocal
index f91eaf44457c..6dce672657fc 100755
--- a/libexec/rc/rc.d/mountcritlocal
+++ b/libexec/rc/rc.d/mountcritlocal
@@ -27,6 +27,15 @@ mountcritlocal_start()
        ;;
    esac
 
+   while read a b vfstype rest; do
+       if [ "$vfstype" = "zfs" -a "$a" != "#" ]; then
+           # zpool is needed for legacy ZFS
+           echo 'Importing zpools for legacy ZFS'
+           /etc/rc.d/zpool start
+           break
+       fi
+   done < /etc/fstab
+
    # Mount everything except nfs filesystems.
    startmsg -n 'Mounting local filesystems:'
    mount_excludes='no'




Does this mean that a comment # must always be folllowed by a whitespace?

Regards,
Ronald
------=_Part_21753_1823422774.1749997280446-- From nobody Sun Jun 15 14:41:12 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bKwmy1v6vz5Vky6; Sun, 15 Jun 2025 14:41:22 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mail01.stack.nl (scw01.stack.nl [51.15.111.152]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "ecc.stack.nl", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bKwmx3dCgz3gyM; Sun, 15 Jun 2025 14:41:21 +0000 (UTC) (envelope-from jilles@stack.nl) Authentication-Results: mx1.freebsd.org; none Received: from localhost (localhost.localdomain [127.0.0.1]) by mail01.stack.nl (Postfix) with ESMTP id C9FA562856; Sun, 15 Jun 2025 14:41:13 +0000 (UTC) Received: from mail01.stack.nl ([127.0.0.1]) by localhost (mail01.stack.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ORkC2K1GfFoJ; Sun, 15 Jun 2025 14:41:12 +0000 (UTC) Received: from blade.stack.nl (unknown [95.211.93.133]) by mail01.stack.nl (Postfix) with ESMTP id A601262854; Sun, 15 Jun 2025 14:41:12 +0000 (UTC) Received: by blade.stack.nl (Postfix, from userid 1677) id 7FDBD8005E; Sun, 15 Jun 2025 14:41:12 +0000 (UTC) Date: Sun, 15 Jun 2025 16:41:12 +0200 From: Jilles Tjoelker To: Hiroki Sato Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 7faddeb395b7 - main - rc: Fix scripts that need pathname expansion Message-ID: References: <202506142026.55EKQeGM032225@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202506142026.55EKQeGM032225@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4bKwmx3dCgz3gyM X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:12876, ipnet:51.15.0.0/17, country:FR] On Sat, Jun 14, 2025 at 08:26:40PM +0000, Hiroki Sato wrote: > The branch main has been updated by hrs: > URL: https://cgit.FreeBSD.org/src/commit/?id=7faddeb395b7976b44393db24f48ec47040eff07 > commit 7faddeb395b7976b44393db24f48ec47040eff07 > Author: Hiroki Sato > AuthorDate: 2025-06-14 20:24:41 +0000 > Commit: Hiroki Sato > CommitDate: 2025-06-14 20:24:41 +0000 > rc: Fix scripts that need pathname expansion > Reported by: Kenneth Raplee > Differential Revision: https://reviews.freebsd.org/D45855 > diff --git a/libexec/rc/rc.subr b/libexec/rc/rc.subr > index 359eebd1d342..d760b75a15a3 100644 > --- a/libexec/rc/rc.subr > +++ b/libexec/rc/rc.subr > @@ -223,10 +223,11 @@ rc_trace() > list_vars() > { > # Localize 'set' option below. > - local - > + local - _s > local IFS=$'\n' line varname > > - # Disable path expansion in unquoted 'for' parameters below. > + # Disable path expansion temporarily in unquoted 'for' parameters below. > + _s=$(set +o) Like the comment says, `local -` already saves and restores `set` options, so it does not make sense to do it again manually. If you want to stop using `local -` in rc and use `_s=$(set +o)`, etc., please do so consistently. > set -o noglob > > for line in $(set); do > @@ -241,6 +242,7 @@ list_vars() > ;; > esac > done > + eval $_s > } > > # set_rcvar [var] [defval] [desc] > @@ -292,6 +294,19 @@ set_rcvar_obsolete() > eval ${_var}_obsolete_msg=\"$*\" > } > +# expandpath str > +# Apply pathname expansion to str. > +# > +expandpath() > +{ > + local _s > + > + _s=$(set +o) > + set +o noglob > + echo $1 > + eval $_s > +} > + This is convenient but it should be kept in mind that unlike direct pathname expansion it will not handle correctly pathnames containing spaces. A comment may be appropriate. If you do not want to use `local -`, I would prefer `eval "$_s"` instead of `eval $_s` since not using the quotes requests word splitting which is not needed (although it should not break anything either). -- Jilles Tjoelker From nobody Sun Jun 15 15:18:51 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bKxcC5HQhz5VnKD; Sun, 15 Jun 2025 15:18:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bKxcC4SS4z453B; Sun, 15 Jun 2025 15:18:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750000731; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pR/L1O+JzrgUHwy1Ad3T0pBdc6aXt+75tjeNj3iyios=; b=k2+Tc7D8uaRJRwpb+FEy/cZyGnQ9p+FViTDvwwcB1tG8HtDs8ALbgxicQgiD5zHyj3fO0U aX560Am4421tMvAKLSoBHCkWlIkSpVqCPok1CMQbI5PjmRSElAV7S3yAm5UWyCkFMVIdH5 UxqXk9ENKLI8M6QVOjE/2f8dLGzvNq6VlVnLOdz9rz2zHR3uTUxFUGmNLkHeTDT1UBKBXy l3y7bwWC4qXtuUX7xdKZxjcBc4RuSdLNF1gzDhEyslg0zmGfSRYF4Qa4Jf3SuSYWVEkxFC duju1e4+vQZ+K8R/Irwec/PQH6/QVVySPSN3z7CTU9OE9FcE+bC+tsfoyQroRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750000731; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pR/L1O+JzrgUHwy1Ad3T0pBdc6aXt+75tjeNj3iyios=; b=psVhfNu5ncomlanzahaENMWC9civmKJXEzFvDCt2Pz/PPkZVBwsFrAHazEZ2USBntPWto7 Vb2G5hrK2LK6MCrnBkNz6F8QgTTCWmfUP+feZIallxv+EP/LFOG6XY9o/7S9Xzs0IJuN9R /ZHxNDp9jJ/hlUk3SjRwo6XIpypleC42wKpDsyRgx/RMSmqk0KiEL69qfOnUWHFXQH8IS0 TeRqz2ttjt0SD/KwX8WYsblydNdB2BKgSS8kjtVv+U6ItDZasq5KJ9ieMs3Y/om+l4+JZB mMKWaQzTzvWbkA2gA2UZ/3bOa9xo/zM+WurTmYR+OGT/HI4rFmALX4yWI1jv+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750000731; a=rsa-sha256; cv=none; b=sgQubN/E3K9cAE01PZoj8pHzqDxc0gF2W/pSAkG0blnDR7RTF2ZG8q75EYU/UHrSYA2dGe moMRnEZk4q5TjIoT+5NJGAP8gSM9/ExZudGFBTL3EyCm5wpo1y/uVFkoRzE0HwlJBHGr7x Z/ElZ0t/jGZ31lcvQDtXVlIRqXql/5Nfha2PaAEhaAfS8JY7VeAU0rr96hyRw3IcAauiRO ZTmMG/Mhz/yAm/uGXl6d9XM/YnfjOspxHNMU5VjCInVDsgQq7+iMBcmN7ik/3lRjeseUns hI/HpSMcG9R1XU/SGMvcDRgTrwiEG6xIZ/KWvAsGm1OwTDm12H3tp4hp7Wld6A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bKxcC3bgtz37Y; Sun, 15 Jun 2025 15:18:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55FFIpwx055333; Sun, 15 Jun 2025 15:18:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55FFIpkH055330; Sun, 15 Jun 2025 15:18:51 GMT (envelope-from git) Date: Sun, 15 Jun 2025 15:18:51 GMT Message-Id: <202506151518.55FFIpkH055330@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 6a54f886bede - main - nuageinit: add support for sudo List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6a54f886bede6e6193ebc82ec5fca85679b7dc41 Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=6a54f886bede6e6193ebc82ec5fca85679b7dc41 commit 6a54f886bede6e6193ebc82ec5fca85679b7dc41 Author: Baptiste Daroussin AuthorDate: 2025-06-15 15:18:32 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-15 15:18:48 +0000 nuageinit: add support for sudo --- libexec/nuageinit/nuage.lua | 39 +++++++++++++++++++++++++++++++++++- libexec/nuageinit/nuageinit | 3 +++ libexec/nuageinit/tests/nuageinit.sh | 2 ++ 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/libexec/nuageinit/nuage.lua b/libexec/nuageinit/nuage.lua index 76f2d24ac178..deb441ee25ba 100644 --- a/libexec/nuageinit/nuage.lua +++ b/libexec/nuageinit/nuage.lua @@ -228,6 +228,42 @@ local function addsshkey(homedir, key) end end +local function addsudo(pwd) + local chmodsudoersd = false + local chmodsudoers = false + local root = os.getenv("NUAGE_FAKE_ROOTDIR") + local sudoers_dir = "/usr/local/etc/sudoers.d" + if root then + sudoers_dir= root .. sudoers_dir + end + local sudoers = sudoers_dir .. "/90-nuageinit-users" + local sudoers_attr = lfs.attributes(sudoers) + if sudoers_attr == nil then + chmodsudoers = true + local dirattrs = lfs.attributes(sudoers_dir) + if dirattrs == nil then + local r, err = mkdir_p(sudoers_dir) + if not r then + return nil, err .. " (creating " .. sudoers_dir .. ")" + end + chmodsudoersd = true + end + end + local f = io.open(sudoers, "a") + if not f then + warnmsg("impossible to open " .. sudoers) + return + end + f:write(pwd.name .. " " .. pwd.sudo .. "\n") + f:close() + if chmodsudoers then + sys_stat.chmod(sudoers, 416) + end + if chmodsudoersd then + sys_stat.chmod(sudoers, 480) + end +end + local function update_sshd_config(key, value) local sshd_config = "/etc/ssh/sshd_config" local root = os.getenv("NUAGE_FAKE_ROOTDIR") @@ -419,7 +455,8 @@ local n = { pkg_bootstrap = pkg_bootstrap, install_package = install_package, update_packages = update_packages, - upgrade_packages = upgrade_packages + upgrade_packages = upgrade_packages, + addsudo = addsudo } return n diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit index c1026aa2afee..d8aa734cb122 100755 --- a/libexec/nuageinit/nuageinit +++ b/libexec/nuageinit/nuageinit @@ -290,6 +290,9 @@ if line == "#cloud-config" then nuage.addsshkey(homedir, v) end end + if u.sudo then + nuage.addsudo(u) + end else nuage.warn("invalid type : " .. type(u) .. " for users entry number " .. n) end diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index edcc80346b5d..fe799a2227f3 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -117,6 +117,7 @@ users: - name: foobar gecos: Foo B. Bar primary_group: foobar + sudo: ALL=(ALL) NOPASSWD:ALL groups: users passwd: $6$j212wezy$7H/1LT4f9/N3wpgNunhsIqtMj62OKiS3nyNwuizouQc3u7MbYCarYeAHWYPYb2FT.lbioDm2RrkJPb9BZMN1O/ EOF @@ -138,6 +139,7 @@ EOF sed -i "" "s/freebsd:.*:1001/freebsd:freebsd:1001/" "${PWD}"/etc/master.passwd atf_check -o file:expectedpasswd cat "${PWD}"/etc/master.passwd atf_check -o file:expectedgroup cat "${PWD}"/etc/group + atf_check -o inline:"foobar ALL=(ALL) NOPASSWD:ALL\n" cat ${PWD}/usr/local/etc/sudoers.d/90-nuageinit-users } nocloud_network_head() From nobody Sun Jun 15 15:35:47 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bKxzm0vSbz5VpR6; Sun, 15 Jun 2025 15:35:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bKxzl6qvMz3GQL; Sun, 15 Jun 2025 15:35:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750001748; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YiglfJBu+E3PWia22LJwQRvPevEYN5JAL9qunst/5rQ=; b=c4ZKErSmOy7iGzcSNMz8wk+Vq2Hxj520xGssU1YSOELi1pv4ngRWJ61wJHem9r8XZwQ1xo Jgkx0VsLZ6+C7JnJH9PB3HFPN/7MOVXKjde5C8rtH0q4h0PiBKSdRcC9y7660RZpFaoB6r qpfwnghIn2Zf4v2xx67wdSmCExFF+cl0J45id1gTa/l/Dc01n34jDzK5mfyjXqvkXATHp6 OvsNCJPwyprt2jR4dwL2xORassrsxhOKTZzKLTsBARIpxwmavCq7Oz/Jov6X2ErSWpgtcu 5aN8m0W9rjFLVQ0MFFABpud9XKrzy0F6YObGYOU7yYuBaMhzYI6sut8R8o5iiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750001748; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YiglfJBu+E3PWia22LJwQRvPevEYN5JAL9qunst/5rQ=; b=NYcQUvBczH3DHRKTXC9lMnJASjc8T0KFfnAVHKU1eV3lUBnj8qT8cQX9JIcnEureNIlbjn Z6Kgd6WqKWCDa1T2vfKwe4qSj7SqhiyrpQw7lmQnktoRCoTAgRcrPw7ymBfN6pBtqQ6bpJ 2fcVeVkmmTr1ksol4K83gf+x4V7K4SFrMjrGi8S1Jjzi3jkPD9w7DLuAuyZjtQ6Qm+0pSG dHxEHj646YBF+fn2SEvgJvZXPTqk1+Ch/16JgZlX1X7K34f41MYVo7G79HH4LtP4yxVIQQ 3WE2JIVtEUIDHFVtebyEmagVuIOMMNxCXTBmvnc1hm08xJjBGjybBiRl62KvaQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750001748; a=rsa-sha256; cv=none; b=fO0cUMZQ4XcSPy3iAPH+d0wWT/Bamzm97FU4t2NaT8V/G8kOPDixUs4MtNVs09xcG83oGX F4t8ZAq9jkE5pFU2Pqgq+8KfCkzVfPW5mFhbq7OykASK8KXVDS/DgOemxXpGwgJTlEpT2K 2BBNxms5rotDmoVaY++v0VTqyeL/SkTGl53mvj8qTO5NGhUP75OgT/aWDppJMUeFqzFxJn 4C/u4uPIe0XKqsnEOTUtypa3Qp73fVGCvE+KEYgp2d7ms7RpkfgHYFrHStzjZOGhS63d4R yxzZRMzbA5klZRZsYnbnBuAT2vkhZ4rqC1/wE1S91KYhZq0YicW/mrVwpPMASw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bKxzl6MHYz3Zt; Sun, 15 Jun 2025 15:35:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55FFZlxD092179; Sun, 15 Jun 2025 15:35:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55FFZlW2092175; Sun, 15 Jun 2025 15:35:47 GMT (envelope-from git) Date: Sun, 15 Jun 2025 15:35:47 GMT Message-Id: <202506151535.55FFZlW2092175@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: 9350e9236242 - main - fusefs: fix a panic in vop_close with a CTL consumer List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9350e9236242f51c88b3e5c19ceeae7869b9cf83 Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=9350e9236242f51c88b3e5c19ceeae7869b9cf83 commit 9350e9236242f51c88b3e5c19ceeae7869b9cf83 Author: Alan Somers AuthorDate: 2024-12-18 18:02:34 +0000 Commit: Alan Somers CommitDate: 2025-06-15 15:35:39 +0000 fusefs: fix a panic in vop_close with a CTL consumer Kernel consumers like CTL may lack ucred objects. That led to a panic when CTL closed a fuse file, if atime was enabled on the mountpoint. Fix it by checking the ucred during close. PR: 283402 MFC after: 2 weeks Sponsored by: ConnectWise Differential Revision: https://reviews.freebsd.org/D48165 --- sys/fs/fuse/fuse_vnops.c | 3 ++ tests/sys/cam/ctl/ctl.subr | 18 ++++++++++-- tests/sys/fs/fusefs/Makefile | 5 ++++ tests/sys/fs/fusefs/ctl.sh | 69 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 93 insertions(+), 2 deletions(-) diff --git a/sys/fs/fuse/fuse_vnops.c b/sys/fs/fuse/fuse_vnops.c index d09d86e4f3a1..107e6db299e0 100644 --- a/sys/fs/fuse/fuse_vnops.c +++ b/sys/fs/fuse/fuse_vnops.c @@ -796,6 +796,9 @@ fuse_vnop_close(struct vop_close_args *ap) if (fflag & IO_NDELAY) return 0; + if (cred == NULL) + cred = td->td_ucred; + err = fuse_flush(vp, cred, pid, fflag); if (err == 0 && (fvdat->flag & FN_ATIMECHANGE) && !vfs_isrdonly(mp)) { struct vattr vap; diff --git a/tests/sys/cam/ctl/ctl.subr b/tests/sys/cam/ctl/ctl.subr index 868b1c809571..5da441b806f0 100644 --- a/tests/sys/cam/ctl/ctl.subr +++ b/tests/sys/cam/ctl/ctl.subr @@ -80,7 +80,20 @@ find_device() { done } -# Create a CTL LUN +# Create a CTL LUN backed by a file +create_block() { + EXTRA_ARGS=$* + + atf_check -o save:lun-create.txt ctladm create -b block $EXTRA_ARGS + atf_check egrep -q "LUN created successfully" lun-create.txt + LUN=`awk '/LUN ID:/ {print $NF}' lun-create.txt` + if [ -z "$LUN" ]; then + atf_fail "Could not find LUN id" + fi + find_device $LUN +} + +# Create a CTL LUN backed by RAM create_ramdisk() { EXTRA_ARGS=$* @@ -95,7 +108,8 @@ create_ramdisk() { cleanup() { if [ -e "lun-create.txt" ]; then + backend=`awk '/backend:/ {print $NF}' lun-create.txt` lun_id=`awk '/LUN ID:/ {print $NF}' lun-create.txt` - ctladm remove -b ramdisk -l $lun_id > /dev/null + ctladm remove -b $backend -l $lun_id > /dev/null fi } diff --git a/tests/sys/fs/fusefs/Makefile b/tests/sys/fs/fusefs/Makefile index b1ac704ab4f6..b11f11bdfa98 100644 --- a/tests/sys/fs/fusefs/Makefile +++ b/tests/sys/fs/fusefs/Makefile @@ -4,6 +4,8 @@ PACKAGE= tests TESTSDIR= ${TESTSBASE}/sys/fs/fusefs +ATF_TESTS_SH+= ctl + # We could simply link all of these files into a single executable. But since # Kyua treats googletest programs as plain tests, it's better to separate them # out, so we get more granular reporting. @@ -64,6 +66,9 @@ TEST_METADATA.default_permissions+= required_user="unprivileged" TEST_METADATA.default_permissions_privileged+= required_user="root" TEST_METADATA.mknod+= required_user="root" TEST_METADATA.nfs+= required_user="root" +# ctl must be exclusive because it disables/enables camsim +TEST_METADATA.ctl+= is_exclusive="true" +TEST_METADATA.ctl+= required_user="root" TEST_METADATA+= timeout=10 diff --git a/tests/sys/fs/fusefs/ctl.sh b/tests/sys/fs/fusefs/ctl.sh new file mode 100644 index 000000000000..7d2e7593cbdc --- /dev/null +++ b/tests/sys/fs/fusefs/ctl.sh @@ -0,0 +1,69 @@ +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2024 ConnectWise +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS DOCUMENTATION IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. $(atf_get_srcdir)/../../cam/ctl/ctl.subr + +# Regression test for https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=283402 +# +# Almost any fuse file system would work, but this tests uses fusefs-ext2 +# because it's simple and its download is very small. +atf_test_case remove_lun_with_atime cleanup +remove_lun_with_atime_head() +{ + atf_set "descr" "Remove a fuse-backed CTL LUN when atime is enabled" + atf_set "require.user" "root" + atf_set "require.progs" "fuse-ext2 mkfs.ext2" +} +remove_lun_with_atime_body() +{ + MOUNTPOINT=$PWD/mnt + atf_check mkdir $MOUNTPOINT + atf_check truncate -s 1g ext2.img + atf_check mkfs.ext2 -q ext2.img + # Note: both default_permissions and atime must be enabled + atf_check fuse-ext2 -o default_permissions,allow_other,rw+ ext2.img \ + $MOUNTPOINT + + atf_check truncate -s 1m $MOUNTPOINT/file + create_block -o file=$MOUNTPOINT/file + + # Force fusefs to open the file, and dirty its atime + atf_check dd if=/dev/$dev of=/dev/null count=1 status=none + + # Finally, remove the LUN. Hopefully it won't panic. + atf_check -o ignore ctladm remove -b block -l $LUN + + rm lun-create.txt # So we don't try to remove the LUN twice +} +remove_lun_with_atime_cleanup() +{ + cleanup + umount $PWD/mnt +} + +atf_init_test_cases() +{ + atf_add_test_case remove_lun_with_atime +} From nobody Sun Jun 15 15:56:27 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bKyRb282tz5pdxX; Sun, 15 Jun 2025 15:56:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bKyRb1g6Rz3TgY; Sun, 15 Jun 2025 15:56:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750002987; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=atXM7thZE4M0rOEH7mHUpNnDMMnQ5ScczkHNULBf0NE=; b=C/pYxW5F6yqq8NtNH00+Qe1JSyCvzwk8uGVAOlBWK/h/0bNhysfV1ZlwxAiDb4zJjCOYtM uxTZM4mwO3rGu9I/bKNf12SDov79E6lCSVNDEyoVdGUONDyU0zWRiUWcuKdCkyD3HmwYuH I+2FJEmwvS8M9YAdXVSzy945kGCpEj1elV4rB2pYDIUhRfT9nIiW8JnBJrr7BX/5NeIzjt 0WzF+brzU0jUwMdOHGdum4fSq/qNr4rpalcQzbD6mUzfS9f/PKZC9iwEFBI85u/nzasoIx LPsCmuFY3zsLLl7JvT65qBo/9RWrmhWPI+WbkPm7RA3jMh3QO5NIDKHLPgsHAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750002987; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=atXM7thZE4M0rOEH7mHUpNnDMMnQ5ScczkHNULBf0NE=; b=J9LO8g3iJX8Q0hFaPNq6ggZUaDhiJlNYwj7stoFiDN3UCKGY0roHvitbzU7r+nyvrVDpsp PPTXK7LUd126RQdeYWuDGa/RX989dshT6/iNv9G3i3DdLziFd2kbYclSHQjj2XBPd63rzU tRne0WyoTwzL/Ognngy2OKyZRcthsw5ObFNJV3WxUJYFCQx9849AkuBgLk6+O0eocwA8pc qh22fVIrjbLwVdJvx216x6WeUOOdYqvPczRib6h4gVKgfTpeHiy2THLIP1uB35wb/60MgY 14y4953Q+bMlbvBVpwtWu94nX3bgXqrTyPPWJR8pt49rRVG2wKOv8ZHokWFFHA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750002987; a=rsa-sha256; cv=none; b=R4bKV5DLlItkFIMHnuBktc/e0yJv+GNisRGc2l5hWRadKs8o5GTGpl9a/utqzSd6+VRHIt FgqaclAnJJteefMxXTOzGGp0gWMaNF7WYIDfPM6cMnKgkjhb7OEABJIH+IUc52n/k0BCqt OSpBmQtCz3Zh6zO19HN3KAADaY/88JIldEufLN4YN4z6g5nW1z4wNIU+B1LcfED0SkfT66 92JKS+xbUSqA2X3ZqO7QxYzXwh4iwsAbu5V4+uNgITWOplOK7J55jCAWR3Le9UM6Atdgx0 mvLnL+9B8+DH66JilK3IY/yl0TqpEp8NgD11bZBgr9Y2xwJ3rMi9croJdJm+3Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bKyRb19Xhz45G; Sun, 15 Jun 2025 15:56:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55FFuRKU029036; Sun, 15 Jun 2025 15:56:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55FFuRQg029033; Sun, 15 Jun 2025 15:56:27 GMT (envelope-from git) Date: Sun, 15 Jun 2025 15:56:27 GMT Message-Id: <202506151556.55FFuRQg029033@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: ece617cda6b5 - main - ctl: add ATF tests for SCSI PERSISTENT RESERVE IN/OUT List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ece617cda6b5999e6e57c2227f98c18c1ca1d79d Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=ece617cda6b5999e6e57c2227f98c18c1ca1d79d commit ece617cda6b5999e6e57c2227f98c18c1ca1d79d Author: Alan Somers AuthorDate: 2024-10-03 21:52:44 +0000 Commit: Alan Somers CommitDate: 2025-06-15 15:55:15 +0000 ctl: add ATF tests for SCSI PERSISTENT RESERVE IN/OUT These commands are complicated, and the test suite isn't complete. But it's a start. And it includes a regression test for HYP-08 (commit 64b0f52be2c9d7bcecebfeef393f8ec56cb85f47). MFC after: 2 weeks Security: HYP-08 Sponsored by: ConnectWise Differential Revision: https://reviews.freebsd.org/D46947 --- tests/sys/cam/ctl/Makefile | 6 + tests/sys/cam/ctl/persist.sh | 349 ++++++++++++++++++++++++++++ tests/sys/cam/ctl/prout_register_huge_cdb.c | 88 +++++++ 3 files changed, 443 insertions(+) diff --git a/tests/sys/cam/ctl/Makefile b/tests/sys/cam/ctl/Makefile index 1333397af464..05f0831fc8b0 100644 --- a/tests/sys/cam/ctl/Makefile +++ b/tests/sys/cam/ctl/Makefile @@ -1,13 +1,19 @@ PACKAGE= tests TESTSDIR= ${TESTSBASE}/sys/cam/ctl +BINDIR=${TESTSDIR} ${PACKAGE}FILES+= ctl.subr +ATF_TESTS_SH+= persist ATF_TESTS_SH+= prevent ATF_TESTS_SH+= read_buffer ATF_TESTS_SH+= start_stop_unit +PROGS+= prout_register_huge_cdb +LIBADD+= cam +CFLAGS+= -I${SRCTOP}/sys + # Must be exclusive because it disables/enables camsim TEST_METADATA+= is_exclusive="true" diff --git a/tests/sys/cam/ctl/persist.sh b/tests/sys/cam/ctl/persist.sh new file mode 100644 index 000000000000..2a350ee4775a --- /dev/null +++ b/tests/sys/cam/ctl/persist.sh @@ -0,0 +1,349 @@ +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2024 ConnectWise +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS DOCUMENTATION IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +. $(atf_get_srcdir)/ctl.subr + +# TODO +# * PRIN READ RESERVATION, with one reservation +# * PROUT with illegal type +# * PROUT REGISTER AND IGNORE EXISTING KEY +# * PROUT REGISTER AND IGNORE EXISTING KEY with a RESERVATION KEY that isn't registered +# * PROUT REGISTER AND IGNORE EXISTING KEY to unregister +# * PROUT CLEAR allows previously prevented medium removal +# * PROUT PREEMPT +# * PROUT PREEMPT with a RESERVATION KEY that isn't registered +# * PROUT PREEMPT_AND_ABORT +# * PROUT PREEMPT_AND_ABORT with a RESERVATION KEY that isn't registered +# * PROUT REGISTER AND MOVE +# * PROUT REGISTER AND MOVE with a RESERVATION KEY that isn't registered +# * multiple initiators + +# Not Tested +# * PROUT REPLACE LOST RESERVATION (not supported by ctl) +# * Specify Initiator Ports bit (not supported by ctl) +# * Activate Persist Through Power Loss bit (not supported by ctl) +# * All Target Ports bit (not supported by ctl) + +RESERVATION_KEY=0xdeadbeef1a7ebabe + +atf_test_case prin_read_full_status_empty cleanup +prin_read_full_status_empty_head() +{ + atf_set "descr" "PERSISTENT RESERVATION IN with the READ FULL STATUS service action, with no status descriptors" + atf_set "require.user" "root" + atf_set "require.progs" sg_persist ctladm +} +prin_read_full_status_empty_body() +{ + create_ramdisk + + atf_check -o match:"No full status descriptors" sg_persist -ns /dev/$dev +} +prin_read_full_status_empty_cleanup() +{ + cleanup +} + +atf_test_case prin_read_keys_empty cleanup +prin_read_keys_empty_head() +{ + atf_set "descr" "PERSISTENT RESERVATION IN with the READ KEYS service action, with no registered keys" + atf_set "require.user" "root" + atf_set "require.progs" sg_persist ctladm +} +prin_read_keys_empty_body() +{ + create_ramdisk + + atf_check -o match:"there are NO registered reservation keys" sg_persist -nk /dev/$dev +} +prin_read_keys_empty_cleanup() +{ + cleanup +} + +atf_test_case prin_read_reservation_empty cleanup +prin_read_reservation_empty_head() +{ + atf_set "descr" "PERSISTENT RESERVATION IN with the READ RESERVATION service action, with no reservations" + atf_set "require.user" "root" + atf_set "require.progs" sg_persist ctladm +} +prin_read_reservation_empty_body() +{ + create_ramdisk + + atf_check -o match:"there is NO reservation held" sg_persist -nr /dev/$dev +} +prin_read_reservation_empty_cleanup() +{ + cleanup +} + +atf_test_case prin_report_capabilities cleanup +prin_report_capabilities_head() +{ + atf_set "descr" "PERSISTENT RESERVATION IN with the REPORT CAPABILITIES service action" + atf_set "require.user" "root" + atf_set "require.progs" sg_persist ctladm +} +prin_report_capabilities_body() +{ + create_ramdisk + + cat > expected < expected <> + scope: LU_SCOPE, type: Exclusive Access, all registrants + Transport Id of initiator: + Parallel SCSI initiator SCSI address: 0x1 + relative port number (of corresponding target): 0x0 +HERE + atf_check -o file:expected sg_persist -ns /dev/$dev +} +prout_reserve_cleanup() +{ + cleanup +} + +atf_test_case prout_reserve_bad_scope cleanup +prout_reserve_bad_scope_head() +{ + atf_set "descr" "PERSISTENT RESERVATION OUT will be rejected with an unknown scope field" + atf_set "require.user" "root" + atf_set "require.progs" sg_persist camcontrol ctladm +} +prout_reserve_bad_scope_body() +{ + create_ramdisk + # First register a key + atf_check sg_persist -n --out --param-rk=0 --param-sark=$RESERVATION_KEY -G /dev/$dev + + # Then make a reservation using that key + atf_check -s exit:1 -e match:"ILLEGAL REQUEST asc:24,0 .Invalid field in CDB." camcontrol persist $dev -o reserve -k $RESERVATION_KEY -T read_shared -s 15 -v + + # Finally, check that nothing has been reserved + atf_check -o match:"there is NO reservation held" sg_persist -nr /dev/$dev +} +prout_reserve_bad_scope_cleanup() +{ + cleanup +} + + +atf_init_test_cases() +{ + atf_add_test_case prin_read_full_status_empty + atf_add_test_case prin_read_keys_empty + atf_add_test_case prin_read_reservation_empty + atf_add_test_case prin_report_capabilities + atf_add_test_case prout_clear + atf_add_test_case prout_register + atf_add_test_case prout_register_duplicate + atf_add_test_case prout_register_huge_cdb + atf_add_test_case prout_register_unregister + atf_add_test_case prout_release + atf_add_test_case prout_reserve + atf_add_test_case prout_reserve_bad_scope +} diff --git a/tests/sys/cam/ctl/prout_register_huge_cdb.c b/tests/sys/cam/ctl/prout_register_huge_cdb.c new file mode 100644 index 000000000000..f57a6abfadd6 --- /dev/null +++ b/tests/sys/cam/ctl/prout_register_huge_cdb.c @@ -0,0 +1,88 @@ +/* + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 ConnectWise + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS DOCUMENTATION IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * Helper that sends a PERSISTENT RESERVATION OUT command to CTL with a + * ridiculously huge size for the length of the CDB. This is not possible with + * ctladm, for good reason. + */ +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +int +main(int argc, char **argv) +{ + union ctl_io *io; + int fd = open("/dev/cam/ctl", O_RDWR); + int r; + uint32_t targ_port; + + if (argc < 2) + errx(2, "usage: prout_register_huge_cdb \n"); + + targ_port = strtoul(argv[1], NULL, 10); + + io = calloc(1, sizeof(*io)); + io->io_hdr.nexus.initid = 7; /* 7 is ctladm's default initiator id */ + io->io_hdr.nexus.targ_port = targ_port; + io->io_hdr.nexus.targ_mapped_lun = 0; + io->io_hdr.nexus.targ_lun = 0; + io->io_hdr.io_type = CTL_IO_SCSI; + io->taskio.tag_type = CTL_TAG_UNTAGGED; + uint8_t cdb[32] = {}; + // ctl_persistent_reserve_out// 5f 00 + cdb[0] = 0x5f; + cdb[1] = 0x00; + struct scsi_per_res_out *cdb_ = ( struct scsi_per_res_out *)cdb; + // Claim an enormous size of the CDB, but don't actually alloc it all. + cdb_->length[0] = 0xff; + cdb_->length[1] = 0xff; + cdb_->length[2] = 0xff; + cdb_->length[3] = 0xff; + io->scsiio.cdb_len = sizeof(cdb); + memcpy(io->scsiio.cdb, cdb, sizeof(cdb)); + io->io_hdr.flags |= CTL_FLAG_DATA_IN; + r = ioctl(fd, CTL_IO, io); + if (r == -1) + err(1, "ioctl"); + if ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS) { + return (0); + } else { + return (1); + } +} From nobody Sun Jun 15 16:02:28 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bKyZX51scz5pf04; Sun, 15 Jun 2025 16:02:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bKyZX32pwz3Xpv; Sun, 15 Jun 2025 16:02:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750003348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RM6Epq55nzOapdyzdr/wNvIAGTK6tjVWkoP7mqRPfFo=; b=vriVWsciP58GAAARY07xfT0oH08U1/kEpVM/veI5Ecp44AEUNmWc2hI9/PREpnHoR0twWQ Fm5L2v7HxDcmEMM6ZZDOQNzWfS2F/D8PHFfsDyuTA0m36wWCnoTuwEBO7AaZWliCmJFoL8 z2RvT+hzhj2UVUEYLv4+jT1Rpx+U2zbVOEE5QkoTU69zyhtl61SLvt/uY//YMMSUi2ro1+ u3J2PLpaOpwJDdYhyr/rigDARFMCIUt4waiKLQLAoOdRCqlABP62x4Ik5/AZYNitv0uO+0 gDvEOaEmJ0aUlo6Uu47yWgJBDb+Q38W3pKpKj5evTn0QocnQf5GKHtJvFBPLkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750003348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RM6Epq55nzOapdyzdr/wNvIAGTK6tjVWkoP7mqRPfFo=; b=byljqPpjlaztOLdZN7NrMTiiV6Ka1ZJXJX7RN8ZXzIy9ORAfY9v8TmSjHnSPyIokXqxbKe YmdSRH44rF2DI3f/QCFqNVsN0UkJZHAKCo2A3MYcAyQvSGAoRpryGQmU1/8zWIB2xAPVwc vkc4OPMeZ0RkM3KUF9fq0XK/1b/Zy5ZsVaXP8AlPt/N8b+gtc7czhBix4XeD8/ZZTUom1h 5gx2WbGcQf7doHeRYMbsMlk5lpZglRREQFylQY/dOj6DdMWXexKOZW1ApcNh2o5cZjDAbk zAsvH0A2t3m+EuQ1U5fMwBS3dTMHQIS/i2cicvaPGK4BbkORoTJelmT5gWwnbA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750003348; a=rsa-sha256; cv=none; b=Pfd3rtmGb2+mC0U2g36NsDqpdaySBPLXZFCVeTILhzOq7pzpJ6me8xA/mnYa1SryEIiTwx FzFb9A+293rX+L76eIzDDD+JDSoAcfblrpeV5CVn4KNtZ90btqVXhVsK/KBA5Sg6Z99zIG Ye1PPbhNX5uqV6pwWPcdlar1Bo7rdXXjod9fL6kaiO4r4KQ2th2KvNc/wthXz1gwb8qUG9 0J9i/WUHwZIjuRfkE1TKvZ2E8b+mb2+fJSluw2ke4J4BrOMM8YvybpU9GCUnjW5TtK4goF Cw9qKq8Zs+TO+y4DxKO5MG2/kYvNlj07StsNJYPgWjErXAUN7GXVpkRJoQUmjA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bKyZX2dyjz4HR; Sun, 15 Jun 2025 16:02:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55FG2S36047775; Sun, 15 Jun 2025 16:02:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55FG2SHe047772; Sun, 15 Jun 2025 16:02:28 GMT (envelope-from git) Date: Sun, 15 Jun 2025 16:02:28 GMT Message-Id: <202506151602.55FG2SHe047772@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: 5c1ba994a8bc - main - Add a regression test for a libtpool bug List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5c1ba994a8bcb6676ea3d1bb21b072b90e2d3ae9 Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=5c1ba994a8bcb6676ea3d1bb21b072b90e2d3ae9 commit 5c1ba994a8bcb6676ea3d1bb21b072b90e2d3ae9 Author: Alan Somers AuthorDate: 2024-05-07 17:48:33 +0000 Commit: Alan Somers CommitDate: 2025-06-15 16:01:37 +0000 Add a regression test for a libtpool bug Test that tpool_dispatch returns an error if it cannot start even one worker. Previously, it would hang. The test must reside here rather than in the OpenZFS repo because the latter has no infrastructure for writing libtpool tests. https://github.com/openzfs/zfs/issues/16172 MFC after: 2 weeks Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D45587 --- cddl/lib/libtpool/Makefile | 5 +++ cddl/lib/libtpool/tests/Makefile | 12 +++++ cddl/lib/libtpool/tests/libtpool_test.c | 78 +++++++++++++++++++++++++++++++++ etc/mtree/BSD.tests.dist | 2 + 4 files changed, 97 insertions(+) diff --git a/cddl/lib/libtpool/Makefile b/cddl/lib/libtpool/Makefile index 2afaf0c417e9..3ab625dd306b 100644 --- a/cddl/lib/libtpool/Makefile +++ b/cddl/lib/libtpool/Makefile @@ -22,4 +22,9 @@ CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccomp CFLAGS+= -DHAVE_ISSETUGID CFLAGS+= -include ${SRCTOP}/sys/modules/zfs/zfs_config.h +.include + +HAS_TESTS= +SUBDIR.${MK_TESTS}+= tests + .include diff --git a/cddl/lib/libtpool/tests/Makefile b/cddl/lib/libtpool/tests/Makefile new file mode 100644 index 000000000000..d87f5fc86789 --- /dev/null +++ b/cddl/lib/libtpool/tests/Makefile @@ -0,0 +1,12 @@ +ZFSTOP= ${SRCTOP}/sys/contrib/openzfs + +ATF_TESTS_C+= libtpool_test + +TEST_METADATA+= timeout="10" + +CFLAGS+= -I${ZFSTOP}/include \ + -I${ZFSTOP}/lib/libspl/include + +LIBADD+= pthread tpool + +.include diff --git a/cddl/lib/libtpool/tests/libtpool_test.c b/cddl/lib/libtpool/tests/libtpool_test.c new file mode 100644 index 000000000000..42726a13420c --- /dev/null +++ b/cddl/lib/libtpool/tests/libtpool_test.c @@ -0,0 +1,78 @@ +#include +#include +#include +#include + +#include + +#include + +static void +tp_delay(void *arg) +{ + pthread_barrier_t *barrier = arg; + + /* Block this task until all thread pool workers have been created. */ + pthread_barrier_wait(barrier); +} + +/* + * NB: we could reduce the test's resource cost by using rctl(4). But that + * isn't enabled by default. And even with a thread limit of 1500, it takes < + * 0.1s to run on my machine. So I don't think it's worth optimizing for the + * case where rctl is available. + */ +ATF_TC(complete_exhaustion); +ATF_TC_HEAD(complete_exhaustion, tc) +{ + atf_tc_set_md_var(tc, "descr", + "A thread pool should fail to schedule tasks if it is completely impossible to spawn any threads."); +} + +ATF_TC_BODY(complete_exhaustion, tc) +{ + pthread_barrier_t barrier; + tpool_t *tp0, *tp1; + size_t len; + int max_threads_per_proc = 0; + int nworkers; + int r, i; + + + len = sizeof(max_threads_per_proc); + r = sysctlbyname("kern.threads.max_threads_per_proc", + &max_threads_per_proc, &len, NULL, 0); + ATF_REQUIRE_EQ_MSG(r, 0, "sysctlbyname: %s", strerror(errno)); + nworkers = max_threads_per_proc - 1; + pthread_barrier_init(&barrier, NULL, max_threads_per_proc); + + /* + * Create the first thread pool and spawn the maximum allowed number of + * processes. + */ + tp0 = tpool_create(nworkers, nworkers, 1, NULL); + ATF_REQUIRE(tp0 != NULL); + for (i = 0; i < nworkers; i++) { + ATF_REQUIRE_EQ(tpool_dispatch(tp0, tp_delay, &barrier), 0); + } + + /* + * Now create a second thread pool. Unable to create new threads, the + * dispatch function should return an error. + */ + tp1 = tpool_create(nworkers, 2 * nworkers, 1, NULL); + ATF_REQUIRE(tp1 != NULL); + ATF_REQUIRE_EQ(tpool_dispatch(tp1, tp_delay, NULL), -1); + + /* Cleanup */ + ATF_REQUIRE_EQ(pthread_barrier_wait(&barrier), 0); + tpool_wait(tp1); + tpool_wait(tp0); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, complete_exhaustion); + + return (atf_no_error()); +} diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index bfd21607ed4d..7d21dcbd2cbf 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -80,6 +80,8 @@ .. cddl lib + libtpool + .. .. sbin .. From nobody Sun Jun 15 21:23:24 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bL5hr6Vrbz5q4G1; Sun, 15 Jun 2025 21:23:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bL5hr5L06z3YZl; Sun, 15 Jun 2025 21:23:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750022604; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=COJeL7hSypGgDjElQPLGTtVeFheEb1wQ/HtTP15j+Pc=; b=usATgNPNptfrZ8gc4joALlY6Hos7HqJ9lnGsNy+ob7/dnFOqxYSIPqnX+V4OXFlxJFLMKz Sf99ngGFaVNFRLCjbrVz5bNDRiaijiTnuRXzhznuQvtkPqPOMNpNcyCtYk9C7hhCz8YyKq fsQhQnYeRFwGxULnK96eQa/DUeyX5cSTF5dZADBqaE9kcNkkqKJPx1Ea5NnGj2n5xXV6oF VxhE+qTOxoeaeYMtyzlDopOSbqxGs0gytZx5t7/M3BOUhO6aER/zeSHlbfb/OkaLs+xN0/ uM8IvLd7Tajk1h/g3vb3HTtIupRCcX7LCUMIQycuWQ/YhE0PfTzkJWb7anQabw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750022604; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=COJeL7hSypGgDjElQPLGTtVeFheEb1wQ/HtTP15j+Pc=; b=Gg/td6UKhA4GGZfevvdbnFxMzGN2yys825dA+3mqjmfQ5mUct6LDqloQ48yYGdNJMKgNQq N4JLOpKiaMTR3Vkt3rn3tvXD0Z6ws6Ohk+/AET6juMSgau/Qlmku0IcvVW23efZuneGymn xT4XafwOVt07ZxQaBpZqH21/boHFaA82mMqvFbqz7dd8d4ExsmsNofb8g/KdRCrWy8A99M 4WSXJFA7dZmC59fENU/vbR+M/eCib1/WrjJf2iu1IB3jKu+r4Yy/ozlFqfy2aAPGqCQRcy 5BrxtkNYaGq7/Ddy9/S+96Tykfv/pfOduOvTaEprzw++mS0FGBe0qAWZNFZqaw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750022604; a=rsa-sha256; cv=none; b=xirDxUTdLybb3NJgyOUmaP0i3mnCn10JHOONR9XKhXMvSg4Vz/avtK5b6Mor7HihJRnnu8 uvYNHwovqmA3Kn8OAzBUaqYC+gOfXuFkYHlDd0Xq4vL8FdJCJxQpZPS0SPFLkka8FLAmZV 6eJCOaalv64mmPlFSKFTaVLMM0zCfqPuZDMHBL11QfycJqSePaO79RbNuGqjHwUjfMs7Lk VfpBuTsAuzSI9kwa35J196quyrruYaEYhKnX2aXAN5gUHIHgOFmSPpBcliT7Q3fIjGGgV2 5u/XylevwM5yv4PPnhz6wkXx7YCXmuwh6KXvp00ZkChJzwlV0Aslmo7kxw6XKg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bL5hr4p0czTZW; Sun, 15 Jun 2025 21:23:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55FLNOAl049138; Sun, 15 Jun 2025 21:23:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55FLNO0c049135; Sun, 15 Jun 2025 21:23:24 GMT (envelope-from git) Date: Sun, 15 Jun 2025 21:23:24 GMT Message-Id: <202506152123.55FLNO0c049135@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: c48077d54da6 - main - vm_map: drop vm_map_simplify_entry.9 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c48077d54da618bb1efb9213ab3759be6f59d4f1 Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=c48077d54da618bb1efb9213ab3759be6f59d4f1 commit c48077d54da618bb1efb9213ab3759be6f59d4f1 Author: Doug Moore AuthorDate: 2025-06-15 21:21:44 +0000 Commit: Doug Moore CommitDate: 2025-06-15 21:23:15 +0000 vm_map: drop vm_map_simplify_entry.9 A change in 2019 removed the function vm_map_simplify_entry(), but failed to remove the manual page that documents it. As that was an internal function not meant to be used outside the kernel, the manual page is dropped, and a new manual page for the function that replaced it is not added. Reported by: pfg Reviewed by: alc Fixes: 83ea714f4fca ("vm_map_simplify_entry considers merging") Differential Revision: https://reviews.freebsd.org/D50861 --- ObsoleteFiles.inc | 3 ++ share/man/man9/Makefile | 1 - share/man/man9/vm_map.9 | 1 - share/man/man9/vm_map_simplify_entry.9 | 59 ---------------------------------- 4 files changed, 3 insertions(+), 61 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 8f5da0483a87..10ce9c7661de 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20250615: don't install man page for absent function +OLD_FILES+=usr/share/man/man9/vm_map_simplify_entry.9.gz + # 20250521: don't install zoneinfo version OLD_FILES+=usr/share/zoneinfo/version diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index f7cd206126d6..badaee1479f7 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -393,7 +393,6 @@ MAN= accept_filter.9 \ vm_map_max.9 \ vm_map_protect.9 \ vm_map_remove.9 \ - vm_map_simplify_entry.9 \ vm_map_stack.9 \ vm_map_submap.9 \ vm_map_sync.9 \ diff --git a/share/man/man9/vm_map.9 b/share/man/man9/vm_map.9 index 9f41a24541b1..d08d54bd1004 100644 --- a/share/man/man9/vm_map.9 +++ b/share/man/man9/vm_map.9 @@ -323,7 +323,6 @@ is backed by a .Xr vm_map_pmap 9 , .Xr vm_map_protect 9 , .Xr vm_map_remove 9 , -.Xr vm_map_simplify_entry 9 , .Xr vm_map_stack 9 , .Xr vm_map_submap 9 , .Xr vm_map_sync 9 , diff --git a/share/man/man9/vm_map_simplify_entry.9 b/share/man/man9/vm_map_simplify_entry.9 deleted file mode 100644 index 0e99596d067e..000000000000 --- a/share/man/man9/vm_map_simplify_entry.9 +++ /dev/null @@ -1,59 +0,0 @@ -.\" -.\" Copyright (c) 2003 Bruce M Simpson -.\" All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -.\" SUCH DAMAGE. -.\" -.Dd July 19, 2003 -.Dt VM_MAP_SIMPLIFY_ENTRY 9 -.Os -.Sh NAME -.Nm vm_map_simplify_entry -.Nd simplify a -.Vt vm_map_entry -.Sh SYNOPSIS -.In sys/param.h -.In vm/vm.h -.In vm/vm_map.h -.Ft void -.Fn vm_map_simplify_entry "vm_map_t map" "vm_map_entry_t entry" -.Sh DESCRIPTION -The -.Fn vm_map_simplify_entry -function simplifies the given -.Fa entry -by merging with either neighbour. -The -.Fa map -must be locked upon entry. -.Pp -This function also has the ability to merge with both neighbours. -.Pp -This function guarantees that the passed entry remains valid, although -possibly extended. -.Sh SEE ALSO -.Xr vm_map 9 , -.Xr vm_map_insert 9 , -.Xr vm_map_remove 9 -.Sh AUTHORS -This manual page was written by -.An Bruce M Simpson Aq Mt bms@spc.org . From nobody Sun Jun 15 23:27:24 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bL8S71JDTz5y7gF for ; Sun, 15 Jun 2025 23:27:35 +0000 (UTC) (envelope-from j_yoon.choi@samsung.com) Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mailout4.samsung.com", Issuer "DigiCert Global G2 TLS RSA SHA256 2020 CA1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bL8S636fTz3sJg for ; Sun, 15 Jun 2025 23:27:34 +0000 (UTC) (envelope-from j_yoon.choi@samsung.com) Authentication-Results: mx1.freebsd.org; none Received: from epcas2p3.samsung.com (unknown [182.195.41.55]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20250615232726epoutp04016bad7766a03ae076677f54f4e0ed23~JWw4bcWPx0952609526epoutp04c for ; Sun, 15 Jun 2025 23:27:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20250615232726epoutp04016bad7766a03ae076677f54f4e0ed23~JWw4bcWPx0952609526epoutp04c DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1750030046; bh=/7s6kFrFjAYLNIjEBFaya/Hu+rKfWBF7rSJG4Eq4T0w=; h=Date:Subject:Reply-To:From:To:CC:In-Reply-To:References:From; b=CS/UrQ0PaxzmxnQnpdSSjZA6hrPlt60zSJ3EvIXoBULb2Mv/SkNBk+B8UMkLWiTmK fSfBaAgHS3gCudZTb3xqWtPYKS+aZElimV/IRRHYtc8ChHiJe4RR7ROh1KMvMcBIsx Xs8KISW3e3kT1+tqr8bO3IqtlOfxxvezSuJR/53E= Received: from epsnrtp03.localdomain (unknown [182.195.42.155]) by epcas2p3.samsung.com (KnoxPortal) with ESMTPS id 20250615232725epcas2p3cafbd0cfab9f3bfa451ac0cd86a0ccdd~JWw3xn5-A0199701997epcas2p3Y; Sun, 15 Jun 2025 23:27:25 +0000 (GMT) Received: from epcas2p1.samsung.com (unknown [182.195.36.97]) by epsnrtp03.localdomain (Postfix) with ESMTP id 4bL8Rx00gbz3hhT9; Sun, 15 Jun 2025 23:27:25 +0000 (GMT) Date: Mon, 16 Jun 2025 08:27:24 +0900 Message-ID: <446616643.2635777.1750030044474@v8mail-kr2-0.v8mail-kr2.knoxportal-kr-prod-green.svc.cluster.local> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 Subject: RE: Re: git: 1349a733cf28 - main - ufshci: Introduce the ufshci(4) driver Reply-To: j_yoon.choi@samsung.com From: Jaeyoon Choi To: A FreeBSD User , "Bjoern A. Zeeb" CC: Warner Losh , Jaeyoon Choi , "src-committers@FreeBSD.org" , "dev-commits-src-all@FreeBSD.org" , "dev-commits-src-main@FreeBSD.org" X-Priority: 3 X-Content-Kind-Code: NORMAL In-Reply-To: <20250615135324.2fa38fba@thor.sb211.local> X-CPGS-Detection: blocking_info_exchange X-Drm-Type: N,general X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N X-CMS-MailID: 20250615232724epcms2p23bafb40ecaa1a171b8192d9c10419682 Content-Type: multipart/mixed; boundary="----=_Part_2635776_1656598423.1750030044474" X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P cpgsPolicy: CPGSC10-223,Y X-CFilter-Loop: Reflected X-CMS-RootMailID: 20250615115418epcas2p2819354750666b01748ce41d903f25ca0 References: <20250615135324.2fa38fba@thor.sb211.local> <202506150609.55F69dn3021406@gitrepo.freebsd.org> <20250615103251.2221265b@thor.sb211.local> <95r7ros1-5296-8orq-sqp5-s7p4935p6039@SerrOFQ.bet> X-Rspamd-Queue-Id: 4bL8S636fTz3sJg X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6619, ipnet:203.254.224.0/24, country:KR] ------=_Part_2635776_1656598423.1750030044474 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" Am Tage des Herren Sun, 15 Jun 2025 09:28:38 +0000 (UTC) > "Bjoern A. Zeeb" schrieb: > > > On Sun, 15 Jun 2025, A FreeBSD User wrote: > > > > > Am Tage des Herren Sun, 15 Jun 2025 06:09:39 GMT > > > Warner Losh schrieb: > > > > > >> The branch main has been updated by imp: > > >> > > >> URL: https://cgit.FreeBSD.org/src/commit/?id=1349a733cf2828e0040cabef89eeadc3ff00c40b > > >> > > >> commit 1349a733cf2828e0040cabef89eeadc3ff00c40b > > >> Author: Jaeyoon Choi > > >> AuthorDate: 2025-06-13 18:33:01 +0000 > > >> Commit: Warner Losh > > >> CommitDate: 2025-06-15 06:08:56 +0000 > > >> > > >> ufshci: Introduce the ufshci(4) driver > > >> > > >> This commit adds a storage driver that supports the Universal Flash > > >> Storage Host Controller Interface (UFSHCI) on FreeBSD. > > >> > > >> Universal Flash Storage (UFS) is a flash-based mobile storage device > > >> that replaces eMMC, aiming for high performance with low power. The UFS > > >> Host Controller Interface (UFSHCI) is the host side controller and > > >> connects UFS device to a system bus, such as PCIe. > > >> > > >> The code targets the latest standards: > > >> - UFS 4.1: https://protect2.fireeye.com/v1/url?k=cb832e5e-aafec626-cb82a511-74fe485fffb1-e312001ade8edb13&q=1&e=a7ecea84-b060-48ec-b5d3-c775104b7c66&u=https%3A%2F%2Fwww.jedec.org%2Fstandards-documents%2Fdocs%2Fjesd220g > > >> - UFSHCI 4.1: https://protect2.fireeye.com/v1/url?k=b4fdaf27-d580475f-b4fc2468-74fe485fffb1-dfdf98856594733e&q=1&e=a7ecea84-b060-48ec-b5d3-c775104b7c66&u=https%3A%2F%2Fwww.jedec.org%2Fstandards-documents%2Fdocs%2Fjesd223f > > >> > > >> The ufshci(4) driver implements controller/device initialization, > > >> interrupt, single-doorbell(SDB) queue based IO requests. Support for > > >> multi-queue (MCQ) IO requests is planned for a later commit. > > >> > > >> Implemented features: > > >> - PCIe bus support > > >> - legacy(INTx) Interrupt Handling > > >> - UIC command support > > >> - UTP Transfer Request (UTR) support > > >> - UTP Task Management Request (UTMR) support > > >> - single doorbell queue (SDB) with multiple queue depth > > >> - SCSI command set support > > >> - sysctl > > >> > > >> Work in progress: > > >> - multi-Circular Queue (per-CPU IO queues) > > >> - MSI-X interrupt Support > > >> - write booster > > >> - write Protect > > >> - Host Performance Booster (HPB) > > >> - interrupt aggregation > > >> - ARM based system bus support > > >> - ufs-utils port > > >> > > >> Tests were performed on QEMU and an Intel-based laptop. > > >> Since QEMU has an emulated UFS device, I tested on QEMU. > > >> > > >> How to test on QEMU: > > >> 1. Run QEMU > > >> $ qemu-system-x86_64 ... -device ufs -drive > > >> file=blk1g.bin,format=raw,if=none,id=luimg -device ufs-lu,drive=luimg,lun=0 2. > > >> Loading/unloading the ufshci module on QEMU $ kldload > > >> /usr/obj/usr/src/amd64.amd64/sys/modules/ufshci/ufshci.ko $ kldunload ufshci > > >> > > >> Testing on real hardware: > > >> - Samsung Galaxy Book S (Intel Lakefield) with UFS 3.0 > > >> - Lenovo duet 3 11ian8 (Intel N100) with UFS 2.1 > > >> > > >> Sponsored by: Samsung Electronics > > >> Reviewed by: imp > > >> Differential Revision: https://reviews.freebsd.org/D50370 > > >> --- > > >> sbin/camcontrol/camcontrol.c | 13 + > > > > > > It seems changes to sources breaks buildkernel (at least for me) on customized kernel > > > config: > > > > > > [...] > > > --- camcontrol.pieo --- > > > /usr/src/sbin/camcontrol/camcontrol.c:5407:23: error: use of undeclared identifier > > > 'CTS_UFSHCI_VALID_MODE' --- all_subdir_bin --- > > > --- all_subdir_bin/sleep --- > > > ===> bin/sleep (all) > > > --- all_subdir_sbin --- > > > 5407 | if (ufshci->valid & CTS_UFSHCI_VALID_MODE) { > > > | ^ > > > [...] > > > > > > Kind regards, > > > > > > I am running a test build just to be sure but I think this should do: > > > > commit 78f12afc38eabea82fd247c157d340e289dceeb8 > > Author: Bjoern A. Zeeb > > AuthorDate: Sun Jun 15 09:25:56 2025 +0000 > > Commit: Bjoern A. Zeeb > > CommitDate: Sun Jun 15 09:25:56 2025 +0000 > > > > ufshci: camcontrol: use correct define to fix the build > > > > Fixes: 1349a733cf28 > > > > diff --git sbin/camcontrol/camcontrol.c sbin/camcontrol/camcontrol.c > > index 19684c044ef5..15a5d42a2ba5 100644 > > --- sbin/camcontrol/camcontrol.c > > +++ sbin/camcontrol/camcontrol.c > > @@ -5404,7 +5404,7 @@ cts_print(struct cam_device *device, struct ccb_trans_settings *cts) > > struct ccb_trans_settings_ufshci *ufshci = > > &cts->xport_specific.ufshci; > > > > - if (ufshci->valid & CTS_UFSHCI_VALID_MODE) { > > + if (ufshci->valid & CTS_UFSHCI_VALID_LINK) { > > fprintf(stdout, "%sHigh Speed Gear: %d (%d max)\n", > > pathstr, ufshci->hs_gear, ufshci->max_hs_gear); > > fprintf(stdout, "%sUnipro TX lanes: %d (%d max)\n", pathstr, > > > > > > > > > > Thank you very much, seems to work, at least, for me. > > Kind regards, > oh > Oh, that was my mistake, thanks for fixing it! Jaeyoon ------=_Part_2635776_1656598423.1750030044474 Content-Type: application/octet-stream Content-Disposition: attachment; filename="No File Name 0" Content-Transfer-Encoding: base64 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0NCg0KaUhVRUFSWUtBQjBXSVFSUWhlRHliVmt0 RzVlVy8xS3h6dnM4T3Fva3J3VUNhRTYwWUFBS0NSQ3h6dnM4T3Fvaw0KcjlDVUFQOWNXTEo3SnFT TjhkY2ZWNTBFbFNWZTExcGI2NXBDY0NsTTA3YzJCS0ZPQkFFQXRCWUdyczJaSURyTA0KVkxzeWVT VUY1Ulp1UTkzc3BNVVlvSDBzNXo1NUd3VT0NCj1XcFB0DQotLS0tLUVORCBQR1AgU0lHTkFUVVJF LS0tLS0NCg== ------=_Part_2635776_1656598423.1750030044474--