From nobody Sun Jun 4 00:46:25 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QYdN167HNz4ZJts; Sun, 4 Jun 2023 00:46:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QYdN154rJz3KMl; Sun, 4 Jun 2023 00:46:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685839585; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2Doa2M+3KMSMyx9FDan6WJh6lcD3rLUJN2e9IE6pB3A=; b=ZGCBI4hqooFkoOHLOVR/HD2+7shw4pz7Nq6z2ksJ9i4PThrkLPRpaYRJTYEN9DqbDDlsfC PC/LGUTxHAW9of/U5U1UUcoyuxn0ZHb6niqbe1X0QRA0kgUZv3CwF57JXhhcYoyjsYMf+v 9qVm67KxcIcMhG4fPH6QQk+JyMt1nUbL5zHcFN61GkNM5TWqwEMR1HwoEV2/uLzELWbadi xxlYSwWmNZUITn1Z0mjdWQ/udaSMiWia6tbUD5GylGvMowQBPy1R+qvmQQsPMN82MgUfe/ J54ZgXOE7dcluSEFKqmkM8ybvI6u5EeoLXWNSGFEQ7WYGCMQOmNGahRZfx6oVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685839585; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2Doa2M+3KMSMyx9FDan6WJh6lcD3rLUJN2e9IE6pB3A=; b=WOp0NlnAndQJIzdugAbxc4XJlzT4rPmVfyt+OsaFdVouLdu8WNK+TMC3i6DZUNEVVK4cMY BMylUR+3XXCGZ5QCJQnsu2Q6Iyc8czO/u3UG979OuseMbjZgq1ycI0GGR/MljozrQPzAkU nsnUzCalwUZ5WT2JwWgSUIdILxvKEoozf5zWD4MkLga4uxYttuAP68mXhiftDsosr1q7vN zKiiH5WyG6tkbr90pWJS3zkzLYm07r9L9jxB437+fTZ9hqyPnrf/FI3dTt5PLT7kkrfvBt EFStkHvH2dcETKzhcqIsXZmflLgKAEe55kr/4VecI9w1/XIfA8X1bKra2DEsWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685839585; a=rsa-sha256; cv=none; b=n/aEsHLVOyWMJEXqiB2pvQn6oB7ohbOQfMqqVv/RLIQMrHFpi5hE6BWA8P2S0OAfn6+nSU 4+8m1efEdLfxyjalLjaZYwoe2WlxwfTdE5fyhrLwcHA726P6pV3jCS7skNglrx4brYPL+X 9utoH2HVxXMzA4Npdaj+rrtoe96qHW206thYkQoSPGs/Z2lEzPSI3L+BA17IyONfai/oPU YOYwmb2pczAEJXN3dU1svP+12eYFUBI7Y7OLB/3OUvNT1guTCj3TbCLaQ2ZR+NnAgB7EOK G6oCcM4Y2aeW3RVE95KnUVGLmjixJh0RzebWPD2/qD6haiBn6Q+6cFtL384esg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QYdN1400rzmmk; Sun, 4 Jun 2023 00:46:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3540kPwG077838; Sun, 4 Jun 2023 00:46:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3540kPit077837; Sun, 4 Jun 2023 00:46:25 GMT (envelope-from git) Date: Sun, 4 Jun 2023 00:46:25 GMT Message-Id: <202306040046.3540kPit077837@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jamie Gritton Subject: git: 097db30a8e03 - main - jail: Allow nested jail definitions. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jamie X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 097db30a8e0310ac28075787fb92ea40dad8b27b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jamie: URL: https://cgit.FreeBSD.org/src/commit/?id=097db30a8e0310ac28075787fb92ea40dad8b27b commit 097db30a8e0310ac28075787fb92ea40dad8b27b Author: Jamie Gritton AuthorDate: 2023-06-04 00:45:54 +0000 Commit: Jamie Gritton CommitDate: 2023-06-04 00:45:54 +0000 jail: Allow nested jail definitions. Make the jail.conf specification recursive, with jail definitions allowed within a jail's parameter list, just as they are allowed at the top level. Such inner jails are part of the outer jail's hierarchy, as if they were specified with hierarchical names. --- usr.sbin/jail/jailp.h | 1 + usr.sbin/jail/jailparse.y | 65 +++++++++++++++++++++++++---------------------- 2 files changed, 36 insertions(+), 30 deletions(-) diff --git a/usr.sbin/jail/jailp.h b/usr.sbin/jail/jailp.h index 00865185fbd1..0325c2a101a4 100644 --- a/usr.sbin/jail/jailp.h +++ b/usr.sbin/jail/jailp.h @@ -176,6 +176,7 @@ struct cfjail { struct cfparams params; struct cfdepends dep[2]; struct cfjails *queue; + struct cfjail *cfparent; struct cfparam *intparams[IP_NPARAM]; struct cfstring *comstring; struct jailparam *jp; diff --git a/usr.sbin/jail/jailparse.y b/usr.sbin/jail/jailparse.y index 9426444f0d09..44e2aacb457e 100644 --- a/usr.sbin/jail/jailparse.y +++ b/usr.sbin/jail/jailparse.y @@ -38,11 +38,12 @@ __FBSDID("$FreeBSD$"); #ifdef DEBUG #define YYDEBUG 1 #endif + +static struct cfjail *current_jail; +static struct cfjail *global_jail; %} %union { - struct cfjail *j; - struct cfparams *pp; struct cfparam *p; struct cfstrings *ss; struct cfstring *s; @@ -52,8 +53,6 @@ __FBSDID("$FreeBSD$"); %token PLEQ %token STR STR1 VAR VAR1 -%type jail -%type param_l %type

param name %type value %type string @@ -61,46 +60,54 @@ __FBSDID("$FreeBSD$"); %% /* - * A config file is a series of jails (containing parameters) and jail-less - * parameters which really belong to a global pseudo-jail. + * A config file is a list of jails and parameters. Parameters are + * added to the current jail, otherwise to a global pesudo-jail. */ conf : - ; | conf jail - ; | conf param ';' { - struct cfjail *j; + struct cfjail *j = current_jail; - j = TAILQ_LAST(&cfjails, cfjails); - if (!j || strcmp(j->name, "*")) { - j = add_jail(); - j->name = estrdup("*"); + if (j == NULL) { + if (global_jail == NULL) { + global_jail = add_jail(); + global_jail->name = estrdup("*"); + } + j = global_jail; } TAILQ_INSERT_TAIL(&j->params, $2, tq); } | conf ';' + ; -jail : STR '{' param_l '}' +jail : jail_name '{' conf '}' { - $$ = add_jail(); - $$->name = $1; - TAILQ_CONCAT(&$$->params, $3, tq); - free($3); + current_jail = current_jail->cfparent; } ; -param_l : - { - $$ = emalloc(sizeof(struct cfparams)); - TAILQ_INIT($$); - } - | param_l param ';' - { - $$ = $1; - TAILQ_INSERT_TAIL($$, $2, tq); +jail_name : STR + { + struct cfjail *j = add_jail(); + + if (current_jail == NULL) + j->name = $1; + else { + /* + * A nested jail definition becomes + * a hierarchically-named sub-jail. + */ + size_t parentlen = strlen(current_jail->name); + j->name = emalloc(parentlen + strlen($1) + 2); + strcpy(j->name, current_jail->name); + j->name[parentlen++] = '.'; + strcpy(j->name + parentlen, $1); + free($1); + } + j->cfparent = current_jail; + current_jail = j; } - | param_l ';' ; /* @@ -131,8 +138,6 @@ param : name free($2); } | error - { - } ; /* From nobody Sun Jun 4 00:54:22 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QYdYH2kxPz4ZKQf; Sun, 4 Jun 2023 00:54:27 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta001.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QYdYG3tqMz3KkV; Sun, 4 Jun 2023 00:54:26 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4002a.ext.cloudfilter.net ([10.228.9.250]) by cmsmtp with ESMTP id 5TVcqmR3nLAoI5c0nqWKFQ; Sun, 04 Jun 2023 00:54:25 +0000 Received: from spqr.komquats.com ([70.66.148.124]) by cmsmtp with ESMTPA id 5c0lqs1xOyAOe5c0mqTagM; Sun, 04 Jun 2023 00:54:25 +0000 X-Authority-Analysis: v=2.4 cv=e5oV9Il/ c=1 sm=1 tr=0 ts=647be0c1 a=Cwc3rblV8FOMdVN/wOAqyQ==:117 a=Cwc3rblV8FOMdVN/wOAqyQ==:17 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=of4jigFt-DYA:10 a=D3aUqHbKAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=ENfAQvD6Ca9huj4GcSgA:9 a=QEXdDO2ut3YA:10 a=cMCrhCMO5xpCME3_Hjt_:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 26E9A60E0; Sat, 3 Jun 2023 17:54:23 -0700 (PDT) Received: from slippy (localhost [IPv6:::1]) by slippy.cwsent.com (Postfix) with ESMTP id DF19717C; Sat, 3 Jun 2023 17:54:22 -0700 (PDT) Date: Sat, 3 Jun 2023 17:54:22 -0700 From: Cy Schubert To: Eric van Gyzen Cc: Gleb Smirnoff , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: fe590ffe40f4 - main - Import vixie cron 4.0 Message-ID: <20230603175422.7d1c1fcb@slippy> In-Reply-To: <63EC8D2A-EA0A-48CD-B86C-011D848A2389@vangyzen.net> References: <202306011914.351JEPUd080685@gitrepo.freebsd.org> <63EC8D2A-EA0A-48CD-B86C-011D848A2389@vangyzen.net> Organization: KOMQUATS X-Mailer: Claws Mail 3.19.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-CMAE-Envelope: MS4xfFbpcvQOBuZjdpd8jo2WqZMCtOuXX78tfVcTMAmHzkfZdSYX4XcO5eJw7laXKGnOLpqCb4eMxrxvZ/6eh3EqDUyAYIwnU2b1NKviYR5OFQB3C12t+t/B ttoVQeVaufbm94lNzTNSnD2WzKSFNPDHavom+4yTx7x7iqqIKf0o97GsMrqo0IryUWNoH5A9xoa6dK469ThLuzu7xSWdpBtQIAcQH6xEPR0hdlvQ9//7rms8 J5S7yI9cdDkvOdT4R/T5Mw9f6L5JN1S0rft6jeqdnPm9pkrYCbSLLy1ZVQ9CBICjt0NHBt0HuH2NM2a1LZZSDZCRhzjuEArh91FZSvyvynmPZw01I1+6OkfY paT3q30C X-Rspamd-Queue-Id: 4QYdYG3tqMz3KkV X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Sat, 3 Jun 2023 13:21:09 -0500 Eric van Gyzen wrote: > On Jun 2, 2023, at 11:08 AM, Gleb Smirnoff wrote: > >=20 > > Given that now source of truth is in git, it could be a good idea > > to seed usr.bin/cron as a git subtree, as we do with other contributed > > software. =20 >=20 > Good idea. There were more good ideas on this topic in the Phab review, = but I don=E2=80=99t have cycles to pursue any of them. This was suggested in the review (https://reviews.freebsd.org/D40260). >=20 > Eric --=20 Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=3D0 From nobody Sun Jun 4 03:07:28 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QYhVm4x8qz4Zcp1; Sun, 4 Jun 2023 03:07:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QYhVm40bXz3mnB; Sun, 4 Jun 2023 03:07:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685848048; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w0bQ18tMMEzsmOjphoG6Lb15pWyUxMWNQAo+VsJFr4g=; b=mSafJGOPDZ6wgFBBLDZriDZaxlVUy4BiJZzjxvPrwl4bQpnGWou75VDQedaqfN8KdpQGsN XFhLpex4VNZtSHuCwb2ceZ/2DHqCNw4u0+n/FoCo8nb5BwdcNPCj8cF+2lFFW5HPnamr3M 8ArRhws8hztBXMa88J3M28KDnlVPAh1grOmZ76iTEUp6MlgY8UjNt89GW85n4Bx8wvNU5s OiXWJLyKuov4g/rklrIdjkyIasiJ+GxcApO++RrijrYfvhLwS0F9cV15ZH7Tv1FZ2khRPB LMzMcebRLLcR2IqFAgaMYeKpyyJWAfFkcHKRNpG5R47tLQ0CKVc5+oSX6w9h0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685848048; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w0bQ18tMMEzsmOjphoG6Lb15pWyUxMWNQAo+VsJFr4g=; b=XGEcw5EYGNGd+L0PojEV21pP56dQXB6NLM3hDNnjFDElxDcJA3PrvPrmlhBo0Cz6RzxsLe jbgcMJOTjvuNpjSecEGvWQvY+5Q3y/4XghT/G7UZ9gr8V9eyCHzXdw44xEDGJ2hJ+G4h4d 4MAz3XkRhczrBGfJPCmDG+JkNtUqh5FwHrST+HxVtIjrLoBcSFVvBaNFNPetqlUgV7qB1d 5iBgZMUw9PVHAaUKMnPF1eh3dtxJtsfcksfYJ0W0mo7IqBn0Gt9opQ5F3IR4ZX7s4mB0Pg MwGlYKr63JTYcT+XmZt8jOG0tjASlleLOQPLV2/p2aozgG26yJrh8WRrmFkL7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685848048; a=rsa-sha256; cv=none; b=li19Yl9FSXeBVTSqdD6gQuGcGdX76OtizMvo48WmTvrYuUDd1+sCh4KV+gO+8N3Yan/Ij9 ntid3rtM8GpFV7baq9/106gFaCxnkIowZahK5NRYamuiPOdTPGjRdpAvXaadeqLWuLKd0R aI50Gdd/CE5NW9Fc3+fwZWlVke3cG6eJHOtCEeoBrfQ3WowZOb5W+j6Ol0AErBYGv0rGNI MoVkCmGGOZ2asX7uGMAm6C5HdRg1UdK1fbuj528zSDWlNriLDG61qjzzazxE3qbQ2CCD4/ wPkPvTMYTrwuZAjtF3IMTr/L+Bl22YeczLiHZVzu7fpiA1c6GWcfqQHnqZbUuQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QYhVm2zCnzr0n; Sun, 4 Jun 2023 03:07:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 35437Sm1010300; Sun, 4 Jun 2023 03:07:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 35437S1P010299; Sun, 4 Jun 2023 03:07:28 GMT (envelope-from git) Date: Sun, 4 Jun 2023 03:07:28 GMT Message-Id: <202306040307.35437S1P010299@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jamie Gritton Subject: git: 086e0149ae56 - main - jail: Use re-entrant versions of lex & yacc, and lex's yylineno List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jamie X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 086e0149ae56641af245ce472e787c2f67d3aea5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jamie: URL: https://cgit.FreeBSD.org/src/commit/?id=086e0149ae56641af245ce472e787c2f67d3aea5 commit 086e0149ae56641af245ce472e787c2f67d3aea5 Author: Jamie Gritton AuthorDate: 2023-06-04 03:07:09 +0000 Commit: Jamie Gritton CommitDate: 2023-06-04 03:07:09 +0000 jail: Use re-entrant versions of lex & yacc, and lex's yylineno --- usr.sbin/jail/config.c | 27 ++++++++++------- usr.sbin/jail/jail.c | 8 ++--- usr.sbin/jail/jaillex.l | 76 ++++++++++++++++++----------------------------- usr.sbin/jail/jailp.h | 11 +++---- usr.sbin/jail/jailparse.y | 27 +++++++++++++++++ 5 files changed, 83 insertions(+), 66 deletions(-) diff --git a/usr.sbin/jail/config.c b/usr.sbin/jail/config.c index cbf5859b1329..52e1cbf05c28 100644 --- a/usr.sbin/jail/config.c +++ b/usr.sbin/jail/config.c @@ -51,10 +51,10 @@ struct ipspec { unsigned flags; }; -extern FILE *yyin; -extern int yynerrs; - -extern int yyparse(void); +extern int yylex_init_extra(struct cflex *extra, void *scanner); +extern int yylex_destroy(void *scanner); +extern int yyparse(void *scanner); +extern int yyset_in(FILE *fp, void *scanner); struct cfjails cfjails = TAILQ_HEAD_INITIALIZER(cfjails); @@ -127,7 +127,7 @@ static const struct ipspec intparams[] = { * Parse the jail configuration file. */ void -load_config(void) +load_config(const char *cfname) { struct cfjails wild; struct cfparams opp; @@ -135,19 +135,26 @@ load_config(void) struct cfparam *p, *vp, *tp; struct cfstring *s, *vs, *ns; struct cfvar *v, *vv; + struct cflex cflex; char *ep; + void *scanner; int did_self, jseq, pgen; + cflex.cfname = cfname; + cflex.error = 0; + yylex_init_extra(&cflex, &scanner); if (!strcmp(cfname, "-")) { - cfname = "STDIN"; - yyin = stdin; + cflex.cfname = "STDIN"; + yyset_in(stdin, scanner); } else { - yyin = fopen(cfname, "r"); - if (!yyin) + FILE *yfp = fopen(cfname, "r"); + if (!yfp) err(1, "%s", cfname); + yyset_in(yfp, scanner); } - if (yyparse() || yynerrs) + if (yyparse(scanner) || cflex.error) exit(1); + yylex_destroy(scanner); /* Separate the wildcard jails out from the actual jails. */ jseq = 0; diff --git a/usr.sbin/jail/jail.c b/usr.sbin/jail/jail.c index 02eb957a2d45..a2c725d51b70 100644 --- a/usr.sbin/jail/jail.c +++ b/usr.sbin/jail/jail.c @@ -56,7 +56,6 @@ struct permspec { int rev; }; -const char *cfname; int iflag; int note_remove; int verbose; @@ -138,6 +137,7 @@ main(int argc, char **argv) FILE *jfp; struct cfjail *j; char *JidFile; + const char *cfname; size_t sysvallen; unsigned op, pi; int ch, docf, error, i, oldcl, sysval; @@ -287,7 +287,7 @@ main(int argc, char **argv) } else if (op == JF_STOP || op == JF_SHOW) { /* Just print list of all configured non-wildcard jails */ if (op == JF_SHOW) { - load_config(); + load_config(cfname); show_jails(); exit(0); } @@ -300,7 +300,7 @@ main(int argc, char **argv) usage(); if ((docf = !Rflag && (!strcmp(cfname, "-") || stat(cfname, &st) == 0))) - load_config(); + load_config(cfname); note_remove = docf || argc > 1 || wild_jail_name(argv[0]); } else if (argc > 1 || (argc == 1 && strchr(argv[0], '='))) { /* Single jail specified on the command line */ @@ -348,7 +348,7 @@ main(int argc, char **argv) /* From the config file, perhaps with a specified jail */ if (Rflag || !docf) usage(); - load_config(); + load_config(cfname); } /* Find out which jails will be run. */ diff --git a/usr.sbin/jail/jaillex.l b/usr.sbin/jail/jaillex.l index 1dcf5bef5358..540b43ab3c5c 100644 --- a/usr.sbin/jail/jaillex.l +++ b/usr.sbin/jail/jaillex.l @@ -38,40 +38,32 @@ __FBSDID("$FreeBSD$"); #include "jailp.h" #include "y.tab.h" -extern int yynerrs; +#define YY_DECL int yylex(YYSTYPE *yylval, yyscan_t yyscanner) +#define YY_EXTRA_TYPE struct cflex* -static ssize_t text2lval(size_t triml, size_t trimr, int tovar); +extern YY_DECL; -static int instr; -static int lineno = 1; +static ssize_t text2lval(size_t triml, size_t trimr, int tovar, + YYSTYPE *yylval, yyscan_t scanner); -#define YY_DECL int yylex(void) +static int instr; %} %option noyywrap %option noinput %option nounput +%option reentrant +%option yylineno %start _ DQ %% /* Whitespace or equivalent */ -<_>[ \t]+ instr = 0; -<_>#.* ; -<_>\/\/.* ; -<_>\/\*([^*]|(\*+([^*\/])))*\*+\/ { - const char *s; - - for (s = yytext; s < yytext + yyleng; s++) - if (*s == '\n') - lineno++; - instr = 0; - } -<_>\n { - lineno++; - instr = 0; - } +<_>[ \t\r\n]+ instr = 0; +<_>#.* instr = 0; +<_>\/\/.* instr = 0; +<_>\/\*([^*]|(\*+([^*\/])))*\*+\/ instr = 0; /* Reserved tokens */ <_>\+= { @@ -87,13 +79,13 @@ static int lineno = 1; <_,DQ>[A-Za-z0-9_!%&()\-.:<>?@\[\]^`|~]+ | <_,DQ>\\(.|\n|[0-7]{1,3}|x[0-9A-Fa-f]{1,2}) | <_,DQ>[$*+/\\] { - (void)text2lval(0, 0, 0); + (void)text2lval(0, 0, 0, yylval, yyscanner); return instr ? STR1 : (instr = 1, STR); } /* Single and double quoted strings */ <_>'([^\'\\]|\\(.|\n))*' { - (void)text2lval(1, 1, 0); + (void)text2lval(1, 1, 0, yylval, yyscanner); return instr ? STR1 : (instr = 1, STR); } <_>\"([^"\\]|\\(.|\n))*\" | @@ -102,7 +94,8 @@ static int lineno = 1; ssize_t atvar; skip = yytext[0] == '"' ? 1 : 0; - atvar = text2lval(skip, 1, 1); + atvar = text2lval(skip, 1, 1, yylval, + yyscanner); if (atvar < 0) BEGIN _; else { @@ -120,32 +113,32 @@ static int lineno = 1; /* Variables, single-word or bracketed */ <_,DQ>$[A-Za-z_][A-Za-z_0-9]* { - (void)text2lval(1, 0, 0); + (void)text2lval(1, 0, 0, yylval, yyscanner); return instr ? VAR1 : (instr = 1, VAR); } <_>$\{([^\n{}]|\\(.|\n))*\} | $\{([^\n\"{}]|\\(.|\n))*\} { - (void)text2lval(2, 1, 0); + (void)text2lval(2, 1, 0, yylval, yyscanner); return instr ? VAR1 : (instr = 1, VAR); } /* Partially formed bits worth complaining about */ <_>\/\*([^*]|(\*+([^*\/])))*\** { warnx("%s line %d: unterminated comment", - cfname, lineno); - yynerrs++; + yyextra->cfname, yylineno); + yyextra->error = 1; } <_>'([^\n'\\]|\\.)* | <_>\"([^\n\"\\]|\\.)* { warnx("%s line %d: unterminated string", - cfname, lineno); - yynerrs++; + yyextra->cfname, yylineno); + yyextra->error = 1; } <_>$\{([^\n{}]|\\.)* | $\{([^\n\"{}]|\\.)* { warnx("%s line %d: unterminated variable", - cfname, lineno); - yynerrs++; + yyextra->cfname, yylineno); + yyextra->error = 1; } /* A hack because "<0>" rules aren't allowed */ @@ -157,28 +150,19 @@ static int lineno = 1; %% -void -yyerror(const char *s) -{ - if (!yytext) - warnx("%s line %d: %s", cfname, lineno, s); - else if (!yytext[0]) - warnx("%s: unexpected EOF", cfname); - else - warnx("%s line %d: %s: %s", cfname, lineno, yytext, s); -} - /* * Copy string from yytext to yylval, handling backslash escapes, * and optionally stopping at the beginning of a variable. */ static ssize_t -text2lval(size_t triml, size_t trimr, int tovar) +text2lval(size_t triml, size_t trimr, int tovar, YYSTYPE *yylval, + yyscan_t scanner) { char *d; const char *s, *se; - yylval.cs = d = emalloc(yyleng - trimr - triml + 1); + struct yyguts_t *yyg = scanner; + yylval->cs = d = emalloc(yyleng - trimr - triml + 1); se = yytext + (yyleng - trimr); for (s = yytext + triml; s < se; s++, d++) { if (*s != '\\') { @@ -186,8 +170,6 @@ text2lval(size_t triml, size_t trimr, int tovar) *d = '\0'; return s - yytext; } - if (*s == '\n') - lineno++; *d = *s; continue; } @@ -209,8 +191,8 @@ text2lval(size_t triml, size_t trimr, int tovar) case 'r': *d = '\r'; break; case 't': *d = '\t'; break; case 'v': *d = '\v'; break; - case '\n': d--; lineno++; break; default: *d = *s; break; + case '\n': d--; break; case 'x': *d = 0; if (s + 1 >= se) diff --git a/usr.sbin/jail/jailp.h b/usr.sbin/jail/jailp.h index 0325c2a101a4..6ea4e3ec09a3 100644 --- a/usr.sbin/jail/jailp.h +++ b/usr.sbin/jail/jailp.h @@ -197,6 +197,11 @@ struct cfdepend { unsigned flags; }; +struct cflex { + const char *cfname; + int error; +}; + extern void *emalloc(size_t); extern void *erealloc(void *, size_t); extern char *estrdup(const char *); @@ -209,7 +214,7 @@ extern int next_command(struct cfjail *j); extern int finish_command(struct cfjail *j); extern struct cfjail *next_proc(int nonblock); -extern void load_config(void); +extern void load_config(const char *cfname); extern struct cfjail *add_jail(void); extern void add_param(struct cfjail *j, const struct cfparam *p, enum intparam ipnum, const char *value); @@ -232,13 +237,9 @@ extern int start_state(const char *target, int docf, unsigned state, extern void requeue(struct cfjail *j, struct cfjails *queue); extern void requeue_head(struct cfjail *j, struct cfjails *queue); -extern void yyerror(const char *); -extern int yylex(void); - extern struct cfjails cfjails; extern struct cfjails ready; extern struct cfjails depend; -extern const char *cfname; extern int iflag; extern int note_remove; extern int paralimit; diff --git a/usr.sbin/jail/jailparse.y b/usr.sbin/jail/jailparse.y index 44e2aacb457e..ccc311a76223 100644 --- a/usr.sbin/jail/jailparse.y +++ b/usr.sbin/jail/jailparse.y @@ -30,6 +30,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include @@ -57,6 +58,11 @@ static struct cfjail *global_jail; %type value %type string +%pure-parser + +%lex-param { void *scanner } +%parse-param { void *scanner } + %% /* @@ -221,3 +227,24 @@ string : STR ; %% + +extern int YYLEX_DECL(); + +extern struct cflex *yyget_extra(void *scanner); +extern int yyget_lineno(void *scanner); +extern char *yyget_text(void *scanner); + +static void +YYERROR_DECL() +{ + if (!yyget_text(scanner)) + warnx("%s line %d: %s", + yyget_extra(scanner)->cfname, yyget_lineno(scanner), s); + else if (!yyget_text(scanner)[0]) + warnx("%s: unexpected EOF", + yyget_extra(scanner)->cfname); + else + warnx("%s line %d: %s: %s", + yyget_extra(scanner)->cfname, yyget_lineno(scanner), + yyget_text(scanner), s); +} From nobody Sun Jun 4 09:08:36 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QYrWT1kTpz4Z7y8; Sun, 4 Jun 2023 09:08:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QYrWS6vs7z4Mnq; Sun, 4 Jun 2023 09:08:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685869717; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OP0zk36p9WKOBOxLUZPIJRWTWSh2XldfSp+J7zk1GYI=; b=dWkcp4LUydAPlHR0M/BW6T9jb/dxTeQKInaGZP0E4C//ku02RTOdobIdnleS53thpfv9SM Emb1V9pfTrU4sVZdmp4JE8gvYWvgrynv9psJkiNF95usv2CekbJP/q3GMpjk39QbdPd+Gp AQk+cO4pAI63RpKZPc+TGHif5ftjQU5q7FbpfkPvtqMCZvesnLVnkH9CvyjF2IAjzvHbth NUBkaTnYl+RfTcYQLdCSuMAuzf2Gzvg/9FEikbdMb1GeSwoTbIOqB01bEaRg9eTzGW8Fpc Ho6hoWRVWOoYa7OOhn61Q8y9y+IWj+j4ekP7i83LwKIEcNn2qqnkRV+DpIlcXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685869717; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OP0zk36p9WKOBOxLUZPIJRWTWSh2XldfSp+J7zk1GYI=; b=XcyfuhtPvRTjSEenm86P09U09zKbizo6uQqAB9Z5bgJPb8e+gtul+Ab/FwoEceuKk22Qci cIn5ZDzvMYm5s5JPniqb3Tkz403RD0pQ0muaPhHhofhbTEhWZOT7BI4STeKe1GU4lr4baR INMcNCfxLROiQLEWGUrh8rjaJqckhScgqKMEh+bFndI+yPubkQLya1yz6i+GwZzRYJMKF0 oH5UU+GwvReBgnKmTvGkOKW8WaKOYkhLQ8p7Pla1yFuvmpMo0SShy7pvkZIY/ao89WLSZr ZQ3bAMV+/Nldg5hn+c4TC32KFMC+78VNYdx7jtIiHOFt2lP2tI+qhdHoL3WuoA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685869717; a=rsa-sha256; cv=none; b=R4c8CzndlbHrIsONSVmnJrdBHirGKFzAupbAf3mF/VxlmLdYWFPP7FelzK1EzUTSrUZuyV HXc4cOI4A6ybgD5ovGo2YmPjBrFNWrYFSochRj9iHDW+TBi09Tt1oPYy+wiDvakI00GLAa YYdjFOQ9EN07jr8Gk54D3uC8KDdbDpZPmiL7Itzj1k2lMwk/uTlEBXmoK2GX1Hf5hjOaEr BO/C8i19yWz/edFrOs+kQsC2ZvmTmRJqXZ6eVVUuEgsnroRPT/YDy5CZRoGcRo3U/+kLD+ VJaSAGCXrIfuRtsA362etQZfeZaSKg/s0T2DZ2sNoBUe8osp+SeRjuco9UOuIQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QYrWS5tPmz10nk; Sun, 4 Jun 2023 09:08:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 35498a8O002533; Sun, 4 Jun 2023 09:08:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 35498a6a002532; Sun, 4 Jun 2023 09:08:36 GMT (envelope-from git) Date: Sun, 4 Jun 2023 09:08:36 GMT Message-Id: <202306040908.35498a6a002532@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: 0be13a45f7cb - main - xregs_sig: Add a ability to handle multiple register banks List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0be13a45f7cb18f8b86c800a28457bf918e130f2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=0be13a45f7cb18f8b86c800a28457bf918e130f2 commit 0be13a45f7cb18f8b86c800a28457bf918e130f2 Author: Dmitry Chagin AuthorDate: 2023-06-04 09:06:25 +0000 Commit: Dmitry Chagin CommitDate: 2023-06-04 09:06:25 +0000 xregs_sig: Add a ability to handle multiple register banks While here replace the .global directive by traditionally used .globl. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D40410 --- tools/test/xregs_sig/c2x2c_aarch64.S | 18 ++--- tools/test/xregs_sig/c2x2c_amd64.S | 18 ++--- tools/test/xregs_sig/xregs_sig.c | 128 ++++++++++++++++++++++------------- 3 files changed, 100 insertions(+), 64 deletions(-) diff --git a/tools/test/xregs_sig/c2x2c_aarch64.S b/tools/test/xregs_sig/c2x2c_aarch64.S index 6f1637f5bcdf..f53550b867fd 100644 --- a/tools/test/xregs_sig/c2x2c_aarch64.S +++ b/tools/test/xregs_sig/c2x2c_aarch64.S @@ -5,9 +5,11 @@ * $FreeBSD$ */ - .global cpu_to_xregs - .type cpu_to_xregs, @function -cpu_to_xregs: + .text + + .globl cpu_to_vfp + .type cpu_to_vfp, @function +cpu_to_vfp: stp q0, q1, [x0, #( 0 * 16)] stp q2, q3, [x0, #( 2 * 16)] stp q4, q5, [x0, #( 4 * 16)] @@ -26,12 +28,12 @@ cpu_to_xregs: stp q30, q31, [x0, #(30 * 16)] ret - .size cpu_to_xregs, . - cpu_to_xregs + .size cpu_to_vfp, . - cpu_to_vfp - .global xregs_to_cpu - .type xregs_to_cpu, @function -xregs_to_cpu: + .globl vfp_to_cpu + .type vfp_to_cpu, @function +vfp_to_cpu: ldp q0, q1, [x0, #( 0 * 16)] ldp q2, q3, [x0, #( 2 * 16)] ldp q4, q5, [x0, #( 4 * 16)] @@ -50,6 +52,6 @@ xregs_to_cpu: ldp q30, q31, [x0, #(30 * 16)] ret - .size xregs_to_cpu, . - xregs_to_cpu + .size vfp_to_cpu, . - vfp_to_cpu .section .note.GNU-stack,"",@progbits diff --git a/tools/test/xregs_sig/c2x2c_amd64.S b/tools/test/xregs_sig/c2x2c_amd64.S index e5ae5af99e97..7348e4871d53 100644 --- a/tools/test/xregs_sig/c2x2c_amd64.S +++ b/tools/test/xregs_sig/c2x2c_amd64.S @@ -5,9 +5,11 @@ * $FreeBSD$ */ - .global cpu_to_xregs - .type cpu_to_xregs, @function -cpu_to_xregs: + .text + + .globl cpu_to_xmm + .type cpu_to_xmm, @function +cpu_to_xmm: movdqu %xmm0, (%rdi) movdqu %xmm1, 1 * 16(%rdi) movdqu %xmm2, 2 * 16(%rdi) @@ -26,12 +28,12 @@ cpu_to_xregs: movdqu %xmm15, 15 * 16(%rdi) retq - .size cpu_to_xregs, . - cpu_to_xregs + .size cpu_to_xmm, . - cpu_to_xmm - .global xregs_to_cpu - .type xregs_to_cpu, @function -xregs_to_cpu: + .globl xmm_to_cpu + .type xmm_to_cpu, @function +xmm_to_cpu: movdqu (%rdi), %xmm0 movdqu 1 * 16(%rdi), %xmm1 movdqu 2 * 16(%rdi), %xmm2 @@ -50,6 +52,6 @@ xregs_to_cpu: movdqu 15 * 16(%rdi), %xmm15 retq - .size xregs_to_cpu, . - xregs_to_cpu + .size xmm_to_cpu, . - xmm_to_cpu .section .note.GNU-stack,"",@progbits diff --git a/tools/test/xregs_sig/xregs_sig.c b/tools/test/xregs_sig/xregs_sig.c index a67379a0080e..4e29165d39e2 100644 --- a/tools/test/xregs_sig/xregs_sig.c +++ b/tools/test/xregs_sig/xregs_sig.c @@ -44,30 +44,49 @@ #ifndef __unused #define __unused __attribute__((__unused__)) #endif -#ifndef nitems -#define nitems(x) (sizeof((x)) / sizeof((x)[0])) -#endif -#if defined(__amd64__) -#define XREGSRNAM "xmm" -#define NREGS 16 -#elif defined(__aarch64__) -#define XREGSRNAM "q" -#define NREGS 32 -#endif - -struct xregsreg { - uint8_t xregs_bytes[16]; +struct xregs_bank { + const char *b_name; + const char *r_name; + uint32_t regs; + uint32_t bytes; + void (*x2c)(uint8_t *); + void (*c2x)(uint8_t *); }; -struct xregs { - struct xregsreg xregsreg[NREGS]; +#if defined(__amd64__) +void cpu_to_xmm(uint8_t *); +void xmm_to_cpu(uint8_t *); + +static const struct xregs_bank xregs_banks[] = { + { + .b_name = "SSE", + .r_name = "xmm", + .regs = 16, + .bytes = 16, + .x2c = xmm_to_cpu, + .c2x = cpu_to_xmm, + }, }; - -void cpu_to_xregs(struct xregs *xregs); -void xregs_to_cpu(struct xregs *xregs); +#elif defined(__aarch64__) +void cpu_to_vfp(uint8_t *); +void vfp_to_cpu(uint8_t *); + +static const struct xregs_bank xregs_banks[] = { + { + .b_name = "VFP", + .r_name = "q", + .regs = 32, + .bytes = 16, + .x2c = vfp_to_cpu, + .c2x = cpu_to_vfp, + }, +}; +#endif static atomic_uint sigs; +static int max_bank_idx; + static void sigusr1_handler(int sig __unused, siginfo_t *si __unused, void *m __unused) @@ -87,23 +106,22 @@ sigalrm_handler(int sig __unused) alarm(TIMO); } -static struct xregs zero_xregs = {}; static void -fill_xregs(struct xregs *xregs) +fill_xregs(uint8_t *xregs, int bank) { - arc4random_buf(xregs, sizeof(*xregs)); + arc4random_buf(xregs, xregs_banks[bank].regs * xregs_banks[bank].bytes); } static void -dump_xregs(const struct xregsreg *r) +dump_xregs(const uint8_t *r, int bank) { unsigned k; - for (k = 0; k < nitems(r->xregs_bytes); k++) { + for (k = 0; k < xregs_banks[bank].bytes; k++) { if (k != 0) printf(" "); - printf("%02x", r->xregs_bytes[k]); + printf("%02x", r[k]); } printf("\n"); } @@ -111,9 +129,9 @@ dump_xregs(const struct xregsreg *r) static pthread_mutex_t show_lock; static void -show_diff(const struct xregs *xregs1, const struct xregs *xregs2) +show_diff(const uint8_t *xregs1, const uint8_t *xregs2, int bank) { - const struct xregsreg *r1, *r2; + const uint8_t *r1, *r2; unsigned i, j; #if defined(__FreeBSD__) @@ -121,14 +139,14 @@ show_diff(const struct xregs *xregs1, const struct xregs *xregs2) #elif defined(__linux__) printf("thr %ld\n", syscall(SYS_gettid)); #endif - for (i = 0; i < nitems(xregs1->xregsreg); i++) { - r1 = &xregs1->xregsreg[i]; - r2 = &xregs2->xregsreg[i]; - for (j = 0; j < nitems(r1->xregs_bytes); j++) { - if (r1->xregs_bytes[j] != r2->xregs_bytes[j]) { - printf("%%%s%u\n", XREGSRNAM, i); - dump_xregs(r1); - dump_xregs(r2); + for (i = 0; i < xregs_banks[bank].regs; i++) { + r1 = xregs1 + i * xregs_banks[bank].bytes; + r2 = xregs2 + i * xregs_banks[bank].bytes; + for (j = 0; j < xregs_banks[bank].bytes; j++) { + if (r1[j] != r2[j]) { + printf("%%%s%u\n", xregs_banks[bank].r_name, i); + dump_xregs(r1, bank); + dump_xregs(r2, bank); break; } } @@ -142,28 +160,32 @@ my_pause(void) } static void * -worker_thread(void *arg __unused) +worker_thread(void *arg) { - struct xregs xregs, xregs_cpu; + int bank = (uintptr_t)arg; + int sz = xregs_banks[bank].regs * xregs_banks[bank].bytes; + uint8_t xregs[sz], xregs_cpu[sz], zero_xregs[sz]; + + memset(zero_xregs, 0, sz); - fill_xregs(&xregs); + fill_xregs(xregs, bank); for (;;) { - xregs_to_cpu(&xregs); + xregs_banks[bank].x2c(xregs); my_pause(); - cpu_to_xregs(&xregs_cpu); - if (memcmp(&xregs, &xregs_cpu, sizeof(struct xregs)) != 0) { + xregs_banks[bank].c2x(xregs_cpu); + if (memcmp(xregs, xregs_cpu, sz) != 0) { pthread_mutex_lock(&show_lock); - show_diff(&xregs, &xregs_cpu); + show_diff(xregs, xregs_cpu, bank); abort(); pthread_mutex_unlock(&show_lock); } - xregs_to_cpu(&zero_xregs); + xregs_banks[bank].x2c(zero_xregs); my_pause(); - cpu_to_xregs(&xregs_cpu); - if (memcmp(&zero_xregs, &xregs_cpu, sizeof(struct xregs)) != 0) { + xregs_banks[bank].c2x(xregs_cpu); + if (memcmp(zero_xregs, xregs_cpu, sz) != 0) { pthread_mutex_lock(&show_lock); - show_diff(&zero_xregs, &xregs_cpu); + show_diff(zero_xregs, xregs_cpu, bank); abort(); pthread_mutex_unlock(&show_lock); } @@ -175,7 +197,9 @@ int main(void) { struct sigaction sa; - int error, i, ncpu; + int error, i, ncpu, bank; + + max_bank_idx = 0; bzero(&sa, sizeof(sa)); sa.sa_handler = sigalrm_handler; @@ -199,14 +223,22 @@ main(void) } ncpu = sysconf(_SC_NPROCESSORS_ONLN); - ncpu *= 2; + if (max_bank_idx == 0) + ncpu *= 2; + bank = 0; pthread_t wt[ncpu]; +nextbank: + printf("Starting %d threads for registers bank %s sized [%d][%d]\n", ncpu, + xregs_banks[bank].b_name, xregs_banks[bank].regs, xregs_banks[bank].bytes); for (i = 0; i < ncpu; i++) { - error = pthread_create(&wt[i], NULL, worker_thread, NULL); + error = pthread_create(&wt[i], NULL, worker_thread, + (void *)(uintptr_t)bank); if (error != 0) { fprintf(stderr, "pthread_create %s\n", strerror(error)); } } + if (++bank <= max_bank_idx) + goto nextbank; alarm(TIMO); for (;;) { From nobody Sun Jun 4 09:08:37 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QYrWV2C1Dz4Z80d; Sun, 4 Jun 2023 09:08:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QYrWV1Rykz4Mv2; Sun, 4 Jun 2023 09:08:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685869718; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EpM+sQTx1he7BjYKaz5JNUq733v9s5R6QZ1RW15I26Y=; b=W5aX/Bhs2bv8sbeB0UF2/qtpScoKK2DAFfDdrucR+ZhNBvnMVM/RN90lrURdTR3DT+Rqnn g06Au/lzu7YBSbNbTdZFsEW8C+Jt2lQLt9NKYwuQCeJp/x5Q/ZeqlsJUH1piRO2d7sGJrm ee5hDwcXujGDmr1ATQ4SZ5dNsbplBqYjy2nerTM6WGaKc3fnroZMYSwRlM81/QzahLHDYE V4DlEAnWNpJ3zW+7gb+EAmsHOLgsbxxdScy1ytjS29zVdnoMRenA5nwTCuZixVAvIkaNbl nKhYXDqjrepHVczaJBYBvYg332KuwhS86pD8VVYlK6TsD8pG0SOsTGlmwK+WRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685869718; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EpM+sQTx1he7BjYKaz5JNUq733v9s5R6QZ1RW15I26Y=; b=FdUaaEAqbBMtl85n3jsuvH1fn2ij9v+ScldjBDqpI3jEZlgtYG1EuQEDt5ouWqqyFA/qzN taNOIhl94RccIaiRFG6QR+tzqmnJHebZIx+ouEdGbHhixL9gDNdVxRUKgXrCjQ7KBgQLoP naTgaG8qPckCVAQ9aUdcr8O9kDGO3MtZFgkKptZ7uL26yG5QFyEyzr4lF9ebYU228++RUg MGM3K+25UMRdtmg3S5DKqWMAKfa7Rebj9qdSHGkcNZLmHNNG7zmQhFtiJp4QEi8U4m4F0P 2rCGEDy3uvKIErTWvatN9gf55/4DWtcciPVru+T41I6acEL5xeBbPvj8x/DHpw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685869718; a=rsa-sha256; cv=none; b=DYKgcLCc8gXEvhCMOA41YJXSlD2EFrOp6Nk+A3MC1e76FuLeoXnECAULwFWwOo3fyw7qbO mgBgfpx7zEt7ruhWeCTrIThiC//hX9WsqgZp/zv+tE0fHbJqeqg0+yN7eap6O4WZxaY59b ScdaVQHwPsh9A/h6tLXLH5LEhnqCWI8Jp70ee6nBw/y6NPJkN7+PvcWWGOAqDy63GSY5Ni dnJETyZv2XsdQvZsvTeq0efozPUUiTAKW0+G3N2+pqVcLqMIMswjOxs8+HsLTRb/f6xR41 yWGmUzSMpzQnWKUZ6Rcvgj1sCsgU7dD3NRKWvQdYKbuCgxMT79XPhg+H+07pSA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QYrWT6kcfz10nl; Sun, 4 Jun 2023 09:08:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 35498b0i002559; Sun, 4 Jun 2023 09:08:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 35498bRV002558; Sun, 4 Jun 2023 09:08:37 GMT (envelope-from git) Date: Sun, 4 Jun 2023 09:08:37 GMT Message-Id: <202306040908.35498bRV002558@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: c8dbef44ffbe - main - xregs_sig: Add avx registers to test List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c8dbef44ffbe8d8acf33a5f20e20ca6b48beb4fa Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=c8dbef44ffbe8d8acf33a5f20e20ca6b48beb4fa commit c8dbef44ffbe8d8acf33a5f20e20ca6b48beb4fa Author: Dmitry Chagin AuthorDate: 2023-06-04 09:07:02 +0000 Commit: Dmitry Chagin CommitDate: 2023-06-04 09:07:02 +0000 xregs_sig: Add avx registers to test Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D40384 --- tools/test/xregs_sig/c2x2c_aarch64.S | 9 ++++ tools/test/xregs_sig/c2x2c_amd64.S | 85 ++++++++++++++++++++++++++++++++++++ tools/test/xregs_sig/xregs_sig.c | 14 +++++- 3 files changed, 107 insertions(+), 1 deletion(-) diff --git a/tools/test/xregs_sig/c2x2c_aarch64.S b/tools/test/xregs_sig/c2x2c_aarch64.S index f53550b867fd..ef29cac8a087 100644 --- a/tools/test/xregs_sig/c2x2c_aarch64.S +++ b/tools/test/xregs_sig/c2x2c_aarch64.S @@ -7,6 +7,15 @@ .text + .globl xregs_banks_max + .type xregs_banks_max, @function +xregs_banks_max: + mov x0, #0 + ret + + .size xregs_banks_max, . - xregs_banks_max + + .globl cpu_to_vfp .type cpu_to_vfp, @function cpu_to_vfp: diff --git a/tools/test/xregs_sig/c2x2c_amd64.S b/tools/test/xregs_sig/c2x2c_amd64.S index 7348e4871d53..bdc0d782e5c8 100644 --- a/tools/test/xregs_sig/c2x2c_amd64.S +++ b/tools/test/xregs_sig/c2x2c_amd64.S @@ -5,8 +5,45 @@ * $FreeBSD$ */ +#if defined(__FreeBSD__) +#include +#else +#define CPUID2_OSXSAVE 0x08000000 +#define CPUID2_AVX 0x10000000 +#define XFEATURE_ENABLED_X87 0x00000001 +#define XFEATURE_ENABLED_SSE 0x00000002 +#define XFEATURE_ENABLED_AVX 0x00000004 +#define XFEATURE_AVX \ + (XFEATURE_ENABLED_X87 | XFEATURE_ENABLED_SSE | XFEATURE_ENABLED_AVX) +#endif + .text + .globl xregs_banks_max + .type xregs_banks_max, @function +xregs_banks_max: + pushq %rbx + movl $1, %eax + cpuid + andl $(CPUID2_AVX|CPUID2_OSXSAVE), %ecx + cmpl $(CPUID2_AVX|CPUID2_OSXSAVE), %ecx + jne sse + xorl %ecx, %ecx + xgetbv + andl $XFEATURE_AVX, %eax + cmpl $XFEATURE_AVX, %eax + jne sse + movl $1, %eax + jmp out +sse: + xorl %eax, %eax +out: + popq %rbx + retq + + .size xregs_banks_max, . - xregs_banks_max + + .globl cpu_to_xmm .type cpu_to_xmm, @function cpu_to_xmm: @@ -54,4 +91,52 @@ xmm_to_cpu: .size xmm_to_cpu, . - xmm_to_cpu + + .globl cpu_to_avx + .type cpu_to_avx, @function +cpu_to_avx: + vmovdqu %ymm0, (%rdi) + vmovdqu %ymm1, 1 * 32(%rdi) + vmovdqu %ymm2, 2 * 32(%rdi) + vmovdqu %ymm3, 3 * 32(%rdi) + vmovdqu %ymm4, 4 * 32(%rdi) + vmovdqu %ymm5, 5 * 32(%rdi) + vmovdqu %ymm6, 6 * 32(%rdi) + vmovdqu %ymm7, 7 * 32(%rdi) + vmovdqu %ymm8, 8 * 32(%rdi) + vmovdqu %ymm9, 9 * 32(%rdi) + vmovdqu %ymm10, 10 * 32(%rdi) + vmovdqu %ymm11, 11 * 32(%rdi) + vmovdqu %ymm12, 12 * 32(%rdi) + vmovdqu %ymm13, 13 * 32(%rdi) + vmovdqu %ymm14, 14 * 32(%rdi) + vmovdqu %ymm15, 15 * 32(%rdi) + retq + + .size cpu_to_avx, . - cpu_to_avx + + + .globl avx_to_cpu + .type avx_to_cpu, @function +avx_to_cpu: + vmovdqu (%rdi), %ymm0 + vmovdqu 1 * 32(%rdi), %ymm1 + vmovdqu 2 * 32(%rdi), %ymm2 + vmovdqu 3 * 32(%rdi), %ymm3 + vmovdqu 4 * 32(%rdi), %ymm4 + vmovdqu 5 * 32(%rdi), %ymm5 + vmovdqu 6 * 32(%rdi), %ymm6 + vmovdqu 7 * 32(%rdi), %ymm7 + vmovdqu 8 * 32(%rdi), %ymm8 + vmovdqu 9 * 32(%rdi), %ymm9 + vmovdqu 10 * 32(%rdi), %ymm10 + vmovdqu 11 * 32(%rdi), %ymm11 + vmovdqu 12 * 32(%rdi), %ymm12 + vmovdqu 13 * 32(%rdi), %ymm13 + vmovdqu 14 * 32(%rdi), %ymm14 + vmovdqu 15 * 32(%rdi), %ymm15 + retq + + .size avx_to_cpu, . - avx_to_cpu + .section .note.GNU-stack,"",@progbits diff --git a/tools/test/xregs_sig/xregs_sig.c b/tools/test/xregs_sig/xregs_sig.c index 4e29165d39e2..2ed47b4eb3bc 100644 --- a/tools/test/xregs_sig/xregs_sig.c +++ b/tools/test/xregs_sig/xregs_sig.c @@ -54,9 +54,13 @@ struct xregs_bank { void (*c2x)(uint8_t *); }; +int xregs_banks_max(void); + #if defined(__amd64__) void cpu_to_xmm(uint8_t *); void xmm_to_cpu(uint8_t *); +void cpu_to_avx(uint8_t *); +void avx_to_cpu(uint8_t *); static const struct xregs_bank xregs_banks[] = { { @@ -67,6 +71,14 @@ static const struct xregs_bank xregs_banks[] = { .x2c = xmm_to_cpu, .c2x = cpu_to_xmm, }, + { + .b_name = "AVX", + .r_name = "ymm", + .regs = 16, + .bytes = 32, + .x2c = avx_to_cpu, + .c2x = cpu_to_avx, + }, }; #elif defined(__aarch64__) void cpu_to_vfp(uint8_t *); @@ -199,7 +211,7 @@ main(void) struct sigaction sa; int error, i, ncpu, bank; - max_bank_idx = 0; + max_bank_idx = xregs_banks_max(); bzero(&sa, sizeof(sa)); sa.sa_handler = sigalrm_handler; From nobody Sun Jun 4 16:39:56 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZ2XF0zKZz4ZJT3; Sun, 4 Jun 2023 16:39:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZ2XF0MCVz3tvn; Sun, 4 Jun 2023 16:39:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685896797; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bBCzqL+kVIJDI2JOWpc0p+GWtE0EGsjyRG0NBl9foF0=; b=sOjeoOjfevcpDXm5OvIJSIHYWaEhSqF3qLlDzj+DAg1R72XE+Bc+aaG5Gi3+gh+9fceBG6 JHuVw6qOGctehQLmp5RABrpV8SkZZ0ViqSldLyZHQin9Z8gmhkrZZ+Ei6s1ldkzO00802E K95OZnR/8jKEZur+NZSCy+Fb/XKf6qb0g/AUBWEqVAVrfu9NyYd1ihcwgkHAd3vrCg44fj 1JK//z6+1HKY0dnje5H4J/gP4/ZBBKIlTt5CnULXp5Pwx1U3NMYS4tDrBjYjZ3Fczja8yh D99PMFUYyBYt0txR7c/uAnsyHxIiKPOfLzSOrPuTsPGa5H5HQELSVAcXxbMKGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685896797; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bBCzqL+kVIJDI2JOWpc0p+GWtE0EGsjyRG0NBl9foF0=; b=fnax4hkdD4eoEMztQTwxQ8XEH36BYG+lNQY+cpasjsnNvIZHJset/vxOoH7VEJ8aQJ5+U0 fuIM30WGLpR63EzinirJZPBPyRivVgUqcrMcTKkf3fj8RbeUa1+DiwdPGEWNU+sMAYJQez Hf1VPPVhdLNAbs0n7i9O+0eHimHk3LK97fj0ao//+uDhg8ZDlIlb9lDnAR7Kf75wp7AZ6E Le/GPklbg5urIj/Txz2vhnD2yWR1/3sXw+pwRE21FO9/asrTzFU2jGvR2RTm0R6Np9o5Hb Zpr/gV8UKTnXURI23/IB1x7wg9qw8e/HsswR1Bi4vV/aU5117aD9k/dFRgN2Uw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685896797; a=rsa-sha256; cv=none; b=yrdmoFZnISWchXpqbIq/RODV10ClGtHQXV36v6M4mFXPUIlleCFLYCsNAyA2+grdSlVTQf q60iUvVpdXQ4kUeijiZp4cQyc+B3ygnsrbEQEiRLCCTWhj0XA38WvcnW3pubfngjiE+hhP vRqECNk2YoLyKqoWfOV45d8YSIxUSHRGHG2vdvBAFwxbuF9ysgSJ7M0SVrVGjlgvqSVih2 16R0PJYSzYHiqS19TEkdLsWUvKPj120IRUdUc5Tktzy6xKdFwmC23YeBEk9swG+Il9TwoR C62z71aeLhp9KRoMZiPdCM7MIDTIIYwFlU7a9+v4Iyxl+Y/GPgfg8xNN5M3IMg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZ2XD6S48z1Cxg; Sun, 4 Jun 2023 16:39:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 354Gdu0L043885; Sun, 4 Jun 2023 16:39:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 354Gdu2O043884; Sun, 4 Jun 2023 16:39:56 GMT (envelope-from git) Date: Sun, 4 Jun 2023 16:39:56 GMT Message-Id: <202306041639.354Gdu2O043884@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: 9d5a47e13c17 - main - ossl: Provide a fallback definition of __uint128_t when needed List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9d5a47e13c175adf7486956847c3d060fe059f2c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=9d5a47e13c175adf7486956847c3d060fe059f2c commit 9d5a47e13c175adf7486956847c3d060fe059f2c Author: Mark Johnston AuthorDate: 2023-06-02 22:18:05 +0000 Commit: Mark Johnston CommitDate: 2023-06-04 16:39:44 +0000 ossl: Provide a fallback definition of __uint128_t when needed This is required on i386. The patch has no functional change, since AES-GCM isn't implemented for that platform. Fixes: 9a3444d91c70 ("ossl: Add a VAES-based AES-GCM implementation for amd64") Reported by: Jenkins --- sys/crypto/openssl/ossl_aes_gcm.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/crypto/openssl/ossl_aes_gcm.h b/sys/crypto/openssl/ossl_aes_gcm.h index 9ce8ee193483..cd0c1e324354 100644 --- a/sys/crypto/openssl/ossl_aes_gcm.h +++ b/sys/crypto/openssl/ossl_aes_gcm.h @@ -49,6 +49,10 @@ struct ossl_aes_gcm_ops { size_t len); }; +#ifndef __SIZEOF_INT128__ +typedef struct { uint64_t v[2]; } __uint128_t; +#endif + struct ossl_gcm_context { struct { union { From nobody Sun Jun 4 17:17:56 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZ3N45MRcz4ZN3f; Sun, 4 Jun 2023 17:17:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZ3N44mPVz3y2v; Sun, 4 Jun 2023 17:17:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685899076; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1tgjOSZtO6aeODv46ndyopEm5cOYq2RktOgKpOiZYV4=; b=cNmsnxBXO7bt+jNS8kLyjhEnHc89FsPEWsHXfb7nQf58+dQdUVYxApbjtEdvIPupLr2jds b0H0rBznUPpRW27DVry0yiOE1du1BpCjeMei1/BoU4a7Cdpgo9J10aPlPM5dL73KiBEb38 y07EQyE7k2C3c23VjQ0QnkDjNut/b/1jgYH2gT817Zg2bRSUXjgA1nGNT7eTuFAILojraC 8dfHqAloo8kOE/UdRsu3UYVOF8u/yxu+9ij0ahSYPmnzpDtDuF/8BYOvhF/g45NDujVwyv 5G6eYmts6ZnPqziTQcRY8uEeCUtFotBN59wCFhSodBnYFfJqF1LTBpJ2QtwbAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685899076; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1tgjOSZtO6aeODv46ndyopEm5cOYq2RktOgKpOiZYV4=; b=rJCMhqtBlvxtHeH1/pHd7ckEP8DYb8Pht4BSCxZ/6cMIIBqYbzZ7ZpvbBE7cwwFiqP9XZk ZK9fbCbv/y/4x9ujShlCZfsE8Zb/mnHDp6lKcOe0Nq50hEmSVv2oCeeM8tm+T4lu6pgrVp QobaHbfpxUhJtJuBUPRi4sF5Z8YNNYZHGWyZaProSd68JwebBqO9nlB91E6ODQ9NGZT1qu VoN3fMtk57bwUsGZLaBHnhrcfJRw4UfJfDoxHs5bHKdKfc36HXsHQevRMGpxXpPZVaExzp txnwirEOdwVt3RjA2fbIN/1haheHU4P4Qy5hXVeBHm7IHGT207YtLioQPmkmNA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685899076; a=rsa-sha256; cv=none; b=jzlbYqEOzdYtkoLsJmb9pjni/5t1V8WUInxQs3Cvsh8Cra2rfhLMwVVnv67NpTMazNQTfP t15pKM4+dkfLx+He+BdkXRdigj1gmE0AtcKRmmQo28t4UL1X+2ik4RN5092APif2pejorI vX94bv9xNNDoTLkbycfun/vjMXtm62ZTXQSTUQX6JaNesR2rTEJYUeRntDbXPG/+SBVHIT 6APTmGB6DkG8LZFAeaT/PmtgqsgDW3gB3X+5SqAPe9AQHSq9HV4v0ZlN6ktsGDXJGZGn2q 2miL9KZJlm3ZRqJOKAArqXGU9MtgY1Xe1Oq6E+7UIFr6TNMGltItoGEsSbRwjw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZ3N43kVSzF1T; Sun, 4 Jun 2023 17:17:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 354HHuQS009943; Sun, 4 Jun 2023 17:17:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 354HHuhf009942; Sun, 4 Jun 2023 17:17:56 GMT (envelope-from git) Date: Sun, 4 Jun 2023 17:17:56 GMT Message-Id: <202306041717.354HHuhf009942@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: 02d90458669d - main - tslog: Handle curthread equal to NULL List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 02d90458669d6f8063ef32e35069e9246f487b37 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=02d90458669d6f8063ef32e35069e9246f487b37 commit 02d90458669d6f8063ef32e35069e9246f487b37 Author: Colin Percival AuthorDate: 2023-05-21 20:03:33 +0000 Commit: Colin Percival CommitDate: 2023-06-04 17:16:22 +0000 tslog: Handle curthread equal to NULL Early in the kernel boot, curthread goes through three stages: 1. Kernel crash when you try to access it, because PCPU doesn't exist. 2. NULL, because PCU exists but isn't initialized. 3. &thread0, which is where most of the kernel boot process runs. This broke TSLOG from inside hammer_time since the scripts which parse logged records didn't understand that NULL meant &thread0. Tell tslog to record &thread0 as the active thread if passed NULL. Sponsored by: https://www.patreon.com/cperciva Differential Revision: https://reviews.freebsd.org/D40324 --- sys/kern/kern_tslog.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/kern/kern_tslog.c b/sys/kern/kern_tslog.c index 5eba7719880d..3629f7d88a93 100644 --- a/sys/kern/kern_tslog.c +++ b/sys/kern/kern_tslog.c @@ -59,6 +59,10 @@ tslog(void * td, int type, const char * f, const char * s) uint64_t tsc = get_cyclecount(); long pos; + /* A NULL thread is thread0 before curthread is set. */ + if (td == NULL) + td = &thread0; + /* Grab a slot. */ pos = atomic_fetchadd_long(&nrecs, 1); From nobody Sun Jun 4 17:17:57 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZ3N6136Nz4ZMyK; Sun, 4 Jun 2023 17:17:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZ3N55V9kz3xrZ; Sun, 4 Jun 2023 17:17:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685899077; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gt2alcKQIrrcAMV7X9E8X5b2Lpjc8/TLTxB9xUh1yac=; b=crRvrvUW6gZS4bnZdFHuMDo3HWjptSyZ6yPiB2UrpFaPzRVd9wtwJOQXpof3DYHcww51PX 6NFiBmywe5azTI45ibz2OVlSZDgsOTjAWMVVpK9kEkiQe3GwXFrjj4sCpDFHSDdo+vQRJ7 CvrZMf1T1weebFRGWGmizZWtkAdeISn0htEL2WYFUqpl5MHquxvxjCeYsg2OSyh3Ofeua6 rja9EgzVfkvhyoOKSJqW81QrZ8xQpc064xXVjHtAyhrmuSS/8+F5adFSPrkbCBWQQ3X1o6 6QJrLOAPSyygMIZbzvguJe4pr/wePrP8q5Hr+PKNXxgUNZdPjVt1Ly0+trCkWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685899077; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gt2alcKQIrrcAMV7X9E8X5b2Lpjc8/TLTxB9xUh1yac=; b=VWL7/9+dfRHDuNo6ZWeOO7CIznUGNFKN4jUDo9V1F7IYgPi+3GyfJbijLNbVOlv17SHDv6 DcyGLdvQgbozRvsoQJOWxgfjxh4pMbREkFlkLRTqJi9Ge7Z2GLjpN+JPNrIbDkIiKoilPG lDsg98Xq657msliwd8BUn2X8szLvvilToHJHWysfyvVbppH4lyddjI3dcgnmhbXhx78uSz LA79EDMqAP8FYaBznPVjubbViwqZUtgS2UGWt/bPNAqXH0jMQg4SAhrR3ef2zD64xvxAfC jwxBmX06xZMsGkyB+UsUbqqV4Oss9XP+EUat4vfphz7aMHYbYSZyAXezPS1xCg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685899077; a=rsa-sha256; cv=none; b=DQmY+xUkCLxf26FEA6OUaHMQDGHeGgmkWiKTaa43nUvy4zPqJH5kd7iDF4ZuhfvpERPaY1 KyxjtHLxSl9Kh6h1gv3JtuCQ795w8m0nk1jzSimuLcOHDUvjD84vU0HQl7OwO5pneKUrkM D08Y6aj4vjwdc24BptOfu4L17UiJZYfw4uo6jN8s3vpzxaPnyzR+i10ar2XEDoU7PZtRkX vdC1WhFREVbo2VaNlVFibhTPMqF/1bBhgKF9+i6KtJxH2gFzuOWlExa9GbT950KtXRwvJO Ex9pU8E4RIpFCgc/NyD08ljxONyqVrEsGjN/pwtdFOJzzO3blJwjsDWyr7+pqA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZ3N54TXqzF1V; Sun, 4 Jun 2023 17:17:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 354HHvZh009962; Sun, 4 Jun 2023 17:17:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 354HHvVL009961; Sun, 4 Jun 2023 17:17:57 GMT (envelope-from git) Date: Sun, 4 Jun 2023 17:17:57 GMT Message-Id: <202306041717.354HHvVL009961@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: 469cfa3c30ee - main - tslog: Annotate some early boot functions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 469cfa3c30ee7a5ddeb597d0a8c3e7cac909b27a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=469cfa3c30ee7a5ddeb597d0a8c3e7cac909b27a commit 469cfa3c30ee7a5ddeb597d0a8c3e7cac909b27a Author: Colin Percival AuthorDate: 2023-05-22 09:54:04 +0000 Commit: Colin Percival CommitDate: 2023-06-04 17:16:22 +0000 tslog: Annotate some early boot functions Booting an amd64 kernel on Firecracker with 1 CPU and 128 MB of RAM, hammer_time takes roughly 2740 us: * 55 us in xen_pvh_parse_preload_data * 20 us in boot_parse_cmdline_delim * 20 us in boot_env_to_howto * 15 us in identify_hypervisor * 1320 us in link_elf_reloc * 1310 us in relocate_file1 handling ef->rela * 25 us in init_param1 * 30 us in dpcpu_init * 355 us in initializecpu * 255 us in initializecpu calling load_cr4 * 425 us in getmemsize * 280 us in pmap_bootstrap * 205 us in create_pagetables * 10 us in init_param2 * 25 us in pci_early_quirks * 60 us in cninit * 90 us in kdb_init * 105 us in msgbufinit * 20 us in fpuinit * 205 us elsewhere in hammer_time Some of these are unavoidable (e.g. identify_hypervisor uses CPUID and load_cr4 loads the CR4 register, both of which trap to the hypervisor) but others may deserve attention. Sponsored by: https://www.patreon.com/cperciva Differential Revision: https://reviews.freebsd.org/D40325 --- sys/amd64/amd64/fpu.c | 3 +++ sys/amd64/amd64/initcpu.c | 4 ++++ sys/amd64/amd64/machdep.c | 2 ++ sys/amd64/amd64/pmap.c | 4 ++++ sys/kern/kern_cons.c | 3 +++ sys/kern/link_elf.c | 7 +++++++ sys/kern/subr_boot.c | 5 +++++ sys/kern/subr_kdb.c | 3 +++ sys/kern/subr_param.c | 4 ++++ sys/kern/subr_pcpu.c | 2 ++ sys/kern/subr_prf.c | 3 +++ sys/x86/pci/pci_early_quirks.c | 3 +++ sys/x86/x86/identcpu.c | 7 ++++++- sys/x86/xen/pv.c | 3 +++ 14 files changed, 52 insertions(+), 1 deletion(-) diff --git a/sys/amd64/amd64/fpu.c b/sys/amd64/amd64/fpu.c index a3421cf0d496..1310a27911fe 100644 --- a/sys/amd64/amd64/fpu.c +++ b/sys/amd64/amd64/fpu.c @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -360,6 +361,7 @@ fpuinit(void) u_int mxcsr; u_short control; + TSENTER(); if (IS_BSP()) fpuinit_bsp1(); @@ -401,6 +403,7 @@ fpuinit(void) ldmxcsr(mxcsr); start_emulating(); intr_restore(saveintr); + TSEXIT(); } /* diff --git a/sys/amd64/amd64/initcpu.c b/sys/amd64/amd64/initcpu.c index a17ef89ba9f8..0de4bc3e2d60 100644 --- a/sys/amd64/amd64/initcpu.c +++ b/sys/amd64/amd64/initcpu.c @@ -276,6 +276,7 @@ initializecpu(void) uint64_t msr; uint32_t cr4; + TSENTER(); cr4 = rcr4(); if ((cpu_feature & CPUID_XMM) && (cpu_feature & CPUID_FXSR)) { cr4 |= CR4_FXSR | CR4_XMM; @@ -311,7 +312,9 @@ initializecpu(void) if (cpu_stdext_feature & CPUID_STDEXT_SMAP) cr4 |= CR4_SMAP; } + TSENTER2("load_cr4"); load_cr4(cr4); + TSEXIT2("load_cr4"); /* Reload cpu ext features to reflect cr4 changes */ if (IS_BSP() && cold) identify_cpu_ext_features(); @@ -340,6 +343,7 @@ initializecpu(void) if (!IS_BSP()) cpu_init_small_core(); + TSEXIT(); } void diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 29a0bd6f9db4..dfd60777110f 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -870,6 +870,7 @@ getmemsize(caddr_t kmdp, u_int64_t first) quad_t dcons_addr, dcons_size; int page_counter; + TSENTER(); /* * Tell the physical memory allocator about pages used to store * the kernel and preloaded data. See kmem_bootstrap_free(). @@ -1125,6 +1126,7 @@ do_next: /* Map the message buffer. */ msgbufp = (struct msgbuf *)PHYS_TO_DMAP(phys_avail[pa_indx]); + TSEXIT(); } static caddr_t diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 6de7f955d624..889311d598d6 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -1668,6 +1668,7 @@ create_pagetables(vm_paddr_t *firstaddr) #endif int i, j, ndm1g, nkpdpe, nkdmpde; + TSENTER(); /* Allocate page table pages for the direct map */ ndmpdp = howmany(ptoa(Maxmem), NBPDP); if (ndmpdp < 4) /* Minimum 4GB of dirmap */ @@ -1884,6 +1885,7 @@ create_pagetables(vm_paddr_t *firstaddr) } kernel_pml4 = (pml4_entry_t *)PHYS_TO_DMAP(KPML4phys); + TSEXIT(); } /* @@ -1906,6 +1908,7 @@ pmap_bootstrap(vm_paddr_t *firstaddr) u_long res; int i; + TSENTER(); KERNend = *firstaddr; res = atop(KERNend - (vm_paddr_t)kernphys); @@ -2061,6 +2064,7 @@ pmap_bootstrap(vm_paddr_t *firstaddr) */ load_cr4(rcr4() | CR4_PCIDE); } + TSEXIT(); } /* diff --git a/sys/kern/kern_cons.c b/sys/kern/kern_cons.c index 7c63b8e4ed9c..ff57b2bdfd8a 100644 --- a/sys/kern/kern_cons.c +++ b/sys/kern/kern_cons.c @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -134,6 +135,7 @@ cninit(void) { struct consdev *best_cn, *cn, **list; + TSENTER(); /* * Check if we should mute the console (for security reasons perhaps) * It can be changes dynamically using sysctl kern.consmute @@ -195,6 +197,7 @@ cninit(void) */ early_putc = NULL; #endif + TSEXIT(); } void diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c index b410469b6270..bd8994ff0e4d 100644 --- a/sys/kern/link_elf.c +++ b/sys/kern/link_elf.c @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -1431,6 +1432,7 @@ relocate_file1(elf_file_t ef, elf_lookup_fn lookup, elf_reloc_fn reloc, const Elf_Rela *rela; const char *symname; + TSENTER(); #define APPLY_RELOCS(iter, tbl, tblsize, type) do { \ for ((iter) = (tbl); (iter) != NULL && \ (iter) < (tbl) + (tblsize) / sizeof(*(iter)); (iter)++) { \ @@ -1449,12 +1451,15 @@ relocate_file1(elf_file_t ef, elf_lookup_fn lookup, elf_reloc_fn reloc, } while (0) APPLY_RELOCS(rel, ef->rel, ef->relsize, ELF_RELOC_REL); + TSENTER2("ef->rela"); APPLY_RELOCS(rela, ef->rela, ef->relasize, ELF_RELOC_RELA); + TSEXIT2("ef->rela"); APPLY_RELOCS(rel, ef->pltrel, ef->pltrelsize, ELF_RELOC_REL); APPLY_RELOCS(rela, ef->pltrela, ef->pltrelasize, ELF_RELOC_RELA); #undef APPLY_RELOCS + TSEXIT(); return (0); } @@ -1950,6 +1955,7 @@ link_elf_ireloc(caddr_t kmdp) struct elf_file eff; elf_file_t ef; + TSENTER(); ef = &eff; bzero_early(ef, sizeof(*ef)); @@ -1966,6 +1972,7 @@ link_elf_ireloc(caddr_t kmdp) link_elf_preload_parse_symbols(ef); relocate_file1(ef, elf_lookup_ifunc, elf_reloc, true); + TSEXIT(); } #if defined(__aarch64__) || defined(__amd64__) diff --git a/sys/kern/subr_boot.c b/sys/kern/subr_boot.c index 057ffb5b7e08..73e75ba11750 100644 --- a/sys/kern/subr_boot.c +++ b/sys/kern/subr_boot.c @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #endif #include #include +#include #ifdef _KERNEL #define SETENV(k, v) kern_setenv(k, v) @@ -95,12 +96,14 @@ boot_env_to_howto(void) int i, howto; char *val; + TSENTER(); for (howto = 0, i = 0; howto_names[i].ev != NULL; i++) { val = GETENV(howto_names[i].ev); if (val != NULL && strcasecmp(val, "no") != 0) howto |= howto_names[i].mask; FREE(val); } + TSEXIT(); return (howto); } @@ -193,12 +196,14 @@ boot_parse_cmdline_delim(char *cmdline, const char *delim) char *v; int howto; + TSENTER(); howto = 0; while ((v = strsep(&cmdline, delim)) != NULL) { if (*v == '\0') continue; howto |= boot_parse_arg(v); } + TSEXIT(); return (howto); } diff --git a/sys/kern/subr_kdb.c b/sys/kern/subr_kdb.c index f8b37c2319b0..2f419b4d8ad5 100644 --- a/sys/kern/subr_kdb.c +++ b/sys/kern/subr_kdb.c @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -559,6 +560,7 @@ kdb_init(void) struct kdb_dbbe *be, **iter; int cur_pri, pri; + TSENTER(); kdb_active = 0; kdb_dbbe = NULL; cur_pri = -1; @@ -582,6 +584,7 @@ kdb_init(void) printf("KDB: current backend: %s\n", kdb_dbbe->dbbe_name); } + TSEXIT(); } /* diff --git a/sys/kern/subr_param.c b/sys/kern/subr_param.c index bb8cb5871af2..b988f28944cc 100644 --- a/sys/kern/subr_param.c +++ b/sys/kern/subr_param.c @@ -171,6 +171,7 @@ void init_param1(void) { + TSENTER(); #if !defined(__arm64__) TUNABLE_INT_FETCH("kern.kstack_pages", &kstack_pages); #endif @@ -245,6 +246,7 @@ init_param1(void) pid_max = 300; TUNABLE_INT_FETCH("vfs.unmapped_buf_allowed", &unmapped_buf_allowed); + TSEXIT(); } /* @@ -254,6 +256,7 @@ void init_param2(long physpages) { + TSENTER(); /* Base parameters */ maxusers = MAXUSERS; TUNABLE_INT_FETCH("kern.maxusers", &maxusers); @@ -335,6 +338,7 @@ init_param2(long physpages) if (maxpipekva > (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) / 64) maxpipekva = (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) / 64; + TSEXIT(); } /* diff --git a/sys/kern/subr_pcpu.c b/sys/kern/subr_pcpu.c index c4c220d66c97..c13a52dffccd 100644 --- a/sys/kern/subr_pcpu.c +++ b/sys/kern/subr_pcpu.c @@ -103,6 +103,7 @@ dpcpu_init(void *dpcpu, int cpuid) { struct pcpu *pcpu; + TSENTER(); pcpu = pcpu_find(cpuid); pcpu->pc_dynamic = (uintptr_t)dpcpu - DPCPU_START; @@ -115,6 +116,7 @@ dpcpu_init(void *dpcpu, int cpuid) * Place it in the global pcpu offset array. */ dpcpu_off[cpuid] = pcpu->pc_dynamic; + TSEXIT(); } static void diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c index 0506c21b5ad8..db4ef168bc70 100644 --- a/sys/kern/subr_prf.c +++ b/sys/kern/subr_prf.c @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1037,6 +1038,7 @@ msgbufinit(void *ptr, int size) static struct msgbuf *oldp = NULL; bool print_boot_tag; + TSENTER(); size -= sizeof(*msgbufp); cp = (char *)ptr; print_boot_tag = !msgbufmapped; @@ -1052,6 +1054,7 @@ msgbufinit(void *ptr, int size) if (print_boot_tag && *current_boot_tag != '\0') printf("%s\n", current_boot_tag); oldp = msgbufp; + TSEXIT(); } /* Sysctls for accessing/clearing the msgbuf */ diff --git a/sys/x86/pci/pci_early_quirks.c b/sys/x86/pci/pci_early_quirks.c index 97ba7e1a0631..ab8072b38d14 100644 --- a/sys/x86/pci/pci_early_quirks.c +++ b/sys/x86/pci/pci_early_quirks.c @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include /* XXX: enable this once the KPI is available */ @@ -317,5 +318,7 @@ void pci_early_quirks(void) { + TSENTER(); intel_graphics_stolen(); + TSEXIT(); } diff --git a/sys/x86/x86/identcpu.c b/sys/x86/x86/identcpu.c index 42cca3250481..3ff59344e17d 100644 --- a/sys/x86/x86/identcpu.c +++ b/sys/x86/x86/identcpu.c @@ -1424,6 +1424,7 @@ identify_hypervisor(void) u_int regs[4]; char *p; + TSENTER(); /* * If CPUID2_HV is set, we are running in a hypervisor environment. */ @@ -1432,8 +1433,10 @@ identify_hypervisor(void) identify_hypervisor_cpuid_base(); /* If we have a definitive vendor, we can return now. */ - if (*hv_vendor != '\0') + if (*hv_vendor != '\0') { + TSEXIT(); return; + } } /* @@ -1446,11 +1449,13 @@ identify_hypervisor(void) if (regs[1] == VMW_HVMAGIC) { vm_guest = VM_GUEST_VMWARE; freeenv(p); + TSEXIT(); return; } } freeenv(p); } + TSEXIT(); } bool diff --git a/sys/x86/xen/pv.c b/sys/x86/xen/pv.c index 367214fe35be..b3da26e9b78e 100644 --- a/sys/x86/xen/pv.c +++ b/sys/x86/xen/pv.c @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -417,6 +418,7 @@ xen_pvh_parse_preload_data(uint64_t modulep) char *envp; char acpi_rsdp[19]; + TSENTER(); if (start_info->modlist_paddr != 0) { struct hvm_modlist_entry *mod; const char *cmdline; @@ -507,6 +509,7 @@ xen_pvh_parse_preload_data(uint64_t modulep) #ifdef DDB xen_pvh_parse_symtab(); #endif + TSEXIT(); return (kmdp); } From nobody Sun Jun 4 17:17:58 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZ3N672Vmz4ZMyN; Sun, 4 Jun 2023 17:17:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZ3N66Y0Zz3xxG; Sun, 4 Jun 2023 17:17:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685899078; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SWX4oJ0IxoGDYZt8OZm+FOzn5KWpSsjMpT1eUPsfgpc=; b=XzAQ6V2WbK34/Gan29+gxcGC5eYmzJlVl8fjzwsNacfGZNC/xv0vHgZZX2nQgCAzVUQtJD hAef6Ag+4s5I1hbsBNySvvOvI4lA2fo6BZ+TRjxhWs3U0lRv6geJJjI3yO9kPkoxGI1CFQ JaNZprlkcTIR9QO1RQ5P6rhzlaHa0i5yYvLJZ74yehU0L4Aq3dPIXFTj5uH2veK8lk8oi4 hamATMBNwLLfRK0P4ofkJO3TfSvgQxgBgHCycUi8L4jQm9e4r4tqaSzHUfisKfFxisyh4+ c+5ZhizCETe8TLhIk+bVOPsDs8ERMAEGKmL/f8+ck+H6CGalXqsHFavIQ0BgaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685899078; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SWX4oJ0IxoGDYZt8OZm+FOzn5KWpSsjMpT1eUPsfgpc=; b=DAZgdWbxTOSfgZuu/rhnWnNeqMq5zUWgeJmLcgfL4EI2hYlGErpXfnJ9YWheF+r+P+vTtx JBI/04F+xn0DsPujE57JV9B/SVu0qtbk4ov2xZW0BeYMmjYUiE0iTFyA+IRCD63Mxaa4Ea ItVz7//d4iZCQU1PxBRAL987+suZ4kOer0oKfSMbwhrnA4qpUvDKXIE6XBrMWnhvD+a4Qx LsG31myQGnyp9jtDrThEGGoKnKx99vXFraPNut7lv0KG2q++QpDUDdgY6+JGVNCFWnIf0S 5vVT3LmT2JSRVlIIH17rP/q588uz4BudeRx1OEM4yPZIgJmal1+xxSc8pEN+dg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685899078; a=rsa-sha256; cv=none; b=HveN2cEi5VOYSLfYWFLO6j5H4pxCGYOlNfwzH6du2RRxU7BBBobDuu7mL1gHOEMF2f1X+A 4x7DUeeNj2Dk6xJP7MCfS75A2RLUvPBc5M0dzZB3CCufdEP7Mma+9QMM/98754Fg8HiUEi NqAhM6r2cwmssosP2/D80e+K1zAXG+ITzyWUtKy+04P5rkzFYoZqWODSPTtnA1T+ASPxlT UNo/wjI0Go8xRvOCCkIDjJltYaWVlgMdE2RTRXuu0JUiYKlBlghiRjHa+Kk8YrBSwcRphp nYUSYUvhTY3ECN1mYxXrFcvoNOghhugQBfCawyO+j1Qb5IcLPJX/jh8UqCU/Kw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZ3N65VgDzFjQ; Sun, 4 Jun 2023 17:17:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 354HHw6W009981; Sun, 4 Jun 2023 17:17:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 354HHwUi009980; Sun, 4 Jun 2023 17:17:58 GMT (envelope-from git) Date: Sun, 4 Jun 2023 17:17:58 GMT Message-Id: <202306041717.354HHwUi009980@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: 2404380aac7e - main - tslog: Optionally instrument pmap_zero_page List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2404380aac7eaf8019aa0939224bbce2d561d01f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=2404380aac7eaf8019aa0939224bbce2d561d01f commit 2404380aac7eaf8019aa0939224bbce2d561d01f Author: Colin Percival AuthorDate: 2023-05-29 23:03:14 +0000 Commit: Colin Percival CommitDate: 2023-06-04 17:16:31 +0000 tslog: Optionally instrument pmap_zero_page Booting an amd64 kernel on Firecracker with 1 CPU and 128 MB of RAM, pmap_zero_page is responsible for 4.6 ms of the 25.0 ms of boot time. This is not in fact time spent zeroing pages though; almost all of that time is spent in a first-touch penalty, presumably due to the host Linux kernel faulting in backing pages one by one. There's probably a way to improve that by teaching Firecracker to fault in all the VM's pages from the start rather than having them faulted in one at a time, but that's outside of FreeBSD's control. This commit adds a TSLOG_PAGEZERO option which enables TSLOG on the amd64 pmap_zero_page function; it's a separate option (turned off by default even if TSLOG is enabled) since zeroing pages happens enough that it can easily fill the TSLOG buffer and prevent other timing information from being recorded. Sponsored by: https://www.patreon.com/cperciva Differential Revision: https://reviews.freebsd.org/D40326 --- sys/amd64/amd64/pmap.c | 9 ++++++++- sys/conf/NOTES | 3 +++ sys/conf/options | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 889311d598d6..657ba67cd619 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -8155,9 +8155,16 @@ pmap_vmspace_copy(pmap_t dst_pmap, pmap_t src_pmap) void pmap_zero_page(vm_page_t m) { - vm_offset_t va = PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)); + vm_offset_t va; +#ifdef TSLOG_PAGEZERO + TSENTER(); +#endif + va = PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)); pagezero((void *)va); +#ifdef TSLOG_PAGEZERO + TSEXIT(); +#endif } /* diff --git a/sys/conf/NOTES b/sys/conf/NOTES index 8725d11a5434..23ec7b5c45c9 100644 --- a/sys/conf/NOTES +++ b/sys/conf/NOTES @@ -615,6 +615,9 @@ options NUM_CORE_FILES=5 # before it is possible to use more sophisticated tools like DTrace. # The TSLOGSIZE option controls the size of the (preallocated, fixed # length) buffer used for storing these events (default: 262144 records). +# The TSLOG_PAGEZERO option enables TSLOG of pmap_zero_page; this must be +# enabled separately since it typically generates too many records to be +# useful. # # For security reasons the TSLOG option should not be enabled on systems # used in production. diff --git a/sys/conf/options b/sys/conf/options index a8b441e320cb..7a34fa0f7333 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -67,6 +67,7 @@ SYSCTL_DEBUG opt_sysctl.h TEXTDUMP_PREFERRED opt_ddb.h TEXTDUMP_VERBOSE opt_ddb.h TSLOG opt_global.h +TSLOG_PAGEZERO opt_global.h TSLOGSIZE opt_global.h # Miscellaneous options. From nobody Sun Jun 4 17:17:59 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZ3N819ZNz4ZMsd; Sun, 4 Jun 2023 17:18:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZ3N80Mzqz3xw2; Sun, 4 Jun 2023 17:18:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685899080; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rL2mF/20oyfUVVD26znBTD1J9DCORXpRC7YII4ayjYg=; b=iWSy/1ZNAZRKG8ybjP876G/P+X1uO4YA/irLYkRP/WD30Sc6oapTdCWc4ixYyWQ0EPa1lA x3BXjrdBZ4V7q2/8G2YaKtnhBSqWc60kvOJnS//qcwBSIfq3VWAbXQ/xIJrfwR1cxFvWFS IjsgPQAPFHEQmYbS2BD5/M/z+0zXlXaLDipz3uGiky4gtwv7Cwr1Z/0U3bVtJKV3g9coF5 vfX8AxPhtQ2hSqObJPzMSqFlHP6gFU5bsYM9abcgzAZ2nqskdR/lz9W4b+bJ5U7175XD77 fAKdy/Xmw/7T7t+4iV3qjJD/iTcr5uLra77b2IrlIUnNivvnuRHBrrgydKaVWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685899080; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rL2mF/20oyfUVVD26znBTD1J9DCORXpRC7YII4ayjYg=; b=wev4uVOWW4y9bF+NWAwuR/HWrYkmKYyb+R3aJ0lwkMwuzGMIeQ05zNDoxIXCdbHrp85Ef0 t50w/WSWuez/5OzU6pUAJoC1QY4IhteACxy5A6707jVqQyH7ZaasctNbaCzCPR2jguhXHb 7F7+YJX6dajwEHWEgrFd9lTE1t2a24izrKstnlIrZpN1U33w8ie92ire6pPxMz/kIS+7bt KyGEVVzFadeu8I/cySTJyUdCKFY9cUG/uz++2EkboP0t4jPGWKoq0BfhLWUnzt9KcIJsb/ o2EiqPUXrEVPnYAB7bf54NcxgZKclUSvQ+AI6z5qYom1iXm0H0QtcRbMRIjM2g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685899080; a=rsa-sha256; cv=none; b=MKzpDNcT6cFCHqXvy7v0+dxRxdl9kh/dN2wWeDgxzQp1QL89o9fNzuIDIX76MM2XG+YsE7 yKSyR8OPPY6HH7kgDoMzQ8s6+hLj7ucP7Kjs6piS1YItFL5Tg1FSTcUGXKCeB57SJKxYek AAq7THIr+GNyqwLFi3OG/0iY51Fs8wyc6PPYhMoEHkKzMRelyY7f5apcQGI+Obbzs8cJ49 zDZwGH61kVUowpPSHD6qbPlx1YcGT2VhakZGmthOhEMbm5EXffco/hwYjaHY9oTt7DY1OQ QuF4Fo6yYmr0dru7TvTxafJu97ZEUx5iBHslMsphCVWv0BPjEuxpm0pZ3hMFww== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZ3N76b3DzFcX; Sun, 4 Jun 2023 17:17:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 354HHxN0010000; Sun, 4 Jun 2023 17:17:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 354HHxKO009999; Sun, 4 Jun 2023 17:17:59 GMT (envelope-from git) Date: Sun, 4 Jun 2023 17:17:59 GMT Message-Id: <202306041717.354HHxKO009999@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: 45cc8519f590 - main - tslog: Annotate parts of SYSINIT cpu List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 45cc8519f5900574826dfd22c851b136023d044e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=45cc8519f5900574826dfd22c851b136023d044e commit 45cc8519f5900574826dfd22c851b136023d044e Author: Colin Percival AuthorDate: 2023-05-30 00:29:24 +0000 Commit: Colin Percival CommitDate: 2023-06-04 17:16:35 +0000 tslog: Annotate parts of SYSINIT cpu Booting an amd64 kernel on Firecracker with 1 CPU and 128 MB of RAM, SYSINIT cpu takes roughly 2770 us: * 2280 us in vm_ksubmap_init * 535 us in kmem_malloc * 450 us in pmap_zero_page * 1720 us in pmap_growkernel * 1620 us in pmap_zero_page * 80 us in bufinit * 480 us in cpu_setregs * 430 us in cpu_setregs calling load_cr0 Much of this is hypervisor overhead: load_cr0 is slow because it traps to the hypervisor, and 99% of the time in pmap_zero_page is spent when we first touch the page, presumably due to the host Linux kernel faulting in backing pages one by one. Sponsored by: https://www.patreon.com/cperciva Differential Revision: https://reviews.freebsd.org/D40327 --- sys/amd64/amd64/machdep.c | 4 ++++ sys/amd64/amd64/pmap.c | 7 ++++++- sys/kern/vfs_bio.c | 2 ++ sys/vm/vm_init.c | 2 ++ sys/vm/vm_kern.c | 12 ++++++++++-- 5 files changed, 24 insertions(+), 3 deletions(-) diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index dfd60777110f..fa3ffe84bfe1 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -326,13 +326,17 @@ cpu_setregs(void) { register_t cr0; + TSENTER(); cr0 = rcr0(); /* * CR0_MP, CR0_NE and CR0_TS are also set by npx_probe() for the * BSP. See the comments there about why we set them. */ cr0 |= CR0_MP | CR0_NE | CR0_TS | CR0_WP | CR0_AM; + TSENTER2("load_cr0"); load_cr0(cr0); + TSEXIT2("load_cr0"); + TSEXIT(); } /* diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 657ba67cd619..123811ed573f 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -5049,6 +5049,7 @@ pmap_growkernel(vm_offset_t addr) pdp_entry_t *pdpe; vm_offset_t end; + TSENTER(); mtx_assert(&kernel_map->system_mtx, MA_OWNED); /* @@ -5075,8 +5076,10 @@ pmap_growkernel(vm_offset_t addr) */ if (KERNBASE < addr) { end = KERNBASE + nkpt * NBPDR; - if (end == 0) + if (end == 0) { + TSEXIT(); return; + } } else { end = kernel_vm_end; } @@ -5089,6 +5092,7 @@ pmap_growkernel(vm_offset_t addr) * The grown region is already mapped, so there is * nothing to do. */ + TSEXIT(); return; } @@ -5136,6 +5140,7 @@ pmap_growkernel(vm_offset_t addr) kernel_vm_end = end; else nkpt = howmany(end - KERNBASE, NBPDR); + TSEXIT(); } /*************************************************** diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index a76ea26d8859..cf01d2a239ea 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -1201,6 +1201,7 @@ bufinit(void) struct buf *bp; int i; + TSENTER(); KASSERT(maxbcachebuf >= MAXBSIZE, ("maxbcachebuf (%d) must be >= MAXBSIZE (%d)\n", maxbcachebuf, MAXBSIZE)); @@ -1336,6 +1337,7 @@ bufinit(void) buffreekvacnt = counter_u64_alloc(M_WAITOK); bufdefragcnt = counter_u64_alloc(M_WAITOK); bufkvaspace = counter_u64_alloc(M_WAITOK); + TSEXIT(); } #ifdef INVARIANTS diff --git a/sys/vm/vm_init.c b/sys/vm/vm_init.c index c5a58c7a0ac7..86b1ade64cb6 100644 --- a/sys/vm/vm_init.c +++ b/sys/vm/vm_init.c @@ -156,6 +156,7 @@ vm_ksubmap_init(struct kva_md_info *kmi) vm_offset_t minaddr; vm_offset_t maxaddr; + TSENTER(); /* * Allocate space for system data structures. * The first available kernel virtual address is in "v". @@ -252,4 +253,5 @@ again: exec_map_entries * exec_map_entry_size + 64 * PAGE_SIZE, false); kmem_subinit(pipe_map, kernel_map, &minaddr, &maxaddr, maxpipekva, false); + TSEXIT(); } diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c index 10fe07cc86da..8b4e69dbebc2 100644 --- a/sys/vm/vm_kern.c +++ b/sys/vm/vm_kern.c @@ -451,8 +451,12 @@ kmem_malloc_domain(int domain, vm_size_t size, int flags) void * kmem_malloc(vm_size_t size, int flags) { + void * p; - return (kmem_malloc_domainset(DOMAINSET_RR(), size, flags)); + TSENTER(); + p = kmem_malloc_domainset(DOMAINSET_RR(), size, flags); + TSEXIT(); + return (p); } void * @@ -731,17 +735,21 @@ kva_import(void *unused, vmem_size_t size, int flags, vmem_addr_t *addrp) vm_offset_t addr; int result; + TSENTER(); KASSERT((size % KVA_QUANTUM) == 0, ("kva_import: Size %jd is not a multiple of %d", (intmax_t)size, (int)KVA_QUANTUM)); addr = vm_map_min(kernel_map); result = vm_map_find(kernel_map, NULL, 0, &addr, size, 0, VMFS_SUPER_SPACE, VM_PROT_ALL, VM_PROT_ALL, MAP_NOFAULT); - if (result != KERN_SUCCESS) + if (result != KERN_SUCCESS) { + TSEXIT(); return (ENOMEM); + } *addrp = addr; + TSEXIT(); return (0); } From nobody Sun Jun 4 17:18:38 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZ3Nt2pFhz4ZN2M; Sun, 4 Jun 2023 17:18:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZ3Nt2Fzpz411V; Sun, 4 Jun 2023 17:18:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685899118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2P7akGGa7W3lSHY47S7RacqZtvIg2tv3f2cmgq0+jg0=; b=MaDO7JTbT4789+/eG3SS+RnIEf42aN0hFlN8MBfKtB85doQg1f3MyYD4im1HSAt91Dv9mZ x8CxaGe5g3dRxHvs5uUivukBLhCQgIN5D32kT8J2T2C7OL5NtskQlUs+ayiV7ZxuG2ukwh p5jyLE5muuLXJ/edsKY89L/StiEexvHHy77lw3wIjuY4GHnjcl9TDUgmAZOORix2dAsQ0K QuXApEaVFIOaqGLDEwfutkWdqxJagzwvrKcVfAQmt4cLEQRxosU6ZLs9SwvWy3Tc2B4aQA aRp8Um+HlaU9AzmlUid1pp4JLlt6l5oCYP0bLYp7oGzlZNFRluwP+kVUg7DKKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685899118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2P7akGGa7W3lSHY47S7RacqZtvIg2tv3f2cmgq0+jg0=; b=NHxc72mi1eGtl1cdzUQ1EXVX1qUqM6Jeg1N2kCOIEhSKGTtOeDH3dMN1xZmt5sub9YbGm5 hXPtcb8tb+iLy/5UtZvv5ektbCBWYJUMpBAOvirs0PEspMNDlalYX5UNzaRaRZbBxAVWuC ZsQCVCKTdf67k7tgFVTAPzp1FUR73LrcpIagSc563s1Fen6rqP3NWUIgtCgim5bf++3zkL NwU+SUlo444MVXXLVGBUkEg3pJ7TTLtxpifRf0zxcf+Zvrth6FHhrXvtyZJ3yB3B6QUCqb J/uPxvyf6LIpHdny1o2xac2yhyAC9ymR3gXfKGJunqTi4cXmf/qOPHJkzNvARw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685899118; a=rsa-sha256; cv=none; b=iav4Fk6LFt1S72S9qmaaDpgBLkB18HLg8aBP6Gld66RfWRtrRD4Xq/VcBegZUeLLPUxXpp 8bHcQ3FdShY07hqpqClGEXU3nTJM0yzecXYGV20pq/AIruL7fKJcwzvasXOSdVXp5246Ud virVphZRd44G3YeLDyWkj4slcXxemzBwjFfaf+gsumxvTwcCHyad9s9kEI6ANRULWTqVR+ UA7EctUS/leypWc/8aM36CW/SQC8UjBioXU07SAgEEzk4BywF+Lv/WQTYA+v9go91gmja4 RmeiDkNJc4EMkl0MVt5IcNayrUVBl9WgBRHzfe0X7DQzEOhRys5QN2XMCPu95Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZ3Nt1MsmzF1Y; Sun, 4 Jun 2023 17:18:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 354HIcls010197; Sun, 4 Jun 2023 17:18:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 354HIcR4010196; Sun, 4 Jun 2023 17:18:38 GMT (envelope-from git) Date: Sun, 4 Jun 2023 17:18:38 GMT Message-Id: <202306041718.354HIcR4010196@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Chuck Silvers Subject: git: 89bd147dbf8e - stable/13 - ffs: restore backward compatibility of newfs and makefs with older binaries List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: chs X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 89bd147dbf8e30acf76838a4170025261c2f3b38 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by chs: URL: https://cgit.FreeBSD.org/src/commit/?id=89bd147dbf8e30acf76838a4170025261c2f3b38 commit 89bd147dbf8e30acf76838a4170025261c2f3b38 Author: Chuck Silvers AuthorDate: 2023-05-30 02:26:28 +0000 Commit: Chuck Silvers CommitDate: 2023-06-04 11:00:22 +0000 ffs: restore backward compatibility of newfs and makefs with older binaries The previous change to CGSIZE had the unintended side-effect of allowing newfs and makefs to create file systems that would fail validation when examined by older commands and kernels, by allowing newfs/makefs to pack slightly more blocks into a CG than those older binaries think is valid. Fix this by having newfs/makefs artificially restrict the number of blocks in a CG to the slightly smaller value that those older binaries will accept. The validation code will continue to accept the slightly larger value that the current newfs/makefs (before this change) could create. Fixes: 0a6e34e950cd5889122a199c34519b67569be9cc Reviewed by: mckusick MFC after: 3 days Sponsored by: Netflix (cherry picked from commit d464a7698de8fe18530ea65fac90dce56b860a59) --- sbin/newfs/mkfs.c | 26 +++++++++++++++++++++++--- usr.sbin/makefs/ffs/mkfs.c | 26 +++++++++++++++++++++++--- 2 files changed, 46 insertions(+), 6 deletions(-) diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c index 42866f9b1426..7b55c5c1f229 100644 --- a/sbin/newfs/mkfs.c +++ b/sbin/newfs/mkfs.c @@ -76,6 +76,23 @@ __FBSDID("$FreeBSD$"); #define UMASK 0755 #define POWEROF2(num) (((num) & ((num) - 1)) == 0) +/* + * The definition of "struct cg" used to contain an extra field at the end + * to represent the variable-length data that followed the fixed structure. + * This had the effect of artificially limiting the number of blocks that + * newfs would put in a CG, since newfs thought that the fixed-size header + * was bigger than it really was. When we started validating that the CG + * header data actually fit into one fs block, the placeholder field caused + * a problem because it caused struct cg to be a different size depending on + * platform. The placeholder field was later removed, but this caused a + * backward compatibility problem with older binaries that still thought + * struct cg was larger, and a new file system could fail validation if + * viewed by the older binaries. To avoid this compatibility problem, we + * now artificially reduce the amount of space that the variable-length data + * can use such that new file systems will pass validation by older binaries. + */ +#define CGSIZEFUDGE 8 + static struct csum *fscs; #define sblock disk.d_fs #define acg disk.d_cg @@ -369,7 +386,8 @@ retry: sblock.fs_fpg = minfpg; sblock.fs_ipg = roundup(howmany(sblock.fs_fpg, fragsperinode), INOPB(&sblock)); - if (CGSIZE(&sblock) < (unsigned long)sblock.fs_bsize) + if (CGSIZE(&sblock) < (unsigned long)sblock.fs_bsize - + CGSIZEFUDGE) break; density -= sblock.fs_fsize; } @@ -388,9 +406,11 @@ retry: if (Oflag > 1 || (Oflag == 1 && sblock.fs_ipg <= 0x7fff)) { if (sblock.fs_size / sblock.fs_fpg < MINCYLGRPS) break; - if (CGSIZE(&sblock) < (unsigned long)sblock.fs_bsize) + if (CGSIZE(&sblock) < (unsigned long)sblock.fs_bsize - + CGSIZEFUDGE) continue; - if (CGSIZE(&sblock) == (unsigned long)sblock.fs_bsize) + if (CGSIZE(&sblock) == (unsigned long)sblock.fs_bsize - + CGSIZEFUDGE) break; } sblock.fs_fpg -= sblock.fs_frag; diff --git a/usr.sbin/makefs/ffs/mkfs.c b/usr.sbin/makefs/ffs/mkfs.c index d48dc65aac68..4e88dae7aae8 100644 --- a/usr.sbin/makefs/ffs/mkfs.c +++ b/usr.sbin/makefs/ffs/mkfs.c @@ -80,6 +80,23 @@ static int count_digits(int); #define UMASK 0755 #define POWEROF2(num) (((num) & ((num) - 1)) == 0) +/* + * The definition of "struct cg" used to contain an extra field at the end + * to represent the variable-length data that followed the fixed structure. + * This had the effect of artificially limiting the number of blocks that + * newfs would put in a CG, since newfs thought that the fixed-size header + * was bigger than it really was. When we started validating that the CG + * header data actually fit into one fs block, the placeholder field caused + * a problem because it caused struct cg to be a different size depending on + * platform. The placeholder field was later removed, but this caused a + * backward compatibility problem with older binaries that still thought + * struct cg was larger, and a new file system could fail validation if + * viewed by the older binaries. To avoid this compatibility problem, we + * now artificially reduce the amount of space that the variable-length data + * can use such that new file systems will pass validation by older binaries. + */ +#define CGSIZEFUDGE 8 + static union { struct fs fs; char pad[SBLOCKSIZE]; @@ -347,7 +364,8 @@ ffs_mkfs(const char *fsys, const fsinfo_t *fsopts, time_t tstamp) sblock.fs_fpg = minfpg; sblock.fs_ipg = roundup(howmany(sblock.fs_fpg, fragsperinode), INOPB(&sblock)); - if (CGSIZE(&sblock) < (unsigned long)sblock.fs_bsize) + if (CGSIZE(&sblock) < (unsigned long)sblock.fs_bsize - + CGSIZEFUDGE) break; density -= sblock.fs_fsize; } @@ -366,9 +384,11 @@ ffs_mkfs(const char *fsys, const fsinfo_t *fsopts, time_t tstamp) INOPB(&sblock)); if (sblock.fs_size / sblock.fs_fpg < 1) break; - if (CGSIZE(&sblock) < (unsigned long)sblock.fs_bsize) + if (CGSIZE(&sblock) < (unsigned long)sblock.fs_bsize - + CGSIZEFUDGE) continue; - if (CGSIZE(&sblock) == (unsigned long)sblock.fs_bsize) + if (CGSIZE(&sblock) == (unsigned long)sblock.fs_bsize - + CGSIZEFUDGE) break; sblock.fs_fpg -= sblock.fs_frag; sblock.fs_ipg = roundup(howmany(sblock.fs_fpg, fragsperinode), From nobody Sun Jun 4 18:42:37 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZ5Fn2pgLz4Zd71; Sun, 4 Jun 2023 18:42:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZ5Fn1ymXz49GQ; Sun, 4 Jun 2023 18:42:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685904157; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8K2KwWmDDzF0MFBFQXT2vR/n6g6dtmRE9EaVC9n9DI4=; b=mUjv9ET5TtIwz5+sZFI6fHDjgJ6P4xhzp8fzJIDcXJ1X/lCgbEXwIY4SoWOzlOsUl0SiH0 znG6cG8lVMf3K1YL91TV3WfwXjAcTHZbTORIsWlreTeMz65NLFUHZKBh0trxzxe3W9q4kq s9tB7PNhNHrexy2nw+Tt9TIBH8H87dRpsnTtter54v9GFLzCqPRENpTABdAExTSq+zVFsO l8DAD6m/qivhvRpOzgwmAr1zgFE5fgmiQivnPR30X/jNLruX8Fdk5f/LeHh6ZfNDLYrZlE RqjBC/w15C0+VuYu0kLSz5h3CGrqjixXATb5rXkcyLkS3mFEtVnmKYaqrRNLdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685904157; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8K2KwWmDDzF0MFBFQXT2vR/n6g6dtmRE9EaVC9n9DI4=; b=OIPanPaFw46+svz/ZnJjVpgYy0LANsKHuDC0t2sAH95b3xjlEiiF8S7kWg5GpoZF1nruSY DMPTg0gLeM6vJ8daH//Q/RAvl+qp1tN0F0Ji5JEm6tSZ1ZPcCm60LfrZ6+AR9vxdsJbAgF JL/7BdoEClxq0m9OWnh99NqD+O5PJ0nG/HUlowTffua5XymKhyWsL2MNpv8qqmKqsGqgKh k6DPfSSBuEdVS+zahFwNjy7qAz9Dn7dDkuFNx9OCPIKOxsy7BkKa2jkpZGh7jNdtJs99Ff LrO5YGyYFUJNzkqfHb/xDlUwD59/F1ICQGt5r6twYVNLsowHuyqoBOF5/lZw2g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685904157; a=rsa-sha256; cv=none; b=pjiP9tf1hL2TM4JN2r9x7dbSY7Fz/BepLPeqtqsSEnUtMc645l9cs+7RsxLQVoBdEAWH5f AofhBHQB+DbV1CAiipMGbuHTEy2qgNNFM8NdKr87TBqw4nH8yFc/bEs3oNqrp0uFN+pnMw 77f8KX8db6foUQ3JAtnXrs/tE+hKL+Nfhprv6iGyVeo+gQVWQj/YAOHfPbYCnk2+8LDSK2 dwPZRyDtFKZV+lRv2TGFYKth6P3DFX+oYS+RavE4CoptU18j0clBn7hDPksqAVG2iX2nvS PGwGyl9c73zkXoxsMG7IbFlZfRxshw+/LtOuK3k1GWbRX763QAqcIiPCqpBUnA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZ5Fn12X3zHbV; Sun, 4 Jun 2023 18:42:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 354IgbPE057426; Sun, 4 Jun 2023 18:42:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 354IgbOj057425; Sun, 4 Jun 2023 18:42:37 GMT (envelope-from git) Date: Sun, 4 Jun 2023 18:42:37 GMT Message-Id: <202306041842.354IgbOj057425@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: 59588a546f55 - main - Revert "tslog: Annotate some early boot functions" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 59588a546f55523d6fd37ab42eb08b719311d7d6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=59588a546f55523d6fd37ab42eb08b719311d7d6 commit 59588a546f55523d6fd37ab42eb08b719311d7d6 Author: Colin Percival AuthorDate: 2023-06-04 18:39:45 +0000 Commit: Colin Percival CommitDate: 2023-06-04 18:39:45 +0000 Revert "tslog: Annotate some early boot functions" The change to subr_boot.c broke the libsa build because the TSLOG macros have their own definitions for the boot loader -- I didn't realize that the loader code used subr_boot.c. I'm currently testing a fix and I'll revert this revert once I'm satisfied that everything works, but I don't want to leave the tree broken for too long. This reverts commit 469cfa3c30ee7a5ddeb597d0a8c3e7cac909b27a. --- sys/amd64/amd64/fpu.c | 3 --- sys/amd64/amd64/initcpu.c | 4 ---- sys/amd64/amd64/machdep.c | 2 -- sys/amd64/amd64/pmap.c | 4 ---- sys/kern/kern_cons.c | 3 --- sys/kern/link_elf.c | 7 ------- sys/kern/subr_boot.c | 5 ----- sys/kern/subr_kdb.c | 3 --- sys/kern/subr_param.c | 4 ---- sys/kern/subr_pcpu.c | 2 -- sys/kern/subr_prf.c | 3 --- sys/x86/pci/pci_early_quirks.c | 3 --- sys/x86/x86/identcpu.c | 7 +------ sys/x86/xen/pv.c | 3 --- 14 files changed, 1 insertion(+), 52 deletions(-) diff --git a/sys/amd64/amd64/fpu.c b/sys/amd64/amd64/fpu.c index 1310a27911fe..a3421cf0d496 100644 --- a/sys/amd64/amd64/fpu.c +++ b/sys/amd64/amd64/fpu.c @@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -361,7 +360,6 @@ fpuinit(void) u_int mxcsr; u_short control; - TSENTER(); if (IS_BSP()) fpuinit_bsp1(); @@ -403,7 +401,6 @@ fpuinit(void) ldmxcsr(mxcsr); start_emulating(); intr_restore(saveintr); - TSEXIT(); } /* diff --git a/sys/amd64/amd64/initcpu.c b/sys/amd64/amd64/initcpu.c index 0de4bc3e2d60..a17ef89ba9f8 100644 --- a/sys/amd64/amd64/initcpu.c +++ b/sys/amd64/amd64/initcpu.c @@ -276,7 +276,6 @@ initializecpu(void) uint64_t msr; uint32_t cr4; - TSENTER(); cr4 = rcr4(); if ((cpu_feature & CPUID_XMM) && (cpu_feature & CPUID_FXSR)) { cr4 |= CR4_FXSR | CR4_XMM; @@ -312,9 +311,7 @@ initializecpu(void) if (cpu_stdext_feature & CPUID_STDEXT_SMAP) cr4 |= CR4_SMAP; } - TSENTER2("load_cr4"); load_cr4(cr4); - TSEXIT2("load_cr4"); /* Reload cpu ext features to reflect cr4 changes */ if (IS_BSP() && cold) identify_cpu_ext_features(); @@ -343,7 +340,6 @@ initializecpu(void) if (!IS_BSP()) cpu_init_small_core(); - TSEXIT(); } void diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index fa3ffe84bfe1..757606311123 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -874,7 +874,6 @@ getmemsize(caddr_t kmdp, u_int64_t first) quad_t dcons_addr, dcons_size; int page_counter; - TSENTER(); /* * Tell the physical memory allocator about pages used to store * the kernel and preloaded data. See kmem_bootstrap_free(). @@ -1130,7 +1129,6 @@ do_next: /* Map the message buffer. */ msgbufp = (struct msgbuf *)PHYS_TO_DMAP(phys_avail[pa_indx]); - TSEXIT(); } static caddr_t diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 123811ed573f..b2abab429730 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -1668,7 +1668,6 @@ create_pagetables(vm_paddr_t *firstaddr) #endif int i, j, ndm1g, nkpdpe, nkdmpde; - TSENTER(); /* Allocate page table pages for the direct map */ ndmpdp = howmany(ptoa(Maxmem), NBPDP); if (ndmpdp < 4) /* Minimum 4GB of dirmap */ @@ -1885,7 +1884,6 @@ create_pagetables(vm_paddr_t *firstaddr) } kernel_pml4 = (pml4_entry_t *)PHYS_TO_DMAP(KPML4phys); - TSEXIT(); } /* @@ -1908,7 +1906,6 @@ pmap_bootstrap(vm_paddr_t *firstaddr) u_long res; int i; - TSENTER(); KERNend = *firstaddr; res = atop(KERNend - (vm_paddr_t)kernphys); @@ -2064,7 +2061,6 @@ pmap_bootstrap(vm_paddr_t *firstaddr) */ load_cr4(rcr4() | CR4_PCIDE); } - TSEXIT(); } /* diff --git a/sys/kern/kern_cons.c b/sys/kern/kern_cons.c index ff57b2bdfd8a..7c63b8e4ed9c 100644 --- a/sys/kern/kern_cons.c +++ b/sys/kern/kern_cons.c @@ -64,7 +64,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -135,7 +134,6 @@ cninit(void) { struct consdev *best_cn, *cn, **list; - TSENTER(); /* * Check if we should mute the console (for security reasons perhaps) * It can be changes dynamically using sysctl kern.consmute @@ -197,7 +195,6 @@ cninit(void) */ early_putc = NULL; #endif - TSEXIT(); } void diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c index bd8994ff0e4d..b410469b6270 100644 --- a/sys/kern/link_elf.c +++ b/sys/kern/link_elf.c @@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include @@ -1432,7 +1431,6 @@ relocate_file1(elf_file_t ef, elf_lookup_fn lookup, elf_reloc_fn reloc, const Elf_Rela *rela; const char *symname; - TSENTER(); #define APPLY_RELOCS(iter, tbl, tblsize, type) do { \ for ((iter) = (tbl); (iter) != NULL && \ (iter) < (tbl) + (tblsize) / sizeof(*(iter)); (iter)++) { \ @@ -1451,15 +1449,12 @@ relocate_file1(elf_file_t ef, elf_lookup_fn lookup, elf_reloc_fn reloc, } while (0) APPLY_RELOCS(rel, ef->rel, ef->relsize, ELF_RELOC_REL); - TSENTER2("ef->rela"); APPLY_RELOCS(rela, ef->rela, ef->relasize, ELF_RELOC_RELA); - TSEXIT2("ef->rela"); APPLY_RELOCS(rel, ef->pltrel, ef->pltrelsize, ELF_RELOC_REL); APPLY_RELOCS(rela, ef->pltrela, ef->pltrelasize, ELF_RELOC_RELA); #undef APPLY_RELOCS - TSEXIT(); return (0); } @@ -1955,7 +1950,6 @@ link_elf_ireloc(caddr_t kmdp) struct elf_file eff; elf_file_t ef; - TSENTER(); ef = &eff; bzero_early(ef, sizeof(*ef)); @@ -1972,7 +1966,6 @@ link_elf_ireloc(caddr_t kmdp) link_elf_preload_parse_symbols(ef); relocate_file1(ef, elf_lookup_ifunc, elf_reloc, true); - TSEXIT(); } #if defined(__aarch64__) || defined(__amd64__) diff --git a/sys/kern/subr_boot.c b/sys/kern/subr_boot.c index 73e75ba11750..057ffb5b7e08 100644 --- a/sys/kern/subr_boot.c +++ b/sys/kern/subr_boot.c @@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$"); #endif #include #include -#include #ifdef _KERNEL #define SETENV(k, v) kern_setenv(k, v) @@ -96,14 +95,12 @@ boot_env_to_howto(void) int i, howto; char *val; - TSENTER(); for (howto = 0, i = 0; howto_names[i].ev != NULL; i++) { val = GETENV(howto_names[i].ev); if (val != NULL && strcasecmp(val, "no") != 0) howto |= howto_names[i].mask; FREE(val); } - TSEXIT(); return (howto); } @@ -196,14 +193,12 @@ boot_parse_cmdline_delim(char *cmdline, const char *delim) char *v; int howto; - TSENTER(); howto = 0; while ((v = strsep(&cmdline, delim)) != NULL) { if (*v == '\0') continue; howto |= boot_parse_arg(v); } - TSEXIT(); return (howto); } diff --git a/sys/kern/subr_kdb.c b/sys/kern/subr_kdb.c index 2f419b4d8ad5..f8b37c2319b0 100644 --- a/sys/kern/subr_kdb.c +++ b/sys/kern/subr_kdb.c @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -560,7 +559,6 @@ kdb_init(void) struct kdb_dbbe *be, **iter; int cur_pri, pri; - TSENTER(); kdb_active = 0; kdb_dbbe = NULL; cur_pri = -1; @@ -584,7 +582,6 @@ kdb_init(void) printf("KDB: current backend: %s\n", kdb_dbbe->dbbe_name); } - TSEXIT(); } /* diff --git a/sys/kern/subr_param.c b/sys/kern/subr_param.c index b988f28944cc..bb8cb5871af2 100644 --- a/sys/kern/subr_param.c +++ b/sys/kern/subr_param.c @@ -171,7 +171,6 @@ void init_param1(void) { - TSENTER(); #if !defined(__arm64__) TUNABLE_INT_FETCH("kern.kstack_pages", &kstack_pages); #endif @@ -246,7 +245,6 @@ init_param1(void) pid_max = 300; TUNABLE_INT_FETCH("vfs.unmapped_buf_allowed", &unmapped_buf_allowed); - TSEXIT(); } /* @@ -256,7 +254,6 @@ void init_param2(long physpages) { - TSENTER(); /* Base parameters */ maxusers = MAXUSERS; TUNABLE_INT_FETCH("kern.maxusers", &maxusers); @@ -338,7 +335,6 @@ init_param2(long physpages) if (maxpipekva > (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) / 64) maxpipekva = (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) / 64; - TSEXIT(); } /* diff --git a/sys/kern/subr_pcpu.c b/sys/kern/subr_pcpu.c index c13a52dffccd..c4c220d66c97 100644 --- a/sys/kern/subr_pcpu.c +++ b/sys/kern/subr_pcpu.c @@ -103,7 +103,6 @@ dpcpu_init(void *dpcpu, int cpuid) { struct pcpu *pcpu; - TSENTER(); pcpu = pcpu_find(cpuid); pcpu->pc_dynamic = (uintptr_t)dpcpu - DPCPU_START; @@ -116,7 +115,6 @@ dpcpu_init(void *dpcpu, int cpuid) * Place it in the global pcpu offset array. */ dpcpu_off[cpuid] = pcpu->pc_dynamic; - TSEXIT(); } static void diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c index db4ef168bc70..0506c21b5ad8 100644 --- a/sys/kern/subr_prf.c +++ b/sys/kern/subr_prf.c @@ -58,7 +58,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -1038,7 +1037,6 @@ msgbufinit(void *ptr, int size) static struct msgbuf *oldp = NULL; bool print_boot_tag; - TSENTER(); size -= sizeof(*msgbufp); cp = (char *)ptr; print_boot_tag = !msgbufmapped; @@ -1054,7 +1052,6 @@ msgbufinit(void *ptr, int size) if (print_boot_tag && *current_boot_tag != '\0') printf("%s\n", current_boot_tag); oldp = msgbufp; - TSEXIT(); } /* Sysctls for accessing/clearing the msgbuf */ diff --git a/sys/x86/pci/pci_early_quirks.c b/sys/x86/pci/pci_early_quirks.c index ab8072b38d14..97ba7e1a0631 100644 --- a/sys/x86/pci/pci_early_quirks.c +++ b/sys/x86/pci/pci_early_quirks.c @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include /* XXX: enable this once the KPI is available */ @@ -318,7 +317,5 @@ void pci_early_quirks(void) { - TSENTER(); intel_graphics_stolen(); - TSEXIT(); } diff --git a/sys/x86/x86/identcpu.c b/sys/x86/x86/identcpu.c index 3ff59344e17d..42cca3250481 100644 --- a/sys/x86/x86/identcpu.c +++ b/sys/x86/x86/identcpu.c @@ -1424,7 +1424,6 @@ identify_hypervisor(void) u_int regs[4]; char *p; - TSENTER(); /* * If CPUID2_HV is set, we are running in a hypervisor environment. */ @@ -1433,10 +1432,8 @@ identify_hypervisor(void) identify_hypervisor_cpuid_base(); /* If we have a definitive vendor, we can return now. */ - if (*hv_vendor != '\0') { - TSEXIT(); + if (*hv_vendor != '\0') return; - } } /* @@ -1449,13 +1446,11 @@ identify_hypervisor(void) if (regs[1] == VMW_HVMAGIC) { vm_guest = VM_GUEST_VMWARE; freeenv(p); - TSEXIT(); return; } } freeenv(p); } - TSEXIT(); } bool diff --git a/sys/x86/xen/pv.c b/sys/x86/xen/pv.c index b3da26e9b78e..367214fe35be 100644 --- a/sys/x86/xen/pv.c +++ b/sys/x86/xen/pv.c @@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -418,7 +417,6 @@ xen_pvh_parse_preload_data(uint64_t modulep) char *envp; char acpi_rsdp[19]; - TSENTER(); if (start_info->modlist_paddr != 0) { struct hvm_modlist_entry *mod; const char *cmdline; @@ -509,7 +507,6 @@ xen_pvh_parse_preload_data(uint64_t modulep) #ifdef DDB xen_pvh_parse_symtab(); #endif - TSEXIT(); return (kmdp); } From nobody Sun Jun 4 19:01:00 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZ5g11cCrz4ZhHM for ; Sun, 4 Jun 2023 19:01:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZ5g112bJz4DD0; Sun, 4 Jun 2023 19:01:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685905261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ro3VqvYCKuTaOrl6gSf5EbNI8VrW9v0P9ER2vD1AnEg=; b=N8LiMnHJ8l5JkWWJKWKiYvnHCOaJyA9NOsOq7GMbX/yueFexc0L4zvL1M1RV0/MsVkVFGC oCqb79jmrapTih9Jsomxsk/DuoSC7o8W0oBqlect33uXMEsUfhG+bvDe7gpnRO5hdMZIfE FP3wrrIjX3av5Q9+gG3IlwLvr6/xDnc0T6O63fMQ02UzZa9L+2PJW9qz56O/oJYMmrmscO QCJr5Qp7h+JqpyvQ8gSe7KOhAZUlprvCpdj5+jB66Sdeck97kqvKB9bjveRlVeqUKLKox+ QZ0FyUZcrQqwx/L8Ho/jp6T9UpvKKdmQa0YgmsykgYSSEzjp+ADX+RzFaUfJlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685905261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ro3VqvYCKuTaOrl6gSf5EbNI8VrW9v0P9ER2vD1AnEg=; b=NuQN4j3C0Z2Okv7v5P9FgoihwKuytxqygfaZC3JH2HWU3KYniq6hHf9YltMJ7MU7zKOTtT gLDnv45aQfrRVNJ0zAk/WPyXelMF8dcYvIFBMc1jNq6wylukmTdoMBBBJdjf8T7UCPo8FH 33ZYi/2Db8IXhQDfnOIOgJGbLIIUmpqL/vmain9FIRh00F0OY9JuPxkfKS+g/+2h+QK2Zx 81PycSrdBJwPBFma5H0LiNM8C1yHkpJxWZ9k1iW4Zuacqry30Pq2HtMGEq4Z5MjTjnmR2C ofmQyzeT6thyYgkJVK9nuJ0b4rv+iioKG7rb0NDfdxIwotrQJWPgGuV4D38yhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685905261; a=rsa-sha256; cv=none; b=cqN45G5abZ/BUwVceerNIuOzGGOU31vZY7gl+ttcHPFxehsf4S8KM7ll27EzAMPdE29AjR mNqKt0yYPvEE1Ktyeb5EQ6lkvnJaHJVzl8741OJ+XHs4tXXz0gym7O8D7JdLIJVo548LKJ eI8HrBKAwdJVQRnldLH4Wvo+RFado0RBMWSJ2BV1mWyINP5cc+85WUs8c9VghI7uS1Cwoz GuX9JPVjadNNkFRZ1QuHt4i2oc1wwrhsxjQrZ2ycz5vhYs2FaueqAEGlp6wuZfeARgKtpF KJYr2f2Qyg9XDzFNKuFsw2xLw+x72Rfm8ga66R939KwMMWd9KOpJinnIVahBCQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZ5g06zPzzHrq; Sun, 4 Jun 2023 19:01:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 354J107K086599; Sun, 4 Jun 2023 19:01:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 354J10Ms086598; Sun, 4 Jun 2023 19:01:00 GMT (envelope-from git) Date: Sun, 4 Jun 2023 19:01:00 GMT Message-Id: <202306041901.354J10Ms086598@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Dimitry Andric Subject: git: 791701a7dc62..3b922bd9516f - vendor/llvm-project/release-16.x - vendor branch updated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/vendor/llvm-project/release-16.x X-Git-Reftype: branch X-Git-Commit: 3b922bd9516f6dc5146815ed8d4363fcbe97997f X-Git-Oldrev: 791701a7dc6225242c41502cb3ed6874623c1785 X-Git-Newrev: 3b922bd9516f6dc5146815ed8d4363fcbe97997f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch vendor/llvm-project/release-16.x has been updated by dim: URL: https://cgit.FreeBSD.org/src/log/?id=791701a7dc62..3b922bd9516f 3b922bd9516f Vendor import of llvm-project branch release/16.x llvmorg-16.0.5-0-g185b81e034ba (aka 16.0.5 release). From nobody Sun Jun 4 19:01:00 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZ5g11jNtz4Zh0n for ; Sun, 4 Jun 2023 19:01:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZ5g111lSz4DCy; Sun, 4 Jun 2023 19:01:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685905261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IH5t/aLNzrclnbvTPnj/qPWWHZWtvhJE3HYLoCGATXA=; b=Uwhq9PpPyBOo8V+cvUVTdTIYjk76z8kPBBnzDmLyTKp9AgEYsOkjsE5cyaMvJxLmxG9gX0 xR0/WzWlcr1Ih8l6lsuHmBheu6IFxbg2gN3L+Ej69JtyCe/z6aKXz12UvQyvdGAlU1AalJ 4G1roXoQ35lw5pku6HXvwZ0S3oDXLOYIL/wDGsNIfnunI4M/alh1ZDVWx5NZ18BML3vxbj tpcqydJNXgOI+E9+CKT3S7VOfAFgf/SQCCV2G+hmdmNqU6S2Z12GiZqzhXoIp/mEtbN3kA dsZbG4r9B2i2FoAV4lf+qo/NRk0ZJWukdNY0krTlCQNlgrA1NI8V3hWPHO0DSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685905261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IH5t/aLNzrclnbvTPnj/qPWWHZWtvhJE3HYLoCGATXA=; b=PxANWdRYYp6XEwGacPq2O0MhSLFeEeHnsjxoRy0KH2hFTNTfyOZAoWjn9g1pZodNW5BZlp hdJATYX8LiU7nncvmsEazCTTr6hIihVF7Nmi4mUm0ssqhAx68TpFqdBK9pvypgH0SAvRLc HNXNaNSh+cZMk6LHTJEdgMbIo9uG9cBb7ovxm9Tkkawzt2tYjssjiVlAs+jFGgMySuStE3 3RUqNiPPfX8+/tJMZLmrGOOZAN2/wgKECf9vN1m55aALrAV5DNu5PrVroZJ+3sKqbFRmwp pJZ11BmK674CKg2S6Ztt8AvDXvxG67hznf5myraTrLiXoz3tg5OAOxD/XYZJxQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685905261; a=rsa-sha256; cv=none; b=nqPwlIcgP/6Fa9pPFxL0F5LgbBTIuyPnBdykcuS7sTMMZ0zo+ktTbc43kFvSY44rkFtrw1 kDgyD3cqKWtzDEiQ4DPGnqQyFac7foZ6p5xCGmHo9ww0WUx81XWXm1nVTaujP76vgLl25/ WAz0XDvxQb3uefGBF0LwxOtFSZRo0KMQPqkpQaUfD/GBtaBYvxgoVVDAKSRSGkfrdGknF8 8H2aWUnRZ8iMGGS10aGjMjt2OfZ3yhWGylw27YY0ipaDJBsD4sgu3kze0CCQJLn6J/6qPZ wlWTyOz2p9VuajVdfTYmKIUgoLuDqUvt0VXU05X1YAKpfdj6+zJ+HxH4csq8Aw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZ5g106KdzHrr; Sun, 4 Jun 2023 19:01:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 354J10AT086618; Sun, 4 Jun 2023 19:01:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 354J10R1086617; Sun, 4 Jun 2023 19:01:00 GMT (envelope-from git) Date: Sun, 4 Jun 2023 19:01:00 GMT Message-Id: <202306041901.354J10R1086617@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Dimitry Andric Subject: git: 5c7d0391c35e - Create tag vendor/llvm-project/llvmorg-16.0.5-0-g185b81e034ba List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/tags/vendor/llvm-project/llvmorg-16.0.5-0-g185b81e034ba X-Git-Reftype: annotated tag X-Git-Commit: 5c7d0391c35e945f4b4f8f38fd74ed2e80a2219e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The annotated tag vendor/llvm-project/llvmorg-16.0.5-0-g185b81e034ba has been created by dim: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/llvm-project/llvmorg-16.0.5-0-g185b81e034ba tag vendor/llvm-project/llvmorg-16.0.5-0-g185b81e034ba Tagger: Dimitry Andric TaggerDate: 2023-06-04 19:00:38 +0000 Tag llvm-project branch release/16.x llvmorg-16.0.5-0-g185b81e034ba (aka 16.0.5 release). commit 3b922bd9516f6dc5146815ed8d4363fcbe97997f Author: Dimitry Andric AuthorDate: 2023-06-04 19:00:19 +0000 Commit: Dimitry Andric CommitDate: 2023-06-04 19:00:19 +0000 Vendor import of llvm-project branch release/16.x llvmorg-16.0.5-0-g185b81e034ba (aka 16.0.5 release). From nobody Sun Jun 4 19:52:52 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZ6pr3w93z4ZsHx; Sun, 4 Jun 2023 19:52:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZ6pr3NGVz4KpK; Sun, 4 Jun 2023 19:52:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685908372; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RIeqLpcd5uN7jwCjfWAlKwDjd6PbgMHSM8pN8qwOPZY=; b=vN6yuKwXmVmGDV4aZ6FMjTeVI5o2HNvXFvuXIpDc/PYr420ubicHRfeUiTsLsgQ4kCm4xq a1MeZOtiZVgL21uiXyZYasvkweKR3ZvM/rX8ElV4dkT7jmmPnDX9b0qWOKO513V+DT+9O5 QVcAX90HjOKWFd7GNWnkzwlvcOFsSMn1r9TVumdWkfohWMAs0pl3l9IyLPb51jRtLVcZIt XaFbU2xe0JKbVvV9Qiq1uo2sATqpUWEzLXF5438s0+NYV6RVgawhsuweSOqUF0ude8K7jc J7nC1mfgjOC1aLYUyGXPC7arhyCyhAP6DzhVLNJmTJWC6sQ3iDgXPhaf8nl2Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685908372; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RIeqLpcd5uN7jwCjfWAlKwDjd6PbgMHSM8pN8qwOPZY=; b=qT58t1hdvJLLiLgmFeN4Zlb2Ce/yWwE19wenOwARJfC58yLLsTgogTiDzAsDNtYu6aeJUM z6aYBb7TXTCBLY1s3iv+WzCQZMB9srWsUvWT4TE8MWa3IgQVFtwm0bL8LuZyLkqzc/S4y/ lHmyCLsdN8dMB7xegqV0049YSbM7lieBmfuC6DHD3YOofkQEvJCg6/UyKpwxMuBwfgm7mn 0D5b/Sr455+nkoARTWdDigwTULHOEc1yn3e5kFJCDpRU1w/bIiL9Cu8/WH/MfALfsLhBTh Sprgw2zuYQxlBRLYf/cBTOynNWeuhV4W8gfy+5Sx4wmLGeGoBWg6ahJMeXCMBQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685908372; a=rsa-sha256; cv=none; b=icvCbHjIwOF37hTNhigprEbACxc8M5ltepVEherzIa8ZxrZRfdvpsDoJJkw4roV4zJzv00 eJ7Q0KfTBxHkdb0p8wGdTBP6jVrVHcESu76IMEVLJrnTdzLuBYzKmN4RoKZqnrIfun0U0T vbiZTo7uJTrAJB9p3uB+QaWt4bLFo3jY8jPiZbXx9UOgMLKy37n8isppEqePXfU2+OS0Py moGAhMIg/HT+qoVMDuf9yijI0S9MYjwn1oQyFp0kRrkBAdTrDLjD+0xpktAZ1QhJC909Nr WvWl+Is7bQtPxny5xRzAgaVaBcNNaaowSrVnBecHdXpu4k6nQImKaE8OVJjXdA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZ6pr2R0tzK3h; Sun, 4 Jun 2023 19:52:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 354JqqCU072575; Sun, 4 Jun 2023 19:52:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 354Jqq4v072574; Sun, 4 Jun 2023 19:52:52 GMT (envelope-from git) Date: Sun, 4 Jun 2023 19:52:52 GMT Message-Id: <202306041952.354Jqq4v072574@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 6fa30de4d3ca - main - nfsuserd.8: Change machines to machine's List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6fa30de4d3caf5be3fd4dd44bf73fda0fb7616c5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=6fa30de4d3caf5be3fd4dd44bf73fda0fb7616c5 commit 6fa30de4d3caf5be3fd4dd44bf73fda0fb7616c5 Author: Rick Macklem AuthorDate: 2023-06-04 19:52:04 +0000 Commit: Rick Macklem CommitDate: 2023-06-04 19:52:04 +0000 nfsuserd.8: Change machines to machine's Change machines to machine's. Suggested by: grahamperrin Differential Revision: https://reviews.freebsd.org/D39877 --- usr.sbin/nfsuserd/nfsuserd.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/nfsuserd/nfsuserd.8 b/usr.sbin/nfsuserd/nfsuserd.8 index 9fff5cd12a30..1912043668b5 100644 --- a/usr.sbin/nfsuserd/nfsuserd.8 +++ b/usr.sbin/nfsuserd/nfsuserd.8 @@ -53,7 +53,7 @@ owner and owner_group strings. It also provides support for manage-gids and must be running on the server if this is being used for any version of NFS. .Pp -Upon startup, it loads the machines DNS domain name, plus timeout and cache size +Upon startup, it loads the machine's DNS domain name, plus timeout and cache size limit into the kernel. It then preloads the cache with group and user information, up to the cache size limit and forks off From nobody Sun Jun 4 23:35:08 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZClK2ZGyz4Zc9d; Sun, 4 Jun 2023 23:35:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZClK1WJWz3spm; Sun, 4 Jun 2023 23:35:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685921709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OuJd66LnZYrw1sFkaeWN2zPxNViiV254c3bpcOtbojM=; b=Pd0VcDHWe1qQRBtUSHlVj7OWpOeuC2+55SnjraEblCc46OTjbbUDQxQCuaS3M2pXKehSmb J2VYJdIIy5yzqbBk8tJi0v7klsIpMOUVBLHNmJOQz4qP2BjDHtGaqvHH93yt7OJCv7lmlQ pOPUqjhg27wt8BtlNyLGqAHmOhtT6PA6EGRNKH1HrmY0jbLtVfepdMbJBU9PYZV41ERr0D 5WY4CvNdCT20EOFkw/D/f8OBpdQrxYQinMX8pmEnMGh8EmSzwYs4uasVrOLNRxPT/RaCAe j829li55OjnUYmBO0nQeJAddrKkOUk1sh+oJZfIc7xyvKiPIMavTc2QjB6j31g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685921709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OuJd66LnZYrw1sFkaeWN2zPxNViiV254c3bpcOtbojM=; b=xKHcIcPNTpn9Rp+HUpA7DUEuDyIdGyByNOwhpTsLHnFuUyMIRElYt1EpdFDySyfkofRvUs Cuut+POpn0uZ/SrtvNuD74Q58CdvArWkdaqaX3AE+w56dM/PXY8d5D4jfG13U/vp7Oiy3V yUFy3Gst5/KIkccCvC24U+owOc4btHFnQ1B1Otqf7nz+6fH9lCtdeajg1lqW083sBVwJ4W o1KMaiicSfVAxlIRLGo/XXc7MhfhypoDVwgPI7HleYabcWuuJ4pec0KDIrTkgADhfpJ0U3 +6yWwg4DV3/RAkmWL12yLNaaLtFWbLw5kzELZm9iZ0Htq/Dt9TlSdVMjcqQ0ww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685921709; a=rsa-sha256; cv=none; b=DPAj3XUGSPlovcNCn+UQdcfaFJEmkoKZsvHF7Qi5NgMNAD81r3/xkgB2yhtnP9PS1t/Quo gDGz6Rxeer1zrQ84s62SkcJ3aQciCjuQW7aZpc6pgdtmr1LkevxLvxw68+Y1HsvQc8Apeg FAtfT7kS4rBCfKF8tJwpFqDL7BEGXglkbKpavlh0v/Yl/Pd/1LH/1Fpfs3xIMF0h6rOIfB fzvqOW3Xv4PoupXlq6uxxzgfaaOccI+06qPGcOK1A04uhjwaFtyLcnPsarcg/+zhcVI8gN +KHMZnIbuRSs4LS+ZtPq7/WqSbcEkbJb6Qx03bplYltWDx+SthR5SahiG+qp9A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZClK0YvvzQZt; Sun, 4 Jun 2023 23:35:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 354NZ8SV034610; Sun, 4 Jun 2023 23:35:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 354NZ8cX034609; Sun, 4 Jun 2023 23:35:08 GMT (envelope-from git) Date: Sun, 4 Jun 2023 23:35:08 GMT Message-Id: <202306042335.354NZ8cX034609@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Xin LI Subject: git: 4d779448adb3 - main - gve: Fix build on i386 and enable LINT builds. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4d779448adb32ef6424abb781dab87065964d42f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=4d779448adb32ef6424abb781dab87065964d42f commit 4d779448adb32ef6424abb781dab87065964d42f Author: Xin LI AuthorDate: 2023-06-04 23:35:00 +0000 Commit: Xin LI CommitDate: 2023-06-04 23:35:00 +0000 gve: Fix build on i386 and enable LINT builds. Reviewed-by: imp Differential Revision: https://reviews.freebsd.org/D40419 --- share/man/man4/Makefile | 5 +---- sys/amd64/conf/LINT-NOIP | 1 + sys/amd64/conf/NOTES | 3 +++ sys/arm64/conf/NOTES | 3 +++ sys/dev/gve/gve_qpl.c | 6 +++--- sys/i386/conf/NOTES | 3 +++ sys/modules/Makefile | 5 +---- 7 files changed, 15 insertions(+), 11 deletions(-) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 9149a562383f..2567cde793ee 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -891,15 +891,12 @@ _nvme.4= nvme.4 .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" || \ ${MACHINE_CPUARCH} == "aarch64" +_gve.4= gve.4 _ipmi.4= ipmi.4 _linux.4= linux.4 _ossl.4= ossl.4 .endif -.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "aarch64" -_gve.4= gve.4 -.endif - .if ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "aarch64" || \ ${MACHINE_CPUARCH} == "riscv" _cgem.4= cgem.4 diff --git a/sys/amd64/conf/LINT-NOIP b/sys/amd64/conf/LINT-NOIP index 0d4ec1e8c1ac..05b1ce75f57f 100644 --- a/sys/amd64/conf/LINT-NOIP +++ b/sys/amd64/conf/LINT-NOIP @@ -13,6 +13,7 @@ nodevice ale nodevice bxe nodevice em nodevice fxp +nodevice gve nodevice jme nodevice lio nodevice msk diff --git a/sys/amd64/conf/NOTES b/sys/amd64/conf/NOTES index ef0f7076633f..3ae61c8ac922 100644 --- a/sys/amd64/conf/NOTES +++ b/sys/amd64/conf/NOTES @@ -499,6 +499,9 @@ device virtio_console # VirtIO Console device # Linux KVM paravirtualization support device kvm_clock # KVM paravirtual clock driver +# Google Virtual NIC +device gve # Google Virtual NIC (gVNIC) driver + # Microsoft Hyper-V enhancement support device hyperv # HyperV drivers device hvhid # HyperV HID device diff --git a/sys/arm64/conf/NOTES b/sys/arm64/conf/NOTES index ce5b071e5ab5..d309ee346b67 100644 --- a/sys/arm64/conf/NOTES +++ b/sys/arm64/conf/NOTES @@ -68,6 +68,9 @@ device virtio_mmio device virtio_blk device vtnet +# Google Virtual NIC +device gve # Google Virtual NIC (gVNIC) driver + # Microsoft Hyper-V device hyperv diff --git a/sys/dev/gve/gve_qpl.c b/sys/dev/gve/gve_qpl.c index 891d132d2f10..3c6d9af6feee 100644 --- a/sys/dev/gve/gve_qpl.c +++ b/sys/dev/gve/gve_qpl.c @@ -101,9 +101,9 @@ gve_alloc_qpl(struct gve_priv *priv, uint32_t id, int npages, bool single_kva) int i; if (npages + priv->num_registered_pages > priv->max_registered_pages) { - device_printf(priv->dev, "Reached max number of registered pages %lu > %lu\n", - npages + priv->num_registered_pages, - priv->max_registered_pages); + device_printf(priv->dev, "Reached max number of registered pages %ju > %ju\n", + (uintmax_t)npages + priv->num_registered_pages, + (uintmax_t)priv->max_registered_pages); return (EINVAL); } diff --git a/sys/i386/conf/NOTES b/sys/i386/conf/NOTES index 4e4c6193ebab..65218529e565 100644 --- a/sys/i386/conf/NOTES +++ b/sys/i386/conf/NOTES @@ -701,6 +701,9 @@ device virtio_console # VirtIO Console device # Linux KVM paravirtualization support device kvm_clock # KVM paravirtual clock driver +# Google Virtual NIC +device gve # Google Virtual NIC (gVNIC) driver + options HYPERV device hyperv # HyperV drivers device hvhid # HyperV HID device diff --git a/sys/modules/Makefile b/sys/modules/Makefile index 8e91e20720ca..67b95a8db6f7 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -555,13 +555,10 @@ _mlx5ib= mlx5ib .endif .endif -.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" -_gve= gve -.endif - .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \ ${MACHINE_CPUARCH} == "i386" _ena= ena +_gve= gve _iwlwifi= iwlwifi .if ${MK_SOURCELESS_UCODE} != "no" _iwlwififw= iwlwififw From nobody Mon Jun 5 02:24:16 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZHVS3C9cz4b86g; Mon, 5 Jun 2023 02: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZHVS2lSyz4FDH; Mon, 5 Jun 2023 02: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=1685931856; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=61nqXhyoFPr0xYLccQThg4eu8QEV6natZrnELcoMYEw=; b=VsrnBxtLIz8MxXPbCqu3lrsixFcmCJrXxX4o4h28xe7MKNvZ/DK2WNbCbEM7rLbRn5lHhr jTZN5jbYb0O5GcdXa6UHi+YUIUwnWSfXHE/lJz+gmorJjUCLSXeORCj3xPnHe5NyGGWjvg AfIFnfFG52AHAnX0Ljl5GBFVxLcefY6oqCHRXxbWSrAkzTaZFnzJNWWaIBDQz5ghXaaiB0 99l6EtlNmWodbXnoXgWKjhCndSmafWkVTUrWO32uzxapJIBH/7Ir7q+pZERaMY4uMqKNiJ zZr+Bllvai4uo3WIRfsQ1Fq/7W0asAbe60dLsSZwP3uJpj36uLoxfIcEFC8Qsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685931856; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=61nqXhyoFPr0xYLccQThg4eu8QEV6natZrnELcoMYEw=; b=EfK358qvxD8UaIqH5STrIt94UJDt9QqLoyvRQDLC1/0EbiZelCIb7M6jZHluTqIkleaWIC 6wrpcQ1NDZ95wbzksgI2yoeon4e2AdDA06TrBUDFyXUiSFy5aUWQyg9VaFe9GAJmlQehJ7 OQntkFb93uudLz3Xdmx9OsLBFHJCc795RuBpaoiWqV9tiwmH/e2XGkPLAqvG1eXLdBG3dZ WXMCL+H9hlSLvivCnbs5Wdtn79C69vKbt2cPqNYBid39BqUzI00BgzfJUYys2E0zs4dWom DfJA+SmAQlH3J/wey3+HwahHgFFjkcvwHMGZrczvlWczspjA/Nh0kXXSL4nTGA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685931856; a=rsa-sha256; cv=none; b=ls8JO8anLMo60QcNq/6/quX2FX/tQq+ZlkYXZe+Eue3behTRg05Sr84UxYGbI31/YhCYnn KjqePqg7OqktuRBfEFnfEzNq8ojYORxIg8jmYQ1jXRDC9nRN9acm/Gc/IEmMkNriiBxbjW 649p49rhRQanZzraLM/dqrA26cNb4hcGr3s3ckUyUK1ThudbSBZinL2ZcvIL5l26fNzUKn PVnUVK8rxXUEGUrHz585GTAp/6Hs17/ugVtNoexObUMzlUy0/SEnH07O4MjpH1nHUCZCul Vt9kwL/8YHAsx1xkLeuvzV/Jjk9WqNlskm/mbWFQzH2zZDIbgXbszLRr5LRpRg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZHVS1kctzW2r; Mon, 5 Jun 2023 02:24:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3552OGMp014311; Mon, 5 Jun 2023 02:24:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3552OGor014310; Mon, 5 Jun 2023 02:24:16 GMT (envelope-from git) Date: Mon, 5 Jun 2023 02:24:16 GMT Message-Id: <202306050224.3552OGor014310@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Xin LI Subject: git: 37e3f5b23b07 - main - Enable support for printing 8-byte integers. For some reason, most of the code for this was present, but disabled. This is required for POSIX compliance on platforms with 8-byte longs. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 37e3f5b23b0720223186f5a00108fdb8d3e88150 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=37e3f5b23b0720223186f5a00108fdb8d3e88150 commit 37e3f5b23b0720223186f5a00108fdb8d3e88150 Author: Ben Harris AuthorDate: 2001-12-07 13:37:39 +0000 Commit: Xin LI CommitDate: 2023-06-05 02:23:35 +0000 Enable support for printing 8-byte integers. For some reason, most of the code for this was present, but disabled. This is required for POSIX compliance on platforms with 8-byte longs. Obtained-From: NetBSD PR: 238586 Reported-By: Mohamed Akram MFC after: 2 weeks --- usr.bin/hexdump/display.c | 2 +- usr.bin/hexdump/parse.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/usr.bin/hexdump/display.c b/usr.bin/hexdump/display.c index 5e5b30b73fd0..cad548e1ec41 100644 --- a/usr.bin/hexdump/display.c +++ b/usr.bin/hexdump/display.c @@ -123,8 +123,8 @@ print(PR *pr, u_char *bp) double f8; float f4; int16_t s2; - int8_t s8; int32_t s4; + int64_t s8; u_int16_t u2; u_int32_t u4; u_int64_t u8; diff --git a/usr.bin/hexdump/parse.c b/usr.bin/hexdump/parse.c index f59f0d9b6356..c6616fdd24d7 100644 --- a/usr.bin/hexdump/parse.c +++ b/usr.bin/hexdump/parse.c @@ -303,6 +303,9 @@ isint: cs[2] = '\0'; case 2: pr->bcnt = 2; break; + case 8: + pr->bcnt = 8; + break; default: p1[1] = '\0'; badcnt(p1); From nobody Mon Jun 5 03:41:35 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZKCh3ntjz4Z8nh; Mon, 5 Jun 2023 03:41:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZKCh3ZwLz4MqW; Mon, 5 Jun 2023 03:41:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685936496; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x/FkAatrO+ZyQjU/oFHWzSyX/snVEcrVVL5w8mLvlsA=; b=auL3a72UH9xJo5gZuAAyGsCUX/U4bu6ksZ6uPgYxa4VHOrI+qX4foc3nPKLlvpFHiZuTHj 8/vUPbvaYUZTt3QjW82GFfSoEiU/t7m53mj2/n4cV09KXMlzPAhGwYlpwkIOSBG+CjRLLz YMbcnuiQ2s4ktWcwqYsGIrHEl0XUBujn9bRtHT7L4EOy8+rmUt9fy5X1tAs8KhB6YNlJo0 UqNBME3VexIjp0VHPrnXJ+CGIpUfKWZ4S+anH9BSl4D2xeUlMKnZcpgCyezY8Wn2uU03U/ /B34/sjXmN8IIGPI+m//IXVbk+JaoNExdVwlDE2DPy2HSSlF+SpQQIUi8g7N7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685936496; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x/FkAatrO+ZyQjU/oFHWzSyX/snVEcrVVL5w8mLvlsA=; b=YTUUhv6T/rPvW+kyqu+V2Ssv2uevlpNO0P+sLE4F66QElUq8sLuZNDCiRYCYrF7PjARdwP U6XEz6ArRvx3eKh9niIlWxiA7k+jrHWDvvdVFIkV+K/J3LzqgJvSo21/O1FPE+DOHSUIrn l16GmzL1ihcUXNTNjFtz/v5oe8k9Zo+lVnNH17fKlTcEvPk0q3FpXWMLKvSD8QtOwU1/ow JPFg0Acjlpk/Xf4TrScg2zd2OYk7S4rMTDqT8PkQFs8pED3iJlBGPThF9u61F+8SYkzD7A xn4fxta8tk8AQx0EDy80u2ApmqVjlWHzb7xrG6NN7jSW+tMcYO3zDmLDHA/Vaw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685936496; a=rsa-sha256; cv=none; b=kp9kINk7SW/60rn6hjU9LWqTNPfW/hbmEFc27KevmHTQxBQxiR59b6WCY6+t1zdgW7+R3D /i8B8du3gsjUG97WIrozKGCy3zCqE+DTFkqXf/sxwGDC1XoI6cY2KLh7tfd2X1YRnV7w/K JnuSQ1JQcxM0u/wFBm0Tldmc4L/P4KTAY5pB2nzORn5VkT6sYJuhBPVE3w7xm3i8NJD253 MllDkgYT6ieR7bI1AE7I9sCPf7vw3NikYbFYy2EQ+Q/CYWkA4f8CRMKnCBZNNt/gGUsPy1 PeAkrz4b9tU/wi1GexIBmOp6iX1RmJlUjrSD6zIuTPuRORsoIdPloKIYkfY6oA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZKCh2gqGzY2R; Mon, 5 Jun 2023 03:41:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3553faSL042548; Mon, 5 Jun 2023 03:41:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3553fZlS042544; Mon, 5 Jun 2023 03:41:35 GMT (envelope-from git) Date: Mon, 5 Jun 2023 03:41:35 GMT Message-Id: <202306050341.3553fZlS042544@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: ea656f7cdcc1 - stable/13 - sqlite3: Vendor import of sqlite3 3.42.0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ea656f7cdcc1fedd5cd62bc9b983c748f814fca2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=ea656f7cdcc1fedd5cd62bc9b983c748f814fca2 commit ea656f7cdcc1fedd5cd62bc9b983c748f814fca2 Author: Cy Schubert AuthorDate: 2023-05-28 14:31:36 +0000 Commit: Cy Schubert CommitDate: 2023-06-05 01:38:55 +0000 sqlite3: Vendor import of sqlite3 3.42.0 Release notes at https://www.sqlite.org/releaselog/3_42_0.html. Obtained from: https://www.sqlite.org/2023/sqlite-autoconf-3420000.tar.gz Merge commit '92b2b066353ddd32e1d59f8c52c430d552d9a9a5' into sqlite3/main (cherry picked from commit 402cee1f19b613bae844a176156a41cdfa507585) --- contrib/sqlite3/configure | 20 +- contrib/sqlite3/configure.ac | 2 +- contrib/sqlite3/shell.c | 1016 ++++-- contrib/sqlite3/sqlite3.c | 6955 +++++++++++++++++++++++++------------- contrib/sqlite3/sqlite3.h | 202 +- contrib/sqlite3/sqlite3rc.h | 2 +- contrib/sqlite3/tea/configure | 18 +- contrib/sqlite3/tea/configure.ac | 2 +- 8 files changed, 5524 insertions(+), 2693 deletions(-) diff --git a/contrib/sqlite3/configure b/contrib/sqlite3/configure index dea9860d00ee..1016e350c37f 100755 --- a/contrib/sqlite3/configure +++ b/contrib/sqlite3/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for sqlite 3.41.2. +# Generated by GNU Autoconf 2.71 for sqlite 3.42.0. # # Report bugs to . # @@ -621,8 +621,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.41.2' -PACKAGE_STRING='sqlite 3.41.2' +PACKAGE_VERSION='3.42.0' +PACKAGE_STRING='sqlite 3.42.0' PACKAGE_BUGREPORT='http://www.sqlite.org' PACKAGE_URL='' @@ -1367,7 +1367,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.41.2 to adapt to many kinds of systems. +\`configure' configures sqlite 3.42.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1438,7 +1438,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.41.2:";; + short | recursive ) echo "Configuration of sqlite 3.42.0:";; esac cat <<\_ACEOF @@ -1563,7 +1563,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.41.2 +sqlite configure 3.42.0 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1833,7 +1833,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.41.2, which was +It was created by sqlite $as_me 3.42.0, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -3106,7 +3106,7 @@ fi # Define the identity of the package. PACKAGE='sqlite' - VERSION='3.41.2' + VERSION='3.42.0' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -15314,7 +15314,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.41.2, which was +This file was extended by sqlite $as_me 3.42.0, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15373,7 +15373,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -sqlite config.status 3.41.2 +sqlite config.status 3.42.0 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/contrib/sqlite3/configure.ac b/contrib/sqlite3/configure.ac index 290f160afc56..a706a4753049 100644 --- a/contrib/sqlite3/configure.ac +++ b/contrib/sqlite3/configure.ac @@ -10,7 +10,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.41.2, http://www.sqlite.org) +AC_INIT(sqlite, 3.42.0, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) AC_CONFIG_AUX_DIR([.]) diff --git a/contrib/sqlite3/shell.c b/contrib/sqlite3/shell.c index e6495d75128e..647a214226cc 100644 --- a/contrib/sqlite3/shell.c +++ b/contrib/sqlite3/shell.c @@ -117,6 +117,7 @@ typedef unsigned short int u16; #include #include #include +#include #include "sqlite3.h" typedef sqlite3_int64 i64; typedef sqlite3_uint64 u64; @@ -245,6 +246,7 @@ typedef unsigned char u8; #if SQLITE_OS_WINRT #include #endif +#define WIN32_LEAN_AND_MEAN #include /* string conversion routines only needed on Win32 */ @@ -459,11 +461,25 @@ static void endTimer(void){ static int bail_on_error = 0; /* -** Threat stdin as an interactive input if the following variable +** Treat stdin as an interactive input if the following variable ** is true. Otherwise, assume stdin is connected to a file or pipe. */ static int stdin_is_interactive = 1; +#if (defined(_WIN32) || defined(WIN32)) && SHELL_USE_LOCAL_GETLINE \ + && !defined(SHELL_OMIT_WIN_UTF8) +# define SHELL_WIN_UTF8_OPT 1 +#else +# define SHELL_WIN_UTF8_OPT 0 +#endif + +#if SHELL_WIN_UTF8_OPT +/* +** Setup console for UTF-8 input/output when following variable true. +*/ +static int console_utf8 = 0; +#endif + /* ** On Windows systems we have to know if standard output is a console ** in order to translate UTF-8 into MBCS. The following variable is @@ -596,16 +612,150 @@ static char *dynamicContinuePrompt(void){ } #endif /* !defined(SQLITE_OMIT_DYNAPROMPT) */ +#if SHELL_WIN_UTF8_OPT +/* Following struct is used for -utf8 operation. */ +static struct ConsoleState { + int stdinEof; /* EOF has been seen on console input */ + int infsMode; /* Input file stream mode upon shell start */ + UINT inCodePage; /* Input code page upon shell start */ + UINT outCodePage; /* Output code page upon shell start */ + HANDLE hConsoleIn; /* Console input handle */ + DWORD consoleMode; /* Console mode upon shell start */ +} conState = { 0, 0, 0, 0, INVALID_HANDLE_VALUE, 0 }; + +#ifndef _O_U16TEXT /* For build environments lacking this constant: */ +# define _O_U16TEXT 0x20000 +#endif + +/* +** Prepare console, (if known to be a WIN32 console), for UTF-8 +** input (from either typing or suitable paste operations) and for +** UTF-8 rendering. This may "fail" with a message to stderr, where +** the preparation is not done and common "code page" issues occur. +*/ +static void console_prepare(void){ + HANDLE hCI = GetStdHandle(STD_INPUT_HANDLE); + DWORD consoleMode = 0; + if( isatty(0) && GetFileType(hCI)==FILE_TYPE_CHAR + && GetConsoleMode( hCI, &consoleMode) ){ + if( !IsValidCodePage(CP_UTF8) ){ + fprintf(stderr, "Cannot use UTF-8 code page.\n"); + console_utf8 = 0; + return; + } + conState.hConsoleIn = hCI; + conState.consoleMode = consoleMode; + conState.inCodePage = GetConsoleCP(); + conState.outCodePage = GetConsoleOutputCP(); + SetConsoleCP(CP_UTF8); + SetConsoleOutputCP(CP_UTF8); + consoleMode |= ENABLE_LINE_INPUT | ENABLE_PROCESSED_INPUT; + SetConsoleMode(conState.hConsoleIn, consoleMode); + conState.infsMode = _setmode(_fileno(stdin), _O_U16TEXT); + console_utf8 = 1; + }else{ + console_utf8 = 0; + } +} + +/* +** Undo the effects of console_prepare(), if any. +*/ +static void SQLITE_CDECL console_restore(void){ + if( console_utf8 && conState.inCodePage!=0 + && conState.hConsoleIn!=INVALID_HANDLE_VALUE ){ + _setmode(_fileno(stdin), conState.infsMode); + SetConsoleCP(conState.inCodePage); + SetConsoleOutputCP(conState.outCodePage); + SetConsoleMode(conState.hConsoleIn, conState.consoleMode); + /* Avoid multiple calls. */ + conState.hConsoleIn = INVALID_HANDLE_VALUE; + conState.consoleMode = 0; + console_utf8 = 0; + } +} + +/* +** Collect input like fgets(...) with special provisions for input +** from the Windows console to get around its strange coding issues. +** Defers to plain fgets() when input is not interactive or when the +** startup option, -utf8, has not been provided or taken effect. +*/ +static char* utf8_fgets(char *buf, int ncmax, FILE *fin){ + if( fin==0 ) fin = stdin; + if( fin==stdin && stdin_is_interactive && console_utf8 ){ +# define SQLITE_IALIM 150 + wchar_t wbuf[SQLITE_IALIM]; + int lend = 0; + int noc = 0; + if( ncmax==0 || conState.stdinEof ) return 0; + buf[0] = 0; + while( noc SQLITE_IALIM*4+1 + noc) + ? SQLITE_IALIM : (ncmax-1 - noc)/4; +# undef SQLITE_IALIM + DWORD nbr = 0; + BOOL bRC = ReadConsoleW(conState.hConsoleIn, wbuf, na, &nbr, 0); + if( !bRC || (noc==0 && nbr==0) ) return 0; + if( nbr > 0 ){ + int nmb = WideCharToMultiByte(CP_UTF8,WC_COMPOSITECHECK|WC_DEFAULTCHAR, + wbuf,nbr,0,0,0,0); + if( nmb !=0 && noc+nmb <= ncmax ){ + int iseg = noc; + nmb = WideCharToMultiByte(CP_UTF8,WC_COMPOSITECHECK|WC_DEFAULTCHAR, + wbuf,nbr,buf+noc,nmb,0,0); + noc += nmb; + /* Fixup line-ends as coded by Windows for CR (or "Enter".)*/ + if( noc > 0 ){ + if( buf[noc-1]=='\n' ){ + lend = 1; + if( noc > 1 && buf[noc-2]=='\r' ){ + buf[noc-2] = '\n'; + --noc; + } + } + } + /* Check for ^Z (anywhere in line) too. */ + while( iseg < noc ){ + if( buf[iseg]==0x1a ){ + conState.stdinEof = 1; + noc = iseg; /* Chop ^Z and anything following. */ + break; + } + ++iseg; + } + }else break; /* Drop apparent garbage in. (Could assert.) */ + }else break; + } + /* If got nothing, (after ^Z chop), must be at end-of-file. */ + if( noc == 0 ) return 0; + buf[noc] = 0; + return buf; + }else{ + return fgets(buf, ncmax, fin); + } +} + +# define fgets(b,n,f) utf8_fgets(b,n,f) +#endif /* SHELL_WIN_UTF8_OPT */ + /* ** Render output like fprintf(). Except, if the output is going to the -** console and if this is running on a Windows machine, translate the -** output from UTF-8 into MBCS. +** console and if this is running on a Windows machine, and if the -utf8 +** option is unavailable or (available and inactive), translate the +** output from UTF-8 into MBCS for output through 8-bit stdout stream. +** (With -utf8 active, no translation is needed and must not be done.) */ #if defined(_WIN32) || defined(WIN32) void utf8_printf(FILE *out, const char *zFormat, ...){ va_list ap; va_start(ap, zFormat); - if( stdout_is_console && (out==stdout || out==stderr) ){ + if( stdout_is_console && (out==stdout || out==stderr) +# if SHELL_WIN_UTF8_OPT + && !console_utf8 +# endif + ){ char *z1 = sqlite3_vmprintf(zFormat, ap); char *z2 = sqlite3_win32_utf8_to_mbcs_v2(z1, 0); sqlite3_free(z1); @@ -637,7 +787,7 @@ static void shell_out_of_memory(void){ /* Check a pointer to see if it is NULL. If it is NULL, exit with an ** out-of-memory error. */ -static void shell_check_oom(void *p){ +static void shell_check_oom(const void *p){ if( p==0 ) shell_out_of_memory(); } @@ -816,9 +966,14 @@ static char *local_getline(char *zLine, FILE *in){ } } #if defined(_WIN32) || defined(WIN32) - /* For interactive input on Windows systems, translate the - ** multi-byte characterset characters into UTF-8. */ - if( stdin_is_interactive && in==stdin ){ + /* For interactive input on Windows systems, without -utf8, + ** translate the multi-byte characterset characters into UTF-8. + ** This is the translation that predates the -utf8 option. */ + if( stdin_is_interactive && in==stdin +# if SHELL_WIN_UTF8_OPT + && !console_utf8 +# endif /* SHELL_WIN_UTF8_OPT */ + ){ char *zTrans = sqlite3_win32_mbcs_to_utf8_v2(zLine, 0); if( zTrans ){ i64 nTrans = strlen(zTrans)+1; @@ -859,10 +1014,21 @@ static char *one_input_line(FILE *in, char *zPrior, int isContinuation){ #if SHELL_USE_LOCAL_GETLINE printf("%s", zPrompt); fflush(stdout); - zResult = local_getline(zPrior, stdin); + do{ + zResult = local_getline(zPrior, stdin); + zPrior = 0; + /* ^C trap creates a false EOF, so let "interrupt" thread catch up. */ + if( zResult==0 ) sqlite3_sleep(50); + }while( zResult==0 && seenInterrupt>0 ); #else free(zPrior); zResult = shell_readline(zPrompt); + while( zResult==0 ){ + /* ^C trap creates a false EOF, so let "interrupt" thread catch up. */ + sqlite3_sleep(50); + if( seenInterrupt==0 ) break; + zResult = shell_readline(""); + } if( zResult && *zResult ) shell_add_history(zResult); #endif } @@ -1002,6 +1168,7 @@ static void appendText(ShellText *p, const char *zAppend, char quote){ */ static char quoteChar(const char *zName){ int i; + if( zName==0 ) return '"'; if( !isalpha((unsigned char)zName[0]) && zName[0]!='_' ) return '"'; for(i=0; zName[i]; i++){ if( !isalnum((unsigned char)zName[i]) && zName[i]!='_' ) return '"'; @@ -1645,7 +1812,8 @@ int sqlite3MemTraceDeactivate(void){ ** ****************************************************************************** ** -** This SQLite extension implements functions that compute SHA3 hashes. +** This SQLite extension implements functions that compute SHA3 hashes +** in the way described by the (U.S.) NIST FIPS 202 SHA-3 Standard. ** Two SQL functions are implemented: ** ** sha3(X,SIZE) @@ -3173,6 +3341,7 @@ SQLITE_EXTENSION_INIT1; #define U8_TYPEDEF #endif +/* Decoding table, ASCII (7-bit) value to base 64 digit value or other */ static const u8 b64DigitValues[128] = { /* HT LF VT FF CR */ ND,ND,ND,ND, ND,ND,ND,ND, ND,WS,WS,WS, WS,WS,ND,ND, @@ -3244,9 +3413,9 @@ static char* toBase64( u8 *pIn, int nbIn, char *pOut ){ } /* Skip over text which is not base64 numeral(s). */ -static char * skipNonB64( char *s ){ +static char * skipNonB64( char *s, int nc ){ char c; - while( (c = *s) && !IS_BX_DIGIT(BX_DV_PROTO(c)) ) ++s; + while( nc-- > 0 && (c = *s) && !IS_BX_DIGIT(BX_DV_PROTO(c)) ) ++s; return s; } @@ -3255,7 +3424,7 @@ static u8* fromBase64( char *pIn, int ncIn, u8 *pOut ){ if( ncIn>0 && pIn[ncIn-1]=='\n' ) --ncIn; while( ncIn>0 && *pIn!=PAD_CHAR ){ static signed char nboi[] = { 0, 0, 1, 2, 3 }; - char *pUse = skipNonB64(pIn); + char *pUse = skipNonB64(pIn, ncIn); unsigned long qv = 0L; int nti, nbo, nac; ncIn -= (pUse - pIn); @@ -3315,9 +3484,16 @@ static void base64(sqlite3_context *context, int na, sqlite3_value *av[]){ sqlite3_result_error(context, "blob expanded to base64 too big", -1); return; } + bBuf = (u8*)sqlite3_value_blob(av[0]); + if( !bBuf ){ + if( SQLITE_NOMEM==sqlite3_errcode(sqlite3_context_db_handle(context)) ){ + goto memFail; + } + sqlite3_result_text(context,"",-1,SQLITE_STATIC); + break; + } cBuf = sqlite3_malloc(nc); if( !cBuf ) goto memFail; - bBuf = (u8*)sqlite3_value_blob(av[0]); nc = (int)(toBase64(bBuf, nb, cBuf) - cBuf); sqlite3_result_text(context, cBuf, nc, sqlite3_free); break; @@ -3330,9 +3506,16 @@ static void base64(sqlite3_context *context, int na, sqlite3_value *av[]){ }else if( nb<1 ){ nb = 1; } + cBuf = (char *)sqlite3_value_text(av[0]); + if( !cBuf ){ + if( SQLITE_NOMEM==sqlite3_errcode(sqlite3_context_db_handle(context)) ){ + goto memFail; + } + sqlite3_result_zeroblob(context, 0); + break; + } bBuf = sqlite3_malloc(nb); if( !bBuf ) goto memFail; - cBuf = (char *)sqlite3_value_text(av[0]); nb = (int)(fromBase64(cBuf, nc, bBuf) - bBuf); sqlite3_result_blob(context, bBuf, nb, sqlite3_free); break; @@ -3520,9 +3703,9 @@ static u8 base85DigitValue( char c ){ #define B85_DARK_MAX 80 -static char * skipNonB85( char *s ){ +static char * skipNonB85( char *s, int nc ){ char c; - while( (c = *s) && !IS_B85(c) ) ++s; + while( nc-- > 0 && (c = *s) && !IS_B85(c) ) ++s; return s; } @@ -3592,7 +3775,7 @@ static u8* fromBase85( char *pIn, int ncIn, u8 *pOut ){ if( ncIn>0 && pIn[ncIn-1]=='\n' ) --ncIn; while( ncIn>0 ){ static signed char nboi[] = { 0, 0, 1, 2, 3, 4 }; - char *pUse = skipNonB85(pIn); + char *pUse = skipNonB85(pIn, ncIn); unsigned long qv = 0L; int nti, nbo; ncIn -= (pUse - pIn); @@ -3677,9 +3860,16 @@ static void base85(sqlite3_context *context, int na, sqlite3_value *av[]){ sqlite3_result_error(context, "blob expanded to base85 too big", -1); return; } + bBuf = (u8*)sqlite3_value_blob(av[0]); + if( !bBuf ){ + if( SQLITE_NOMEM==sqlite3_errcode(sqlite3_context_db_handle(context)) ){ + goto memFail; + } + sqlite3_result_text(context,"",-1,SQLITE_STATIC); + break; + } cBuf = sqlite3_malloc(nc); if( !cBuf ) goto memFail; - bBuf = (u8*)sqlite3_value_blob(av[0]); nc = (int)(toBase85(bBuf, nb, cBuf, "\n") - cBuf); sqlite3_result_text(context, cBuf, nc, sqlite3_free); break; @@ -3692,9 +3882,16 @@ static void base85(sqlite3_context *context, int na, sqlite3_value *av[]){ }else if( nb<1 ){ nb = 1; } + cBuf = (char *)sqlite3_value_text(av[0]); + if( !cBuf ){ + if( SQLITE_NOMEM==sqlite3_errcode(sqlite3_context_db_handle(context)) ){ + goto memFail; + } + sqlite3_result_zeroblob(context, 0); + break; + } bBuf = sqlite3_malloc(nb); if( !bBuf ) goto memFail; - cBuf = (char *)sqlite3_value_text(av[0]); nb = (int)(fromBase85(cBuf, nc, bBuf) - bBuf); sqlite3_result_blob(context, bBuf, nb, sqlite3_free); break; @@ -4114,7 +4311,7 @@ int sqlite3_ieee_init( /************************* End ../ext/misc/ieee754.c ********************/ /************************* Begin ../ext/misc/series.c ******************/ /* -** 2015-08-18 +** 2015-08-18, 2023-04-28 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: @@ -4127,7 +4324,19 @@ int sqlite3_ieee_init( ** ** This file demonstrates how to create a table-valued-function using ** a virtual table. This demo implements the generate_series() function -** which gives similar results to the eponymous function in PostgreSQL. +** which gives the same results as the eponymous function in PostgreSQL, +** within the limitation that its arguments are signed 64-bit integers. +** +** Considering its equivalents to generate_series(start,stop,step): A +** value V[n] sequence is produced for integer n ascending from 0 where +** ( V[n] == start + n * step && sgn(V[n] - stop) * sgn(step) >= 0 ) +** for each produced value (independent of production time ordering.) +** +** All parameters must be either integer or convertable to integer. +** The start parameter is required. +** The stop parameter defaults to (1<<32)-1 (aka 4294967295 or 0xffffffff) +** The step parameter defaults to 1 and 0 is treated as 1. +** ** Examples: ** ** SELECT * FROM generate_series(0,100,5); @@ -4143,6 +4352,14 @@ int sqlite3_ieee_init( ** ** Integers 20 through 29. ** +** SELECT * FROM generate_series(0,-100,-5); +** +** Integers 0 -5 -10 ... -100. +** +** SELECT * FROM generate_series(0,-1); +** +** Empty sequence. +** ** HOW IT WORKS ** ** The generate_series "function" is really a virtual table with the @@ -4155,6 +4372,9 @@ int sqlite3_ieee_init( ** step HIDDEN ** ); ** +** The virtual table also has a rowid, logically equivalent to n+1 where +** "n" is the ascending integer in the aforesaid production definition. +** ** Function arguments in queries against this virtual table are translated ** into equality constraints against successive hidden columns. In other ** words, the following pairs of queries are equivalent to each other: @@ -4187,9 +4407,126 @@ int sqlite3_ieee_init( SQLITE_EXTENSION_INIT1 #include #include +#include #ifndef SQLITE_OMIT_VIRTUALTABLE +/* +** Return that member of a generate_series(...) sequence whose 0-based +** index is ix. The 0th member is given by smBase. The sequence members +** progress per ix increment by smStep. +*/ +static sqlite3_int64 genSeqMember(sqlite3_int64 smBase, + sqlite3_int64 smStep, + sqlite3_uint64 ix){ + if( ix>=(sqlite3_uint64)LLONG_MAX ){ + /* Get ix into signed i64 range. */ + ix -= (sqlite3_uint64)LLONG_MAX; + /* With 2's complement ALU, this next can be 1 step, but is split into + * 2 for UBSAN's satisfaction (and hypothetical 1's complement ALUs.) */ + smBase += (LLONG_MAX/2) * smStep; + smBase += (LLONG_MAX - LLONG_MAX/2) * smStep; + } + /* Under UBSAN (or on 1's complement machines), must do this last term + * in steps to avoid the dreaded (and harmless) signed multiply overlow. */ + if( ix>=2 ){ + sqlite3_int64 ix2 = (sqlite3_int64)ix/2; + smBase += ix2*smStep; + ix -= ix2; + } + return smBase + ((sqlite3_int64)ix)*smStep; +} + +/* typedef unsigned char u8; */ + +typedef struct SequenceSpec { + sqlite3_int64 iBase; /* Starting value ("start") */ + sqlite3_int64 iTerm; /* Given terminal value ("stop") */ + sqlite3_int64 iStep; /* Increment ("step") */ + sqlite3_uint64 uSeqIndexMax; /* maximum sequence index (aka "n") */ + sqlite3_uint64 uSeqIndexNow; /* Current index during generation */ + sqlite3_int64 iValueNow; /* Current value during generation */ + u8 isNotEOF; /* Sequence generation not exhausted */ + u8 isReversing; /* Sequence is being reverse generated */ +} SequenceSpec; + +/* +** Prepare a SequenceSpec for use in generating an integer series +** given initialized iBase, iTerm and iStep values. Sequence is +** initialized per given isReversing. Other members are computed. +*/ +static void setupSequence( SequenceSpec *pss ){ + int bSameSigns; + pss->uSeqIndexMax = 0; + pss->isNotEOF = 0; + bSameSigns = (pss->iBase < 0)==(pss->iTerm < 0); + if( pss->iTerm < pss->iBase ){ + sqlite3_uint64 nuspan = 0; + if( bSameSigns ){ + nuspan = (sqlite3_uint64)(pss->iBase - pss->iTerm); + }else{ + /* Under UBSAN (or on 1's complement machines), must do this in steps. + * In this clause, iBase>=0 and iTerm<0 . */ + nuspan = 1; + nuspan += pss->iBase; + nuspan += -(pss->iTerm+1); + } + if( pss->iStep<0 ){ + pss->isNotEOF = 1; + if( nuspan==ULONG_MAX ){ + pss->uSeqIndexMax = ( pss->iStep>LLONG_MIN )? nuspan/-pss->iStep : 1; + }else if( pss->iStep>LLONG_MIN ){ + pss->uSeqIndexMax = nuspan/-pss->iStep; + } + } + }else if( pss->iTerm > pss->iBase ){ + sqlite3_uint64 puspan = 0; + if( bSameSigns ){ + puspan = (sqlite3_uint64)(pss->iTerm - pss->iBase); + }else{ + /* Under UBSAN (or on 1's complement machines), must do this in steps. + * In this clause, iTerm>=0 and iBase<0 . */ + puspan = 1; + puspan += pss->iTerm; + puspan += -(pss->iBase+1); + } + if( pss->iStep>0 ){ + pss->isNotEOF = 1; + pss->uSeqIndexMax = puspan/pss->iStep; + } + }else if( pss->iTerm == pss->iBase ){ + pss->isNotEOF = 1; + pss->uSeqIndexMax = 0; + } + pss->uSeqIndexNow = (pss->isReversing)? pss->uSeqIndexMax : 0; + pss->iValueNow = (pss->isReversing) + ? genSeqMember(pss->iBase, pss->iStep, pss->uSeqIndexMax) + : pss->iBase; +} +/* +** Progress sequence generator to yield next value, if any. +** Leave its state to either yield next value or be at EOF. +** Return whether there is a next value, or 0 at EOF. +*/ +static int progressSequence( SequenceSpec *pss ){ + if( !pss->isNotEOF ) return 0; + if( pss->isReversing ){ + if( pss->uSeqIndexNow > 0 ){ + pss->uSeqIndexNow--; + pss->iValueNow -= pss->iStep; + }else{ + pss->isNotEOF = 0; + } + }else{ + if( pss->uSeqIndexNow < pss->uSeqIndexMax ){ + pss->uSeqIndexNow++; + pss->iValueNow += pss->iStep; + }else{ + pss->isNotEOF = 0; + } + } + return pss->isNotEOF; +} /* series_cursor is a subclass of sqlite3_vtab_cursor which will ** serve as the underlying representation of a cursor that scans @@ -4198,12 +4535,7 @@ SQLITE_EXTENSION_INIT1 typedef struct series_cursor series_cursor; struct series_cursor { sqlite3_vtab_cursor base; /* Base class - must be first */ - int isDesc; /* True to count down rather than up */ - sqlite3_int64 iRowid; /* The rowid */ - sqlite3_int64 iValue; /* Current value ("value") */ - sqlite3_int64 mnValue; /* Mimimum value ("start") */ - sqlite3_int64 mxValue; /* Maximum value ("stop") */ - sqlite3_int64 iStep; /* Increment ("step") */ + SequenceSpec ss; /* (this) Derived class data */ }; /* @@ -4285,12 +4617,7 @@ static int seriesClose(sqlite3_vtab_cursor *cur){ */ static int seriesNext(sqlite3_vtab_cursor *cur){ series_cursor *pCur = (series_cursor*)cur; - if( pCur->isDesc ){ - pCur->iValue -= pCur->iStep; - }else{ - pCur->iValue += pCur->iStep; - } - pCur->iRowid++; + progressSequence( & pCur->ss ); return SQLITE_OK; } @@ -4306,23 +4633,23 @@ static int seriesColumn( series_cursor *pCur = (series_cursor*)cur; sqlite3_int64 x = 0; switch( i ){ - case SERIES_COLUMN_START: x = pCur->mnValue; break; - case SERIES_COLUMN_STOP: x = pCur->mxValue; break; - case SERIES_COLUMN_STEP: x = pCur->iStep; break; - default: x = pCur->iValue; break; + case SERIES_COLUMN_START: x = pCur->ss.iBase; break; + case SERIES_COLUMN_STOP: x = pCur->ss.iTerm; break; + case SERIES_COLUMN_STEP: x = pCur->ss.iStep; break; + default: x = pCur->ss.iValueNow; break; } sqlite3_result_int64(ctx, x); return SQLITE_OK; } /* -** Return the rowid for the current row. In this implementation, the -** first row returned is assigned rowid value 1, and each subsequent -** row a value 1 more than that of the previous. +** Return the rowid for the current row, logically equivalent to n+1 where +** "n" is the ascending integer in the aforesaid production definition. */ static int seriesRowid(sqlite3_vtab_cursor *cur, sqlite_int64 *pRowid){ series_cursor *pCur = (series_cursor*)cur; - *pRowid = pCur->iRowid; + sqlite3_uint64 n = pCur->ss.uSeqIndexNow; + *pRowid = (sqlite3_int64)((n<0xffffffffffffffff)? n+1 : 0); return SQLITE_OK; } @@ -4332,14 +4659,10 @@ static int seriesRowid(sqlite3_vtab_cursor *cur, sqlite_int64 *pRowid){ */ static int seriesEof(sqlite3_vtab_cursor *cur){ series_cursor *pCur = (series_cursor*)cur; - if( pCur->isDesc ){ - return pCur->iValue < pCur->mnValue; - }else{ - return pCur->iValue > pCur->mxValue; - } + return !pCur->ss.isNotEOF; } -/* True to cause run-time checking of the start=, stop=, and/or step= +/* True to cause run-time checking of the start=, stop=, and/or step= ** parameters. The only reason to do this is for testing the ** constraint checking logic for virtual tables in the SQLite core. */ @@ -4350,7 +4673,7 @@ static int seriesEof(sqlite3_vtab_cursor *cur){ /* ** This method is called to "rewind" the series_cursor object back ** to the first row of output. This method is always called at least -** once prior to any call to seriesColumn() or seriesRowid() or +** once prior to any call to seriesColumn() or seriesRowid() or ** seriesEof(). ** ** The query plan selected by seriesBestIndex is passed in the idxNum @@ -4370,7 +4693,7 @@ static int seriesEof(sqlite3_vtab_cursor *cur){ ** (so that seriesEof() will return true) if the table is empty. */ static int seriesFilter( - sqlite3_vtab_cursor *pVtabCursor, + sqlite3_vtab_cursor *pVtabCursor, int idxNum, const char *idxStrUnused, int argc, sqlite3_value **argv ){ @@ -4378,46 +4701,41 @@ static int seriesFilter( int i = 0; (void)idxStrUnused; if( idxNum & 1 ){ - pCur->mnValue = sqlite3_value_int64(argv[i++]); + pCur->ss.iBase = sqlite3_value_int64(argv[i++]); }else{ - pCur->mnValue = 0; + pCur->ss.iBase = 0; } if( idxNum & 2 ){ - pCur->mxValue = sqlite3_value_int64(argv[i++]); + pCur->ss.iTerm = sqlite3_value_int64(argv[i++]); }else{ - pCur->mxValue = 0xffffffff; + pCur->ss.iTerm = 0xffffffff; } if( idxNum & 4 ){ - pCur->iStep = sqlite3_value_int64(argv[i++]); - if( pCur->iStep==0 ){ - pCur->iStep = 1; - }else if( pCur->iStep<0 ){ - pCur->iStep = -pCur->iStep; + pCur->ss.iStep = sqlite3_value_int64(argv[i++]); + if( pCur->ss.iStep==0 ){ + pCur->ss.iStep = 1; + }else if( pCur->ss.iStep<0 ){ if( (idxNum & 16)==0 ) idxNum |= 8; } }else{ - pCur->iStep = 1; + pCur->ss.iStep = 1; } for(i=0; imnValue = 1; - pCur->mxValue = 0; + pCur->ss.iBase = 1; + pCur->ss.iTerm = 0; + pCur->ss.iStep = 1; break; } } if( idxNum & 8 ){ - pCur->isDesc = 1; - pCur->iValue = pCur->mxValue; - if( pCur->iStep>0 ){ - pCur->iValue -= (pCur->mxValue - pCur->mnValue)%pCur->iStep; - } + pCur->ss.isReversing = pCur->ss.iStep > 0; }else{ - pCur->isDesc = 0; - pCur->iValue = pCur->mnValue; + pCur->ss.isReversing = pCur->ss.iStep < 0; } - pCur->iRowid = 1; + setupSequence( &pCur->ss ); return SQLITE_OK; } @@ -5172,7 +5490,7 @@ static const char *re_subcompile_string(ReCompiled *p){ break; } case '[': { - int iFirst = p->nState; + unsigned int iFirst = p->nState; if( rePeek(p)=='^' ){ re_append(p, RE_OP_CC_EXC, 0); p->sIn.i++; @@ -5196,7 +5514,7 @@ static const char *re_subcompile_string(ReCompiled *p){ if( rePeek(p)==']' ){ p->sIn.i++; break; } } if( c==0 ) return "unclosed '['"; - p->aArg[iFirst] = p->nState - iFirst; + if( p->nState>iFirst ) p->aArg[iFirst] = p->nState - iFirst; break; } case '\\': { @@ -8773,7 +9091,10 @@ static int zipfileColumn( ** it to be a directory either if the mode suggests so, or if ** the final character in the name is '/'. */ u32 mode = pCDS->iExternalAttr >> 16; - if( !(mode & S_IFDIR) && pCDS->zFile[pCDS->nFile-1]!='/' ){ + if( !(mode & S_IFDIR) + && pCDS->nFile>=1 + && pCDS->zFile[pCDS->nFile-1]!='/' + ){ sqlite3_result_blob(ctx, "", 0, SQLITE_STATIC); } } @@ -9210,9 +9531,19 @@ static u32 zipfileGetTime(sqlite3_value *pVal){ */ static void zipfileRemoveEntryFromList(ZipfileTab *pTab, ZipfileEntry *pOld){ if( pOld ){ - ZipfileEntry **pp; - for(pp=&pTab->pFirstEntry; (*pp)!=pOld; pp=&((*pp)->pNext)); - *pp = (*pp)->pNext; + if( pTab->pFirstEntry==pOld ){ + pTab->pFirstEntry = pOld->pNext; + if( pTab->pLastEntry==pOld ) pTab->pLastEntry = 0; + }else{ + ZipfileEntry *p; + for(p=pTab->pFirstEntry; p; p=p->pNext){ + if( p->pNext==pOld ){ + p->pNext = pOld->pNext; + if( pTab->pLastEntry==pOld ) pTab->pLastEntry = p; + break; + } + } + } zipfileEntryFree(pOld); } } @@ -12678,6 +13009,7 @@ static int dbdataConnect( (void)argc; (void)argv; (void)pzErr; + sqlite3_vtab_config(db, SQLITE_VTAB_USES_ALL_SCHEMAS); if( rc==SQLITE_OK ){ pTab = (DbdataTable*)sqlite3_malloc64(sizeof(DbdataTable)); if( pTab==0 ){ @@ -13323,8 +13655,6 @@ static int dbdataFilter( } if( rc==SQLITE_OK ){ rc = sqlite3_bind_text(pCsr->pStmt, 1, zSchema, -1, SQLITE_TRANSIENT); - }else{ - pTab->base.zErrMsg = sqlite3_mprintf("%s", sqlite3_errmsg(pTab->db)); } /* Try to determine the encoding of the db by inspecting the header @@ -13333,6 +13663,10 @@ static int dbdataFilter( rc = dbdataGetEncoding(pCsr); } + if( rc!=SQLITE_OK ){ + pTab->base.zErrMsg = sqlite3_mprintf("%s", sqlite3_errmsg(pTab->db)); + } + if( rc==SQLITE_OK ){ rc = dbdataNext(pCursor); } @@ -14571,7 +14905,7 @@ static void recoverAddTable( int iField = sqlite3_column_int(pStmt, 0); int iCol = sqlite3_column_int(pStmt, 1); - assert( iFieldnCol && iColnCol ); + assert( iColnCol ); pNew->aCol[iCol].iField = iField; pNew->bIntkey = 0; @@ -16335,7 +16669,7 @@ int sqlite3_recover_finish(sqlite3_recover *p){ #endif /* ifndef SQLITE_OMIT_VIRTUALTABLE */ /************************* End ../ext/recover/sqlite3recover.c ********************/ -# endif +# endif /* SQLITE_HAVE_SQLITE3R */ #endif #ifdef SQLITE_SHELL_EXTSRC # include SHELL_STRINGIFY(SQLITE_SHELL_EXTSRC) @@ -16517,6 +16851,7 @@ static ShellState shellState; #define SHFLG_HeaderSet 0x00000080 /* showHeader has been specified */ #define SHFLG_DumpDataOnly 0x00000100 /* .dump show data only */ #define SHFLG_DumpNoSys 0x00000200 /* .dump omits system tables */ +#define SHFLG_TestingMode 0x00000400 /* allow unsafe testing features */ /* ** Macros for testing and setting shellFlgs @@ -16760,6 +17095,7 @@ static void editFunc( }else{ /* If the file did not originally contain \r\n then convert any new ** \r\n back into \n */ + p[sz] = 0; for(i=j=0; i To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 60ab53f3a67b - stable/12 - sqlite3: Vendor import of sqlite3 3.42.0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 60ab53f3a67be68174f5a8ef4a64b03f52b60201 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=60ab53f3a67be68174f5a8ef4a64b03f52b60201 commit 60ab53f3a67be68174f5a8ef4a64b03f52b60201 Author: Cy Schubert AuthorDate: 2023-05-28 14:31:36 +0000 Commit: Cy Schubert CommitDate: 2023-06-05 03:42:08 +0000 sqlite3: Vendor import of sqlite3 3.42.0 Release notes at https://www.sqlite.org/releaselog/3_42_0.html. Obtained from: https://www.sqlite.org/2023/sqlite-autoconf-3420000.tar.gz Merge commit '92b2b066353ddd32e1d59f8c52c430d552d9a9a5' into sqlite3/main (cherry picked from commit 402cee1f19b613bae844a176156a41cdfa507585) --- contrib/sqlite3/configure | 20 +- contrib/sqlite3/configure.ac | 2 +- contrib/sqlite3/shell.c | 1016 ++++-- contrib/sqlite3/sqlite3.c | 6955 +++++++++++++++++++++++++------------- contrib/sqlite3/sqlite3.h | 202 +- contrib/sqlite3/sqlite3rc.h | 2 +- contrib/sqlite3/tea/configure | 18 +- contrib/sqlite3/tea/configure.ac | 2 +- 8 files changed, 5524 insertions(+), 2693 deletions(-) diff --git a/contrib/sqlite3/configure b/contrib/sqlite3/configure index dea9860d00ee..1016e350c37f 100755 --- a/contrib/sqlite3/configure +++ b/contrib/sqlite3/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for sqlite 3.41.2. +# Generated by GNU Autoconf 2.71 for sqlite 3.42.0. # # Report bugs to . # @@ -621,8 +621,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.41.2' -PACKAGE_STRING='sqlite 3.41.2' +PACKAGE_VERSION='3.42.0' +PACKAGE_STRING='sqlite 3.42.0' PACKAGE_BUGREPORT='http://www.sqlite.org' PACKAGE_URL='' @@ -1367,7 +1367,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.41.2 to adapt to many kinds of systems. +\`configure' configures sqlite 3.42.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1438,7 +1438,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.41.2:";; + short | recursive ) echo "Configuration of sqlite 3.42.0:";; esac cat <<\_ACEOF @@ -1563,7 +1563,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.41.2 +sqlite configure 3.42.0 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1833,7 +1833,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.41.2, which was +It was created by sqlite $as_me 3.42.0, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -3106,7 +3106,7 @@ fi # Define the identity of the package. PACKAGE='sqlite' - VERSION='3.41.2' + VERSION='3.42.0' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -15314,7 +15314,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.41.2, which was +This file was extended by sqlite $as_me 3.42.0, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15373,7 +15373,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -sqlite config.status 3.41.2 +sqlite config.status 3.42.0 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/contrib/sqlite3/configure.ac b/contrib/sqlite3/configure.ac index 290f160afc56..a706a4753049 100644 --- a/contrib/sqlite3/configure.ac +++ b/contrib/sqlite3/configure.ac @@ -10,7 +10,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.41.2, http://www.sqlite.org) +AC_INIT(sqlite, 3.42.0, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) AC_CONFIG_AUX_DIR([.]) diff --git a/contrib/sqlite3/shell.c b/contrib/sqlite3/shell.c index e6495d75128e..647a214226cc 100644 --- a/contrib/sqlite3/shell.c +++ b/contrib/sqlite3/shell.c @@ -117,6 +117,7 @@ typedef unsigned short int u16; #include #include #include +#include #include "sqlite3.h" typedef sqlite3_int64 i64; typedef sqlite3_uint64 u64; @@ -245,6 +246,7 @@ typedef unsigned char u8; #if SQLITE_OS_WINRT #include #endif +#define WIN32_LEAN_AND_MEAN #include /* string conversion routines only needed on Win32 */ @@ -459,11 +461,25 @@ static void endTimer(void){ static int bail_on_error = 0; /* -** Threat stdin as an interactive input if the following variable +** Treat stdin as an interactive input if the following variable ** is true. Otherwise, assume stdin is connected to a file or pipe. */ static int stdin_is_interactive = 1; +#if (defined(_WIN32) || defined(WIN32)) && SHELL_USE_LOCAL_GETLINE \ + && !defined(SHELL_OMIT_WIN_UTF8) +# define SHELL_WIN_UTF8_OPT 1 +#else +# define SHELL_WIN_UTF8_OPT 0 +#endif + +#if SHELL_WIN_UTF8_OPT +/* +** Setup console for UTF-8 input/output when following variable true. +*/ +static int console_utf8 = 0; +#endif + /* ** On Windows systems we have to know if standard output is a console ** in order to translate UTF-8 into MBCS. The following variable is @@ -596,16 +612,150 @@ static char *dynamicContinuePrompt(void){ } #endif /* !defined(SQLITE_OMIT_DYNAPROMPT) */ +#if SHELL_WIN_UTF8_OPT +/* Following struct is used for -utf8 operation. */ +static struct ConsoleState { + int stdinEof; /* EOF has been seen on console input */ + int infsMode; /* Input file stream mode upon shell start */ + UINT inCodePage; /* Input code page upon shell start */ + UINT outCodePage; /* Output code page upon shell start */ + HANDLE hConsoleIn; /* Console input handle */ + DWORD consoleMode; /* Console mode upon shell start */ +} conState = { 0, 0, 0, 0, INVALID_HANDLE_VALUE, 0 }; + +#ifndef _O_U16TEXT /* For build environments lacking this constant: */ +# define _O_U16TEXT 0x20000 +#endif + +/* +** Prepare console, (if known to be a WIN32 console), for UTF-8 +** input (from either typing or suitable paste operations) and for +** UTF-8 rendering. This may "fail" with a message to stderr, where +** the preparation is not done and common "code page" issues occur. +*/ +static void console_prepare(void){ + HANDLE hCI = GetStdHandle(STD_INPUT_HANDLE); + DWORD consoleMode = 0; + if( isatty(0) && GetFileType(hCI)==FILE_TYPE_CHAR + && GetConsoleMode( hCI, &consoleMode) ){ + if( !IsValidCodePage(CP_UTF8) ){ + fprintf(stderr, "Cannot use UTF-8 code page.\n"); + console_utf8 = 0; + return; + } + conState.hConsoleIn = hCI; + conState.consoleMode = consoleMode; + conState.inCodePage = GetConsoleCP(); + conState.outCodePage = GetConsoleOutputCP(); + SetConsoleCP(CP_UTF8); + SetConsoleOutputCP(CP_UTF8); + consoleMode |= ENABLE_LINE_INPUT | ENABLE_PROCESSED_INPUT; + SetConsoleMode(conState.hConsoleIn, consoleMode); + conState.infsMode = _setmode(_fileno(stdin), _O_U16TEXT); + console_utf8 = 1; + }else{ + console_utf8 = 0; + } +} + +/* +** Undo the effects of console_prepare(), if any. +*/ +static void SQLITE_CDECL console_restore(void){ + if( console_utf8 && conState.inCodePage!=0 + && conState.hConsoleIn!=INVALID_HANDLE_VALUE ){ + _setmode(_fileno(stdin), conState.infsMode); + SetConsoleCP(conState.inCodePage); + SetConsoleOutputCP(conState.outCodePage); + SetConsoleMode(conState.hConsoleIn, conState.consoleMode); + /* Avoid multiple calls. */ + conState.hConsoleIn = INVALID_HANDLE_VALUE; + conState.consoleMode = 0; + console_utf8 = 0; + } +} + +/* +** Collect input like fgets(...) with special provisions for input +** from the Windows console to get around its strange coding issues. +** Defers to plain fgets() when input is not interactive or when the +** startup option, -utf8, has not been provided or taken effect. +*/ +static char* utf8_fgets(char *buf, int ncmax, FILE *fin){ + if( fin==0 ) fin = stdin; + if( fin==stdin && stdin_is_interactive && console_utf8 ){ +# define SQLITE_IALIM 150 + wchar_t wbuf[SQLITE_IALIM]; + int lend = 0; + int noc = 0; + if( ncmax==0 || conState.stdinEof ) return 0; + buf[0] = 0; + while( noc SQLITE_IALIM*4+1 + noc) + ? SQLITE_IALIM : (ncmax-1 - noc)/4; +# undef SQLITE_IALIM + DWORD nbr = 0; + BOOL bRC = ReadConsoleW(conState.hConsoleIn, wbuf, na, &nbr, 0); + if( !bRC || (noc==0 && nbr==0) ) return 0; + if( nbr > 0 ){ + int nmb = WideCharToMultiByte(CP_UTF8,WC_COMPOSITECHECK|WC_DEFAULTCHAR, + wbuf,nbr,0,0,0,0); + if( nmb !=0 && noc+nmb <= ncmax ){ + int iseg = noc; + nmb = WideCharToMultiByte(CP_UTF8,WC_COMPOSITECHECK|WC_DEFAULTCHAR, + wbuf,nbr,buf+noc,nmb,0,0); + noc += nmb; + /* Fixup line-ends as coded by Windows for CR (or "Enter".)*/ + if( noc > 0 ){ + if( buf[noc-1]=='\n' ){ + lend = 1; + if( noc > 1 && buf[noc-2]=='\r' ){ + buf[noc-2] = '\n'; + --noc; + } + } + } + /* Check for ^Z (anywhere in line) too. */ + while( iseg < noc ){ + if( buf[iseg]==0x1a ){ + conState.stdinEof = 1; + noc = iseg; /* Chop ^Z and anything following. */ + break; + } + ++iseg; + } + }else break; /* Drop apparent garbage in. (Could assert.) */ + }else break; + } + /* If got nothing, (after ^Z chop), must be at end-of-file. */ + if( noc == 0 ) return 0; + buf[noc] = 0; + return buf; + }else{ + return fgets(buf, ncmax, fin); + } +} + +# define fgets(b,n,f) utf8_fgets(b,n,f) +#endif /* SHELL_WIN_UTF8_OPT */ + /* ** Render output like fprintf(). Except, if the output is going to the -** console and if this is running on a Windows machine, translate the -** output from UTF-8 into MBCS. +** console and if this is running on a Windows machine, and if the -utf8 +** option is unavailable or (available and inactive), translate the +** output from UTF-8 into MBCS for output through 8-bit stdout stream. +** (With -utf8 active, no translation is needed and must not be done.) */ #if defined(_WIN32) || defined(WIN32) void utf8_printf(FILE *out, const char *zFormat, ...){ va_list ap; va_start(ap, zFormat); - if( stdout_is_console && (out==stdout || out==stderr) ){ + if( stdout_is_console && (out==stdout || out==stderr) +# if SHELL_WIN_UTF8_OPT + && !console_utf8 +# endif + ){ char *z1 = sqlite3_vmprintf(zFormat, ap); char *z2 = sqlite3_win32_utf8_to_mbcs_v2(z1, 0); sqlite3_free(z1); @@ -637,7 +787,7 @@ static void shell_out_of_memory(void){ /* Check a pointer to see if it is NULL. If it is NULL, exit with an ** out-of-memory error. */ -static void shell_check_oom(void *p){ +static void shell_check_oom(const void *p){ if( p==0 ) shell_out_of_memory(); } @@ -816,9 +966,14 @@ static char *local_getline(char *zLine, FILE *in){ } } #if defined(_WIN32) || defined(WIN32) - /* For interactive input on Windows systems, translate the - ** multi-byte characterset characters into UTF-8. */ - if( stdin_is_interactive && in==stdin ){ + /* For interactive input on Windows systems, without -utf8, + ** translate the multi-byte characterset characters into UTF-8. + ** This is the translation that predates the -utf8 option. */ + if( stdin_is_interactive && in==stdin +# if SHELL_WIN_UTF8_OPT + && !console_utf8 +# endif /* SHELL_WIN_UTF8_OPT */ + ){ char *zTrans = sqlite3_win32_mbcs_to_utf8_v2(zLine, 0); if( zTrans ){ i64 nTrans = strlen(zTrans)+1; @@ -859,10 +1014,21 @@ static char *one_input_line(FILE *in, char *zPrior, int isContinuation){ #if SHELL_USE_LOCAL_GETLINE printf("%s", zPrompt); fflush(stdout); - zResult = local_getline(zPrior, stdin); + do{ + zResult = local_getline(zPrior, stdin); + zPrior = 0; + /* ^C trap creates a false EOF, so let "interrupt" thread catch up. */ + if( zResult==0 ) sqlite3_sleep(50); + }while( zResult==0 && seenInterrupt>0 ); #else free(zPrior); zResult = shell_readline(zPrompt); + while( zResult==0 ){ + /* ^C trap creates a false EOF, so let "interrupt" thread catch up. */ + sqlite3_sleep(50); + if( seenInterrupt==0 ) break; + zResult = shell_readline(""); + } if( zResult && *zResult ) shell_add_history(zResult); #endif } @@ -1002,6 +1168,7 @@ static void appendText(ShellText *p, const char *zAppend, char quote){ */ static char quoteChar(const char *zName){ int i; + if( zName==0 ) return '"'; if( !isalpha((unsigned char)zName[0]) && zName[0]!='_' ) return '"'; for(i=0; zName[i]; i++){ if( !isalnum((unsigned char)zName[i]) && zName[i]!='_' ) return '"'; @@ -1645,7 +1812,8 @@ int sqlite3MemTraceDeactivate(void){ ** ****************************************************************************** ** -** This SQLite extension implements functions that compute SHA3 hashes. +** This SQLite extension implements functions that compute SHA3 hashes +** in the way described by the (U.S.) NIST FIPS 202 SHA-3 Standard. ** Two SQL functions are implemented: ** ** sha3(X,SIZE) @@ -3173,6 +3341,7 @@ SQLITE_EXTENSION_INIT1; #define U8_TYPEDEF #endif +/* Decoding table, ASCII (7-bit) value to base 64 digit value or other */ static const u8 b64DigitValues[128] = { /* HT LF VT FF CR */ ND,ND,ND,ND, ND,ND,ND,ND, ND,WS,WS,WS, WS,WS,ND,ND, @@ -3244,9 +3413,9 @@ static char* toBase64( u8 *pIn, int nbIn, char *pOut ){ } /* Skip over text which is not base64 numeral(s). */ -static char * skipNonB64( char *s ){ +static char * skipNonB64( char *s, int nc ){ char c; - while( (c = *s) && !IS_BX_DIGIT(BX_DV_PROTO(c)) ) ++s; + while( nc-- > 0 && (c = *s) && !IS_BX_DIGIT(BX_DV_PROTO(c)) ) ++s; return s; } @@ -3255,7 +3424,7 @@ static u8* fromBase64( char *pIn, int ncIn, u8 *pOut ){ if( ncIn>0 && pIn[ncIn-1]=='\n' ) --ncIn; while( ncIn>0 && *pIn!=PAD_CHAR ){ static signed char nboi[] = { 0, 0, 1, 2, 3 }; - char *pUse = skipNonB64(pIn); + char *pUse = skipNonB64(pIn, ncIn); unsigned long qv = 0L; int nti, nbo, nac; ncIn -= (pUse - pIn); @@ -3315,9 +3484,16 @@ static void base64(sqlite3_context *context, int na, sqlite3_value *av[]){ sqlite3_result_error(context, "blob expanded to base64 too big", -1); return; } + bBuf = (u8*)sqlite3_value_blob(av[0]); + if( !bBuf ){ + if( SQLITE_NOMEM==sqlite3_errcode(sqlite3_context_db_handle(context)) ){ + goto memFail; + } + sqlite3_result_text(context,"",-1,SQLITE_STATIC); + break; + } cBuf = sqlite3_malloc(nc); if( !cBuf ) goto memFail; - bBuf = (u8*)sqlite3_value_blob(av[0]); nc = (int)(toBase64(bBuf, nb, cBuf) - cBuf); sqlite3_result_text(context, cBuf, nc, sqlite3_free); break; @@ -3330,9 +3506,16 @@ static void base64(sqlite3_context *context, int na, sqlite3_value *av[]){ }else if( nb<1 ){ nb = 1; } + cBuf = (char *)sqlite3_value_text(av[0]); + if( !cBuf ){ + if( SQLITE_NOMEM==sqlite3_errcode(sqlite3_context_db_handle(context)) ){ + goto memFail; + } + sqlite3_result_zeroblob(context, 0); + break; + } bBuf = sqlite3_malloc(nb); if( !bBuf ) goto memFail; - cBuf = (char *)sqlite3_value_text(av[0]); nb = (int)(fromBase64(cBuf, nc, bBuf) - bBuf); sqlite3_result_blob(context, bBuf, nb, sqlite3_free); break; @@ -3520,9 +3703,9 @@ static u8 base85DigitValue( char c ){ #define B85_DARK_MAX 80 -static char * skipNonB85( char *s ){ +static char * skipNonB85( char *s, int nc ){ char c; - while( (c = *s) && !IS_B85(c) ) ++s; + while( nc-- > 0 && (c = *s) && !IS_B85(c) ) ++s; return s; } @@ -3592,7 +3775,7 @@ static u8* fromBase85( char *pIn, int ncIn, u8 *pOut ){ if( ncIn>0 && pIn[ncIn-1]=='\n' ) --ncIn; while( ncIn>0 ){ static signed char nboi[] = { 0, 0, 1, 2, 3, 4 }; - char *pUse = skipNonB85(pIn); + char *pUse = skipNonB85(pIn, ncIn); unsigned long qv = 0L; int nti, nbo; ncIn -= (pUse - pIn); @@ -3677,9 +3860,16 @@ static void base85(sqlite3_context *context, int na, sqlite3_value *av[]){ sqlite3_result_error(context, "blob expanded to base85 too big", -1); return; } + bBuf = (u8*)sqlite3_value_blob(av[0]); + if( !bBuf ){ + if( SQLITE_NOMEM==sqlite3_errcode(sqlite3_context_db_handle(context)) ){ + goto memFail; + } + sqlite3_result_text(context,"",-1,SQLITE_STATIC); + break; + } cBuf = sqlite3_malloc(nc); if( !cBuf ) goto memFail; - bBuf = (u8*)sqlite3_value_blob(av[0]); nc = (int)(toBase85(bBuf, nb, cBuf, "\n") - cBuf); sqlite3_result_text(context, cBuf, nc, sqlite3_free); break; @@ -3692,9 +3882,16 @@ static void base85(sqlite3_context *context, int na, sqlite3_value *av[]){ }else if( nb<1 ){ nb = 1; } + cBuf = (char *)sqlite3_value_text(av[0]); + if( !cBuf ){ + if( SQLITE_NOMEM==sqlite3_errcode(sqlite3_context_db_handle(context)) ){ + goto memFail; + } + sqlite3_result_zeroblob(context, 0); + break; + } bBuf = sqlite3_malloc(nb); if( !bBuf ) goto memFail; - cBuf = (char *)sqlite3_value_text(av[0]); nb = (int)(fromBase85(cBuf, nc, bBuf) - bBuf); sqlite3_result_blob(context, bBuf, nb, sqlite3_free); break; @@ -4114,7 +4311,7 @@ int sqlite3_ieee_init( /************************* End ../ext/misc/ieee754.c ********************/ /************************* Begin ../ext/misc/series.c ******************/ /* -** 2015-08-18 +** 2015-08-18, 2023-04-28 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: @@ -4127,7 +4324,19 @@ int sqlite3_ieee_init( ** ** This file demonstrates how to create a table-valued-function using ** a virtual table. This demo implements the generate_series() function -** which gives similar results to the eponymous function in PostgreSQL. +** which gives the same results as the eponymous function in PostgreSQL, +** within the limitation that its arguments are signed 64-bit integers. +** +** Considering its equivalents to generate_series(start,stop,step): A +** value V[n] sequence is produced for integer n ascending from 0 where +** ( V[n] == start + n * step && sgn(V[n] - stop) * sgn(step) >= 0 ) +** for each produced value (independent of production time ordering.) +** +** All parameters must be either integer or convertable to integer. +** The start parameter is required. +** The stop parameter defaults to (1<<32)-1 (aka 4294967295 or 0xffffffff) +** The step parameter defaults to 1 and 0 is treated as 1. +** ** Examples: ** ** SELECT * FROM generate_series(0,100,5); @@ -4143,6 +4352,14 @@ int sqlite3_ieee_init( ** ** Integers 20 through 29. ** +** SELECT * FROM generate_series(0,-100,-5); +** +** Integers 0 -5 -10 ... -100. +** +** SELECT * FROM generate_series(0,-1); +** +** Empty sequence. +** ** HOW IT WORKS ** ** The generate_series "function" is really a virtual table with the @@ -4155,6 +4372,9 @@ int sqlite3_ieee_init( ** step HIDDEN ** ); ** +** The virtual table also has a rowid, logically equivalent to n+1 where +** "n" is the ascending integer in the aforesaid production definition. +** ** Function arguments in queries against this virtual table are translated ** into equality constraints against successive hidden columns. In other ** words, the following pairs of queries are equivalent to each other: @@ -4187,9 +4407,126 @@ int sqlite3_ieee_init( SQLITE_EXTENSION_INIT1 #include #include +#include #ifndef SQLITE_OMIT_VIRTUALTABLE +/* +** Return that member of a generate_series(...) sequence whose 0-based +** index is ix. The 0th member is given by smBase. The sequence members +** progress per ix increment by smStep. +*/ +static sqlite3_int64 genSeqMember(sqlite3_int64 smBase, + sqlite3_int64 smStep, + sqlite3_uint64 ix){ + if( ix>=(sqlite3_uint64)LLONG_MAX ){ + /* Get ix into signed i64 range. */ + ix -= (sqlite3_uint64)LLONG_MAX; + /* With 2's complement ALU, this next can be 1 step, but is split into + * 2 for UBSAN's satisfaction (and hypothetical 1's complement ALUs.) */ + smBase += (LLONG_MAX/2) * smStep; + smBase += (LLONG_MAX - LLONG_MAX/2) * smStep; + } + /* Under UBSAN (or on 1's complement machines), must do this last term + * in steps to avoid the dreaded (and harmless) signed multiply overlow. */ + if( ix>=2 ){ + sqlite3_int64 ix2 = (sqlite3_int64)ix/2; + smBase += ix2*smStep; + ix -= ix2; + } + return smBase + ((sqlite3_int64)ix)*smStep; +} + +/* typedef unsigned char u8; */ + +typedef struct SequenceSpec { + sqlite3_int64 iBase; /* Starting value ("start") */ + sqlite3_int64 iTerm; /* Given terminal value ("stop") */ + sqlite3_int64 iStep; /* Increment ("step") */ + sqlite3_uint64 uSeqIndexMax; /* maximum sequence index (aka "n") */ + sqlite3_uint64 uSeqIndexNow; /* Current index during generation */ + sqlite3_int64 iValueNow; /* Current value during generation */ + u8 isNotEOF; /* Sequence generation not exhausted */ + u8 isReversing; /* Sequence is being reverse generated */ +} SequenceSpec; + +/* +** Prepare a SequenceSpec for use in generating an integer series +** given initialized iBase, iTerm and iStep values. Sequence is +** initialized per given isReversing. Other members are computed. +*/ +static void setupSequence( SequenceSpec *pss ){ + int bSameSigns; + pss->uSeqIndexMax = 0; + pss->isNotEOF = 0; + bSameSigns = (pss->iBase < 0)==(pss->iTerm < 0); + if( pss->iTerm < pss->iBase ){ + sqlite3_uint64 nuspan = 0; + if( bSameSigns ){ + nuspan = (sqlite3_uint64)(pss->iBase - pss->iTerm); + }else{ + /* Under UBSAN (or on 1's complement machines), must do this in steps. + * In this clause, iBase>=0 and iTerm<0 . */ + nuspan = 1; + nuspan += pss->iBase; + nuspan += -(pss->iTerm+1); + } + if( pss->iStep<0 ){ + pss->isNotEOF = 1; + if( nuspan==ULONG_MAX ){ + pss->uSeqIndexMax = ( pss->iStep>LLONG_MIN )? nuspan/-pss->iStep : 1; + }else if( pss->iStep>LLONG_MIN ){ + pss->uSeqIndexMax = nuspan/-pss->iStep; + } + } + }else if( pss->iTerm > pss->iBase ){ + sqlite3_uint64 puspan = 0; + if( bSameSigns ){ + puspan = (sqlite3_uint64)(pss->iTerm - pss->iBase); + }else{ + /* Under UBSAN (or on 1's complement machines), must do this in steps. + * In this clause, iTerm>=0 and iBase<0 . */ + puspan = 1; + puspan += pss->iTerm; + puspan += -(pss->iBase+1); + } + if( pss->iStep>0 ){ + pss->isNotEOF = 1; + pss->uSeqIndexMax = puspan/pss->iStep; + } + }else if( pss->iTerm == pss->iBase ){ + pss->isNotEOF = 1; + pss->uSeqIndexMax = 0; + } + pss->uSeqIndexNow = (pss->isReversing)? pss->uSeqIndexMax : 0; + pss->iValueNow = (pss->isReversing) + ? genSeqMember(pss->iBase, pss->iStep, pss->uSeqIndexMax) + : pss->iBase; +} +/* +** Progress sequence generator to yield next value, if any. +** Leave its state to either yield next value or be at EOF. +** Return whether there is a next value, or 0 at EOF. +*/ +static int progressSequence( SequenceSpec *pss ){ + if( !pss->isNotEOF ) return 0; + if( pss->isReversing ){ + if( pss->uSeqIndexNow > 0 ){ + pss->uSeqIndexNow--; + pss->iValueNow -= pss->iStep; + }else{ + pss->isNotEOF = 0; + } + }else{ + if( pss->uSeqIndexNow < pss->uSeqIndexMax ){ + pss->uSeqIndexNow++; + pss->iValueNow += pss->iStep; + }else{ + pss->isNotEOF = 0; + } + } + return pss->isNotEOF; +} /* series_cursor is a subclass of sqlite3_vtab_cursor which will ** serve as the underlying representation of a cursor that scans @@ -4198,12 +4535,7 @@ SQLITE_EXTENSION_INIT1 typedef struct series_cursor series_cursor; struct series_cursor { sqlite3_vtab_cursor base; /* Base class - must be first */ - int isDesc; /* True to count down rather than up */ - sqlite3_int64 iRowid; /* The rowid */ - sqlite3_int64 iValue; /* Current value ("value") */ - sqlite3_int64 mnValue; /* Mimimum value ("start") */ - sqlite3_int64 mxValue; /* Maximum value ("stop") */ - sqlite3_int64 iStep; /* Increment ("step") */ + SequenceSpec ss; /* (this) Derived class data */ }; /* @@ -4285,12 +4617,7 @@ static int seriesClose(sqlite3_vtab_cursor *cur){ */ static int seriesNext(sqlite3_vtab_cursor *cur){ series_cursor *pCur = (series_cursor*)cur; - if( pCur->isDesc ){ - pCur->iValue -= pCur->iStep; - }else{ - pCur->iValue += pCur->iStep; - } - pCur->iRowid++; + progressSequence( & pCur->ss ); return SQLITE_OK; } @@ -4306,23 +4633,23 @@ static int seriesColumn( series_cursor *pCur = (series_cursor*)cur; sqlite3_int64 x = 0; switch( i ){ - case SERIES_COLUMN_START: x = pCur->mnValue; break; - case SERIES_COLUMN_STOP: x = pCur->mxValue; break; - case SERIES_COLUMN_STEP: x = pCur->iStep; break; - default: x = pCur->iValue; break; + case SERIES_COLUMN_START: x = pCur->ss.iBase; break; + case SERIES_COLUMN_STOP: x = pCur->ss.iTerm; break; + case SERIES_COLUMN_STEP: x = pCur->ss.iStep; break; + default: x = pCur->ss.iValueNow; break; } sqlite3_result_int64(ctx, x); return SQLITE_OK; } /* -** Return the rowid for the current row. In this implementation, the -** first row returned is assigned rowid value 1, and each subsequent -** row a value 1 more than that of the previous. +** Return the rowid for the current row, logically equivalent to n+1 where +** "n" is the ascending integer in the aforesaid production definition. */ static int seriesRowid(sqlite3_vtab_cursor *cur, sqlite_int64 *pRowid){ series_cursor *pCur = (series_cursor*)cur; - *pRowid = pCur->iRowid; + sqlite3_uint64 n = pCur->ss.uSeqIndexNow; + *pRowid = (sqlite3_int64)((n<0xffffffffffffffff)? n+1 : 0); return SQLITE_OK; } @@ -4332,14 +4659,10 @@ static int seriesRowid(sqlite3_vtab_cursor *cur, sqlite_int64 *pRowid){ */ static int seriesEof(sqlite3_vtab_cursor *cur){ series_cursor *pCur = (series_cursor*)cur; - if( pCur->isDesc ){ - return pCur->iValue < pCur->mnValue; - }else{ - return pCur->iValue > pCur->mxValue; - } + return !pCur->ss.isNotEOF; } -/* True to cause run-time checking of the start=, stop=, and/or step= +/* True to cause run-time checking of the start=, stop=, and/or step= ** parameters. The only reason to do this is for testing the ** constraint checking logic for virtual tables in the SQLite core. */ @@ -4350,7 +4673,7 @@ static int seriesEof(sqlite3_vtab_cursor *cur){ /* ** This method is called to "rewind" the series_cursor object back ** to the first row of output. This method is always called at least -** once prior to any call to seriesColumn() or seriesRowid() or +** once prior to any call to seriesColumn() or seriesRowid() or ** seriesEof(). ** ** The query plan selected by seriesBestIndex is passed in the idxNum @@ -4370,7 +4693,7 @@ static int seriesEof(sqlite3_vtab_cursor *cur){ ** (so that seriesEof() will return true) if the table is empty. */ static int seriesFilter( - sqlite3_vtab_cursor *pVtabCursor, + sqlite3_vtab_cursor *pVtabCursor, int idxNum, const char *idxStrUnused, int argc, sqlite3_value **argv ){ @@ -4378,46 +4701,41 @@ static int seriesFilter( int i = 0; (void)idxStrUnused; if( idxNum & 1 ){ - pCur->mnValue = sqlite3_value_int64(argv[i++]); + pCur->ss.iBase = sqlite3_value_int64(argv[i++]); }else{ - pCur->mnValue = 0; + pCur->ss.iBase = 0; } if( idxNum & 2 ){ - pCur->mxValue = sqlite3_value_int64(argv[i++]); + pCur->ss.iTerm = sqlite3_value_int64(argv[i++]); }else{ - pCur->mxValue = 0xffffffff; + pCur->ss.iTerm = 0xffffffff; } if( idxNum & 4 ){ - pCur->iStep = sqlite3_value_int64(argv[i++]); - if( pCur->iStep==0 ){ - pCur->iStep = 1; - }else if( pCur->iStep<0 ){ - pCur->iStep = -pCur->iStep; + pCur->ss.iStep = sqlite3_value_int64(argv[i++]); + if( pCur->ss.iStep==0 ){ + pCur->ss.iStep = 1; + }else if( pCur->ss.iStep<0 ){ if( (idxNum & 16)==0 ) idxNum |= 8; } }else{ - pCur->iStep = 1; + pCur->ss.iStep = 1; } for(i=0; imnValue = 1; - pCur->mxValue = 0; + pCur->ss.iBase = 1; + pCur->ss.iTerm = 0; + pCur->ss.iStep = 1; break; } } if( idxNum & 8 ){ - pCur->isDesc = 1; - pCur->iValue = pCur->mxValue; - if( pCur->iStep>0 ){ - pCur->iValue -= (pCur->mxValue - pCur->mnValue)%pCur->iStep; - } + pCur->ss.isReversing = pCur->ss.iStep > 0; }else{ - pCur->isDesc = 0; - pCur->iValue = pCur->mnValue; + pCur->ss.isReversing = pCur->ss.iStep < 0; } - pCur->iRowid = 1; + setupSequence( &pCur->ss ); return SQLITE_OK; } @@ -5172,7 +5490,7 @@ static const char *re_subcompile_string(ReCompiled *p){ break; } case '[': { - int iFirst = p->nState; + unsigned int iFirst = p->nState; if( rePeek(p)=='^' ){ re_append(p, RE_OP_CC_EXC, 0); p->sIn.i++; @@ -5196,7 +5514,7 @@ static const char *re_subcompile_string(ReCompiled *p){ if( rePeek(p)==']' ){ p->sIn.i++; break; } } if( c==0 ) return "unclosed '['"; - p->aArg[iFirst] = p->nState - iFirst; + if( p->nState>iFirst ) p->aArg[iFirst] = p->nState - iFirst; break; } case '\\': { @@ -8773,7 +9091,10 @@ static int zipfileColumn( ** it to be a directory either if the mode suggests so, or if ** the final character in the name is '/'. */ u32 mode = pCDS->iExternalAttr >> 16; - if( !(mode & S_IFDIR) && pCDS->zFile[pCDS->nFile-1]!='/' ){ + if( !(mode & S_IFDIR) + && pCDS->nFile>=1 + && pCDS->zFile[pCDS->nFile-1]!='/' + ){ sqlite3_result_blob(ctx, "", 0, SQLITE_STATIC); } } @@ -9210,9 +9531,19 @@ static u32 zipfileGetTime(sqlite3_value *pVal){ */ static void zipfileRemoveEntryFromList(ZipfileTab *pTab, ZipfileEntry *pOld){ if( pOld ){ - ZipfileEntry **pp; - for(pp=&pTab->pFirstEntry; (*pp)!=pOld; pp=&((*pp)->pNext)); - *pp = (*pp)->pNext; + if( pTab->pFirstEntry==pOld ){ + pTab->pFirstEntry = pOld->pNext; + if( pTab->pLastEntry==pOld ) pTab->pLastEntry = 0; + }else{ + ZipfileEntry *p; + for(p=pTab->pFirstEntry; p; p=p->pNext){ + if( p->pNext==pOld ){ + p->pNext = pOld->pNext; + if( pTab->pLastEntry==pOld ) pTab->pLastEntry = p; + break; + } + } + } zipfileEntryFree(pOld); } } @@ -12678,6 +13009,7 @@ static int dbdataConnect( (void)argc; (void)argv; (void)pzErr; + sqlite3_vtab_config(db, SQLITE_VTAB_USES_ALL_SCHEMAS); if( rc==SQLITE_OK ){ pTab = (DbdataTable*)sqlite3_malloc64(sizeof(DbdataTable)); if( pTab==0 ){ @@ -13323,8 +13655,6 @@ static int dbdataFilter( } if( rc==SQLITE_OK ){ rc = sqlite3_bind_text(pCsr->pStmt, 1, zSchema, -1, SQLITE_TRANSIENT); - }else{ - pTab->base.zErrMsg = sqlite3_mprintf("%s", sqlite3_errmsg(pTab->db)); } /* Try to determine the encoding of the db by inspecting the header @@ -13333,6 +13663,10 @@ static int dbdataFilter( rc = dbdataGetEncoding(pCsr); } + if( rc!=SQLITE_OK ){ + pTab->base.zErrMsg = sqlite3_mprintf("%s", sqlite3_errmsg(pTab->db)); + } + if( rc==SQLITE_OK ){ rc = dbdataNext(pCursor); } @@ -14571,7 +14905,7 @@ static void recoverAddTable( int iField = sqlite3_column_int(pStmt, 0); int iCol = sqlite3_column_int(pStmt, 1); - assert( iFieldnCol && iColnCol ); + assert( iColnCol ); pNew->aCol[iCol].iField = iField; pNew->bIntkey = 0; @@ -16335,7 +16669,7 @@ int sqlite3_recover_finish(sqlite3_recover *p){ #endif /* ifndef SQLITE_OMIT_VIRTUALTABLE */ /************************* End ../ext/recover/sqlite3recover.c ********************/ -# endif +# endif /* SQLITE_HAVE_SQLITE3R */ #endif #ifdef SQLITE_SHELL_EXTSRC # include SHELL_STRINGIFY(SQLITE_SHELL_EXTSRC) @@ -16517,6 +16851,7 @@ static ShellState shellState; #define SHFLG_HeaderSet 0x00000080 /* showHeader has been specified */ #define SHFLG_DumpDataOnly 0x00000100 /* .dump show data only */ #define SHFLG_DumpNoSys 0x00000200 /* .dump omits system tables */ +#define SHFLG_TestingMode 0x00000400 /* allow unsafe testing features */ /* ** Macros for testing and setting shellFlgs @@ -16760,6 +17095,7 @@ static void editFunc( }else{ /* If the file did not originally contain \r\n then convert any new ** \r\n back into \n */ + p[sz] = 0; for(i=j=0; i To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: 1e4b7ab136b4 - main - tslog.h: Wrap in #ifdef _KERNEL List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1e4b7ab136b434dcb296833e509f87c95ac868bc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=1e4b7ab136b434dcb296833e509f87c95ac868bc commit 1e4b7ab136b434dcb296833e509f87c95ac868bc Author: Colin Percival AuthorDate: 2023-06-04 22:59:10 +0000 Commit: Colin Percival CommitDate: 2023-06-05 05:49:38 +0000 tslog.h: Wrap in #ifdef _KERNEL This is not intended to be used from outside of the kernel; in particular, the boot loader has its own version of tslog. --- sys/sys/tslog.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/sys/tslog.h b/sys/sys/tslog.h index af3c0931cac8..dcbfd266c5c2 100644 --- a/sys/sys/tslog.h +++ b/sys/sys/tslog.h @@ -29,6 +29,7 @@ #ifndef _TSLOG_H_ #define _TSLOG_H_ +#ifdef _KERNEL #ifdef TSLOG #include #include @@ -66,4 +67,5 @@ void tslog_user(pid_t, pid_t, const char *, const char *); #define TSRAW_USER(a, b, c, d) /* Timestamp logging disabled */ #endif +#endif /* _KERNEL */ #endif /* _TSLOG_H_ */ From nobody Mon Jun 5 05:50:08 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZN410cvDz4Zq2Z; Mon, 5 Jun 2023 05:50:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZN406MNcz3MXX; Mon, 5 Jun 2023 05:50:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685944209; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ijSjajLM6I8+BJVyfohkgFuiUxog45Lp0TmGXG8H5q8=; b=UCJb8PDG3Jl8vbm/OERHUCljf/SMir5Um38gt9PK+jvHYURg1wQ8pvD4pwdo2UQh2AZfjS Lbrd2rUEqDfO/2Sq2QmG3ZF2t88V61noh2TIQKF2y6gvx7oMXudj0ROojetMvZZnOGf0tg MBQA8ivieewyCIkrZEXEccBtdaIF4Y/kWdKfF73eKjRWADTtYlu61a7Yrc+sLbz/pm6vpp r6nmj6iqBjlwY3Bt3MLGAXGF2XKnfFlHutRDt/dXtXBRktLqFtl1LcZmr6DcW3dVljk5GV LAd1Yk2qWJzx+mnuzXdueU8iUD92bBV2L5cl9O5udlespC5aoAQAR5/V37gq+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685944209; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ijSjajLM6I8+BJVyfohkgFuiUxog45Lp0TmGXG8H5q8=; b=WtXaDsofiGtnzh5G/kCgTSVJS7ynO0es55BbIYUSfW24Sl6aVclSWWcGfMUY0hiyWBK2L5 OfnD2f5sNBVFVQuFmOtR+RdOMzyXcy96oUNY4C8IrOUqhpadk+10c+jEbPYrx8zHU5YIRo tbKf80TFc84g0dyCQD/4ngWQPMGbwGHKTXDcDljBYBSRjlplb8YjKY5eg/MH/09qLE4RMg yYKj+j163IyMA4DR7RO6C46/62dGKJ8GEcI8U0chV3szmVVJ7sE0IGsNq0yzm2R9CFqt8p Mi4yZ5AXLEqJ0JSMg/fdncuekgfp5KRh0Z+at2ff1hJLKW05DXFtYX6ZJTJLjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685944209; a=rsa-sha256; cv=none; b=JA+X9r8kjn5rJ3esCYSGnGH95bhMLMHqAZQpeHqrL8pCTpOiPWxlhdCfY9+4P9A9/XV7xH Lak2Svz5SMVarXEpkrieKCdB5VKrfHgzrntmDMWctlXrUqYlxuwRh7cAOoLFesozS6gwJ9 oIudQ8tfZjpnywoTsuIOsHDFxAsAJkSAkUv3Y0cgznDZskGyYr8zIEZ9NuhO/G+WfpI3Zg 7crQhGMJRX8PIDnCMJOCXCOIEYnGI/twAqEUprvBcTtLsHiztEqIULeXokk1UnkeOf2SeT a2yTPShCb1+YzVE5dspDzvMRb16OgmZwNt/IdC1g8ljsp1dV+J1qwmCo5f9iNg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZN405SB6zc5D; Mon, 5 Jun 2023 05:50:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3555o83c047950; Mon, 5 Jun 2023 05:50:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3555o8G2047943; Mon, 5 Jun 2023 05:50:08 GMT (envelope-from git) Date: Mon, 5 Jun 2023 05:50:08 GMT Message-Id: <202306050550.3555o8G2047943@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: 9d6ae1e3c26a - main - Revert "Revert "tslog: Annotate some early boot functions"" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9d6ae1e3c26a0c3334a268b587f17dccb9a503d7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=9d6ae1e3c26a0c3334a268b587f17dccb9a503d7 commit 9d6ae1e3c26a0c3334a268b587f17dccb9a503d7 Author: Colin Percival AuthorDate: 2023-06-04 23:01:31 +0000 Commit: Colin Percival CommitDate: 2023-06-05 05:49:38 +0000 Revert "Revert "tslog: Annotate some early boot functions"" Now that is wrapped in #ifdef _KERNEL, it's safe to have tslog annotations in files which might be built from userland (i.e. in subr_boot.c, which is built as part of the boot loader). This reverts commit 59588a546f55523d6fd37ab42eb08b719311d7d6. --- sys/amd64/amd64/fpu.c | 3 +++ sys/amd64/amd64/initcpu.c | 4 ++++ sys/amd64/amd64/machdep.c | 2 ++ sys/amd64/amd64/pmap.c | 4 ++++ sys/kern/kern_cons.c | 3 +++ sys/kern/link_elf.c | 7 +++++++ sys/kern/subr_boot.c | 5 +++++ sys/kern/subr_kdb.c | 3 +++ sys/kern/subr_param.c | 4 ++++ sys/kern/subr_pcpu.c | 2 ++ sys/kern/subr_prf.c | 3 +++ sys/x86/pci/pci_early_quirks.c | 3 +++ sys/x86/x86/identcpu.c | 7 ++++++- sys/x86/xen/pv.c | 3 +++ 14 files changed, 52 insertions(+), 1 deletion(-) diff --git a/sys/amd64/amd64/fpu.c b/sys/amd64/amd64/fpu.c index a3421cf0d496..1310a27911fe 100644 --- a/sys/amd64/amd64/fpu.c +++ b/sys/amd64/amd64/fpu.c @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -360,6 +361,7 @@ fpuinit(void) u_int mxcsr; u_short control; + TSENTER(); if (IS_BSP()) fpuinit_bsp1(); @@ -401,6 +403,7 @@ fpuinit(void) ldmxcsr(mxcsr); start_emulating(); intr_restore(saveintr); + TSEXIT(); } /* diff --git a/sys/amd64/amd64/initcpu.c b/sys/amd64/amd64/initcpu.c index a17ef89ba9f8..0de4bc3e2d60 100644 --- a/sys/amd64/amd64/initcpu.c +++ b/sys/amd64/amd64/initcpu.c @@ -276,6 +276,7 @@ initializecpu(void) uint64_t msr; uint32_t cr4; + TSENTER(); cr4 = rcr4(); if ((cpu_feature & CPUID_XMM) && (cpu_feature & CPUID_FXSR)) { cr4 |= CR4_FXSR | CR4_XMM; @@ -311,7 +312,9 @@ initializecpu(void) if (cpu_stdext_feature & CPUID_STDEXT_SMAP) cr4 |= CR4_SMAP; } + TSENTER2("load_cr4"); load_cr4(cr4); + TSEXIT2("load_cr4"); /* Reload cpu ext features to reflect cr4 changes */ if (IS_BSP() && cold) identify_cpu_ext_features(); @@ -340,6 +343,7 @@ initializecpu(void) if (!IS_BSP()) cpu_init_small_core(); + TSEXIT(); } void diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 757606311123..fa3ffe84bfe1 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -874,6 +874,7 @@ getmemsize(caddr_t kmdp, u_int64_t first) quad_t dcons_addr, dcons_size; int page_counter; + TSENTER(); /* * Tell the physical memory allocator about pages used to store * the kernel and preloaded data. See kmem_bootstrap_free(). @@ -1129,6 +1130,7 @@ do_next: /* Map the message buffer. */ msgbufp = (struct msgbuf *)PHYS_TO_DMAP(phys_avail[pa_indx]); + TSEXIT(); } static caddr_t diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index b2abab429730..123811ed573f 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -1668,6 +1668,7 @@ create_pagetables(vm_paddr_t *firstaddr) #endif int i, j, ndm1g, nkpdpe, nkdmpde; + TSENTER(); /* Allocate page table pages for the direct map */ ndmpdp = howmany(ptoa(Maxmem), NBPDP); if (ndmpdp < 4) /* Minimum 4GB of dirmap */ @@ -1884,6 +1885,7 @@ create_pagetables(vm_paddr_t *firstaddr) } kernel_pml4 = (pml4_entry_t *)PHYS_TO_DMAP(KPML4phys); + TSEXIT(); } /* @@ -1906,6 +1908,7 @@ pmap_bootstrap(vm_paddr_t *firstaddr) u_long res; int i; + TSENTER(); KERNend = *firstaddr; res = atop(KERNend - (vm_paddr_t)kernphys); @@ -2061,6 +2064,7 @@ pmap_bootstrap(vm_paddr_t *firstaddr) */ load_cr4(rcr4() | CR4_PCIDE); } + TSEXIT(); } /* diff --git a/sys/kern/kern_cons.c b/sys/kern/kern_cons.c index 7c63b8e4ed9c..ff57b2bdfd8a 100644 --- a/sys/kern/kern_cons.c +++ b/sys/kern/kern_cons.c @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -134,6 +135,7 @@ cninit(void) { struct consdev *best_cn, *cn, **list; + TSENTER(); /* * Check if we should mute the console (for security reasons perhaps) * It can be changes dynamically using sysctl kern.consmute @@ -195,6 +197,7 @@ cninit(void) */ early_putc = NULL; #endif + TSEXIT(); } void diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c index b410469b6270..bd8994ff0e4d 100644 --- a/sys/kern/link_elf.c +++ b/sys/kern/link_elf.c @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -1431,6 +1432,7 @@ relocate_file1(elf_file_t ef, elf_lookup_fn lookup, elf_reloc_fn reloc, const Elf_Rela *rela; const char *symname; + TSENTER(); #define APPLY_RELOCS(iter, tbl, tblsize, type) do { \ for ((iter) = (tbl); (iter) != NULL && \ (iter) < (tbl) + (tblsize) / sizeof(*(iter)); (iter)++) { \ @@ -1449,12 +1451,15 @@ relocate_file1(elf_file_t ef, elf_lookup_fn lookup, elf_reloc_fn reloc, } while (0) APPLY_RELOCS(rel, ef->rel, ef->relsize, ELF_RELOC_REL); + TSENTER2("ef->rela"); APPLY_RELOCS(rela, ef->rela, ef->relasize, ELF_RELOC_RELA); + TSEXIT2("ef->rela"); APPLY_RELOCS(rel, ef->pltrel, ef->pltrelsize, ELF_RELOC_REL); APPLY_RELOCS(rela, ef->pltrela, ef->pltrelasize, ELF_RELOC_RELA); #undef APPLY_RELOCS + TSEXIT(); return (0); } @@ -1950,6 +1955,7 @@ link_elf_ireloc(caddr_t kmdp) struct elf_file eff; elf_file_t ef; + TSENTER(); ef = &eff; bzero_early(ef, sizeof(*ef)); @@ -1966,6 +1972,7 @@ link_elf_ireloc(caddr_t kmdp) link_elf_preload_parse_symbols(ef); relocate_file1(ef, elf_lookup_ifunc, elf_reloc, true); + TSEXIT(); } #if defined(__aarch64__) || defined(__amd64__) diff --git a/sys/kern/subr_boot.c b/sys/kern/subr_boot.c index 057ffb5b7e08..73e75ba11750 100644 --- a/sys/kern/subr_boot.c +++ b/sys/kern/subr_boot.c @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #endif #include #include +#include #ifdef _KERNEL #define SETENV(k, v) kern_setenv(k, v) @@ -95,12 +96,14 @@ boot_env_to_howto(void) int i, howto; char *val; + TSENTER(); for (howto = 0, i = 0; howto_names[i].ev != NULL; i++) { val = GETENV(howto_names[i].ev); if (val != NULL && strcasecmp(val, "no") != 0) howto |= howto_names[i].mask; FREE(val); } + TSEXIT(); return (howto); } @@ -193,12 +196,14 @@ boot_parse_cmdline_delim(char *cmdline, const char *delim) char *v; int howto; + TSENTER(); howto = 0; while ((v = strsep(&cmdline, delim)) != NULL) { if (*v == '\0') continue; howto |= boot_parse_arg(v); } + TSEXIT(); return (howto); } diff --git a/sys/kern/subr_kdb.c b/sys/kern/subr_kdb.c index f8b37c2319b0..2f419b4d8ad5 100644 --- a/sys/kern/subr_kdb.c +++ b/sys/kern/subr_kdb.c @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -559,6 +560,7 @@ kdb_init(void) struct kdb_dbbe *be, **iter; int cur_pri, pri; + TSENTER(); kdb_active = 0; kdb_dbbe = NULL; cur_pri = -1; @@ -582,6 +584,7 @@ kdb_init(void) printf("KDB: current backend: %s\n", kdb_dbbe->dbbe_name); } + TSEXIT(); } /* diff --git a/sys/kern/subr_param.c b/sys/kern/subr_param.c index bb8cb5871af2..b988f28944cc 100644 --- a/sys/kern/subr_param.c +++ b/sys/kern/subr_param.c @@ -171,6 +171,7 @@ void init_param1(void) { + TSENTER(); #if !defined(__arm64__) TUNABLE_INT_FETCH("kern.kstack_pages", &kstack_pages); #endif @@ -245,6 +246,7 @@ init_param1(void) pid_max = 300; TUNABLE_INT_FETCH("vfs.unmapped_buf_allowed", &unmapped_buf_allowed); + TSEXIT(); } /* @@ -254,6 +256,7 @@ void init_param2(long physpages) { + TSENTER(); /* Base parameters */ maxusers = MAXUSERS; TUNABLE_INT_FETCH("kern.maxusers", &maxusers); @@ -335,6 +338,7 @@ init_param2(long physpages) if (maxpipekva > (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) / 64) maxpipekva = (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) / 64; + TSEXIT(); } /* diff --git a/sys/kern/subr_pcpu.c b/sys/kern/subr_pcpu.c index c4c220d66c97..c13a52dffccd 100644 --- a/sys/kern/subr_pcpu.c +++ b/sys/kern/subr_pcpu.c @@ -103,6 +103,7 @@ dpcpu_init(void *dpcpu, int cpuid) { struct pcpu *pcpu; + TSENTER(); pcpu = pcpu_find(cpuid); pcpu->pc_dynamic = (uintptr_t)dpcpu - DPCPU_START; @@ -115,6 +116,7 @@ dpcpu_init(void *dpcpu, int cpuid) * Place it in the global pcpu offset array. */ dpcpu_off[cpuid] = pcpu->pc_dynamic; + TSEXIT(); } static void diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c index 0506c21b5ad8..db4ef168bc70 100644 --- a/sys/kern/subr_prf.c +++ b/sys/kern/subr_prf.c @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1037,6 +1038,7 @@ msgbufinit(void *ptr, int size) static struct msgbuf *oldp = NULL; bool print_boot_tag; + TSENTER(); size -= sizeof(*msgbufp); cp = (char *)ptr; print_boot_tag = !msgbufmapped; @@ -1052,6 +1054,7 @@ msgbufinit(void *ptr, int size) if (print_boot_tag && *current_boot_tag != '\0') printf("%s\n", current_boot_tag); oldp = msgbufp; + TSEXIT(); } /* Sysctls for accessing/clearing the msgbuf */ diff --git a/sys/x86/pci/pci_early_quirks.c b/sys/x86/pci/pci_early_quirks.c index 97ba7e1a0631..ab8072b38d14 100644 --- a/sys/x86/pci/pci_early_quirks.c +++ b/sys/x86/pci/pci_early_quirks.c @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include /* XXX: enable this once the KPI is available */ @@ -317,5 +318,7 @@ void pci_early_quirks(void) { + TSENTER(); intel_graphics_stolen(); + TSEXIT(); } diff --git a/sys/x86/x86/identcpu.c b/sys/x86/x86/identcpu.c index 42cca3250481..3ff59344e17d 100644 --- a/sys/x86/x86/identcpu.c +++ b/sys/x86/x86/identcpu.c @@ -1424,6 +1424,7 @@ identify_hypervisor(void) u_int regs[4]; char *p; + TSENTER(); /* * If CPUID2_HV is set, we are running in a hypervisor environment. */ @@ -1432,8 +1433,10 @@ identify_hypervisor(void) identify_hypervisor_cpuid_base(); /* If we have a definitive vendor, we can return now. */ - if (*hv_vendor != '\0') + if (*hv_vendor != '\0') { + TSEXIT(); return; + } } /* @@ -1446,11 +1449,13 @@ identify_hypervisor(void) if (regs[1] == VMW_HVMAGIC) { vm_guest = VM_GUEST_VMWARE; freeenv(p); + TSEXIT(); return; } } freeenv(p); } + TSEXIT(); } bool diff --git a/sys/x86/xen/pv.c b/sys/x86/xen/pv.c index 367214fe35be..b3da26e9b78e 100644 --- a/sys/x86/xen/pv.c +++ b/sys/x86/xen/pv.c @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -417,6 +418,7 @@ xen_pvh_parse_preload_data(uint64_t modulep) char *envp; char acpi_rsdp[19]; + TSENTER(); if (start_info->modlist_paddr != 0) { struct hvm_modlist_entry *mod; const char *cmdline; @@ -507,6 +509,7 @@ xen_pvh_parse_preload_data(uint64_t modulep) #ifdef DDB xen_pvh_parse_symtab(); #endif + TSEXIT(); return (kmdp); } From nobody Mon Jun 5 08:35:56 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZRlJ3zC3z4bM3Y; Mon, 5 Jun 2023 08:35:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZRlJ2LpNz3wXH; Mon, 5 Jun 2023 08:35:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954156; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2SniJDHvm7YMOAIbZ2okQYl61ZuH90izBPYHxBHdGds=; b=eC5X26ya21ivpHUt2tEX5hq4z0dNQECLK1peDCl49xZHpk4AHimujSSVj458alS3ovynDu PSSHR7lZ1e84T2Vy31jEBGcbnHM0LHLxD7j+mMuyOF1RKHMoKxYHmH0dt3uEvrd5qQv4An lVKG12nTHk2mgnCbZMb0NuWN6eL0qX/ZCi8EAfokVy6qJ/Ykgu0aWK6QAFGBaojNIH8zpR 0EtF3KbtpfyIt3xBu5yu/JbfIyj2coJUYJsPXU0eCCmc84tf8NBheRN49iGeTolWCoeC3C IgU7+wSuCsWacodMQLz5eEj2xjvbkabVuB6lVGBu0+x5JhipGc4c2gYrveeJyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954156; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2SniJDHvm7YMOAIbZ2okQYl61ZuH90izBPYHxBHdGds=; b=hVnBF9uvzusXw3TZ0UtL174O/mXnWKHpSuYrzm5lxSM5Fr7gRUaN4wnf6nZlnKZXRdUTbF fQIXvjU1wjHuz/AC/5Zr2dYVgiTvwWFq8XHQeBRqHpt285rlihpHcWz22mUnRq8WYI9imA sJgjk3oOLQKo4Y0OSNmLbhLGJBJ7TUgkr9RzphUCadL7i8PKms/Cx82iIbppTd4ujO/Szv +v91IZ8Sy5Y7VzKcuY8ZEFcThVQOMtNjdPs+qGEvUDWKUSa6zCk+I9K9jJXvSMfpLJ4r5R 8zxu9FxcGs/+hDIn51WGOR6ORaTYAx2WvHyb8rFQ8P+Pty6iw9buXbiJgaax2A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685954156; a=rsa-sha256; cv=none; b=khkKla/dNAj/AkluhcyIoIaeUCDJ/H3mDQbXs+dA+STSp1E5YUyWTnA24h8Qo8AOZg/ykU WRHwCU7sx9PSdBIICNcPfdkva8s2F2fg7ZspHvcE0ssi2vCXO7b5ZpXy7N+ZVzJtOXtFkz oLUIS2rsEcmfJSgSazuDSouyybXZft4aOk0XTt+2HsTFQ6e+jqBAgSvzz8YDXXc6HZQbeX oxcVj1nl5+XiogGGB/T7pwXhgME056cwKTjWwHeAL0XeTFWN0tjsdnyC4tVCbZmglRkV0F 6YzHba7YEBktmdhZlpeN28fpf3VCYCKICjdJiU9sHNbOSMGbRNyZYBL7Rlw47g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZRlJ1Rwvzgmx; Mon, 5 Jun 2023 08:35:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3558Zuxp024249; Mon, 5 Jun 2023 08:35:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3558ZuA7024248; Mon, 5 Jun 2023 08:35:56 GMT (envelope-from git) Date: Mon, 5 Jun 2023 08:35:56 GMT Message-Id: <202306050835.3558ZuA7024248@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 64d0e990f766 - stable/13 - setkey(8): remove redundand returns List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 64d0e990f766a169751ed7771f4cf6303fe01d49 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=64d0e990f766a169751ed7771f4cf6303fe01d49 commit 64d0e990f766a169751ed7771f4cf6303fe01d49 Author: Konstantin Belousov AuthorDate: 2023-04-03 01:59:07 +0000 Commit: Konstantin Belousov CommitDate: 2023-06-05 08:35:00 +0000 setkey(8): remove redundand returns (cherry picked from commit 462c3d3cf45eca034683d9793b9ce09381346744) --- sbin/setkey/parse.y | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sbin/setkey/parse.y b/sbin/setkey/parse.y index ae0859c22d2c..0d8605c3409a 100644 --- a/sbin/setkey/parse.y +++ b/sbin/setkey/parse.y @@ -1306,14 +1306,10 @@ parse_init() p_aiflags = 0; p_aifamily = PF_UNSPEC; - - return; } void free_buffer() { /* we got tons of memory leaks in the parser anyways, leave them */ - - return; } From nobody Mon Jun 5 08:35:57 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZRlK5l88z4bLyM; Mon, 5 Jun 2023 08:35:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZRlK3SLhz3wlK; Mon, 5 Jun 2023 08:35:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954157; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=voGp3eFqDNHdjMF6REm/acFfNQGHkgwI85PJsKZn01U=; b=GC7jk3gSECclLk8rfFgN4QDaYY63/irnvnMBLoWDzkWWGC1dnSE/wP15kO/UWTGyNuJkQn mAUgzEOaqzXMDn9Mfy1T5Dq3eCzP01v3GbAzEIpoTtKvdERpS3gwEel8E/C9MiMFvze3mc TQJq9AqD3xKXPonJTZJ4nRaRbR7EplDPI+QAbdYw7Wl+U1bVvfx94CgKQ88AopQ2hB1/IX Q9iDzmdo5fHKisJS/Jv54EKoVPUpoMsvWRZpjnzBo1UFiPfbtTRclIYwlM0bU9gGAaG/7m Oa1D253SYmE6BTzWZayaHHQwIp8uXlU1/K8fp7FWhPGgZ4GrvUFypEbyWdwGtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954157; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=voGp3eFqDNHdjMF6REm/acFfNQGHkgwI85PJsKZn01U=; b=S237YuaC8a8eVzsoxwWTwQsqyyxa1/18uVHCjeodhlhrLciECaebGJgWuwE0fh7YXk388z wkZiIJ+5kaHERquCYMS0O/HAWMGc0X407mSb/a4fcrunhiaSvH0oFclsNDYf77Nns2t5Qa YqCjYwGmBgA1VapYsb2/taariPhir8a2MNXbKw8n4KmH2d3DjptgqVqRm2Vw2tPKajjNMU ypbjGtCnk8Sk3KsPPtsHkOB/UjrYTgKtMLrJKQhU2N4Ycf3O6uOD5RFP9bp5s4xlQ1baNj Ne6GyykDm/OpOsFFrf3hSuH6RHgGVGJ/eCuSVyIQTAN3ZddL7aW5O+inksz2Og== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685954157; a=rsa-sha256; cv=none; b=K44iORFGh17XFPisG6N1FOi3W5XZqdrYS79PHm0zvqbOj3/nYGbQ5PRBFg2TAW3zDkRWWi w3G3SQk7CU/WKtiFWjAIYiiVbQwKVG047olKsHoBvixa7mSAhbOHLurCbKf75t1MQkj/P/ kl9X6/ZC8bhYPuAiVH/UP+XzT2szndZT1wEM5eho9dTlUr+X44KQn0b77CCNL0rCro445T 5wTlofd1lvEJC+Tim0n+f+QdAuaNKmAtSNoheFbyOj1965J9OvHMO3o+sXrSDlPJ5jEUT/ gKuzMqJ9jRCQIDh/MDNM/GQ3R2lI3Xqp8FwIT7jPC+nXlBJyMYDX1nA9zs5B3w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZRlK26FyzgVD; Mon, 5 Jun 2023 08:35:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3558Zv6P024268; Mon, 5 Jun 2023 08:35:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3558ZvnQ024267; Mon, 5 Jun 2023 08:35:57 GMT (envelope-from git) Date: Mon, 5 Jun 2023 08:35:57 GMT Message-Id: <202306050835.3558ZvnQ024267@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 0957619bf5f0 - stable/13 - setkey(8): ansify parser List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0957619bf5f0933b572a726200dad96ac9ecb96e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0957619bf5f0933b572a726200dad96ac9ecb96e commit 0957619bf5f0933b572a726200dad96ac9ecb96e Author: Konstantin Belousov AuthorDate: 2023-04-03 02:00:25 +0000 Commit: Konstantin Belousov CommitDate: 2023-06-05 08:35:00 +0000 setkey(8): ansify parser (cherry picked from commit bef81bc0aef9dd4cd772b292d81bcc0ff7151d9f) --- sbin/setkey/parse.y | 51 +++++++++++++-------------------------------------- sbin/setkey/token.l | 9 +++------ 2 files changed, 16 insertions(+), 44 deletions(-) diff --git a/sbin/setkey/parse.y b/sbin/setkey/parse.y index 0d8605c3409a..3d3ed123d4f0 100644 --- a/sbin/setkey/parse.y +++ b/sbin/setkey/parse.y @@ -773,11 +773,7 @@ policy_requests %% int -setkeymsg0(msg, type, satype, l) - struct sadb_msg *msg; - unsigned int type; - unsigned int satype; - size_t l; +setkeymsg0(struct sadb_msg *msg, unsigned type, unsigned satype, size_t l) { msg->sadb_msg_version = PF_KEY_V2; @@ -793,14 +789,8 @@ setkeymsg0(msg, type, satype, l) /* XXX NO BUFFER OVERRUN CHECK! BAD BAD! */ static int -setkeymsg_spdaddr(type, upper, policy, srcs, splen, dsts, dplen) - unsigned int type; - unsigned int upper; - vchar_t *policy; - struct addrinfo *srcs; - int splen; - struct addrinfo *dsts; - int dplen; +setkeymsg_spdaddr(unsigned type, unsigned upper, vchar_t *policy, + struct addrinfo *srcs, int splen, struct addrinfo *dsts, int dplen) { struct sadb_msg *msg; char buf[BUFSIZ]; @@ -892,12 +882,8 @@ setkeymsg_spdaddr(type, upper, policy, srcs, splen, dsts, dplen) /* XXX NO BUFFER OVERRUN CHECK! BAD BAD! */ static int -setkeymsg_addr(type, satype, srcs, dsts, no_spi) - unsigned int type; - unsigned int satype; - struct addrinfo *srcs; - struct addrinfo *dsts; - int no_spi; +setkeymsg_addr(unsigned type, unsigned satype, struct addrinfo *srcs, + struct addrinfo *dsts, int no_spi) { struct sadb_msg *msg; char buf[BUFSIZ]; @@ -1023,11 +1009,8 @@ setkeymsg_addr(type, satype, srcs, dsts, no_spi) /* XXX NO BUFFER OVERRUN CHECK! BAD BAD! */ static int -setkeymsg_add(type, satype, srcs, dsts) - unsigned int type; - unsigned int satype; - struct addrinfo *srcs; - struct addrinfo *dsts; +setkeymsg_add(unsigned type, unsigned satype, struct addrinfo *srcs, + struct addrinfo *dsts) { struct sadb_msg *msg; char buf[BUFSIZ]; @@ -1211,9 +1194,7 @@ setkeymsg_add(type, satype, srcs, dsts) } static struct addrinfo * -parse_addr(host, port) - char *host; - char *port; +parse_addr(char *host, char *port) { struct addrinfo hints, *res = NULL; int error; @@ -1232,8 +1213,7 @@ parse_addr(host, port) } static int -fix_portstr(spec, sport, dport) - vchar_t *spec, *sport, *dport; +fix_portstr(vchar_t *spec, vchar_t *sport, vchar_t *dport) { char *p, *p2; u_int l; @@ -1273,13 +1253,8 @@ fix_portstr(spec, sport, dport) } static int -setvarbuf(buf, off, ebuf, elen, vbuf, vlen) - char *buf; - int *off; - struct sadb_ext *ebuf; - int elen; - caddr_t vbuf; - int vlen; +setvarbuf(char *buf, int *off, struct sadb_ext *ebuf, int elen, caddr_t vbuf, + int vlen) { memset(buf + *off, 0, PFKEY_UNUNIT64(ebuf->sadb_ext_len)); memcpy(buf + *off, (caddr_t)ebuf, elen); @@ -1290,7 +1265,7 @@ setvarbuf(buf, off, ebuf, elen, vbuf, vlen) } void -parse_init() +parse_init(void) { p_spi = 0; @@ -1309,7 +1284,7 @@ parse_init() } void -free_buffer() +free_buffer(void) { /* we got tons of memory leaks in the parser anyways, leave them */ } diff --git a/sbin/setkey/token.l b/sbin/setkey/token.l index 9a0cc9ea1915..180493d76b05 100644 --- a/sbin/setkey/token.l +++ b/sbin/setkey/token.l @@ -251,23 +251,20 @@ any { return(ANY); } %% void -yyfatal(s) - const char *s; +yyfatal(const char *s) { yyerror(s); exit(1); } void -yyerror(s) - const char *s; +yyerror(const char *s) { printf("line %d: %s at [%s]\n", lineno, s, yytext); } int -parse(fp) - FILE **fp; +parse(FILE **fp) { yyin = *fp; From nobody Mon Jun 5 08:35:58 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZRlL4rMMz4bM7r; Mon, 5 Jun 2023 08:35:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZRlL4L6Mz3wVY; Mon, 5 Jun 2023 08:35:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954158; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pOIM6U+bFDvrTLQCUk5v/m4GtvpS6NLcJOhIJMOKtlU=; b=r0PBBAIO7cIZOPCUT1tdyEc7dJejjr/x2TMbOYQNHFXWPFM2dEYUE5Sj7KhzBCAVOGDfTb quTi7leC5y3tyaZM3xztuEXIvq5FOnSA7m2HJ0u5OgyAG2Bos7umsouNyEDK4eJD0pLTu/ OC0ywndaPK+caHXY1B99KxgMyAaLlys5mu6NHm0AS5hIi6npWwQcnr8A71bz4+qER+HDtE cFWbs+qaQ2g/DEgfaAVjYME3TLC7zsj1qhMhRTrA5oTXan+r7+1ZLVvJOxQFSMh4FsOgb8 8QlEGRVfXewrLdVjfXAsQy+rQu20cbcTVLDGxccEaW5zHhJ/UMV5xZuFkoSysg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954158; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pOIM6U+bFDvrTLQCUk5v/m4GtvpS6NLcJOhIJMOKtlU=; b=HVTdvNA05qG1sT325vmzcxJ/bxcFLeGfx+RHFrOUK3L4aSVsP6O14Ja/J5+A0F10XgUdLj fwWyEIUjoiDZabw5+w6VS0b+JCQRim25rq0Xna0a6oAyuSovlcQqraZWOSAyM9r/Ubg8bl bkUxfwFLukpqe+zoPCZqEYBTXYevMywsqQHO5VmyIPxBQCrCOjO+AH8zVv/z3xWHMmN/71 XMrxXXo7qiqNwnDJ0JfUKFtWM0wxdkpV6I9OoG+Qhmra9z8EYHNOYxbsZbq96v4fGRvUyl bHrg9YyKIIhWiwtunNLXbqZYQk378WAyXjynq8k9brki6Mfx35w8cu5R7+kE3A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685954158; a=rsa-sha256; cv=none; b=Y8x9g3yvBQCtG6SMiaqYTR2/ERZE2c7CczkvNACi08cEVPd1wezX4DMam3wq/hVOKnaX0c RRJsP9bY/Vx82yZiU5i3XqUI607cswJCZLwne3eNsAzPScul/0/YTzGJ4Cx8XdQqOMx0sQ 3MXoaZ0csx3PUPjeHuzRyMoVelG9iiO785yi7bL0NUb3yzoGpnZi78WfI3XhO4vdMgUFYs mTsH+tNQwwvPZiszNjbQ+IZzQ4JWyDzOXmxiE5BOivbFaB+Cck17eHvTxf1qGpHnKm/i6g 0zJZQHjkvrh2gTpiBsNIo/U70xZaHCCPBx+FaZEb5iLWWOPxydw+gsC6pskjvw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZRlL3GWLzh0v; Mon, 5 Jun 2023 08:35:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3558ZwnR024287; Mon, 5 Jun 2023 08:35:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3558Zw1m024286; Mon, 5 Jun 2023 08:35:58 GMT (envelope-from git) Date: Mon, 5 Jun 2023 08:35:58 GMT Message-Id: <202306050835.3558Zw1m024286@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 256d03bc580e - stable/13 - setkey(8): extract prefixlen calculation info helper List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 256d03bc580e9ad5f34b1c17ce356b65799473c0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=256d03bc580e9ad5f34b1c17ce356b65799473c0 commit 256d03bc580e9ad5f34b1c17ce356b65799473c0 Author: Konstantin Belousov AuthorDate: 2023-05-25 12:20:00 +0000 Commit: Konstantin Belousov CommitDate: 2023-06-05 08:35:00 +0000 setkey(8): extract prefixlen calculation info helper (cherry picked from commit 2c1296a3c5473651aa87eefea25e7b7475e9e16c) --- sbin/setkey/parse.y | 56 ++++++++++++++++++++++------------------------------- 1 file changed, 23 insertions(+), 33 deletions(-) diff --git a/sbin/setkey/parse.y b/sbin/setkey/parse.y index 3d3ed123d4f0..d279546fada6 100644 --- a/sbin/setkey/parse.y +++ b/sbin/setkey/parse.y @@ -787,6 +787,23 @@ setkeymsg0(struct sadb_msg *msg, unsigned type, unsigned satype, size_t l) return 0; } +static int +setkeymsg_plen(struct addrinfo *s) +{ + switch (s->ai_addr->sa_family) { +#ifdef INET + case AF_INET: + return (sizeof(struct in_addr) << 3); +#endif +#ifdef INET6 + case AF_INET6: + return (sizeof(struct in6_addr) << 3); +#endif + default: + return (-1); + } +} + /* XXX NO BUFFER OVERRUN CHECK! BAD BAD! */ static int setkeymsg_spdaddr(unsigned type, unsigned upper, vchar_t *policy, @@ -825,18 +842,9 @@ setkeymsg_spdaddr(unsigned type, unsigned upper, vchar_t *policy, if (s->ai_addr->sa_family != d->ai_addr->sa_family) continue; - switch (s->ai_addr->sa_family) { - case AF_INET: - plen = sizeof(struct in_addr) << 3; - break; -#ifdef INET6 - case AF_INET6: - plen = sizeof(struct in6_addr) << 3; - break; -#endif - default: + plen = setkeymsg_plen(s); + if (plen == -1) continue; - } /* set src */ sa = s->ai_addr; @@ -954,18 +962,9 @@ setkeymsg_addr(unsigned type, unsigned satype, struct addrinfo *srcs, if (s->ai_addr->sa_family != d->ai_addr->sa_family) continue; - switch (s->ai_addr->sa_family) { - case AF_INET: - plen = sizeof(struct in_addr) << 3; - break; -#ifdef INET6 - case AF_INET6: - plen = sizeof(struct in6_addr) << 3; - break; -#endif - default: + plen = setkeymsg_plen(s); + if (plen == -1) continue; - } /* set src */ sa = s->ai_addr; @@ -1140,18 +1139,9 @@ setkeymsg_add(unsigned type, unsigned satype, struct addrinfo *srcs, if (s->ai_addr->sa_family != d->ai_addr->sa_family) continue; - switch (s->ai_addr->sa_family) { - case AF_INET: - plen = sizeof(struct in_addr) << 3; - break; -#ifdef INET6 - case AF_INET6: - plen = sizeof(struct in6_addr) << 3; - break; -#endif - default: + plen = setkeymsg_plen(s); + if (plen == -1) continue; - } /* set src */ sa = s->ai_addr; From nobody Mon Jun 5 08:35:59 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZRlM6TVdz4bLyP; Mon, 5 Jun 2023 08:35:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZRlM5l4Yz3wrV; Mon, 5 Jun 2023 08:35:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954159; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6Xw0DZ+kh/xlgMplJ8R4kER0gwMD/JjeuqHXuVvWDqo=; b=vxNdGKBBvt0ECGw7eyNLcxFWath2bLQpFErvYXWKiaegTjAcx2g4jswHDl305YsJWUknjf yWXIbUCg3e1Z/edbYtLs4fI2ZFHOa2W74N7MYAYT2jR4YGCQAL5C2+tbnEktS28hbUpeN0 jsKyiaoY0XdeWuEDfnjZK0SM/dTu6UpPkU7xo6l9kf2rfXNl4FF4NtY/pO+qoDC92Htzcn CWqwGS91B2WzArZa++YTxkvCFQLf50PjD0kMRNnhTwKxniBaXAHHdopZLVU8PxSzlkcEKa QaOF4wYQH2koSOTFnXLHTsAjkZIoFHR+B6AaZOxa9D8xkC5YMWHiOj8/bfIXsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954159; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6Xw0DZ+kh/xlgMplJ8R4kER0gwMD/JjeuqHXuVvWDqo=; b=vCKWfuxTP7/P8hcKX8AuJ8//s0tI6pYoTOnTsssY5JIGDGd5JcD+ciuw35yuK7W7pj5FJm JFgMtOm6CzDLg1DQCghKJogIIZlcoGqXJvadhT2UWuTD4nAz94JUFtw7Unoy0DvAkVryBj fJSLyv8DbuIy+NiIidhFco5fm7VeRExuWClwH1ND01sCLOFmfAG2K1sc//ACzt2lhTaWST Wa7dIziPKoGHG8LBVt4i20tS0AbBkhesBVFDrJ8HTJNJ1MMyFXw6gzvXQI3AosqCOOV0az 4JGRHWuDhsF7YF93JHeyCsdCxkskz/clE3tE4e7eZHxr0KRaMydXZmQ2PLbpyw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685954159; a=rsa-sha256; cv=none; b=KvorQ20l2of9NkYIS1jbGKhR54fqoY7NzH6hmzwMxk8GVI2cTmggcHD80q6dBSczROSkr5 yrSoxQkdDb6NQQYzU2Kc4p84ZtHPI6mWO+pM+n4tNSUpskgPQQM1RL1zyxnVbZgmZc0DNp wnrp6SSvISUNQ5k7kYPg6Bb1PA8G5Qilmhjk+sT7jBRYQujWhkvibJXUjVRRcNsU+R/s8C 9MzhcOaHpyGYKlIOVzQRu4crb3KzqClrD8jZFjt48jBMeNhYV0ALnlqMi5JlMatmrD2nOb s6Yrof4BXx4J/Bo/piP2vi6x4PIBQGZG+Vk7/4EJIFzgIYxKhI77MurpcTqyWg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZRlM4BCGzgMN; Mon, 5 Jun 2023 08:35:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3558Zx6d024306; Mon, 5 Jun 2023 08:35:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3558Zxls024305; Mon, 5 Jun 2023 08:35:59 GMT (envelope-from git) Date: Mon, 5 Jun 2023 08:35:59 GMT Message-Id: <202306050835.3558Zxls024305@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 447af6361cec - stable/13 - setkey(8): NAT-T manual configuration support List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 447af6361cec48b2d6e5955e7b2284620cb50ece Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=447af6361cec48b2d6e5955e7b2284620cb50ece commit 447af6361cec48b2d6e5955e7b2284620cb50ece Author: Konstantin Belousov AuthorDate: 2023-05-25 10:41:15 +0000 Commit: Konstantin Belousov CommitDate: 2023-06-05 08:35:00 +0000 setkey(8): NAT-T manual configuration support (cherry picked from commit 2fa1b8617fdf68d0043efb7ae7c524702afba27c) --- sbin/setkey/parse.y | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++++- sbin/setkey/token.l | 2 ++ 2 files changed, 88 insertions(+), 1 deletion(-) diff --git a/sbin/setkey/parse.y b/sbin/setkey/parse.y index d279546fada6..8e4866e7e848 100644 --- a/sbin/setkey/parse.y +++ b/sbin/setkey/parse.y @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -64,6 +65,10 @@ u_int32_t p_reqid; u_int p_key_enc_len, p_key_auth_len; caddr_t p_key_enc, p_key_auth; time_t p_lt_hard, p_lt_soft; +u_int p_natt_type; +struct addrinfo *p_natt_oai, *p_natt_oar; +int p_natt_sport, p_natt_dport; +int p_natt_fraglen; static int p_aiflags = 0, p_aifamily = PF_UNSPEC; @@ -110,7 +115,7 @@ extern void yyerror(const char *); /* SPD management */ %token SPDADD SPDDELETE SPDDUMP SPDFLUSH %token F_POLICY PL_REQUESTS -%token F_AIFLAGS +%token F_AIFLAGS F_NATT F_NATT_MTU %token TAGGED %type prefix protocol_spec upper_spec @@ -521,6 +526,20 @@ extension } | F_LIFETIME_HARD DECSTRING { p_lt_hard = $2; } | F_LIFETIME_SOFT DECSTRING { p_lt_soft = $2; } + | F_NATT ipaddr BLCL DECSTRING ELCL ipaddr BLCL DECSTRING ELCL + { + p_natt_type = UDP_ENCAP_ESPINUDP; + p_natt_oai = $2; + p_natt_oar = $6; + if (p_natt_oai == NULL || p_natt_oar == NULL) + return (-1); + p_natt_sport = $4; + p_natt_dport = $8; + } + | F_NATT_MTU DECSTRING + { + p_natt_fraglen = $2; + } ; /* definition about command for SPD management */ @@ -1019,6 +1038,9 @@ setkeymsg_add(unsigned type, unsigned satype, struct addrinfo *srcs, struct sadb_address m_addr; struct sadb_x_sa_replay m_replay; struct addrinfo *s, *d; + struct sadb_x_nat_t_type m_natt_type; + struct sadb_x_nat_t_port m_natt_port; + struct sadb_x_nat_t_frag m_natt_frag; int n; int plen; struct sockaddr *sa; @@ -1128,6 +1150,64 @@ setkeymsg_add(unsigned type, unsigned satype, struct addrinfo *srcs, memcpy(buf + l, &m_replay, len); l += len; } + + if (p_natt_type != 0) { + len = sizeof(m_natt_type); + memset(&m_natt_type, 0, sizeof(m_natt_type)); + m_natt_type.sadb_x_nat_t_type_len = PFKEY_UNIT64(len); + m_natt_type.sadb_x_nat_t_type_exttype = SADB_X_EXT_NAT_T_TYPE; + m_natt_type.sadb_x_nat_t_type_type = p_natt_type; + memcpy(buf + l, &m_natt_type, len); + l += len; + + memset(&m_addr, 0, sizeof(m_addr)); + m_addr.sadb_address_exttype = SADB_X_EXT_NAT_T_OAI; + sa = p_natt_oai->ai_addr; + salen = p_natt_oai->ai_addr->sa_len; + m_addr.sadb_address_len = PFKEY_UNIT64(sizeof(m_addr) + + PFKEY_ALIGN8(salen)); + m_addr.sadb_address_prefixlen = setkeymsg_plen(p_natt_oai); + setvarbuf(buf, &l, (struct sadb_ext *)&m_addr, + sizeof(m_addr), (caddr_t)sa, salen); + + len = sizeof(m_natt_port); + memset(&m_natt_port, 0, sizeof(m_natt_port)); + m_natt_port.sadb_x_nat_t_port_len = PFKEY_UNIT64(len); + m_natt_port.sadb_x_nat_t_port_exttype = SADB_X_EXT_NAT_T_SPORT; + m_natt_port.sadb_x_nat_t_port_port = htons(p_natt_sport); + memcpy(buf + l, &m_natt_port, len); + l += len; + + memset(&m_addr, 0, sizeof(m_addr)); + m_addr.sadb_address_exttype = SADB_X_EXT_NAT_T_OAR; + sa = p_natt_oar->ai_addr; + salen = p_natt_oar->ai_addr->sa_len; + m_addr.sadb_address_len = PFKEY_UNIT64(sizeof(m_addr) + + PFKEY_ALIGN8(salen)); + m_addr.sadb_address_prefixlen = setkeymsg_plen(p_natt_oar); + setvarbuf(buf, &l, (struct sadb_ext *)&m_addr, + sizeof(m_addr), (caddr_t)sa, salen); + + len = sizeof(m_natt_port); + memset(&m_natt_port, 0, sizeof(m_natt_port)); + m_natt_port.sadb_x_nat_t_port_len = PFKEY_UNIT64(len); + m_natt_port.sadb_x_nat_t_port_exttype = SADB_X_EXT_NAT_T_DPORT; + m_natt_port.sadb_x_nat_t_port_port = htons(p_natt_dport); + memcpy(buf + l, &m_natt_port, len); + l += len; + + if (p_natt_fraglen != -1) { + len = sizeof(m_natt_frag); + memset(&m_natt_port, 0, sizeof(m_natt_frag)); + m_natt_frag.sadb_x_nat_t_frag_len = PFKEY_UNIT64(len); + m_natt_frag.sadb_x_nat_t_frag_exttype = + SADB_X_EXT_NAT_T_FRAG; + m_natt_frag.sadb_x_nat_t_frag_fraglen = p_natt_fraglen; + memcpy(buf + l, &m_natt_frag, len); + l += len; + } + } + l0 = l; n = 0; @@ -1271,6 +1351,11 @@ parse_init(void) p_aiflags = 0; p_aifamily = PF_UNSPEC; + + p_natt_type = 0; + p_natt_oai = p_natt_oar = NULL; + p_natt_sport = p_natt_dport = 0; + p_natt_fraglen = -1; } void diff --git a/sbin/setkey/token.l b/sbin/setkey/token.l index 180493d76b05..f5ccb4297d33 100644 --- a/sbin/setkey/token.l +++ b/sbin/setkey/token.l @@ -184,6 +184,8 @@ nocyclic-seq { return(NOCYCLICSEQ); } {hyphen}r { return(F_REPLAY); } {hyphen}lh { return(F_LIFETIME_HARD); } {hyphen}ls { return(F_LIFETIME_SOFT); } +{hyphen}natt { return(F_NATT); } +{hyphen}natt_mtu { return(F_NATT_MTU); } /* ... */ any { return(ANY); } From nobody Mon Jun 5 08:36:00 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZRlN65Rbz4bM81; Mon, 5 Jun 2023 08:36:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZRlN5XTXz3wh2; Mon, 5 Jun 2023 08:36:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954160; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=llqr0RNcRGvi3BE/6x3LXYXFteHGAlCELH3GqrQgQjQ=; b=HsOyBpn6ucbAKzjMLojXyrUDoiNGu6wOwSSUBceKXCC1dO8s6b12p6LarGTWtmCfz9eLNv NgeON+8n54+hj2GWgZ0Fy7AbL5vbPnN5pRKmNhPT/DjPe4CqS7Swc2UtYrFuQBcW9qE87m ifTQbibw9wwuqEcfPqy1Ps8WeW1gyd5a7pliPCXFMrd2hIYVU3jGY5n4bbLh2tB86X4dZl RX4ixHM8NShgU/G8JsDSrPpMLzkWlFlpJ1BOHW7qK53VsOXbo/lr3BcCG3pzR7GCcjkyfk rcYhIxQqTQl/f8ikHBOFLa2pyDWoiVjUx8Ntao/MiTQuqxKJ83skimA5Yg/cCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954160; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=llqr0RNcRGvi3BE/6x3LXYXFteHGAlCELH3GqrQgQjQ=; b=fAg5COfn7RIPvcTrnKmLZR48MvVLfmsh04DQ7XK0tVInIsrkyxK/7oX8KgSOCUFXwDZ7K/ 22alrsOnwOm9cl8HPiMjJ5Y9nQcAUMDhLf+AHAvDWNCsqWWx4a06rivW/Ez6DOmLXEp9Xo zrdjZLTdnxZlwcS5/tEVYiSMQW3Urfhpk5drGjc/zOet59DOoBmOCmn5xjT3EeaK6HLmKA 160SUMR7/JFWNXEPUw6Z0zWGJ3b0ko38pKKtlz5L4qaMWsTQDhAuFx8cNpUElyz6lJVCII g7R5OUnOt8gvaswiNZ1n2h3l3AQ/BpHQJ/mfJT4RAhdjDZy8M/n0p9Fze4FiAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685954160; a=rsa-sha256; cv=none; b=SRsGIIfjut2tLo1VUEmgdMCo3UzVkCSUtMhXU6/N1u6uNvRakPjfuTu34cxwUq5dfGPWA9 Yof0oYkz/cKWgt4Bn3k1W+uwKh+d0VIHxdUeeNeCCTklrdv3JRFFW8Yq/8GUTxpwZ5qXrl MwfLLdM9SCBW1YmKObyv1rm3dVjA1Zy7SGy5DO7bi3i6NSffqhdG8JfqWOJlNAyuskGgZX G3huKhJgXv8hunvLbDPnbKUo/6LZF1A6iMKqYgzqxyU/f+3nvtzlVGknf427HDB2AyrIZu MMarDMop/V+PXj49RABTns+QrVNxxP7sCobawITY4a3Ii5DUbK0gilartuQjgw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZRlN4fDCzh1D; Mon, 5 Jun 2023 08:36:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3558a09d024335; Mon, 5 Jun 2023 08:36:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3558a0Ph024334; Mon, 5 Jun 2023 08:36:00 GMT (envelope-from git) Date: Mon, 5 Jun 2023 08:36:00 GMT Message-Id: <202306050836.3558a0Ph024334@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: dcaa24cf3057 - stable/13 - setkey(8): document NAT-T and NAT-T MTU extensions syntax List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: dcaa24cf30571be8b80be3f5202e4ec77aa595f2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=dcaa24cf30571be8b80be3f5202e4ec77aa595f2 commit dcaa24cf30571be8b80be3f5202e4ec77aa595f2 Author: Konstantin Belousov AuthorDate: 2023-05-27 06:00:24 +0000 Commit: Konstantin Belousov CommitDate: 2023-06-05 08:35:00 +0000 setkey(8): document NAT-T and NAT-T MTU extensions syntax (cherry picked from commit cf85818e05a9349dfba040fb32e752d3c691ed1f) --- sbin/setkey/setkey.8 | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/sbin/setkey/setkey.8 b/sbin/setkey/setkey.8 index 20754c1b368f..73c89fdf9ec2 100644 --- a/sbin/setkey/setkey.8 +++ b/sbin/setkey/setkey.8 @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 3, 2023 +.Dd May 27, 2023 .Dt SETKEY 8 .Os .\" @@ -283,7 +283,7 @@ and they cannot be used. .Pp .It Ar extensions take some of the following: -.Bl -tag -width Fl -compact +.Bl -tag -width Fl natt_mtu -compact .\" .It Fl m Ar mode Specify a security protocol mode for use. @@ -328,6 +328,21 @@ Do not allow cyclic sequence number. .It Fl lh Ar time .It Fl ls Ar time Specify hard/soft life time duration of the SA. +.It Fl natt Ar oai \([ Ar sport \(] Ar oar \([ Ar dport \(] +Manually configure NAT-T for the SA, by specifying initiator +.Ar oai +and +requestor +.Ar oar +ip addresses and ports. +Note that the +.Sq \([ +and +.Sq \(] +symbols are part of the syntax for the ports specification, +not indication of the optional components. +.It Fl natt_mtu Ar fragsize +Configure NAT-T fragment size. .El .\" .Pp From nobody Mon Jun 5 08:36:01 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZRlQ1mPsz4bLrx; Mon, 5 Jun 2023 08:36:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZRlP6Gxxz3wxR; Mon, 5 Jun 2023 08:36:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954161; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h6xEUy2zyQvahoSxL0oqnYzW9qysarexVnSd+SQ4K4g=; b=OQqJUOOQYss1EAdlWaokHH8kD+FKnX3SG5VINkhtuOoe7G2AcDc1AgGTTsgJB2R6ZcgBUJ xw9UCodp3VDDFF2VG6WqObfUStVzUH9zAfZGBpHeL9f8Y4JdOI+zqaQjNjCKPdf8UwJ+Vq 3k3nSpkK750iL15LVe5qmHtItNmjG3X2UkqqF1ENgpc2hFgZyygKRYlT/XsVqVUql8PBt7 eEizaQ0W8jttC6x7Z0tUCwTtruLXnT/NoeNTFg6u8FHwabk/rtjpD76porCRlv3zPpEZbl pcXpUgfu5E1J3jfvpzRRt/LKHgKfU6uOjViO0Cr3G4lDxmrOxDeOwzppEMUlHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954161; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h6xEUy2zyQvahoSxL0oqnYzW9qysarexVnSd+SQ4K4g=; b=TT+CZAFbpx09JISYqF7Jo4AJPr+FTMLIzo4Uv/UnkZboLnrVZ+p2JVRFPDYxAmsVKgygjy KfLgj+lObl2jENfixCr1+eTDbpBcyAcWhbXVGlBqDmJZe3usTGWECSDhahBwq7dn8Dvyeu CXpTeaZskJAnzbMfviCDX3mVESjASIJFyErT+DZCUi6fqMG2GiHDAqsM48HZmaatfXayDL NVfVQcmRLY0IoOaDVKi3w309Hneh35R/eFwMgOUMgDrn5C+/2x5e1j580kMjnKPZf4gbqD n2ohEnk1R/2UVKCwDnWTGCFJRMcUNjPVJYvrwY0pPirDupUp12ZM6KUbG/bV6g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685954161; a=rsa-sha256; cv=none; b=Sx/FkuacUuQbK8hBMPgg4MudHgoqAwevDVkHNKSknC79zIyGIDqU1/FaqqaLGS3EXz9/5l t/B52oIQx0tKQmAxcPIJJ1d2m86djQAfQh7MMA06XN+9l3OxkgVYLWBLK045AygBpiTRBa Bvzir+sLn1YykJLuL58mbgTHZaYn9K8ehOh1YA5ivf7Q4YC1aeK5TpzjvJjkYsj6otM3o+ 8gPrK6XEUShnwQI6LhiwZO7kkQ3LRY3cmA2Id+QMVCPuw76Yq5Cp+HtDygkHRC1Kveaa0S UP3Fau9ktzkn4ztM1YQx1vyQMXpmPP0vNp24tUOstJvQQ0vyV07O1LmRvtkwzw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZRlP4zXVzgVF; Mon, 5 Jun 2023 08:36:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3558a1TO024354; Mon, 5 Jun 2023 08:36:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3558a1cK024353; Mon, 5 Jun 2023 08:36:01 GMT (envelope-from git) Date: Mon, 5 Jun 2023 08:36:01 GMT Message-Id: <202306050836.3558a1cK024353@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: be455be5099d - stable/13 - kern/subr_unit.c: some style List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: be455be5099db29e6dae645fc221d331367ae38f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=be455be5099db29e6dae645fc221d331367ae38f commit be455be5099db29e6dae645fc221d331367ae38f Author: Konstantin Belousov AuthorDate: 2023-05-12 22:37:35 +0000 Commit: Konstantin Belousov CommitDate: 2023-06-05 08:35:00 +0000 kern/subr_unit.c: some style (cherry picked from commit 042ec55f9df769697feb6cee472959d001a0f033) --- sys/kern/subr_unit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/subr_unit.c b/sys/kern/subr_unit.c index 8e5eb94711c3..fd9425e95dd5 100644 --- a/sys/kern/subr_unit.c +++ b/sys/kern/subr_unit.c @@ -205,7 +205,7 @@ struct unrb { CTASSERT((sizeof(struct unr) % sizeof(bitstr_t)) == 0); /* Number of bits we can store in the bitmap */ -#define NBITS (8 * sizeof(((struct unrb*)NULL)->map)) +#define NBITS (NBBY * sizeof(((struct unrb *)NULL)->map)) /* Is the unrb empty in at least the first len bits? */ static inline bool @@ -1024,7 +1024,7 @@ test_alloc_unr_specific(struct unrhdr *uh, u_int i, char a[]) } static void -usage(char** argv) +usage(char **argv) { printf("%s [-h] [-r REPETITIONS] [-v]\n", argv[0]); } From nobody Mon Jun 5 08:36:02 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZRlR1fHWz4bLs1; Mon, 5 Jun 2023 08:36:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZRlQ6t4Mz3wqG; Mon, 5 Jun 2023 08:36:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954163; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B6MP1IziZYdmJXzPIWDn6y1T8kuiBk6a86rL3gMNGVk=; b=MUt9x7O0k205K9KxoQgBz5aRzeJCl6tbFk+5dFRG2AyVx0yDMCl6gDDwzWcQTpGbvoSEtF zncNbDx1xej9pPZ+cZZpyHmMbTIov9d8A7rl6y9NtvOW7HLUXtq6kfolADLMa1jBeZ4RdA Wr1PY0VugFAc9S8b4mlI3aBT2y9S1Q+EkBiuHFNXJcUSOgb/gjuFp2+AiF3aBi0bVNYpSM b421uNQRUaUN8PV79YN92dTLhkbug8kN8Up5EPDow+8D5tkG/LhCeTG2/db/4WzSZMWcE5 oOeq3cW4OF+HVHC0k4oD7daA10Z9YaWt9Uxk3c+VVtda5flllR1JkKYr6tE0kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954163; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B6MP1IziZYdmJXzPIWDn6y1T8kuiBk6a86rL3gMNGVk=; b=LNGGrhtdy1p3W6Moq9UKUqsS5lAb54K4jzq4Qj3b7TDg2izvChAIU57EV6mQZ3fZyUHIDL 1DF+3KU4E6GYfa33OD7HkX8gVVWf1NsOvGvr+sHaeGHYBMgMLW+rpRxYlLkip0z8ibshJO AOr4Jovam2FIvQCKeL0mEjv3DRvQDvSzKmzblGsjKqr+2nLhRoC2i91TdzeDaV0wwufwXi jwqlBid/iOUklgAiXgNzk8wcnsI7/Oicsw1vY7Ptx8sVOCL5M/T+77Lthew5nwJ020r4F/ NF0oCv/+gh6R8XYfdfwwwPuK/ArCk2vqLj5Q5K0YIHm9e20i8h3Ubv31nHGibQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685954163; a=rsa-sha256; cv=none; b=EFGzvCV+EKmwZbrfXL1NGFsurqYwTM4nc+GIzFytfUCLGVIJ+7Rg0MfMgpAQ0P0o+iMWMH 5U4XvAOKSiSQDll+gfMb05RYYmpQw2N2ylJ7vlkIEoBZVsQ8Duun0AAjs0sFd5nQyqmc42 FWGFkJitV7yQYXMdBkRnC9t22eM/NTTZWitH0TUDBDaDdBDs4Vf/EyvtLbH2aWaX7wMEjN tEH8chDYXMd2E672RRlel43J8JpZhO0k05eBo5CdV/pfOhwk+9mYeFw/JJSrkr8GrORQc4 hB859O7kpWAIWPeb+ecP4l8WaLOWlqzJ4jTTFLVGlaSf2hczB+0NLYUMOoN1Fw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZRlQ5kHkzgPr; Mon, 5 Jun 2023 08:36:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3558a2oQ024373; Mon, 5 Jun 2023 08:36:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3558a2JG024372; Mon, 5 Jun 2023 08:36:02 GMT (envelope-from git) Date: Mon, 5 Jun 2023 08:36:02 GMT Message-Id: <202306050836.3558a2JG024372@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 23af3ca2d418 - stable/13 - kern/subr_unit.c: more uses for is_bitmap() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 23af3ca2d4183c298435297b2e0aca226e2277dd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=23af3ca2d4183c298435297b2e0aca226e2277dd commit 23af3ca2d4183c298435297b2e0aca226e2277dd Author: Konstantin Belousov AuthorDate: 2023-05-12 22:39:35 +0000 Commit: Konstantin Belousov CommitDate: 2023-06-05 08:35:00 +0000 kern/subr_unit.c: more uses for is_bitmap() (cherry picked from commit 36b1f8a81ef96b42ce446efb79cffd577f1819f7) --- sys/kern/subr_unit.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/kern/subr_unit.c b/sys/kern/subr_unit.c index fd9425e95dd5..6c1368c64e00 100644 --- a/sys/kern/subr_unit.c +++ b/sys/kern/subr_unit.c @@ -207,6 +207,12 @@ CTASSERT((sizeof(struct unr) % sizeof(bitstr_t)) == 0); /* Number of bits we can store in the bitmap */ #define NBITS (NBBY * sizeof(((struct unrb *)NULL)->map)) +static inline bool +is_bitmap(struct unrhdr *uh, struct unr *up) +{ + return (up->ptr != uh && up->ptr != NULL); +} + /* Is the unrb empty in at least the first len bits? */ static inline bool ub_empty(struct unrb *ub, int len) { @@ -246,7 +252,7 @@ check_unrhdr(struct unrhdr *uh, int line) z = 0; TAILQ_FOREACH(up, &uh->head, list) { z++; - if (up->ptr != uh && up->ptr != NULL) { + if (is_bitmap(uh, up)) { ub = up->ptr; KASSERT (up->len <= NBITS, ("UNR inconsistency: len %u max %zd (line %d)\n", @@ -409,12 +415,6 @@ clear_unrhdr(struct unrhdr *uh) check_unrhdr(uh, __LINE__); } -static __inline int -is_bitmap(struct unrhdr *uh, struct unr *up) -{ - return (up->ptr != uh && up->ptr != NULL); -} - /* * Look for sequence of items which can be combined into a bitmap, if * multiple are present, take the one which saves most memory. From nobody Mon Jun 5 08:36:03 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZRlS1MFCz4bLyg; Mon, 5 Jun 2023 08:36:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZRlS0TdHz3x1X; Mon, 5 Jun 2023 08:36:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954164; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7o6GkU4q2nHWn+CdSSgrzxpB1VRcIt8cXDNgZxaq9e4=; b=rTafMRymr2z4P1g1ShXg1aT/qFRkO7eFyBhKLsHdMHigNq/unrj7q5ZXcTWLtndPCpxOPj 8be0MOwJxY8Jgp7ILmVGIfyJMJ3oqRk+JM3D15/UMmdMEFQp4pDVVNnA+VQJ8L6nOKsEJA TjZhYMZZUnnqmONFG6KDbbTdmdIFvvSE2t8GW5396pa3SnRaw1S09navBhBsamQHqaJKdS u0Syw0ia6VZL5tNozTub3Fa8SplorJzHEhpMu963AgBF9AgHoby3qsJ6E2JGXhlzgpla/+ zDrsy3OtGkaXd1QmaXrH2UFAggAOQAfCFSP6bu71C5UgBKL8BjlKbyLwY94F0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954164; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7o6GkU4q2nHWn+CdSSgrzxpB1VRcIt8cXDNgZxaq9e4=; b=KaRqiA3wtQZC59nuZwQ2lFDHAjuMEFiATLcKSr7oQLPgYb4n9+6SCW6Gnx6MM1I0LWvCTp YsPqhn7ipsb6l6oxpsewlbfa5OyQGbFxkcKNQuKcKVQagZ7EsW9+Sck2YJuRG+lCHQlRaa ZMWnwzZU3BMbn5p3iVrPkMaxvKZ4qud47VuQWoWdEEdxT9ZcNELAY4M5v4JNjxJbxEUY7z hh7+Vcui1PObEKhs+SIAqGGURO1YyEywSyiGn2bY5GCNJ4gCJWX7jvxVDh+FVDEjW5/Ne0 5iOOLMM+Z1QbvkDU/Md86aVGVJ5+NBJ/HHB0/sycwAF4utremegKjkDhpzI2rA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685954164; a=rsa-sha256; cv=none; b=nLEpKbyqXT4aQUavzp+OyIr57bTsHsf/ImrS+ZSvU8FaUYjd1sr4mbhUs0JzYiGejB6Trq 5efxBltEqYiqSkpU3ea0wtCIoQb35HGFcMosCQjBhAmkGE+FB2QaJHjXP8D1lBC2twsnhl cGmj8Y1Ml+bMkFbDJqq6+HHWipgvM/ysyq1edOz/LjHI4H3mzXKwmMpE6fX0fXIAYHvUhB fat/utFo9tSEmgezEUoUI+SojrnCPEyMocvdHXXl8s1VqskPNJOkePqv92/pfAoORMO5fD 0Yg3sPXEIONwcksQJ2qBLEeUwdVv8jLn5hNvxbRrf373B+4DPBhTw8dw7WOMhQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZRlR6Y1Czh0w; Mon, 5 Jun 2023 08:36:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3558a3sb024392; Mon, 5 Jun 2023 08:36:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3558a3Uk024391; Mon, 5 Jun 2023 08:36:03 GMT (envelope-from git) Date: Mon, 5 Jun 2023 08:36:03 GMT Message-Id: <202306050836.3558a3Uk024391@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: c26549327f42 - stable/13 - subr_unit.c: explain first/last special ranges List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c26549327f425bc1b0272037d524af18392c0c88 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c26549327f425bc1b0272037d524af18392c0c88 commit c26549327f425bc1b0272037d524af18392c0c88 Author: Konstantin Belousov AuthorDate: 2023-05-14 23:11:17 +0000 Commit: Konstantin Belousov CommitDate: 2023-06-05 08:35:01 +0000 subr_unit.c: explain first/last special ranges (cherry picked from commit d44f477038d3ede5fe62fa19c9301b43455cd8f1) --- sys/kern/subr_unit.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/kern/subr_unit.c b/sys/kern/subr_unit.c index 6c1368c64e00..a78b6ddf4840 100644 --- a/sys/kern/subr_unit.c +++ b/sys/kern/subr_unit.c @@ -191,6 +191,12 @@ mtx_assert(struct mtx *mp, int flag) * For bitmaps the len field represents the number of allocated items. * * The bitmap is the same size as struct unr to optimize memory management. + * + * Two special ranges are not covered by unrs: + * - at the start of the allocator space, all elements in [low, low + first) + * are allocated; + * - at the end of the allocator space, all elements in [high - last, high] + * are free. */ struct unr { TAILQ_ENTRY(unr) list; From nobody Mon Jun 5 08:36:04 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZRlT23L1z4bLsL; Mon, 5 Jun 2023 08:36:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZRlT1LbSz3xFH; Mon, 5 Jun 2023 08:36:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954165; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mi/6Ie06cI10EG9aIgeLK5I4TZNsLVgPgfZG245Ptow=; b=QlJD6z52uYE8REM5ZAd3uFYkbUc0n64rnMD2badjK4C0ckgwGp/FjTomHrnnAUrMUYpOxd lpGE0B2Rj1GJNtE64ZVY4Som/YxkON9DMn/ctguCgYjiGVCW5Sohi8aDz8f2nevN/DDtFD spRACOa1D8+ZWfzTU1bWTzWtMslR0pT17ZynQme7FnCLx5/3p7firaRqA2r61uVfKGKp4/ 4jhw/tUsDRPzVSfD0mSNo+MPrUba1iX47ll6G5rtMMdimJgAbodLLqEmVqwsRSA46A2KWw C7xUEF0YfqsokPkZC79akb6VsOo4E6iwjSTszXa4rR9mDlrGTY1QwRcnSoGkIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954165; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mi/6Ie06cI10EG9aIgeLK5I4TZNsLVgPgfZG245Ptow=; b=K8zFWyvc6GTaZOUcDz6ugxmx2z25eUjikZGLX2cQ9Lic0VI5zDjOBf83cq1WUwRnaTRydx B6XBKTq5FoLGejusu991NP3zhXCW/z/c6YoaUQFdm89d63MdGLdRiZXa20rlp5ZQdxJmM/ htiGupTAMgPKHRztx4bZMVH06g1NhZfUB0K29Hff4KR26uRBJD5yNfDbwhHoHnwVhf8v3d c5M4qA/FPs6ES7R8x6LinFYhGlxghsN0Lf4EbWAK/pvNsaa5jVdS121HYqFiDzK0wt0rTw TxErM1Qq61PmbHeJ5erBbZDxwL5wS9KjUdcrRc9sQdWbKtrHOnxYuLG1bvqGqQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685954165; a=rsa-sha256; cv=none; b=bTdO9Tt3EoQICwuBJge68Uhfqur6GE+2dg8olDVxaKl3GLx9foaXnnX2+txFWWihDBMTwo lpWxF8EAIjhoEywxJPYhlGl9Fanhc54i17scVQnuuG2VNBmIt5JfEeDjiWh3XRV5Omj2hg cz7MpSjnEKPmoqTzKnoEQuvGq5fK6LpHBD3JGQlh32+Kaz1JSF6J63oQGy4zRamOkcBc3q h6XgngENn4lRVhbudDYDkOK0LwJ6F6QqJz+mp9pFw5X02Ynht2ggmBliloCcyZg70QjqAp aCDVavmXRTjxPS+09g9FBXDKESJv9EhsZEcB/HU8rpFzP1kYlgT+BsnP4Z4+Ww== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZRlT0NRvzgPs; Mon, 5 Jun 2023 08:36:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3558a4Sa024411; Mon, 5 Jun 2023 08:36:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3558a48v024410; Mon, 5 Jun 2023 08:36:04 GMT (envelope-from git) Date: Mon, 5 Jun 2023 08:36:04 GMT Message-Id: <202306050836.3558a48v024410@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 4ae4e074ebe8 - stable/13 - unr(9): document clean_unrhdr() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4ae4e074ebe8d1ffa749ae7444b1704acc2b25d2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=4ae4e074ebe8d1ffa749ae7444b1704acc2b25d2 commit 4ae4e074ebe8d1ffa749ae7444b1704acc2b25d2 Author: Konstantin Belousov AuthorDate: 2023-05-14 00:43:54 +0000 Commit: Konstantin Belousov CommitDate: 2023-06-05 08:35:01 +0000 unr(9): document clean_unrhdr() (cherry picked from commit f8c37080853c13ada935e7fe3d53286c1d9220f1) --- share/man/man9/unr.9 | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/share/man/man9/unr.9 b/share/man/man9/unr.9 index c2e9b3943829..c0cf44b9033e 100644 --- a/share/man/man9/unr.9 +++ b/share/man/man9/unr.9 @@ -29,6 +29,7 @@ .Os .Sh NAME .Nm new_unrhdr , +.Nm clean_unrhdr , .Nm clear_unrhdr , .Nm delete_unrhdr , .Nm alloc_unr , @@ -40,6 +41,10 @@ .Ft "struct unrhdr *" .Fn new_unrhdr "int low" "int high" "struct mtx *mutex" .Ft void +.Fn clean_unrhdr "struct unrhdr *uh" +.Ft void +.Fn clean_unrhdrl "struct unrhdr *uh" +.Ft void .Fn clear_unrhdr "struct unrhdr *uh" .Ft void .Fn delete_unrhdr "struct unrhdr *uh" @@ -86,6 +91,26 @@ This function frees the memory associated with the entity, it does not free any units. To free all units use .Fn clear_unrhdr . +.It Fn clean_unrhdr uh +Freeing unit numbers might result in some internal memory becoming unused. +There are +.Nm unit +allocator consumers that cannot tolerate taking +.Xr malloc 9 +locks to free the memory, while having their unit mutex locked. +For this reason, free of the unused memory after delete is postponed +until the consumer can afford calling into the +.Xr malloc 9 +subsystem. +Call +.Fn clean_unrhdr uh +to do the cleanup. +In particular, this needs to be done before freeing a unr, if +a deletion of units could have been performed. +.It Fn clean_unrhdrl +Same as +.Fn clean_unrhdr , +but assumes that the unr mutex is already owned, if any. .It Fn alloc_unr uh Return a new unit number. The lowest free number is always allocated. From nobody Mon Jun 5 08:36:06 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZRlV2wrNz4bLqD; Mon, 5 Jun 2023 08:36:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZRlV2VFRz3wxC; Mon, 5 Jun 2023 08:36:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954166; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NR198L/rMjSiRPbNaPNJF1d6cE+DVWBVBGlrI2Q9IJA=; b=gdCfBq/8l6rERqCubMnAF363nRhHkVUZa+w9ZKld2AeR9/yUqWPVA/AavxDlhHwYImUqN4 yOjqEPfAKSisn45yKjNm2tWRf9VZ1X2gTIm0ukksQLf0WHK8jcJaQVNdHd3wL5BJVIWSjN UkDybyZFyDYJfM28q6SeTzByIvfhmMl/+XTgWfHiY8Yy2y5xu7bnrwKWFBql99fc0/klZM THFIvf0dS/aRurkBr8ee5xE+EqX/Zuniev9Hj3wQilZ7vdJNLVFQkjGg9dVnq+Vo7o7Kdg qEOawAa/rsfDN1mw/pAZz8AVH0fSZL21SjRVlVbaCdreahZvbllOOVlcvGDF/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954166; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NR198L/rMjSiRPbNaPNJF1d6cE+DVWBVBGlrI2Q9IJA=; b=qHmt9f7WPgdnrMz/5yzabr9HMzIW7ZE7og/kEtVrPm1mSKgWzwUF787XOPYGgQitQBGX/3 +tKibuQJbuZ9TgszCp5TnOP7Q1595p8ePPfbktKdGZ2WWkooOVGb5WplanSF2KKeVB5Eq/ 91MXbntKhPCsyIhzdZ1RR7GRABc5TvXTgSmrhaekur/ktaH7TfHkAdVULZqcXmWA9jRJSx PlT6ZJlsspl+96LQVRVMApFJKE3dp4GTriywiUUGKnYHGf9GKka2Iy3pcGckpMOIRaoGiH sTL+/IbC6jn0GyYg1BheQXLJqU7zAZTmtMaPkrqYYj5vndRvjftBhSDXvsiMuw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685954166; a=rsa-sha256; cv=none; b=MaRYGeguunlf8tZdPE4Pi22yV+7Rtbfu1eftaeAAU0PAZYGIu2J9Bm4bKJHuZbxSKZ6W3d X3GU9wlGLba9Zvi554tOV7VkWljR64qnCXFN/+wBU2IlXsYZ6fvfNoxRABPkRwQ+YAC+Gt gte0BxA8mnOsxui/QvbYUGECyJwHFpFWTofZkcuDL+HVj7IpPJYt5e+YIRirdNSRAxJwBR 8ptdKK1yY9bci2gCpKNOZ/ia6/f9DQKGjC8sQJkcFct18gSckzXwiTrN5RDS9WTPjFuzye upyY9MIzL4nsRKSfoLONk/lCnlnmOfVT+8a92vf8frko1joClK41KsnORkaKuw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZRlV1Mcszh0x; Mon, 5 Jun 2023 08:36:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3558a6AL024430; Mon, 5 Jun 2023 08:36:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3558a64s024429; Mon, 5 Jun 2023 08:36:06 GMT (envelope-from git) Date: Mon, 5 Jun 2023 08:36:06 GMT Message-Id: <202306050836.3558a64s024429@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 694714adcd19 - stable/13 - unr(9): add 'show unrhdr' ddb command List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 694714adcd19b7463b2fe697f2d8301a13a25729 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=694714adcd19b7463b2fe697f2d8301a13a25729 commit 694714adcd19b7463b2fe697f2d8301a13a25729 Author: Konstantin Belousov AuthorDate: 2023-05-25 11:14:19 +0000 Commit: Konstantin Belousov CommitDate: 2023-06-05 08:35:01 +0000 unr(9): add 'show unrhdr' ddb command (cherry picked from commit f386b27736fe6dee535a530d5c7610d8a9827758) --- sys/kern/subr_unit.c | 59 ++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 43 insertions(+), 16 deletions(-) diff --git a/sys/kern/subr_unit.c b/sys/kern/subr_unit.c index a78b6ddf4840..0f4d25257553 100644 --- a/sys/kern/subr_unit.c +++ b/sys/kern/subr_unit.c @@ -939,15 +939,18 @@ free_unr(struct unrhdr *uh, u_int item) Free(p2); } -#ifndef _KERNEL /* USERLAND test driver */ +#ifdef _KERNEL +#include "opt_ddb.h" +#ifdef DDB +#include +#endif +#endif -/* - * Simple stochastic test driver for the above functions. The code resides - * here so that it can access static functions and structures. - */ +#if (defined(_KERNEL) && defined(DDB)) || !defined(_KERNEL) -static bool verbose; -#define VPRINTF(...) {if (verbose) printf(__VA_ARGS__);} +#if !defined(_KERNEL) +#define db_printf printf +#endif static void print_unr(struct unrhdr *uh, struct unr *up) @@ -955,21 +958,21 @@ print_unr(struct unrhdr *uh, struct unr *up) u_int x; struct unrb *ub; - printf(" %p len = %5u ", up, up->len); + db_printf(" %p len = %5u ", up, up->len); if (up->ptr == NULL) - printf("free\n"); + db_printf("free\n"); else if (up->ptr == uh) - printf("alloc\n"); + db_printf("alloc\n"); else { ub = up->ptr; - printf("bitmap ["); + db_printf("bitmap ["); for (x = 0; x < up->len; x++) { if (bit_test(ub->map, x)) - printf("#"); + db_printf("#"); else - printf(" "); + db_printf(" "); } - printf("]\n"); + db_printf("]\n"); } } @@ -979,12 +982,12 @@ print_unrhdr(struct unrhdr *uh) struct unr *up; u_int x; - printf( + db_printf( "%p low = %u high = %u first = %u last = %u busy %u chunks = %u\n", uh, uh->low, uh->high, uh->first, uh->last, uh->busy, uh->alloc); x = uh->low + uh->first; TAILQ_FOREACH(up, &uh->head, list) { - printf(" from = %5u", x); + db_printf(" from = %5u", x); print_unr(uh, up); if (up->ptr == NULL || up->ptr == uh) x += up->len; @@ -993,6 +996,30 @@ print_unrhdr(struct unrhdr *uh) } } +#endif + +#if defined(_KERNEL) && defined(DDB) +DB_SHOW_COMMAND(unrhdr, unrhdr_print_unrhdr) +{ + if (!have_addr) { + db_printf("show unrhdr addr\n"); + return; + } + + print_unrhdr((struct unrhdr *)addr); +} +#endif + +#ifndef _KERNEL /* USERLAND test driver */ + +/* + * Simple stochastic test driver for the above functions. The code resides + * here so that it can access static functions and structures. + */ + +static bool verbose; +#define VPRINTF(...) {if (verbose) printf(__VA_ARGS__);} + static void test_alloc_unr(struct unrhdr *uh, u_int i, char a[]) { From nobody Mon Jun 5 08:36:07 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZRlW5YHnz4bM1s; Mon, 5 Jun 2023 08:36:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZRlW3F2Gz3xCj; Mon, 5 Jun 2023 08:36:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954167; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=n7PPf5hn96BriOW9E6XJZxbIsJoaAJQ4m1GqMlNnnOM=; b=GOwbe8WqPYutkLP41HOsqVJv3rbjYwgZPMeM0M99IncgtTukZmDlA5eGcMNSMkPuc2nQl5 /eh8Ks6Up2lQNw1rdJWsQx7fsRD+6U33Y7VFR/xaSCziou7rIzGrRn6X8s+Dy58Mw/q3C6 ubKtK9h4ltUWu5aSkDc5Yhem1Pb3rWwqPC4NaifUlgSNhT/1EiOykt0RTMoX2VUD8/yD9G ZMpkYXb0uW3U1oeF1hItQtk/qZUh9Ayr6OPNhz9JcSAaRR4/z7PTR8F/9T+QsvYakiofwf IQcE1WNXctMJ/j8ajMgqoo2e0KxA7db2Q1Efg2rIwBR+qYeNTt9WbcMA/4Hxgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954167; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=n7PPf5hn96BriOW9E6XJZxbIsJoaAJQ4m1GqMlNnnOM=; b=yzdMh40JwacOki3hIfQQ9dHnq9KFgk/J/zV/RuaQOOT0gYAkWdnbGrlBJbc13DJWcQrEaX al/9l1hucLI7dR2pxQos7sE5bNUfOT3eWf/Od1+OAPoGDNJmx77clAdnBhX6Xd02yk6eLO owtRoMlfziBgl6wnjIFfA+6j1B5kTygMIrlw/0eh7A1rD3gd8NVc0Rnf54PFns9aEgXL4/ 29PTzCa5QtBaDNf8+PCHXWkHUvcb9tE4SBZ+ApmDB9QP608QPt/HTR/j9ezUA26dk4OewK GVtrfjCVi1aLLzEvZMhGGnbkbcXiy7H5lOFl6l2TfhCmg7922YGnjvIzv1dD4Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685954167; a=rsa-sha256; cv=none; b=ZRX0rTxj1FhbmWDTkloMzNiiT74fjPmzHG5d4v+awJl3I4mcLeOnN9C21CUMcDHlXkpE1b pQwnMhS8SCY8DA3t/4l9dyFcL/G87DHKP84tmY4uF66jn8P6Aw9rORNT5Iq0vOCU8AxRXG IvpZZ/6c9xeykpVC5urOc7uRSK8xQqxXi2SzG2DHfVwrp5noqCO0AHciV54xcpcGjzHY7+ 03VCk5kwBcOEnAu/0PUmetx/pZoEfYNweQfw6luzCno4FshZdWaFNhyivb/LFyTUWAvVpY Bh5H0lWF033LCmxRKsGiCVti10CF6WIVGuXH2Bg8g6DyhHvCeH3R1kIq6msWlw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZRlW2Ltgzgs5; Mon, 5 Jun 2023 08:36:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3558a72q024455; Mon, 5 Jun 2023 08:36:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3558a7o7024454; Mon, 5 Jun 2023 08:36:07 GMT (envelope-from git) Date: Mon, 5 Jun 2023 08:36:07 GMT Message-Id: <202306050836.3558a7o7024454@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: c0360504add5 - stable/13 - unr(9): add iterator interface List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c0360504add56d422bb8f77ec7f7a32689a2e8b1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c0360504add56d422bb8f77ec7f7a32689a2e8b1 commit c0360504add56d422bb8f77ec7f7a32689a2e8b1 Author: Konstantin Belousov AuthorDate: 2023-05-12 22:49:29 +0000 Commit: Konstantin Belousov CommitDate: 2023-06-05 08:35:01 +0000 unr(9): add iterator interface (cherry picked from commit a014e0a3987a277a0e56c7fa5b9d895f735a8d1e) --- sys/kern/subr_unit.c | 121 +++++++++++++++++++++++++++++++++++++++++++++++++++ sys/sys/systm.h | 3 ++ 2 files changed, 124 insertions(+) diff --git a/sys/kern/subr_unit.c b/sys/kern/subr_unit.c index 0f4d25257553..ee67e5db01d6 100644 --- a/sys/kern/subr_unit.c +++ b/sys/kern/subr_unit.c @@ -238,6 +238,122 @@ ub_full(struct unrb *ub, int len) return (first_clear == -1); } +/* + * start: ipos = -1, upos = NULL; + * end: ipos = -1, upos = uh + */ +struct unrhdr_iter { + struct unrhdr *uh; + int ipos; + int upos_first_item; + void *upos; +}; + +void * +create_iter_unr(struct unrhdr *uh) +{ + struct unrhdr_iter *iter; + + iter = Malloc(sizeof(*iter)); + iter->ipos = -1; + iter->uh = uh; + iter->upos = NULL; + iter->upos_first_item = -1; + return (iter); +} + +static void +next_iter_unrl(struct unrhdr *uh, struct unrhdr_iter *iter) +{ + struct unr *up; + struct unrb *ub; + u_int y; + int c; + + if (iter->ipos == -1) { + if (iter->upos == uh) + return; + y = uh->low - 1; + if (uh->first == 0) { + up = TAILQ_FIRST(&uh->head); + if (up == NULL) { + iter->upos = uh; + return; + } + iter->upos = up; + if (up->ptr == NULL) + iter->upos = NULL; + else + iter->upos_first_item = uh->low; + } + } else { + y = iter->ipos; + } + + up = iter->upos; + + /* Special case for the compacted [low, first) run. */ + if (up == NULL) { + if (y + 1 < uh->low + uh->first) { + iter->ipos = y + 1; + return; + } + up = iter->upos = TAILQ_FIRST(&uh->head); + iter->upos_first_item = uh->low + uh->first; + } + + for (;;) { + if (y + 1 < iter->upos_first_item + up->len) { + if (up->ptr == uh) { + iter->ipos = y + 1; + return; + } else if (is_bitmap(uh, up)) { + ub = up->ptr; + bit_ffs_at(&ub->map[0], + y + 1 - iter->upos_first_item, + up->len, &c); + if (c != -1) { + iter->ipos = iter->upos_first_item + c; + return; + } + } + } + iter->upos_first_item += up->len; + y = iter->upos_first_item - 1; + up = iter->upos = TAILQ_NEXT((struct unr *)iter->upos, list); + if (iter->upos == NULL) { + iter->ipos = -1; + iter->upos = uh; + return; + } + } +} + +/* + * returns -1 on end, otherwise the next element + */ +int +next_iter_unr(void *handle) +{ + struct unrhdr *uh; + struct unrhdr_iter *iter; + + iter = handle; + uh = iter->uh; + if (uh->mtx != NULL) + mtx_lock(uh->mtx); + next_iter_unrl(uh, iter); + if (uh->mtx != NULL) + mtx_unlock(uh->mtx); + return (iter->ipos); +} + +void +free_iter_unr(void *handle) +{ + Free(handle); +} + #if defined(DIAGNOSTIC) || !defined(_KERNEL) /* * Consistency check function. @@ -1056,6 +1172,11 @@ test_alloc_unr_specific(struct unrhdr *uh, u_int i, char a[]) } } +static void +test_iter(void) +{ +} + static void usage(char **argv) { diff --git a/sys/sys/systm.h b/sys/sys/systm.h index 828297e5b948..4b479e95aa2f 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -483,6 +483,9 @@ int alloc_unr(struct unrhdr *uh); int alloc_unr_specific(struct unrhdr *uh, u_int item); int alloc_unrl(struct unrhdr *uh); void free_unr(struct unrhdr *uh, u_int item); +void *create_iter_unr(struct unrhdr *uh); +int next_iter_unr(void *handle); +void free_iter_unr(void *handle); #ifndef __LP64__ #define UNR64_LOCKED From nobody Mon Jun 5 08:36:08 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZRlX4dhZz4bMDY; Mon, 5 Jun 2023 08:36:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZRlX48nWz3xD3; Mon, 5 Jun 2023 08:36:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954168; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jki3ZElsbV5Lqt4oN9GCPnWfaBov38EoaiMXCMdgRdo=; b=iicdsGtn0scbEiH2A49tWi4QOEj9wtj13JRKzfjlKApmIR6ag8CvoYPqyg5jWcn2ljgRcN to9mRN7tC6C7/drxENmisaMZhT7B+dj8GdHt+pMxy5zIPCpEyM0ENg0mwlpJAAzEWXN/ep OOK1s9/nTUD/HrbBiZcAlakc/I9tuMFMoIyu4zhBq3DqoqN0ei2KHbrlCaw5uIPBSRa+W4 g1hke3VIvlR8AVIAzRnzMCaFsBF53yHU/VJCKpqTWz/mkaR1ADXaQ5MkZ4G0p+ZOIGlMdU ssfr0n++uWlPz1okWUPjriyOBQkN/Y/33Q8E6Z5n7Y51P2cQ9U5M34DqVwBhmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954168; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jki3ZElsbV5Lqt4oN9GCPnWfaBov38EoaiMXCMdgRdo=; b=qd5mJHRABPyCmuHWdVdWH9dV2Rhlj+NlS3YwuxW7cnEH/vk3vVRoyycvT+jqrSUp1TUDzw 5dK67NNCYvTVZmuo7DU9SnnhKffpVQllP3LTM1QxK4qEc7cw/vunti7G2i8eq8tzCirv1M ZvLEedeMDhRSAeO9uo7IYSA+feM36hYUmCd11piwJzrLbR8iDXS62soI/inPHbykweNj2p mFH9IE9znSy6ICjFZAWOCYZw28b+sY8RY/IgLhXy7WXiAK5ViSY6saHa0g/RFRbunnVWoh LNa+/ci6a+qDhK03rDOe1A/OY/AaA6VVaz+24cORVGRGbIReFI0I2An8e2cnXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685954168; a=rsa-sha256; cv=none; b=DxEd85OyJy89pE3SzIwFCLihK/o3AHusSz8Z4ioTz1rN4Zw1gOrG7sBk6324J11ml30d8D tGvghUdDOtJZ/3t5c9QBbJzP+tU+j44ak91pYPRfXSe83+vfCiMjytP2f50Ma692EpbULF jMJy6lPoPjaDU4Ya8XZRfC3oOPofYau9j9ZpodtA5NZgkZmFb7vo112B1MEPJEIe470Jg2 kHUWLdXoVUem+wnj7rtIB6Gys966D8qHRbj6wblV1ISffoI0cZ/PjMcxEAMA9koXcNTTgi PCowW4eZ9ESC89pFNN/bKyueN//YKgufk1J6zLqLT/WXpBcyrzuttd7kW0Ey8Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZRlX3GKLzgds; Mon, 5 Jun 2023 08:36:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3558a89O024474; Mon, 5 Jun 2023 08:36:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3558a89i024473; Mon, 5 Jun 2023 08:36:08 GMT (envelope-from git) Date: Mon, 5 Jun 2023 08:36:08 GMT Message-Id: <202306050836.3558a89i024473@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: e7c3889a1736 - stable/13 - unr(9): add 'show unrhdr_iter' command List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e7c3889a17368ba396734019a480c0c2dfb3fd63 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e7c3889a17368ba396734019a480c0c2dfb3fd63 commit e7c3889a17368ba396734019a480c0c2dfb3fd63 Author: Konstantin Belousov AuthorDate: 2023-05-25 18:09:27 +0000 Commit: Konstantin Belousov CommitDate: 2023-06-05 08:35:01 +0000 unr(9): add 'show unrhdr_iter' command (cherry picked from commit c4cc0cab1ea619e07b52ce4c3825e7941996cb49) --- sys/kern/subr_unit.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/sys/kern/subr_unit.c b/sys/kern/subr_unit.c index ee67e5db01d6..236ca9915740 100644 --- a/sys/kern/subr_unit.c +++ b/sys/kern/subr_unit.c @@ -1124,6 +1124,23 @@ DB_SHOW_COMMAND(unrhdr, unrhdr_print_unrhdr) print_unrhdr((struct unrhdr *)addr); } + +static void +print_unrhdr_iter(struct unrhdr_iter *iter) +{ + db_printf("iter %p unrhdr %p ipos %d upos %p ufi %d\n", + iter, iter->uh, iter->ipos, iter->upos, iter->upos_first_item); +} + +DB_SHOW_COMMAND(unrhdr_iter, unrhdr_print_iter) +{ + if (!have_addr) { + db_printf("show unrhdr_iter addr\n"); + return; + } + + print_unrhdr_iter((struct unrhdr_iter *)addr); +} #endif #ifndef _KERNEL /* USERLAND test driver */ From nobody Mon Jun 5 08:36:09 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZRlY5tF2z4bLsh; Mon, 5 Jun 2023 08:36:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZRlY52J2z3xK5; Mon, 5 Jun 2023 08:36:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954169; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f1aJyFYmHfzSC6qvD9J3pNPpVYAB7r7A0wg2Mt54eyE=; b=h7apJzIXsGtptJSpoHGON7J+vuYvH43dUmOdhse2XitZPjxP6NlNl08NA9OzyFX8u3FPUI b9XqbebLkgLGSKzjtlr1bIRFsq4NGqnZryAHMdHfyIgY+jsB37R7rfpobvxQEwzI3xrfmZ 2tN8iWZhWvXBXAL1J589DBbon5UNSP0/u8mYpIOesPxHbUBVB1wGMMcYIaj0omQTJJc+nn fznYs0MaWCrn2SN6ZlZ2sG6KjZfcckrHQjx62vHQRtNo8KGFYS9br9fGgFkgpFuJZ3A7H6 Sx/0XwLb3ylX+pjXPOFF1znzw8zJRsAwZTcNyhL2VyKWb9hgqXWI4CmGJIzoFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954169; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f1aJyFYmHfzSC6qvD9J3pNPpVYAB7r7A0wg2Mt54eyE=; b=cuEtRjJZjFhgD77ZMsUBcx/QPpmxOcdmpDQsfcpzWFQ4i/JT2QX4C+VHD24q83wuiY2rrD cCB6mgm7WPwQTg8492Hgu6OZAbSbRCrzjHWz9vFJiC+oTNh9WbgcQxpY763odFKig4r8kf AlcNV5F3O0inK2aWC413236D4Q1bz/U1meTCk92lHdeCUoNGm/JBZNyV6U587Qf0x28bxv ExTfpXYjZWRA5uUdRAkR7xJd2HWcAmVkdqesFZ1z5dNvzyEf76lGtKrBmZTOhbrfckGSy2 CP0CME2eOjFqgNcGelHjU+rdB7RJyEkHVmcQaGYuoIAkrGeW3TznP7s5u6j40A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685954169; a=rsa-sha256; cv=none; b=NWnbvV+dDqeW/UQw3pb4XnhJgcNdKkUe3crv11q3iTJ0yV84htm1hY7eDs2WpXBtag7Spi vTsliWDNgtELRagi3BKQn2B7/BYebc1s3x5VkNWjD+pVx6/FmNMk10T6zaLhrKPYr03ytN oLidK7VBrDA8Zaekr/0sKoVNsl/h9yxWY95EvBANmMcWOPbURfUHJuvh+9xGUVO4kPYUuh Ebp3eDDH6LnvjyJC62VvasC8QULuUzsD59f26iQ3y8ba5QCL9+5X93jMj+iCKb/xfi/OuO iFdJ7qbRRLUV7BaRUS5rwwyzJfYA1vRLmcxeMc4E8A3ReD1bMFovj43YFRQn0g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZRlY45V9zgPt; Mon, 5 Jun 2023 08:36:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3558a9GC024494; Mon, 5 Jun 2023 08:36:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3558a99i024493; Mon, 5 Jun 2023 08:36:09 GMT (envelope-from git) Date: Mon, 5 Jun 2023 08:36:09 GMT Message-Id: <202306050836.3558a99i024493@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: d4fb56c08fb9 - stable/13 - unr(9) iterator: add naive test List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d4fb56c08fb971916d87483f74ae3f1b4adf2e91 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d4fb56c08fb971916d87483f74ae3f1b4adf2e91 commit d4fb56c08fb971916d87483f74ae3f1b4adf2e91 Author: Konstantin Belousov AuthorDate: 2023-05-13 01:32:25 +0000 Commit: Konstantin Belousov CommitDate: 2023-06-05 08:35:01 +0000 unr(9) iterator: add naive test (cherry picked from commit 12db3c914fe0a985de1e393ee964c9cda5b3e0ca) --- sys/kern/subr_unit.c | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 89 insertions(+), 2 deletions(-) diff --git a/sys/kern/subr_unit.c b/sys/kern/subr_unit.c index 236ca9915740..2be7a27064ad 100644 --- a/sys/kern/subr_unit.c +++ b/sys/kern/subr_unit.c @@ -1189,15 +1189,93 @@ test_alloc_unr_specific(struct unrhdr *uh, u_int i, char a[]) } } +#define TBASE 7 +#define XSIZE 10 +#define ISIZE 1000 + +static int +test_iter_compar(const void *a, const void *b) +{ + return (*(const int *)a - *(const int *)b); +} + +static void +test_iter_fill(int *vals, struct unrhdr *uh, int i, int v, int *res) +{ + int x; + + vals[i] = v; + x = alloc_unr_specific(uh, v); + if (x != v) { + VPRINTF("alloc_unr_specific failed %d %d\n", x, v); + *res = 1; + } +} + static void test_iter(void) { + struct unrhdr *uh; + void *ihandle; + int vals[ISIZE]; + int i, j, v, x, res; + + res = 0; + uh = new_unrhdr(TBASE, INT_MAX, NULL); + for (i = 0; i < XSIZE; i++) { + vals[i] = i + TBASE; + x = alloc_unr_specific(uh, i + TBASE); + if (x != i + TBASE) { + VPRINTF("alloc_unr_specific failed %d %d\n", x, + i + TBASE); + res = 1; + } + } + for (; i < ISIZE; i++) { + for (;;) { +again: + v = arc4random_uniform(INT_MAX); + if (v < TBASE) + goto again; + for (j = 0; j < i; j++) { + if (v == vals[j] || v + 1 == vals[j]) + goto again; + } + break; + } + test_iter_fill(vals, uh, i, v, &res); + i++, v++; + if (i < ISIZE) + test_iter_fill(vals, uh, i, v, &res); + } + qsort(vals, ISIZE, sizeof(vals[0]), test_iter_compar); + + ihandle = create_iter_unr(uh); + i = 0; + while ((v = next_iter_unr(ihandle)) != -1) { + if (vals[i] != v) { + VPRINTF("iter %d: iter %d != val %d\n", i, v, vals[i]); + if (res == 0) { + if (verbose) + print_unrhdr(uh); + res = 1; + } + } else { + VPRINTF("iter %d: val %d\n", i, v); + } + i++; + } + free_iter_unr(ihandle); + clean_unrhdr(uh); + clear_unrhdr(uh); + delete_unrhdr(uh); + exit(res); } static void usage(char **argv) { - printf("%s [-h] [-r REPETITIONS] [-v]\n", argv[0]); + printf("%s [-h] [-i] [-r REPETITIONS] [-v]\n", argv[0]); } int @@ -1209,11 +1287,16 @@ main(int argc, char **argv) long reps = 1, m; int ch; u_int i; + bool testing_iter; verbose = false; + testing_iter = false; - while ((ch = getopt(argc, argv, "hr:v")) != -1) { + while ((ch = getopt(argc, argv, "hir:v")) != -1) { switch (ch) { + case 'i': + testing_iter = true; + break; case 'r': errno = 0; reps = strtol(optarg, NULL, 0); @@ -1234,6 +1317,10 @@ main(int argc, char **argv) } setbuf(stdout, NULL); + + if (testing_iter) + test_iter(); + uh = new_unrhdr(0, count - 1, NULL); print_unrhdr(uh); From nobody Mon Jun 5 08:36:10 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZRlb1MCmz4bLsl; Mon, 5 Jun 2023 08:36:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZRlb0xC8z3xFG; Mon, 5 Jun 2023 08:36:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954171; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9iscgdeh92DYY0oav6JxWF5q2JnJ9BpKGtUuwBASOT4=; b=NvWIj3d/a3TERE7eu/1Nv+xFILOSYRsC1k1cv8oZDy7SDuc+rE9Y14xaoiLzDWGVhHSBOP U8DBmJlNdUV81GKKMXEajqPNFhGzr1BABD/Fcbkq3m0CqqoNmBTVptfOKKKOgO6bC7Gvuv 33h1LgTSVGPWZaT5TlvuA786wYR0ilitLDe1bdcaraAuD9PhunVbqPZASIDewS3U0rUoke 6ci+9/EWoykAKJ2rKa8q3QbYnfnnPCkFiqratJQriyjzPxMJCfk/yZRfb7HwPf4MGD0pWN b3yy2/3EaIrk8YlTBVFdt+F75NPwxGxTz4AQn9TLXECKCQooD7DfQ8aBkwpocw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954171; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9iscgdeh92DYY0oav6JxWF5q2JnJ9BpKGtUuwBASOT4=; b=ozcctHn1a3Tgz4lk9TBF4I2yiPMZzh83jOI7P5RHYzVjZEiL30j1koHaHH2yOWsmNob2dx UtyPqQL2M/zMRMLJASYMveBnWesHGv0usiHeXBN6ijfmH8lPIC/DOCvqEU9SkDsGTPQzu+ 5Y8BM5unS+3830oC7FgRaAcRq3ZTDXwN/tfFe75e1GMZMFUHFxUffRiT9qEFJid+GiVcN3 kl02btG1AGuMst9IB94MmB+ClwIWOrK6yTDPthRAtiw/nuussp8kPPeuolCqF9z/DAtzA2 JpSV8HOiV2q9//5aQrLEX2nLbXmJ5s4U0SPVb7msjTCCjKBf0iCTRJQ8dUlWLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685954171; a=rsa-sha256; cv=none; b=i3IXxps3N6hvVOr3s6zk5i+IDHyCv6rNqPg0hhp4MuDTD9gjTA8igfYjGDGR1rEZd8oSdr 7Gki3FVVEyNajKO1RkFPw+rdV3Qt/JNqaaFA0bmqYM26hgVzmxR7Ni7Y+2Oa/PjjgkeVf+ vFzOpVAtdwNaEWHQkaLdT1dP3T7ZCljAIyiFLzptiuxcjlbCPXEh2Hi0y55WOOavtoIYyh clPCU3HPP1XXNBT3wqZgnl7bJXgieLswsjFPlhb67k0uknF/2BECqxKqrU8mFeCB2g3wuM sc4LpGVMFbIZ2QaadhX2NyAD9ssGHBfmZEjoxm/CFJQ7vrCGTv/J0AJ1FVi4lg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZRlZ75m0zgMP; Mon, 5 Jun 2023 08:36:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3558aAbi024520; Mon, 5 Jun 2023 08:36:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3558aAW5024519; Mon, 5 Jun 2023 08:36:10 GMT (envelope-from git) Date: Mon, 5 Jun 2023 08:36:10 GMT Message-Id: <202306050836.3558aAW5024519@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 135bc1d49de5 - stable/13 - unr(9): document iterators List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 135bc1d49de598a8c1c0b679e70265e01d08beea Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=135bc1d49de598a8c1c0b679e70265e01d08beea commit 135bc1d49de598a8c1c0b679e70265e01d08beea Author: Konstantin Belousov AuthorDate: 2023-05-14 01:40:08 +0000 Commit: Konstantin Belousov CommitDate: 2023-06-05 08:35:01 +0000 unr(9): document iterators (cherry picked from commit ea95173dbb3b67019a83155e55f798d4618f18c7) --- share/man/man9/unr.9 | 46 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/share/man/man9/unr.9 b/share/man/man9/unr.9 index c0cf44b9033e..201717ccdfd2 100644 --- a/share/man/man9/unr.9 +++ b/share/man/man9/unr.9 @@ -34,7 +34,10 @@ .Nm delete_unrhdr , .Nm alloc_unr , .Nm alloc_unr_specific , -.Nm free_unr +.Nm free_unr , +.Nm create_iter_unr , +.Nm next_iter_unr , +.Nm free_iter_unr .Nd "kernel unit number allocator" .Sh SYNOPSIS .In sys/systm.h @@ -56,6 +59,12 @@ .Fn alloc_unr_specific "struct unrhdr *uh" "u_int item" .Ft void .Fn free_unr "struct unrhdr *uh" "u_int item" +.Ft void * +.Fn create_iter_unr "struct unrhdr *uh" +.Ft int +.Fn next_iter_unr "void *handle" +.Ft void +.Fn free_iter_unr "void *handle" .Sh DESCRIPTION The kernel unit number allocator is a generic facility, which allows to allocate unit numbers within a specified range. @@ -135,6 +144,41 @@ Free a previously allocated unit number. This function may require allocating memory, and thus it can sleep. There is no pre-locked variant. .El +.Sh ITERATOR INTERFACE +The +.Nm unr +facility provides an interface to iterate over all allocated units +for the given +.Dv unrhdr . +Iterators are identified by an opaque handle. +More than one iterators can operate simultaneously; the iterator position +data is recorded only in the iterator handle. +.Pp +Consumers must ensure that the unit allocator is not modified between +calls to the iterator functions. +In particular, the internal allocator mutex cannot provide consistency, +because it is acquired and dropped inside the +.Fn next_iter_unr +function. +If the allocator was modified, it is safe to free the iterator with +.Fn free_iter_unr +method nevertheless. +.Bl -tag -width indent +.It Fn create_iter_unr uh +Create an iterator. +Return the handle that should be passed to other iterator functions. +.It Fn next_iter_unr handle +Return the value of the next unit. +Units are returned in ascending order. +A return value of +.Li \-1 +indicates the end of iteration, in which +case +.Li \-1 +is returned for all future calls. +.It Fn free_iter_unr handle +Free the iterator, handle is no longer valid. +.El .Sh CODE REFERENCES The above functions are implemented in .Pa sys/kern/subr_unit.c . From nobody Mon Jun 5 08:36:11 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZRlc1ntPz4bMBN; Mon, 5 Jun 2023 08:36:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZRlb72t0z3xXj; Mon, 5 Jun 2023 08:36:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954172; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nNvJQBGlmRU2rKeF6UugbxPPURnV+GyVgzwO3arF9h0=; b=wDCm3ohSbKOEfxQH3c+1db1VK2enPFdBorVg/Gzh2zQ9b9rNlRS4xVleofTs9WuMUlxjAr NzCuXkZmTNjMOWiLT5VA3eXgO5EVw6JK18ylMlzyFsECDkrE0H8OcNrF+PO1N6F2DUZxEF Hlr6C46kS5mF92NnxtLa7DlpJg40eZp8sYZoRyAt3EAjXg80jL/40dpJwifSU0SgNdGXe6 mkzYICf9An1ekLUKpiTlvk/3k0Z1thIQ04Dw+NTTTrT4hQhys7EJI+Bj6TkD5h6jH2AQZ2 n7ZDHGE9GRD2tM5fmrfE88kYlQ/gYaqfQ5Pq/O8cTYEx6Cv6/g4CU4wihdUkwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954172; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nNvJQBGlmRU2rKeF6UugbxPPURnV+GyVgzwO3arF9h0=; b=rr0rRU2JuRhsaY3EMBmZUziVunQ3BWAbcm7xddfCGPuRi8L0dFMlhMlzVgRsROEkcdHZaE KvmiHLCM5kVgYSV2m7mxmtY0yr4SQbYDUJRDKT/nhYqajiiGr7Z9hPeepuWpMiuu9ib+eh fhLK73svEuRaFkuRbZMNMYCrktI0igYoMJIpmNG58uuaQ4pbjOtqprDKlr14y4Au3zrw2m mlMC1GQWkJzCLa3p9im7ccuJHhsa/axy8ya1gIhO1FvUGLGMW8vcHj5JGX2CChOiZP2naN bRPQaoKVd5T9p2spIlqENOPaPnfN1b5dgLDc2KCJWOZ+1hkd7qpl0kY5us31Kg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685954172; a=rsa-sha256; cv=none; b=cM7aHZ2ivXI0eCbc1WbikbVakGe37koD7f33nv/ArgWO+OOSgfmJp9qeEW0anp70Wzuvw7 +eGqQqMXUQynOLjhp3bFClqNzsmAXqez3hOZtlBEgV73lw7Ym7wqg12xwP3mZvrQ41v80U EPdeo8NbDSHT5QcTGGOGFdGjPYmpKPcNuzQuRi94pve457PTJX4i/tioOWpdkQ5TPpXsD7 oJ31UwA8j7XOiB8fiGFjPcTSNfeA8Jav2K/aT+pIk+VL5f/bopzfip6ysEDZts8tuq2h+w Cky9K9R6n+Nwy96Nd8/hgkWoSA3HG7VxUF43xsmjWohSyqyHXx0z/vwMBUfl0g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZRlb68zLzgMQ; Mon, 5 Jun 2023 08:36:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3558aBTk024542; Mon, 5 Jun 2023 08:36:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3558aB6n024541; Mon, 5 Jun 2023 08:36:11 GMT (envelope-from git) Date: Mon, 5 Jun 2023 08:36:11 GMT Message-Id: <202306050836.3558aB6n024541@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: bb75966eaa31 - stable/13 - reapkill: handle possible pid reuse after the pid was recorded as signalled List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: bb75966eaa3125aa22884663768068a173cda408 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=bb75966eaa3125aa22884663768068a173cda408 commit bb75966eaa3125aa22884663768068a173cda408 Author: Konstantin Belousov AuthorDate: 2023-05-12 22:36:52 +0000 Commit: Konstantin Belousov CommitDate: 2023-06-05 08:35:01 +0000 reapkill: handle possible pid reuse after the pid was recorded as signalled (cherry picked from commit 8164032a495b53b9176814f7b08e093961fabdca) --- sys/kern/kern_procctl.c | 36 +++++++++++++++++++++++++++++++++++- sys/sys/proc.h | 1 + 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_procctl.c b/sys/kern/kern_procctl.c index a4f675c2938e..16bd9ac702e8 100644 --- a/sys/kern/kern_procctl.c +++ b/sys/kern/kern_procctl.c @@ -416,8 +416,22 @@ reap_kill_subtree_once(struct thread *td, struct proc *p, struct proc *reaper, continue; if ((p2->p_treeflag & P_TREE_REAPER) != 0) reap_kill_sched(&tracker, p2); - if (alloc_unr_specific(pids, p2->p_pid) != p2->p_pid) + + /* + * Handle possible pid reuse. If we recorded + * p2 as killed but its p_flag2 does not + * confirm it, that means that the process + * terminated and its id was reused by other + * process in the reaper subtree. + * + * Unlocked read of p2->p_flag2 is fine, it is + * our thread that set the tested flag. + */ + if (alloc_unr_specific(pids, p2->p_pid) != p2->p_pid && + (atomic_load_int(&p2->p_flag2) & + (P2_REAPKILLED | P2_WEXIT)) != 0) continue; + if (p2 == td->td_proc) { if ((p2->p_flag & P_HADTHREADS) != 0 && (p2->p_flag2 & P2_WEXIT) == 0) { @@ -428,6 +442,11 @@ reap_kill_subtree_once(struct thread *td, struct proc *p, struct proc *reaper, st = false; } PROC_LOCK(p2); + /* + * sapblk ensures that only one thread + * in the system sets this flag. + */ + p2->p_flag2 |= P2_REAPKILLED; if (st) r = thread_single(p2, SINGLE_NO_EXIT); (void)pksignal(p2, w->rk->rk_sig, w->ksi); @@ -445,6 +464,7 @@ reap_kill_subtree_once(struct thread *td, struct proc *p, struct proc *reaper, PROC_LOCK(p2); if ((p2->p_flag2 & P2_WEXIT) == 0) { _PHOLD_LITE(p2); + p2->p_flag2 |= P2_REAPKILLED; PROC_UNLOCK(p2); w->target = p2; taskqueue_enqueue(taskqueue_thread, @@ -471,6 +491,9 @@ reap_kill_subtree(struct thread *td, struct proc *p, struct proc *reaper, struct reap_kill_proc_work *w) { struct unrhdr pids; + void *ihandle; + struct proc *p2; + int pid; /* * pids records processes which were already signalled, to @@ -486,6 +509,17 @@ reap_kill_subtree(struct thread *td, struct proc *p, struct proc *reaper, PROC_UNLOCK(td->td_proc); while (reap_kill_subtree_once(td, p, reaper, &pids, w)) ; + + ihandle = create_iter_unr(&pids); + while ((pid = next_iter_unr(ihandle)) != -1) { + p2 = pfind(pid); + if (p2 != NULL) { + p2->p_flag2 &= ~P2_REAPKILLED; + PROC_UNLOCK(p2); + } + } + free_iter_unr(ihandle); + out: clean_unrhdr(&pids); clear_unrhdr(&pids); diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 0f04921fffe6..997ff110bcdc 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -836,6 +836,7 @@ struct proc { #define P2_WEXIT 0x00040000 /* exit just started, no external thread_single() is permitted */ +#define P2_REAPKILLED 0x00080000 /* Flags protected by proctree_lock, kept in p_treeflags. */ #define P_TREE_ORPHANED 0x00000001 /* Reparented, on orphan list */ From nobody Mon Jun 5 08:36:12 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZRld1TRQz4bM2B; Mon, 5 Jun 2023 08:36:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZRld0rnRz3xXv; Mon, 5 Jun 2023 08:36:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954173; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I0HmjvV7L2VOlJHsliSbAkxIDqjHw9g1oo9n6sIUZEE=; b=FBJ8sGy4x50789a/wdeZ/UfrnwlQ5S4QeCiR6vp3KfXRP/PCuHOWyoga4bKAIEvyZdVkmz fLK16R4Tg4k5oqbPf8hQ9AsGUlv5uN2XmCAIBTiVhti/w+byPta/g/UWbreMNHo7P/7HCP pgmFhcgYklH4Egu1MUNhfc3bBChi7a2Xu0wsD8zLM8aERCczCrVr1U4tYcaE84Jjyk3x+9 6KhQksDPJ/HI6AryjEZPEqe++RF+js1E48TdxMLnug9sU2DGqtMEChwLbjTlIzJP2J6Xta 1H6EgVeEJVfpdMRIEivg9c0qMayNyIYmPkglY0Hv4npVurLPoBliSR5WyT4vEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954173; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I0HmjvV7L2VOlJHsliSbAkxIDqjHw9g1oo9n6sIUZEE=; b=TSpyL6GLuqqnSi9JywCG540ZnmMxF3s1zjU09nJmlF88yGWolHnsG7ahG9vIgTZfKZjtXS 9+N9dAjCZMU/8YpcrPnkouijVa2OtB+mu5H+88V9Tk3qQ4Rof0BeyJZjAKaLbUfN7S/LPT ZfYoV4nA9josq/WURtmBvrvX+ySVR4VZvifIGjf+G37tFRXXFv0ZkqeIQHju8fPsuEqb4y 0LRHqQ/uo/BmEIACFD/RE3iC+TF7EiOjhrZKk5S9GLm1JIf4v2+1lNPm96WDSjxJa6Z7KW KMjKRUxYqFi6tmZHFm+JT9pJRjKeen1Aw+goYVoKA3iUMSs44PLvW6Y/zYD90g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685954173; a=rsa-sha256; cv=none; b=vUbKxTO5SZQclBiHNI3ZgXK0cB/HlPaMfnpXtWAgbJa20iGNKN++XYwFg2x47uKLVhokej X3EAlwTqftCM0sCHx6AlhNh+SoRl3dtgSS9NEk5g1W4vXV1srXBBvqMFRSPqpXl1xjChsW D73ptwutNdqeIWCRiYY0eBg0CvBuPKQSOyY2s3/zC/G5lJFxiMDIqM3/9lfJ3h4zQN4dJJ xlAv1ocMLZ/r6l1abh92Y6tRtbpvTyNKejmcTIki5ZhFJEPeR6GLTyNlzZjIXE/wNPSDVP 2jBXFAjHl/ZuFuGvqTcfsVDmUUjj2Cedr6ApTG5mY/6SfvLl11pitCGol9l4jg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZRlc74GnzgPv; Mon, 5 Jun 2023 08:36:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3558aCvk024569; Mon, 5 Jun 2023 08:36:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3558aCFg024568; Mon, 5 Jun 2023 08:36:12 GMT (envelope-from git) Date: Mon, 5 Jun 2023 08:36:12 GMT Message-Id: <202306050836.3558aCFg024568@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 1e26f443cd2b - stable/13 - __acl_get_fd(2), __acl_aclcheck_fd(2): enable for O_PATH filedescriptors List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1e26f443cd2b8775ba50207aa9645ec12ead9e8a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1e26f443cd2b8775ba50207aa9645ec12ead9e8a commit 1e26f443cd2b8775ba50207aa9645ec12ead9e8a Author: Konstantin Belousov AuthorDate: 2023-05-29 15:07:18 +0000 Commit: Konstantin Belousov CommitDate: 2023-06-05 08:35:01 +0000 __acl_get_fd(2), __acl_aclcheck_fd(2): enable for O_PATH filedescriptors PR: 271704 (cherry picked from commit 7a292504bad8467915f072f0576b2a07c76de1f5) --- lib/libc/sys/open.2 | 3 ++- sys/kern/vfs_acl.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/libc/sys/open.2 b/lib/libc/sys/open.2 index 876a4ce1e57d..db3e8f373ad7 100644 --- a/lib/libc/sys/open.2 +++ b/lib/libc/sys/open.2 @@ -28,7 +28,7 @@ .\" @(#)open.2 8.2 (Berkeley) 11/16/93 .\" $FreeBSD$ .\" -.Dd April 22, 2022 +.Dd May 29, 2023 .Dt OPEN 2 .Os .Sh NAME @@ -344,6 +344,7 @@ message using for .Dv EVFILT_VNODE .It Xr readlinkat 2 +.It Xr __acl_get_fd 2 , Xr __alc_aclcheck_fd 2 .El But operations like .Xr read 2 , diff --git a/sys/kern/vfs_acl.c b/sys/kern/vfs_acl.c index 596a26f8acea..dff1d9368f40 100644 --- a/sys/kern/vfs_acl.c +++ b/sys/kern/vfs_acl.c @@ -434,7 +434,7 @@ sys___acl_get_fd(struct thread *td, struct __acl_get_fd_args *uap) int error; AUDIT_ARG_FD(uap->filedes); - error = getvnode(td, uap->filedes, + error = getvnode_path(td, uap->filedes, cap_rights_init_one(&rights, CAP_ACL_GET), &fp); if (error == 0) { error = vacl_get_acl(td, fp->f_vnode, uap->type, uap->aclp); @@ -567,7 +567,7 @@ sys___acl_aclcheck_fd(struct thread *td, struct __acl_aclcheck_fd_args *uap) int error; AUDIT_ARG_FD(uap->filedes); - error = getvnode(td, uap->filedes, + error = getvnode_path(td, uap->filedes, cap_rights_init_one(&rights, CAP_ACL_CHECK), &fp); if (error == 0) { error = vacl_aclcheck(td, fp->f_vnode, uap->type, uap->aclp); From nobody Mon Jun 5 08:36:13 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZRlf2VR5z4bM6j; Mon, 5 Jun 2023 08:36:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZRlf1Qhvz3xX3; Mon, 5 Jun 2023 08:36:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954174; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CKVxEFbBgbG5P+yFgGME+02JVkQLzQgUeO29qVDsrqQ=; b=vpp42IWhdA5XHzl1HWwWwpmZJKBoM7B48kKPIdqEMSRb99PJZBE3KiPKI+2PHPX/H75mWB SYQqhTDt4iXToSQoAkoxRUob3b84A/DsHTKxhlfTIPRWQslY3QvY/hLm8sfKKr/EVrtKRS 1vXq/Nn4SRqXdf2JdjniZAtFN/NottL4214Yw8s/GPPBDByYcpvA4tJvZtjNNH6rbNuWEg x6B02nlj9ZrpofKF5TtaWDV0Vms7clXfBzOQCaXTAyxRelurX25mCjQr2zzZiDLIY36Xg/ 65U5/PgvEHCm6fjhVhe0rL+mMCuhCVYaAnqwRg0u9vac4XzgPfJEcqb2k+opBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685954174; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CKVxEFbBgbG5P+yFgGME+02JVkQLzQgUeO29qVDsrqQ=; b=Tp68ll9pRN/xfzgBDYIICw0YADU6r8ELq3JjMIsInUXTUUjvE8rkLOe1UIlyFURyISQNC1 wQsA0rTXhnWhu9u8KHQLlpb3uORd8nEP1OG07vpUucrdGX7kYlOUk2hmbaEx4556rbl4Pr FNPOHnRQ/mH4YGUnxfO+tA4kSi7yzwue91Y0I/RRnJqijdJ5qDErHjA2TB0y8k/4mqRp9S MR/+/53ZmERdMpO7t9ogPiJ8Shw6sWaVUOsKTy4XHiBoxDnKzVDH1l62NY4t+u5N341bYR QYb9r6Pgrn1navsyOdM70iAQnkR6wSA9dpXb5yzjTRRFuBBQxexSzuoR04eEvA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685954174; a=rsa-sha256; cv=none; b=iPWAZKWITMQqtWHjUv9u368T9ptHD1h+DoiA9qsdV4q7lMmgVz6fQhv+bf409j5O0iM3N4 Rb4FXHuU6Ka68EaY0ZwEdF5w6dUT4c6WPSeMIPE9dPuKDCnuXQ37SWb1B146jTrUTbHFbb KvHPpUym6ra5Ln4Hy81vHRVVgGKGCPerFtOdR95K1rR4NLduw6nOGwbczu0GKaOB6EL1oO Tui5RS5Spt/wNw7/UHJas9OiaQXiYYUgByriAmWYVAml5zXS0GzCEWa0t2XnqPC5nwHGGV dX/L71GibpyyzcZFCwIM6zbNf1tz6Dy6DK9ux4u+4QnE4LQhKWm/jOJdElrE8w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZRlf0VGSzgdt; Mon, 5 Jun 2023 08:36:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3558aD9w024591; Mon, 5 Jun 2023 08:36:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3558aDX2024590; Mon, 5 Jun 2023 08:36:13 GMT (envelope-from git) Date: Mon, 5 Jun 2023 08:36:13 GMT Message-Id: <202306050836.3558aDX2024590@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: e99631746701 - stable/13 - open(2): fix typo List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e99631746701ffb81b6d090a4217349d3bf86faa Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e99631746701ffb81b6d090a4217349d3bf86faa commit e99631746701ffb81b6d090a4217349d3bf86faa Author: Konstantin Belousov AuthorDate: 2023-05-30 09:17:26 +0000 Commit: Konstantin Belousov CommitDate: 2023-06-05 08:35:02 +0000 open(2): fix typo (cherry picked from commit 1fc174cba6e0b949f7499d195dc36bf8df15df4f) --- lib/libc/sys/open.2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/sys/open.2 b/lib/libc/sys/open.2 index db3e8f373ad7..ae66797c558e 100644 --- a/lib/libc/sys/open.2 +++ b/lib/libc/sys/open.2 @@ -344,7 +344,7 @@ message using for .Dv EVFILT_VNODE .It Xr readlinkat 2 -.It Xr __acl_get_fd 2 , Xr __alc_aclcheck_fd 2 +.It Xr __acl_get_fd 2 , Xr __acl_aclcheck_fd 2 .El But operations like .Xr read 2 , From nobody Mon Jun 5 10:57:59 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZVvC5rHGz4ZbR4; Mon, 5 Jun 2023 10:57:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZVvC5M9Nz4YPs; Mon, 5 Jun 2023 10:57:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685962679; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X9QfWoTybqDf7bl0bC6aNtF5JFolTZIIk4gZFFeGuCk=; b=nZXJaxp+VHahhTvbURRa3WVGik9/DICK4krS7cYGgHsnpMVWvDSXNX+/ZwOG1yS900jMwx JmAbnmY3hwKyCysHXaCZLbWiattpkwzGiYzGvdKwcA6VVjV8PLNHSHs7rrYsNJPE0ALo2J WaaWlrsrjowZE47g5ffPgcp1QFBOEtCy8XEsbK4dZbnL5QhcdFXu9BgTSKecPArLRrTQQF pEVVIKytOWJdG71W4hCeAyyp525XtrPydXOPl6KBJdiGGN/LE6eqtU18mA/0UTkUw6RY1N xin4vQkFxEb2GLUtdNn0lq+vF8SJgibuJ+9QrMzgGIE0Ztie0VMIqtaHBHAsUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685962679; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X9QfWoTybqDf7bl0bC6aNtF5JFolTZIIk4gZFFeGuCk=; b=rB0cooSK+BGT0cvu5iNVIcO2Zmp6K7eLa8ILNbv0p4eZvsN3xhQevJelmHjtDFYWMNn8ty g5g4KjOBsljItYnQ/VaRM9agRV2v5ocad+uD3Vu4SmbN3eCZ3soFo2YDZUkj6GXL9gCoFX pdfrZeL1u7pW049zOt3kHXLhvkQU7eishuuQsWFJrLLzELfxjYih87WQrUaW5Mm3xJSrBJ zkAVay8Sw1mmuRGeEDx13P70EL/er6Cl51hAGr518/wy838/NY21SFoYRGCGjPkXykuA6d 9UmiqcnQtf7ci3tYOG21tomuY0yqQwIuR7Ost+zUZCkRDUxDRY/mgyTOXjXdFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685962679; a=rsa-sha256; cv=none; b=SkFlBGjzDfLyAJK22+qoZZrKwH/IYIb2PTpd970GhY3RBIQKmsZD1t3JY1fWSPVJNEoCf6 W/Xmj3l+XAsEGhvbc62ejauy/3JwzStMnceZ0hzY26IYalUajdyEQ/JZsUlzzfORvusTeL +wyl2QepSfOgTOf+ax8thzGud4esQ1ccD692jlAzDCgt9GAwlLWZba8+OwacPHtJU15ViY om/mV8bguzHVauPyU8zJXXgqtANbBJQwb8wX7eYGIUb842bA+UEzydYQEc2bEAVqzOQQy0 mPhzHbOcpu8DkfRaAQVWwuWrbW0IxVJvb0TujV8/RKNY2MbVyNP/1MGeiO9oFA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZVvC4JXmzl6G; Mon, 5 Jun 2023 10:57:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 355AvxqZ055519; Mon, 5 Jun 2023 10:57:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 355AvxXc055518; Mon, 5 Jun 2023 10:57:59 GMT (envelope-from git) Date: Mon, 5 Jun 2023 10:57:59 GMT Message-Id: <202306051057.355AvxXc055518@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 6180303a79bc - stable/13 - cd9660.5: Fix the history section List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6180303a79bca73597db695ba6a3980049618406 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=6180303a79bca73597db695ba6a3980049618406 commit 6180303a79bca73597db695ba6a3980049618406 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2023-04-25 17:36:34 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2023-06-05 10:57:13 +0000 cd9660.5: Fix the history section MFC after: 7 days Sponsored by: Klara Inc. (cherry picked from commit 5212225753e965c87ae4a7fe5f8a7d9a8b6d04af) --- share/man/man5/cd9660.5 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man5/cd9660.5 b/share/man/man5/cd9660.5 index 54f26738bc4f..48b14e4cbc42 100644 --- a/share/man/man5/cd9660.5 +++ b/share/man/man5/cd9660.5 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 8, 2022 +.Dd April 25, 2023 .Dt CD9660 5 .Os .Sh NAME @@ -69,7 +69,7 @@ volume located on The .Nm driver first appeared in -.Fx 4.4 Lite +.Bx 4.4 Lite . .Sh AUTHORS .An -nosplit The From nobody Mon Jun 5 10:58:00 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZVvD5wrNz4ZbNy; Mon, 5 Jun 2023 10:58:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZVvD5TR2z4YL1; Mon, 5 Jun 2023 10:58:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685962680; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oqeeSDbGWF9ZTbrJQCJRamyhB7UuzmSNGz6460yj19k=; b=cQrsdeEJOtOzB08sr6YZCXYjEZG67Jw4pg0O5O4Izwh+yGK1exgrIQMgn7OCWM4WgOhVeZ orXbEOG4sYJOkVaTbc5zIPAt6olit/RFSd/+sKm8qRU+NDBVsWhVldTC+u/NqrwucX8s9w IW3dXN9EEF89YaPPzaiIObAnCMLmQH/rZNtXSUNNP4v0HIMwx9inw/9ZTahenqaLPfwfYg 3g+9ACLpjkveNf34QcYOVyfXyVgs5UMcxsr8GaHdO0E2FgxbcnZLdXqKlGhv6zlDPej43U ESu3sS0irxgngEfdfCKQyLYFfEg2O7syE6IU6NIwL2vAJBGIG2ZsPQaKgPdJMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685962680; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oqeeSDbGWF9ZTbrJQCJRamyhB7UuzmSNGz6460yj19k=; b=uYCFXOM166D/jFyKYlbXKcNl1GPVVxkKrPN/4fXPIsK77fzoOPqOmYo/3t8FLUkY+ys60V EqlxIa7ETuLR0bfYmlOYA0HQae32cbBd88tvmfEboDemKpo0WrP/SCSxnF70kOG+aS9IEs Kob3f92V8qULeF4ivMcBqfiQNJCPUIrl5T3SQ207/1niYIqAbkDzg8OYcM8ilbjZjcwYHQ pX2OzN2PuKPPUOu2OA8M9h1fg2kPpE30Ty0tQ+CrRp5X30Fv7EozrEgmEUQgNTV8G1P32X OreC0/iALDO/e2/KSr24JrSzdJk4iV+RVjVqVIrDTilJTGCbS2gpmhvPLdI4gA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685962680; a=rsa-sha256; cv=none; b=dUAeEuargbR4hUP/P55QjIS2k5TGwwnGwrIK8ibd5PzcW1K3RM+x3AxGXFhyUpao2ss3au sByFlNIlklodkLs+TqyNGnswIWFCGkcPgIyZuGizuCJlwZLjCb048UAIQYNIAxFE2Bf9w8 mVnFpmIJZlflSmlsRLfwtqujfPx47H+1B4koHTLAubXTaOdmsa4doD2BgUePL8JyObpKHK jFZ33O2SZgwsHYtfFNIaX0Fiq7xixA2gMLwiIwcnpDIoZFGFwr2Ym88ayPXiZdzJeYS9Fo vpTF4ibTswR7tHeuEppuQ1FKN9WNCH5Snit6wTgfo6EbCT2QpFHCeL39xKqKqA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZVvD4ZW7zlQ9; Mon, 5 Jun 2023 10:58:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 355Aw0DF055540; Mon, 5 Jun 2023 10:58:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 355Aw0vh055539; Mon, 5 Jun 2023 10:58:00 GMT (envelope-from git) Date: Mon, 5 Jun 2023 10:58:00 GMT Message-Id: <202306051058.355Aw0vh055539@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 19677c0da80f - stable/13 - ps: Fix synopsis List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 19677c0da80fe687e438489f7074ca1670c83952 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=19677c0da80fe687e438489f7074ca1670c83952 commit 19677c0da80fe687e438489f7074ca1670c83952 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2023-04-25 11:38:10 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2023-06-05 10:57:13 +0000 ps: Fix synopsis In the -L mode, the -L flag is not optional. MFC after: 3 days Sponsored by: Klara Inc. (cherry picked from commit 3f46bf40a1b26c49b53df4ec504757c5d8c9f921) --- bin/ps/ps.1 | 4 ++-- bin/ps/ps.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/ps/ps.1 b/bin/ps/ps.1 index 25373adb7d73..bc760c174c11 100644 --- a/bin/ps/ps.1 +++ b/bin/ps/ps.1 @@ -29,7 +29,7 @@ .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd June 27, 2020 +.Dd April 25, 2023 .Dt PS 1 .Os .Sh NAME @@ -49,7 +49,7 @@ .Op Fl U Ar user Ns Op , Ns Ar user Ns Ar ... .Nm .Op Fl -libxo -.Op Fl L +.Fl L .Sh DESCRIPTION The .Nm diff --git a/bin/ps/ps.c b/bin/ps/ps.c index 0c656d8a1544..141b57cfd683 100644 --- a/bin/ps/ps.c +++ b/bin/ps/ps.c @@ -1463,6 +1463,6 @@ usage(void) "usage: ps " SINGLE_OPTS " [-O fmt | -o fmt] [-G gid[,gid...]]", " [-J jid[,jid...]] [-M core] [-N system]", " [-p pid[,pid...]] [-t tty[,tty...]] [-U user[,user...]]", - " ps [-L]"); + " ps -L"); exit(1); } From nobody Mon Jun 5 10:58:01 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZVvG1lj6z4ZbR9; Mon, 5 Jun 2023 10:58:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZVvF6NBtz4YVv; Mon, 5 Jun 2023 10:58:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685962681; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=22QlV7XaVH/PjU1Vkpg6DdKj6MosBJd71Qp44rrGmTU=; b=gXht+J6d+OIbRKFjeciyr+Je4kG4mRKyqadzIlTXV10R0H67Ng1amJbHZo7W6lX/08dzJ/ MgeC7T79WGtMW2Y4fpqu8A4JM0JxzPCX2TOh7dYxn75BAvgrIbZS46nkyxqcvQxFi5jV/p Pkw7MQksaHnGsxAXyYeYzC9WiKrkaXOIcPxzCkkBIjEyhM66uZEK6/JqhvqT3kF1kukJ0D T2ScrE9kl8NA67IquFAfEQZcZYkuFnN9264DegKyLZpT4HNRvCT6DThiludpJCGFURLjCy 9Z874d7G+uIXEgrWfxsgiY13hrV1BCCsQZdGYKkhrcNn8wz4VMmhQBUkR58gfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685962681; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=22QlV7XaVH/PjU1Vkpg6DdKj6MosBJd71Qp44rrGmTU=; b=f5ToNwLoC2rxoUaF5Jvf5Vdy7tqTijNndB3S274bX4gnOcgA6XhIObBHT8h9G72H8DCbgk E0Ir1mtc++EqY16xE1xOTWLPFuGhevqTwtOaqMpxZNBWN3Mn22eIcFFDlBw2lk1EpiNRV8 rqjdYZoVvscc7YYuy1+RloJ913ywvlOkss4d4/9cixtd6aHszmQo0OBBMymFQoyLc+Mu1f wAZS5ht3b8NPRVWkCU4g1sqVg62n6PzSEc9wiFsMEHm7vEn9ynP+zC5TGXWglcobbC/Xv4 1AR4+0XPa7/YG4vzOGUCtEDiE9ttlbIxv68Zt3gXP0TyjdM9kW3OiWmkdT9sYw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685962681; a=rsa-sha256; cv=none; b=iSwKfky+cZWrZk8ejLDVokfAreDa1rSW4LZRSQtUdv1okWD3wkI5VutkxbB3bq3UXDbxNS RC6lGhxfHL3cxuWQGBilUPPA++d5T80GOVlz0+wgwq6kqlKUDHHIoSMXFrrf72FpmUmE9e GIZj6PSN4O5Cc71gulsF2JW2VUeVcbufOZ1QJn48VVDJdzv7OzVTfoMnV1z3L2tFgYjoVF MZq/rKQSpsQ5CbicTE5nHbpgFCU/H1G36eXqlZ3GfMRyjlepczl+Ao4h0CI7AM8J/daV0X kWhkmlCyNegQXbzLLxi+6CoPLvExQQz6/fyfamAIDRzSKFWrErEB+j23mfgmHw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZVvF5V42zkc2; Mon, 5 Jun 2023 10:58:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 355Aw1Uk055559; Mon, 5 Jun 2023 10:58:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 355Aw1sf055558; Mon, 5 Jun 2023 10:58:01 GMT (envelope-from git) Date: Mon, 5 Jun 2023 10:58:01 GMT Message-Id: <202306051058.355Aw1sf055558@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: e06bc4821edd - stable/13 - ps: Add libxo to usage message List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e06bc4821edd7d4d69bd27b7d40ef30aa7c2f234 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=e06bc4821edd7d4d69bd27b7d40ef30aa7c2f234 commit e06bc4821edd7d4d69bd27b7d40ef30aa7c2f234 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2023-04-25 11:55:17 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2023-06-05 10:57:13 +0000 ps: Add libxo to usage message MFC after: 1 week Sponsored by: Klara Inc. (cherry picked from commit 820ac126795b8b1c55009676fad3dfe5c7834b0b) --- bin/ps/ps.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/ps/ps.c b/bin/ps/ps.c index 141b57cfd683..b4b1c5c01730 100644 --- a/bin/ps/ps.c +++ b/bin/ps/ps.c @@ -1460,9 +1460,9 @@ usage(void) #define SINGLE_OPTS "[-aCcde" OPT_LAZY_f "HhjlmrSTuvwXxZ]" (void)xo_error("%s\n%s\n%s\n%s\n", - "usage: ps " SINGLE_OPTS " [-O fmt | -o fmt] [-G gid[,gid...]]", - " [-J jid[,jid...]] [-M core] [-N system]", + "usage: ps [--libxo] " SINGLE_OPTS " [-O fmt | -o fmt]", + " [-G gid[,gid...]] [-J jid[,jid...]] [-M core] [-N system]", " [-p pid[,pid...]] [-t tty[,tty...]] [-U user[,user...]]", - " ps -L"); + " ps [--libxo] -L"); exit(1); } From nobody Mon Jun 5 10:58:02 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZVvH0b8Gz4ZbSn; Mon, 5 Jun 2023 10:58:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZVvH08Mzz4YTV; Mon, 5 Jun 2023 10:58:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685962683; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VFEBospWcZtCsLhd4CmYV96JRgQzr4zdUFQgU1iBSuU=; b=lzgoO0hbvvjFXiLTcfsq0aY/8wuTWSx7LCyGyfIzLxHi5PPsv4vzWD+527CW/3MIJ83jc/ anGnPntZUCEjEJcgj01Y+Gq0hibZ3fE4LTTAv/raotDG10UmRptHiMH4qk2BpUGc3OVxiT jLTh95unK7CGG8nj7QSWplHAjZwNBH5q6BIiAulO/E4IvN1BLEwCCmDfIcqLhzxv7guXoj iV1bKp9UqGnFfTDTgqnI3ttXe6vaH5QQ4PoAFTOgkc8NUxY1T57lwlnPV9bKGjBk6FK1nR hOGJE1MnMOTA7p5jhPsP+HW1cgzmFqbmdaC1Za92OmsGHj5qxYb/0XVUkcfncQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685962683; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VFEBospWcZtCsLhd4CmYV96JRgQzr4zdUFQgU1iBSuU=; b=EHyiSLsNYpFYG2CtAjTpkh2WyZS7hvnMMXqcfJsrU9w/DhWOWZRUOs7YmjiQYpuw1oWPdt vrfhtzL/nTnNNX9GqVY9ftDLEcgXWZl4iio2kgx5GBeh6jHjev3/aFZUILQ6mO1CIz6YDG iuIZOCuFOfXAzrypqYafd7woqfTWJnUeAQe5OQtV4Bw2XlIEzZ8kQe9qMMPXCctPv6B+xJ V1/QkWTgbA9jj1YWbi+VCLqEatO9xY0axSJ5tXRhwuWGkH9KGGAWZpVaJm9DQkduKBBOvY q2XA8H8YLdFznIP/5oOvEStqbypK1hDR9O/AWLhA+Dizhfyw/emKopJuGjA4Pw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685962683; a=rsa-sha256; cv=none; b=nt1Lq2qLRxXc0aEG6ntB4krOdbofw8t9XZHcim3fZik2sNqZjd1C99DsX1E6oxUjXvASRO T/RAnugN/nu8v2Yvkmdl704bTWgMeVxIfp3K3Ue+VCK8t40oV9xTBTdZ5Zfm34oc8tMS+J 0kzGdEp7I+/RqVRwV4Qj02JlMbkd8WhHgAAk2jz0XtwGU1zH5UCsKVg3bbznKzHyCmJGsL DWxl7gowNmGwmIwMsBNxtaX6M5axm/HK5IU9hNsIH2APCE54hoZI0hTudmmskqnTk+KdFm m4NYxj68RlIXsOrBIyyHpBttWGBe6yv+b4kw37t/vNMUYcRL/j5dhHgsGoeW/g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZVvG6MvwzknZ; Mon, 5 Jun 2023 10:58:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 355Aw2qR055578; Mon, 5 Jun 2023 10:58:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 355Aw2rR055577; Mon, 5 Jun 2023 10:58:02 GMT (envelope-from git) Date: Mon, 5 Jun 2023 10:58:02 GMT Message-Id: <202306051058.355Aw2rR055577@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 412394a79096 - stable/13 - nproc.1: Fix "first appeared in" details List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 412394a79096b989d0f6bdfb3213e3f8e5105f7a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=412394a79096b989d0f6bdfb3213e3f8e5105f7a commit 412394a79096b989d0f6bdfb3213e3f8e5105f7a Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2023-06-02 16:49:36 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2023-06-05 10:57:17 +0000 nproc.1: Fix "first appeared in" details nproc(1) has been MFC'ed into 13-STABLE and made it into 13.2-RELEASE. MFC after: 3 days (cherry picked from commit 1e078fb6021ebb5ccfb092fe9e5befcf4054ac0b) --- bin/nproc/nproc.1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/nproc/nproc.1 b/bin/nproc/nproc.1 index d4d97ccbb5be..b693ded79a39 100644 --- a/bin/nproc/nproc.1 +++ b/bin/nproc/nproc.1 @@ -3,7 +3,7 @@ .\" .\" * SPDX-License-Identifier: BSD-2-Clause .\" -.Dd February 15, 2023 +.Dd June 2, 2023 .Dt NPROC 1 .Os .Sh NAME @@ -50,7 +50,7 @@ On FreeBSD only active threads will be reported. The .Nm utility first appeared in -.Fx 14.0 . +.Fx 13.2 . .Sh AUTHORS .An -nosplit .An Mateusz Guzik Aq Mt mjg@FreeBSD.org From nobody Mon Jun 5 12:36:57 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZY5P34NJz4Zvs2; Mon, 5 Jun 2023 12:36:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZY5P2Gvgz3lPp; Mon, 5 Jun 2023 12:36:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685968617; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OC/v5krMth7gl9Xk5R20e7c9vDbUdW4ebdZAkWrZDo8=; b=gmlLeu5XOdaitDM1GX0n5RufczSQDuAiHK+q7REWlaYzvwwoMeILRtpOMefy6FT8HF9I5g sKfcQcBdWS8zf9SNrYzBEXDz65sey2XG6DRfgrTdFjo5924NDTxGnQ5GTdASrdbcf02Z9O ngayUUq4jvpjjXbov36qWGF7VxnnrTw0EwaU7/e3v26o8ZZ4OwtrvOpbm7/iwq/kQyNG27 0IxNUhfLRh21esC1lAMh6WzTWBXyq/kJfiO6LWeh7avS4pJ8n/o2i+U6/nFrOnr+5YaKyt bGirs5KUu/9TJZWaOnhA572HT2xt5KOY+A6OMP64SQQiqdGlaC+Xq6MawSKUtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685968617; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OC/v5krMth7gl9Xk5R20e7c9vDbUdW4ebdZAkWrZDo8=; b=bu47YEswyU2K5x4BKkvGZs5DjYI7J5C5WVhs+1V2RPRpOt2pmVws9XZ43fmiHPSFJSHJyU M1vTP6ZhPhps9hNKZlIh0TN7nnu8IiMjggqkRiLMMu97eY5gQagJUYHi20BpRScqxfxqE7 NFm/6TUnKjrEMYiXJ+Yox/pGudC8eK10hEMBdO4wOt2WxGAatyjOrgTPZi69fNDRt54quz XhhjvNzUARCTHLUPrbE4fkaOHh+lwG4S50Q9zveavl/YvTJKMwM/T7pXO6MdP/Tu2VTjVo VL2KmrD0q3IaBnytmyVZPSxzdLS5VVGsWabLHiAcYT8imKk3dhOlLUGq5Sfh0A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685968617; a=rsa-sha256; cv=none; b=wdy0Eqnux6HS0KUoaTurJlg9IIR/G9ughEXwN6dd+jggN7nhrmL5qFRxsXkoKazHlA3B/s HORYEDluxuLbNA9acs1iP0IuuoxEQZQ2ab8W+tv2mhkE3EyuhaGQ7h/r3GcWC6vCxPoB6f ir6TJ1vQynsKDtQQoKCsGCA38c/upPduy+b/9Wv+4+USXwJbaGHBWBwzTWiXKUQskcF2bl VSKiofq18C0yXyvx19W634cDRqWlxSFBxTcxMUBxjBuMcextb9BmC46PB1zZs8p9jTSIqz q3lmx5rv3jLlxlBWoPviOZqIBWFg7ERoO3vwzi6awKO7/q+JPPWoioSaFUhw5w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZY5P1DHjznbc; Mon, 5 Jun 2023 12:36:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 355Cavjv020079; Mon, 5 Jun 2023 12:36:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 355CavVs020078; Mon, 5 Jun 2023 12:36:57 GMT (envelope-from git) Date: Mon, 5 Jun 2023 12:36:57 GMT Message-Id: <202306051236.355CavVs020078@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: 979754a15ae4 - main - nfsstat.1: Add a missing argument to -w List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 979754a15ae4c507cd739163331cbaef7b100e23 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=979754a15ae4c507cd739163331cbaef7b100e23 commit 979754a15ae4c507cd739163331cbaef7b100e23 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2023-06-05 12:32:46 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2023-06-05 12:33:55 +0000 nfsstat.1: Add a missing argument to -w MFC after: 3 days Sponsored by: Klara Inc. --- usr.bin/nfsstat/nfsstat.1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.bin/nfsstat/nfsstat.1 b/usr.bin/nfsstat/nfsstat.1 index 4a37fdc7529a..892e675390b3 100644 --- a/usr.bin/nfsstat/nfsstat.1 +++ b/usr.bin/nfsstat/nfsstat.1 @@ -28,7 +28,7 @@ .\" From: @(#)nfsstat.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd December 31, 2019 +.Dd June 5, 2023 .Dt NFSSTAT 1 .Os .Sh NAME @@ -53,7 +53,7 @@ If you wish to compare RPC counts between NFSv3 and NFSv4, you must use statistics in the client(s). .Pp The options are as follows: -.Bl -tag -width indent +.Bl -tag -width "-w wait" .It Fl c Only display client side statistics. .It Fl d @@ -111,7 +111,7 @@ useful when combined with or .Fl s and a time delay. -.It Fl w +.It Fl w Ar wait Display a shorter summary of .Tn NFS activity for both the client and server at From nobody Mon Jun 5 14:30:05 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZbbx57pxz4bHgr; Mon, 5 Jun 2023 14:30:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZbbx4ggVz42K4; Mon, 5 Jun 2023 14:30:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685975405; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1+gsv8Pt9jXsQP4dG7F+KWJ0zX+oQxE8/sVRTCnV0XA=; b=d/XUAXSu5BCw2JuSraU7QVr4eHAyua8pu/cPbNJYOFSq8fSwzfHjXDuBMwjZR5SzK5zo5G FtVWYB1dROdiXdHAhaP/jEwjTVgU5WenFoEN/AT0sMHAMsJv2iyVbQa9U3AnnBS34ezZGl ftKnOfsgXzNZKsGhvnfcTlS4l4ppet5ZSTkEJ8WvnyL6WWpTJiaz+3uA0fNiCZ/SE4Mgy4 XRac6vE+wm6r8wrlpaYVBdOIYfDEoyBfqrJwjGn3EeKjDi3lKmw2oDtBBDkr0Q5LuKDmhc 2YaJPsEn/MnLkjdJHnI3yuhF+0wB2V1p+VffaW9EwlS6H6Vg/9EkfUIvu22lSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685975405; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1+gsv8Pt9jXsQP4dG7F+KWJ0zX+oQxE8/sVRTCnV0XA=; b=KFyAQBM4pVIgYpDZYkg2rz0qrgbeMATtbBM+lNBHW2n9UR1CGxuHfAObZsbb4TckHM0Xl+ SvLYvWoWYWjMakau1xc/j5RqGXE51gdjI2bcYZUX5YQoxoGX6EDTUVrNZDhUR6eD7xtpwR +S4ksWka2dq368RUz77+zsyedQqrwzUkNRF6vDazMUtK/AKnVDqoXBNEPG37DP+YFN6Ix7 WzPfDbwGxoNTXuPYfcqzhYYf+/+ALtGfaliST6SK/8hPz0jdYMpwPrhUjRiNnQfb9athYP U0kMEg9AHWyDg9lFhFd3FK6LbQ0MWD/3UJKb5frZKmhnRNWbAntLICvLaLaXFQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685975405; a=rsa-sha256; cv=none; b=Uowh/zUnSxF1B7H/ecfuKBVMnHB7oC5yA4ykXFpLV7yrv6zfOK3O5Z9reH8nUbDVRn2ZYz SsEkODbljqEQ/8Bk+AsplPxQPPc5YmjJlb7SH9HQYAKGliDVUiYIjTVyfVirbrkJlGoyz5 ZYvUnMpT9MK0hqxJ1RquE5EktapiGhLM1nM8fm3dKf4Lfwp/+lLL3spm8IZ5ZQRxuskh0E Sq/ZAMBHH/TN4uB9uZUL8t1jLyDZIN5CvvU5LXlbxVtMXARNDxr/NWwTeEXYVZSR0jFYZU 1XtEewEasD3+l5BZgvKs7EM5sNSbkIj24w7EfIJpDWQ+VhCCx+/yuGjfopyp9g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZbbx3kVMzrWW; Mon, 5 Jun 2023 14:30:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 355EU51S004735; Mon, 5 Jun 2023 14:30:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 355EU5qf004731; Mon, 5 Jun 2023 14:30:05 GMT (envelope-from git) Date: Mon, 5 Jun 2023 14:30:05 GMT Message-Id: <202306051430.355EU5qf004731@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: c2144c3766ba - stable/13 - Cirrus-CI: add gcc12 automatic task on primary GitHub mirror List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c2144c3766baa70f49ba0ba76ac54b9ef0fcdad7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=c2144c3766baa70f49ba0ba76ac54b9ef0fcdad7 commit c2144c3766baa70f49ba0ba76ac54b9ef0fcdad7 Author: Ed Maste AuthorDate: 2023-05-09 18:26:47 +0000 Commit: Ed Maste CommitDate: 2023-06-05 14:29:42 +0000 Cirrus-CI: add gcc12 automatic task on primary GitHub mirror We want to get GCC coverage via Cirrus-CI, but don't want to trigger excessive runs across all forks and branches. Create a duplicate gcc12 task to run automatically for freebsd/freebsd-src. Reviewed by: jhb Sponsored by: The FreeBSD Foundation (cherry picked from commit f5f1b9a9828a4fdf5b0ba51b291e0e1e7ac7b55f) --- .cirrus.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 57ff4a3b271f..3270040aba40 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -27,12 +27,18 @@ task: TARGET: arm64 TARGET_ARCH: aarch64 TOOLCHAIN_PKG: llvm15 - - name: World and kernel gcc12 amd64 build and boot smoke test + - name: World and kernel gcc12 amd64 build and boot smoke test (manual) trigger_type: manual env: TARGET: amd64 TARGET_ARCH: amd64 TOOLCHAIN_PKG: amd64-gcc12 + - name: World and kernel gcc12 amd64 build and boot smoke test (FreeBSD repo) + only_if: $CIRRUS_REPO_FULL_NAME == 'freebsd/freebsd-src' + env: + TARGET: amd64 + TARGET_ARCH: amd64 + TOOLCHAIN_PKG: amd64-gcc12 timeout_in: 120m install_script: - sh .cirrus-ci/pkg-install.sh qemu-nox11 ${TOOLCHAIN_PKG} From nobody Mon Jun 5 15:54:05 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZdSs2d42z4Z5QK; Mon, 5 Jun 2023 15:54:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZdSs25Psz4HXt; Mon, 5 Jun 2023 15:54:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685980445; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lrGfzoqGqpJUSLU1PXnRvUnzypNtJ7t5xonQG8WWFVw=; b=vu3uHmb6nJqE9+mu4Vkz9iyuIdrCqyF4zxVEbkfMb+NLuN3wNRGnFOnHVHtYRm4Yk0auVf S3JbKXuKqiCfHsMe39OsQ+b6ivnhBov20/QzdO/djCgc4gIurr/Op9mZS6xQJ3w29pB7zr CVGbp3oovRzfdwEf4YnfOXdCqp/4cd70oaBIbsJXgMAyO7Cu6SeTl/KQoMuO/q27JyizL1 UbkWXIC1el7v/lO0KiS4nxv1hpPbyNcWjvvLdplhVPVbIXf7gKtsbIfyShqqrzZBZsDbUJ 013nbwmJt6kHuDID3JF58tkriNThwjY7YYFgtMtBpt6Miaes70cqbvNtmV+/2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685980445; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lrGfzoqGqpJUSLU1PXnRvUnzypNtJ7t5xonQG8WWFVw=; b=aXUknfTxYMON5gMB59Her4yv+q/B96QyKn19P4aBmFQ696fEkpfdkz+E8mn80ZkY/lQ/OX A9PVVao6f5EYy6ZY3pk5WeFc6fMIS1bYCBe+I0LX3Vf/TVu2s/a121fm93xerD34WeaPnX pid+KtxYsRv0f9p0B9VNXsTsYa0EMJeY7hJkHQ36vM/7HM6Lfpybz/O/d16NJxkyROxiHc 7JY8GGwyQnwAa3R646r4emofaaWPgFCIzm5Cyw8BwpJaKhr4JlWKH4FNqxZcAsf752NELc wH8VG3IZV3TtXDozgOv6Xlegu6FjRDxFRHIOGNdbqPCba62TXsv+DWzhq4nnaw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685980445; a=rsa-sha256; cv=none; b=gLj75+442qEGLj6P7cDpXH7fYdPKupM5p871rs1UuHGFvQSpFIqszgG6KdLfhxhz3c8rOj +jBGB0HRWXGvRxG5IRdjVb3yMydu7XQD5WdndRxxY289yiz6qqPpzs8O4ZTfb+YjmfJVHL G3fJbArT9PoJtxOVFJfaKtj15KFKXup2WaFvsklRQqdDoeNdHVRAmKq74eNxKa0QE5lt8Z T4SZACQGVpXJShfgf35UA3qsOyPDc7TdAjetYhjimhQlP3dp1nrz1Ec/15rLmSZwZkVXND v3j9nDiQa/ti64uTATXdBeHw1a2byNWtlTyWktHrwzz32lMbm5jzbu/joxXzhQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZdSs19JLztRC; Mon, 5 Jun 2023 15:54:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 355Fs5uR049379; Mon, 5 Jun 2023 15:54:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 355Fs5gh049378; Mon, 5 Jun 2023 15:54:05 GMT (envelope-from git) Date: Mon, 5 Jun 2023 15:54:05 GMT Message-Id: <202306051554.355Fs5gh049378@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Dag-Erling=20Sm=C3=B8rgrav?= Subject: git: 7ba6119e22b5 - main - ctags: Don't undercount lines when handling // comments. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7ba6119e22b54c2104b1948f0e8a4157d4112958 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=7ba6119e22b54c2104b1948f0e8a4157d4112958 commit 7ba6119e22b54c2104b1948f0e8a4157d4112958 Author: Dag-Erling Smørgrav AuthorDate: 2023-06-05 15:53:45 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-06-05 15:53:45 +0000 ctags: Don't undercount lines when handling // comments. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D40374 --- usr.bin/ctags/C.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/ctags/C.c b/usr.bin/ctags/C.c index 80b6c42a7a5c..e36b60de4a55 100644 --- a/usr.bin/ctags/C.c +++ b/usr.bin/ctags/C.c @@ -483,9 +483,9 @@ skip_comment(int t) /* t is comment character */ return; break; case '\n': + SETLINE; if (t == '/') return; - SETLINE; /*FALLTHROUGH*/ default: star = NO; From nobody Mon Jun 5 16:01:42 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZddf4PS5z4Z6fs; Mon, 5 Jun 2023 16:01:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZddf3xqqz4KCY; Mon, 5 Jun 2023 16:01:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685980902; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hGEjVmhDjVZCCVXR0QnEhuRNnt4Ro/P6/gXWwoo9h0g=; b=B5//xeAO6Zs4bMwOTlVQ2G1Xuq1qb0uQ03uptjE944edx5jq6ruVwXXTGVM0H3kVLzsW6o +sKFI3ZZ/eYMtUtyP+YZLEeKYXj28zqrAAyilk2Eg4VqnzVYWYjeIu8kFVtRTsEyQLSb0A jGb+ZHeP1aFNXtNhoDg87fqNHD/vOLhkrWEy7Fwji11J8axesSNBrEN3Fsv94b7iNWWl0B aUwh9Fer/e4EsAwGUZxOGTfq+TvyZv0JGfzHvdyfVWridQMOXJ52CvDDAOlGCcicKx4osW ohfaWBOEkW0JXaMpIOIoRk6pPrOG8os+X48V+8bAjYCzXibsF61BcWw9HqVucw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685980902; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hGEjVmhDjVZCCVXR0QnEhuRNnt4Ro/P6/gXWwoo9h0g=; b=xyhqNqxd+hoflAOojrIkkhfZ2YRBQMk7OSyG7/zTtodWtzGWNU71OYj9RrLJZb+Zrh8Ax4 h6tgsRzXCrMmNlF8AOUbJR+CWso0rzjUoUIwOIa54nX8wPhwrwFzFBVOlpcwWfpebPmDj6 LerNsJTFnPvV0d5AyYC/tJml0Qqq7L89r1zXF1jspwNXBw0rfCEJkLHp6K+1kAP8RKkMd8 zxKAlQ+jbfWt6+Afb+tSHO6qc+Yl7XJJm/6lIdw1BA7/24V07o2k7YT3GmxF9sHVvwdZuj CRZIwE1UZP6DjvPZk9bl1U+ZThSqc+O+ToYxYmwgW+zcJHLB/6TG3jOyQ4QAdg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685980902; a=rsa-sha256; cv=none; b=HRbt9TPhHB/uKftSPliv5ArqnKgF422UV2UnGk6Uxdwp3L4iFElw9MQLzVhkoEydkyJLHH MABBNXMYie3eFv6B+3kmCEg4m2OLjogFhYcDJ0XOJ5QUAAxxjaky8WZqF0gVTqrLzmg/RF Je9lpwV2w5FUrluc32vJyXfzP3Nv7tdMsv9xTlG4c35vFQ8jt6giwbuFrcWKClMX3gSo4B kBkdbt5HJ2PhqmDq/PMlRhSo7hPJaP4rG5hZlDDJgQi15/IL/rOGzpl1Fyjw9o6xFQlBGm nfTU7djDzVfM89DGi1A02yN3sZqTBMXs4qP5gSVN/7HenHVKZy5qv1vMSgXeNQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZddf30DtztkR; Mon, 5 Jun 2023 16:01:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 355G1gLF065648; Mon, 5 Jun 2023 16:01:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 355G1g4A065647; Mon, 5 Jun 2023 16:01:42 GMT (envelope-from git) Date: Mon, 5 Jun 2023 16:01:42 GMT Message-Id: <202306051601.355G1g4A065647@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 089d1ed94c07 - stable/13 - Cirrus-CI: move QEMU pkg installation to test script List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 089d1ed94c0708c4ef9ba13c121294904750d5f1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=089d1ed94c0708c4ef9ba13c121294904750d5f1 commit 089d1ed94c0708c4ef9ba13c121294904750d5f1 Author: Ed Maste AuthorDate: 2022-09-07 14:12:37 +0000 Commit: Ed Maste CommitDate: 2023-06-05 14:35:06 +0000 Cirrus-CI: move QEMU pkg installation to test script Occasionally the QEMU package fails to build and isn't available on -CURRENT using the Latest package set. Move the package installation to the test script, so that if the package isn't available we at least still perform a build test. Sponsored by: The FreeBSD Foundation (cherry picked from commit 612f254c82468d037fccb6c26dc0a7e37a73a53e) --- .cirrus.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 3270040aba40..eeb4bf83fb07 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -41,7 +41,7 @@ task: TOOLCHAIN_PKG: amd64-gcc12 timeout_in: 120m install_script: - - sh .cirrus-ci/pkg-install.sh qemu-nox11 ${TOOLCHAIN_PKG} + - sh .cirrus-ci/pkg-install.sh ${TOOLCHAIN_PKG} setup_script: - uname -a - gpart show @@ -57,6 +57,7 @@ task: package_check_script: - su user -c "/usr/libexec/flua tools/pkgbase/metalog_reader.lua -c /usr/obj/$(pwd -P)/${TARGET}.${TARGET_ARCH}/worldstage/METALOG" test_script: + - sh .cirrus-ci/pkg-install.sh qemu-nox11 - sh tools/boot/ci-qemu-test.sh post_script: - df -m From nobody Mon Jun 5 16:01:43 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZddg5WVcz4Z6wx; Mon, 5 Jun 2023 16:01:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZddg53s9z4K54; Mon, 5 Jun 2023 16:01:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685980903; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WR+lIE9JQPfr0bVbmLBlh9ieEcU0awRiUxmz6qID6aQ=; b=iMeN7dc4fgk5wEv0R3/tWVobxoR0Lmu6b6Y4Td/6Bd6fV447YWs1yfEiYeGvIKxuwKjDhj J3D+Uk7pG4qQSRSmNqNpuHnQKQvgoOJiOUyD6GHc+LjM4XyqJanzbTNKP6KxZmWsj/KDAk D7y+HfbPTN4xysO5M0oMT6MNlCBdtyShi3zS1adTcM18VRk+7cUCvr976AH8nty9TxPklt iFMF0CbNLwGzx1d7OnTQMgJR455pLe2Pfc0CYgAU8GXxQFTGLqx5Bd0pbbJtBgQxFOt8PS 0g2ruacD85p8vHUzFOZ1POUbd+KwJceqtQ8Hntjw3zGet19gB07yJHm3R4YUhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685980903; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WR+lIE9JQPfr0bVbmLBlh9ieEcU0awRiUxmz6qID6aQ=; b=wjjT9XZxfKCvpgg6CcC27pgaCG9sZJA/tbNnUZOPp9aW0e9IFM6kxEB4Ws92L9ztVWQUF2 cxNeVuMTQfAgCuKpEXmyFdBgoQbrb7GiT+nJ/hL7ZEqU0ayXeE/f1VKNJUhwprHGGx446q 0wr3EEg3+K3it50211ZynJ0Kbrvwgd+kQ8FCVunL9MsPzicsMVpEFdG52DB3mGgfPE7pes qQcVPJoV11/2GXE+BBmiyQ+g7yLIQUZDN3EU8053TWvoPR2o8k5JdiBlj/pO08bJWHvTSM 6siCkZ4CA8JQrf/5o8MGtDbMSqNDVHG0HlX2YxBINbeqRbNlpMMZxR91Dq/h9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685980903; a=rsa-sha256; cv=none; b=amL7FDUzmaobciIf79rJT3DiHShxyJugBAfprVOmzVYYXbtgk5NJ7Zn9poz1QqEV9xLFP9 NWMwbO6lf55rIo9PIkAS+34vPzk0CGaY4cQkVKyMCwkgrw6vD9V8hV0Ay8epe7EBRNUNG/ TEbuliEolddaonNGpBYOMeagv0AY4NED139yYWf4WWVc4XeJtcubtbzp/wok6B1Carh6NO zJJ+YV+LTXXQzrc/0FhZfxzxgS++RHlVFCh67BZ1lLhzoFObqRDOZjCFCvfZfRu2kExODV WkR1N+MalQ47DVMf9sL/AXEaJSOAa8xDqyYX6fkM/Lx97YYiT3wx2pdAM0I2FA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZddg490Fzt7r; Mon, 5 Jun 2023 16:01:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 355G1hr8065667; Mon, 5 Jun 2023 16:01:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 355G1hVe065666; Mon, 5 Jun 2023 16:01:43 GMT (envelope-from git) Date: Mon, 5 Jun 2023 16:01:43 GMT Message-Id: <202306051601.355G1hVe065666@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 7d947ad81079 - stable/13 - Cirrus-CI: hide manual tasks from official runs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7d947ad810791fa4fa11ce9b63308e8205cd5ccc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=7d947ad810791fa4fa11ce9b63308e8205cd5ccc commit 7d947ad810791fa4fa11ce9b63308e8205cd5ccc Author: Ed Maste AuthorDate: 2023-05-11 15:16:51 +0000 Commit: Ed Maste CommitDate: 2023-06-05 14:35:15 +0000 Cirrus-CI: hide manual tasks from official runs Sponsored by: The FreeBSD Foundation (cherry picked from commit 9244506a1b314d9ad5bcb1bd5cc0b75939464174) --- .cirrus.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.cirrus.yml b/.cirrus.yml index eeb4bf83fb07..1c6bb1d8e5a4 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -22,12 +22,14 @@ task: TARGET_ARCH: amd64 TOOLCHAIN_PKG: llvm15 - name: World and kernel arm64 build and boot smoke test + only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src' trigger_type: manual env: TARGET: arm64 TARGET_ARCH: aarch64 TOOLCHAIN_PKG: llvm15 - name: World and kernel gcc12 amd64 build and boot smoke test (manual) + only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src' trigger_type: manual env: TARGET: amd64 From nobody Mon Jun 5 16:01:44 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZddh6t02z4Z6g5; Mon, 5 Jun 2023 16:01:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZddh5zBtz4KLZ; Mon, 5 Jun 2023 16:01:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685980904; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a7yqYAuskHNdbHrKEeAIT5t0G0cnFlMA6NR980CLJNQ=; b=KOpAv4IdIIJSIHA6/1PPFrGc65wWRYSVeqPf4a7PXGnJbWMe/68tZVu9q3ZQe0GYaVrajZ cNgydjICiNyqOertauSwmyPrRsZY3IR4qMVMskcLYnzT3jo7gz9Ml8FwUSUZuIuNWJXQCZ tF8OgDsFpRkHmm0KCuu/FAgJHzDTbKZjGXTj3vGL5XYmB/k5IUUxx1+OQ0xaF0zlWfe4v8 tFZD6oUNvICAbcN2G7DEZwmIFwyEzMhX/bnyDRwkm810P/mQwlOIrXxYyDxL8lm+Munclv JvdqMoVLAN928UKuAUcRzZc0T2pjKW+OhVdJHGCVfIFx4rfZYYKWuMSnliln3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685980904; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a7yqYAuskHNdbHrKEeAIT5t0G0cnFlMA6NR980CLJNQ=; b=azEDJ7jdgAvZ/FF2TczVOf4CH5ZE5kWysWNJQxYmNg/VDQWyv2bd3GBEkJU7VYtJyt3LWc Xy95TBB9yDBHjQWUFiAVuHl6XNEHBu9iSew4QDTyUyuxzS2ZnsvQT/WyGJ5nPedAj2GB22 bLDk1xWHeKXAgqS669rfr9T24Vh3mfRbUA2gfO58cdyDpWdbhhBacQvBDao8oBEisChDgM LSioA8feauee2XV4yaFkSByNDwwm+2vlGmo08HBh4x+kPhswcxIiJvk8zHv+Hg7jFqwbkb ket5ZN1kensuUnRp1zhHtCaWYC4EFc8Ff2pxmMJz85dqjGI1c97bdqKLQ58z0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685980904; a=rsa-sha256; cv=none; b=rBFgtyTIUTn9tuJdHvERmxIEUntUqibzrLSnUQ/xU03Z+JagOvmcfjPFr5TNCJFWo4RPvc jlp/OvIpSGde08+K70bFWOXrB/NIY1gIda3Rx1q7y8mp18ErX52UhKNRH7GmDOgV574W5T VPJZ52UxO1/qBK7EH6FhrrmnMwwqWS4PH6df5xJD1/VnGGGy4k+GuzDpfKe1ctrHxNORHA sssMq0MJ24iFHDtrvXfL4ZVc7sKPpgHtzJfeJ7Csy+Ad6M3JeDl98Q3V7pzo/9NBeFfch8 bpfASSdJwor8ZSH6tpPYI8r2OY/rcjqr0hOpxaRTvV9DkpCiZ6NgkTcEQaLxAw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZddh55Lpzt7s; Mon, 5 Jun 2023 16:01:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 355G1ivG065687; Mon, 5 Jun 2023 16:01:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 355G1iaE065686; Mon, 5 Jun 2023 16:01:44 GMT (envelope-from git) Date: Mon, 5 Jun 2023 16:01:44 GMT Message-Id: <202306051601.355G1iaE065686@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 99b983ffe737 - stable/13 - Cirrus-CI: switch to -lite LLVM package for native run List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 99b983ffe737fa2cb7bd5b2f1cc0f6b6b8d5fe9e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=99b983ffe737fa2cb7bd5b2f1cc0f6b6b8d5fe9e commit 99b983ffe737fa2cb7bd5b2f1cc0f6b6b8d5fe9e Author: Ed Maste AuthorDate: 2023-05-17 18:16:06 +0000 Commit: Ed Maste CommitDate: 2023-06-05 14:35:28 +0000 Cirrus-CI: switch to -lite LLVM package for native run This reduces CI cycle time (a small amount). Suggested by: brooks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40136 (cherry picked from commit f326a83c857066754cbc92c59e1904a68af37deb) --- .cirrus.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 1c6bb1d8e5a4..0e3fea9e3776 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -20,27 +20,31 @@ task: env: TARGET: amd64 TARGET_ARCH: amd64 - TOOLCHAIN_PKG: llvm15 + TOOLCHAIN: llvm15 + TOOLCHAIN_PKG: ${TOOLCHAIN}-lite - name: World and kernel arm64 build and boot smoke test only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src' trigger_type: manual env: TARGET: arm64 TARGET_ARCH: aarch64 - TOOLCHAIN_PKG: llvm15 + TOOLCHAIN: llvm15 + TOOLCHAIN_PKG: ${TOOLCHAIN} - name: World and kernel gcc12 amd64 build and boot smoke test (manual) only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src' trigger_type: manual env: TARGET: amd64 TARGET_ARCH: amd64 - TOOLCHAIN_PKG: amd64-gcc12 + TOOLCHAIN: amd64-gcc12 + TOOLCHAIN_PKG: ${TOOLCHAIN} - name: World and kernel gcc12 amd64 build and boot smoke test (FreeBSD repo) only_if: $CIRRUS_REPO_FULL_NAME == 'freebsd/freebsd-src' env: TARGET: amd64 TARGET_ARCH: amd64 - TOOLCHAIN_PKG: amd64-gcc12 + TOOLCHAIN: amd64-gcc12 + TOOLCHAIN_PKG: ${TOOLCHAIN} timeout_in: 120m install_script: - sh .cirrus-ci/pkg-install.sh ${TOOLCHAIN_PKG} @@ -53,9 +57,9 @@ task: - mkdir -p /usr/obj/$(pwd -P) - chown user:user /usr/obj/$(pwd -P) script: - - su user -c "make -j$(sysctl -n hw.ncpu) CROSS_TOOLCHAIN=${TOOLCHAIN_PKG} WITHOUT_TOOLCHAIN=yes buildworld buildkernel" + - su user -c "make -j$(sysctl -n hw.ncpu) CROSS_TOOLCHAIN=${TOOLCHAIN} WITHOUT_TOOLCHAIN=yes buildworld buildkernel" package_script: - - su user -c "make CROSS_TOOLCHAIN=${TOOLCHAIN_PKG} WITHOUT_TOOLCHAIN=yes packages" + - su user -c "make CROSS_TOOLCHAIN=${TOOLCHAIN} WITHOUT_TOOLCHAIN=yes packages" package_check_script: - su user -c "/usr/libexec/flua tools/pkgbase/metalog_reader.lua -c /usr/obj/$(pwd -P)/${TARGET}.${TARGET_ARCH}/worldstage/METALOG" test_script: From nobody Mon Jun 5 16:01:45 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZddk0n8zz4Z6d9; Mon, 5 Jun 2023 16:01:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZddj6tyvz4KGf; Mon, 5 Jun 2023 16:01:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685980906; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qem6yMEgiuX2zO5B/Xo1tONayt9Uh3zZMYTGeA6QmkE=; b=WquUJijE5S1N2vFXz65LIuAAnJ8A+7OuddAZb8c6ayM90aLJU7nY7JtmO0DoRdr7otkF76 nrd8htUrFk61HYyCyl3P8CLCgo+NFPdssv7hD9SrhzVSRPP7fqwmuDO9fBaKl9MIVFqphV zxYBdJp8S6eqPZEdJMqZqoNLIkw6UN1W7QZg2VVYwhAibzmLwpKxJ4CpwCR0622WWs19xK mKZZ9gaPZwBcndqagRKeIf1wup8LV0orjZ/Qf3QvEk2IL8ODYJ7KJFV8ep118N12uHezzj Ruom1cFvCWO+uFwv1d5AUprKrVmwdxLZ8SG4KYj+5O58TuIPnvAj2CM4q6TvUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685980906; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qem6yMEgiuX2zO5B/Xo1tONayt9Uh3zZMYTGeA6QmkE=; b=PoBZE02w3EhYgE/JDjKQrLj1HxjagAFkBrkDbo0EoHDv3ISPk8kVtiIm7tD6EvG/EzbgjT U8KumavanIQIaciBTky4NCAbS8/n1RfmqBIe7SYTp840tem2gmhuldhol33+8hS9KC/Ziv owjWJVM72CQ6uiYRB5CrzLZr6XPEEfU5n0Ob4cvXA+0QSK+mu/D5hjlA2Dnj7ktTMeE2mB PyNdsh8Se61o38WTIPRcbrh4CiurVb5DPq8Jt2Vj6PXCMRZ5pn0NeYrRZ/3AvxHHFkW312 zEpyHrI2xz2X1pH/O+wuQRJBUJa6bvn7KE07nOZqC2rfsz5qdXQKY3u+6FtIUQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685980906; a=rsa-sha256; cv=none; b=Dl3XWiy+CbMWNueYUtMxKoZ6422wfFzZ6JwFt6CiS8NOVpML5VMN6OrHrLplSl0qKRHcZi G5DbE+0uZPBz+RagwqGgYsQx4fdSHTRIiJtj/VD4CQP3pICNyqy3vKxxzEEZdmw6rYbIdI EKkY9WRaTyx4DX6rTaJD3+nt4Br4eOhqQox7GMbzMDH8qLBzkaU7MDisirwkrYSHJQD9hf Dk1LHHFXrlulVmZ5hyuwuEIEPg4nYI3UfwlP7Pn+tZ13KmiYH/o9tV+zH+B1uOyWqv+gVX euE5BpL9K6RogwMcur28qumIqz58/q5jVvFqQSO8zRLoITgyBMMeaOpO5Nh1vA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZddj60j9ztHN; Mon, 5 Jun 2023 16:01:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 355G1j7F065712; Mon, 5 Jun 2023 16:01:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 355G1jsH065711; Mon, 5 Jun 2023 16:01:45 GMT (envelope-from git) Date: Mon, 5 Jun 2023 16:01:45 GMT Message-Id: <202306051601.355G1jsH065711@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 80622a0a440d - stable/13 - Cirrus-CI: move arch and toolchain to beginning of task names List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 80622a0a440da63fc9e816500901788283b70e77 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=80622a0a440da63fc9e816500901788283b70e77 commit 80622a0a440da63fc9e816500901788283b70e77 Author: Ed Maste AuthorDate: 2023-05-26 17:58:04 +0000 Commit: Ed Maste CommitDate: 2023-06-05 14:39:25 +0000 Cirrus-CI: move arch and toolchain to beginning of task names This is the key difference between the tasks, so make it the most prominent. Sponsored by: The FreeBSD Foundation (cherry picked from commit 98c5211847afbfef54cf7446a4a94a6aad6a31bd) --- .cirrus.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 0e3fea9e3776..6b588d05e551 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -16,13 +16,13 @@ env: task: matrix: - - name: World and kernel amd64 build and boot smoke test + - name: amd64-llvm15 World and kernel build and boot smoke test env: TARGET: amd64 TARGET_ARCH: amd64 TOOLCHAIN: llvm15 TOOLCHAIN_PKG: ${TOOLCHAIN}-lite - - name: World and kernel arm64 build and boot smoke test + - name: arm64-llvm15 World and kernel build and boot smoke test only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src' trigger_type: manual env: @@ -30,7 +30,7 @@ task: TARGET_ARCH: aarch64 TOOLCHAIN: llvm15 TOOLCHAIN_PKG: ${TOOLCHAIN} - - name: World and kernel gcc12 amd64 build and boot smoke test (manual) + - name: amd64-gcc12 World and kernel build and boot smoke test (manual) only_if: $CIRRUS_REPO_FULL_NAME != 'freebsd/freebsd-src' trigger_type: manual env: @@ -38,7 +38,7 @@ task: TARGET_ARCH: amd64 TOOLCHAIN: amd64-gcc12 TOOLCHAIN_PKG: ${TOOLCHAIN} - - name: World and kernel gcc12 amd64 build and boot smoke test (FreeBSD repo) + - name: amd64-gcc12 World and kernel build and boot smoke test (FreeBSD repo) only_if: $CIRRUS_REPO_FULL_NAME == 'freebsd/freebsd-src' env: TARGET: amd64 From nobody Mon Jun 5 16:03:31 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZdgl4vtqz4Z6yn; Mon, 5 Jun 2023 16:03:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZdgl4RjPz4LDC; Mon, 5 Jun 2023 16:03:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685981011; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+LW3CqbVshYpLDzP7HOjo41gkEVaoUwUiYuoVOxGOHs=; b=hfpRfJbMzc3pQNc1FVCe5zrDsnGa+PW5XUHHDH6sKVUr22Kx7AfO+7xGvrvrSwxiE+jjZR Qk4rJDrAxh893HVyuoiygfBhwixKxvq2Jl0paaka8BiCP+fPTx0zlTLrN+VK7OyrFaLors Z7kUT5m2bdLcYURWBTQEs/+ovbpUkmGDedlInwsz8rOREzCJIUZh83Qm/r21DHZkVxsZqX n85DzeW+JGvC+AjWJE4WiqRljc0AKq/fv8svLTLdc55mhs+QWMYMaIp0ye3X0CGk0tA13K f4fZuW7dYCYhIJc1bwVJKkmR9T2J2UkG+/HBwaKpvHcI4TQi7TRbl/0xPgQP7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685981011; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+LW3CqbVshYpLDzP7HOjo41gkEVaoUwUiYuoVOxGOHs=; b=dvDnEzDrLECyTU1T2aHv8WZ1ZXzDgV/JJydh2HRAkajM+Z5iz2qepz9DQcX9wMofaJrXcq Xb+3tmkfSGA3QmMyZmtFJy53zrftzKmZsML7CnR30jVs3a0X81hTM7VPW83istxtxfKHxJ aTmJ9+eRLO4wuN9FKhORjUPyS/hOChRIsV03BK/d3OgkfbSl/x7rwOvpSrirrp0a1AU2zD /XbV+PfMr6hSEUlYJR7ykQdZtbw+mPtxcJ2XU1ZC0Yggow8zQGhw63sHqqqvHUJ8jxM+cl zY0vVSqVdc9jneWTHV5Pvlu+WR1xr/e3DjrR0ZYo6zxEbnpzM4gOc2sn5m3Wng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685981011; a=rsa-sha256; cv=none; b=hRN0fErgaBg1EoU0dQsCX22/TrWIfaKkaT1HratCPmcsSMi5l7oUvLwy3Qz8sC8ZjPYw3J lg+tB/5q9lFyEJ+sdK7p7aG3ao+T7ZOCmedGAYczP0KvzRjk6Kv3977RCQq/x8yGcPg94z oc6/KhPpMxV+vrmk1fl+BB+9Su+nEs5SF8vEjMNCyLRa+CI53k3ub0Lth7XFnHPfZtYfPc NAT+SFsEzmUAwJSkq4b0dBm6sHW8CfbvjRlfv66s5axKtxkRiyfCj2KRT6bnVit+Uq0QJi P5wrNuN7vozJedaW/dXm9yPpUSCkXYzc7YLQ9UY06cHoTBMu5p2xxzsHKhADIw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZdgl3W4HztSZ; Mon, 5 Jun 2023 16:03:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 355G3Vsk067057; Mon, 5 Jun 2023 16:03:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 355G3VIQ067056; Mon, 5 Jun 2023 16:03:31 GMT (envelope-from git) Date: Mon, 5 Jun 2023 16:03:31 GMT Message-Id: <202306051603.355G3VIQ067056@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 2b4fb1350cee - stable/12 - openssh: include destination constraints for smartcard keys List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 2b4fb1350ceea0f2a0f04b1b8f5bfd3c32329ae4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=2b4fb1350ceea0f2a0f04b1b8f5bfd3c32329ae4 commit 2b4fb1350ceea0f2a0f04b1b8f5bfd3c32329ae4 Author: Ed Maste AuthorDate: 2023-06-05 14:49:53 +0000 Commit: Ed Maste CommitDate: 2023-06-05 14:56:23 +0000 openssh: include destination constraints for smartcard keys From openssh-portable 54ac4ab2b53ce9fcb66b8250dee91c070e4167ed, OpenBSD-Commit-ID: add879fac6903a1cb1d1e42c4309e5359c3d870f PR: 271839 Sponsored by: The FreeBSD Foundation --- crypto/openssh/authfd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/openssh/authfd.c b/crypto/openssh/authfd.c index b633e35eaf8b..b9ae505ad7b2 100644 --- a/crypto/openssh/authfd.c +++ b/crypto/openssh/authfd.c @@ -666,7 +666,7 @@ ssh_update_card(int sock, int add, const char *reader_id, const char *pin, struct dest_constraint **dest_constraints, size_t ndest_constraints) { struct sshbuf *msg; - int r, constrained = (life || confirm); + int r, constrained = (life || confirm || dest_constraints); u_char type; if (add) { From nobody Mon Jun 5 16:11:53 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZdsP3nnrz4Z7gX; Mon, 5 Jun 2023 16:11:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZdsP3Mxtz4Mdd; Mon, 5 Jun 2023 16:11:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685981513; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uyFMxcg3TuyT9371TkyBpBq5nVXl2N7yGUwcpUb5ObQ=; b=o1UsIXPhWIjj1AHiA+6BZbNDhG+mj2MwnSWxLUzFOLyhGJj989VbE1gp7zKx46vzL/IjcU pLPEgAVJVwYgheKp/su2BVJrDBqn52l81fm49glGf7hL9WcvmO+Nt7SNMy/k2s4dKblA0B 7WqVHK4aJ7xmRHNue/aNCIql/qb6GfU5XX3bo6aBLfj3CBsPE5dTCe7HFYPCB0sZ4JDK/2 VSfk929cImKN7hpRwPMF5I21iPli/IOXC+rm3YXibAhlpzubUXNumTYqfUg2AyDPr3abNA JtBa4qDkiu/IKIpNsQPU1hygD67WZIPf/S6E+g7geF7NLRDJBJFyBzBYH0e6zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685981513; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uyFMxcg3TuyT9371TkyBpBq5nVXl2N7yGUwcpUb5ObQ=; b=LyyPfbtf4PFe3z95B9cyab7u+QtG+iCk8efNDnmTTrXBRzVfmrt3tash5JSqxtAmpaxiGZ 4mQ9Bf0bl0V7pH+1GWccVv/BXJJntRnXKn0VWuhTg9SOHYeMLeYC/zRPcqTH7UC81o8tN5 zKfc1jnij+dmllNM9au8Dx0A8CgqzPwpxHg/0G+VB+aVG0trg2zEdtCYBGqJLHjuAYCbF0 1Z1ds5DJbgOiRmibfrc/bK46CKzyoLmDpW+4SNi50ERXDjrwNNzfSfoEyzHrvLRp93fkQt joMtnyayqOos38wCn87utS4d3mhhc/Wd0O1aH2XlRocJK8WleivaQ2VdLM9oDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685981513; a=rsa-sha256; cv=none; b=IcA3Kp8TqbO1OfJ/pp20npB/oFeIlTQdd8+6+VYsBTcZHKwGGtPidrt/0GrTHovn2K6kbY zUmEa8rwl60H16Zka4d8RWwH1IRQA2qTOCJbnqo07VC15WDtG7nxA0vr7T5BbFdASsQn8z PmOqqZA4uCOlbEhGFWB3fkAh9tfYmOMldnOtNeFyQRgBj7Z/cfn6PWoeobC6PbkhDQvyiO b2rb/JqoDN7jRP/URRssbJM9248LgRt7fBFRCAyXjMqFt15+up9zWCVF5nJrNubrufj9va h2HY8vEgPSDtZOIkk4sB/QlIVJtFPtF0Cxc/yyfitX338OFU8Ds5oKqn2xSvQQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZdsP2QwQztlL; Mon, 5 Jun 2023 16:11:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 355GBrht081927; Mon, 5 Jun 2023 16:11:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 355GBrxY081926; Mon, 5 Jun 2023 16:11:53 GMT (envelope-from git) Date: Mon, 5 Jun 2023 16:11:53 GMT Message-Id: <202306051611.355GBrxY081926@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Dag-Erling=20Sm=C3=B8rgrav?= Subject: git: 6d777389e19d - main - xargs: Fix typo in error message. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6d777389e19d3bebde515e88e8405de45d8af7bd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=6d777389e19d3bebde515e88e8405de45d8af7bd commit 6d777389e19d3bebde515e88e8405de45d8af7bd Author: Dag-Erling Smørgrav AuthorDate: 2023-06-05 16:10:53 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-06-05 16:11:44 +0000 xargs: Fix typo in error message. MFC after: 1 week Sponsored by: Klara, Inc. --- usr.bin/xargs/xargs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/xargs/xargs.c b/usr.bin/xargs/xargs.c index cadb0c76cc2f..eb496d8e09fe 100644 --- a/usr.bin/xargs/xargs.c +++ b/usr.bin/xargs/xargs.c @@ -526,7 +526,7 @@ prerun(int argc, char *argv[]) *tmp = *avj++; if (repls && strstr(*tmp, replstr) != NULL) { if (strnsubst(tmp++, replstr, inpline, (size_t)Sflag)) { - warnx("comamnd line cannot be assembled, too long"); + warnx("command line cannot be assembled, too long"); xexit(*argv, 1); } if (repls > 0) From nobody Mon Jun 5 16:20:44 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZf3w1qXzz4ZQKl; Mon, 5 Jun 2023 16:21:00 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZf3v2Q5yz4P3w; Mon, 5 Jun 2023 16:20:59 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.208.174 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com; dmarc=none Received: by mail-lj1-f174.google.com with SMTP id 38308e7fff4ca-2b1b2ca09b9so39918561fa.1; Mon, 05 Jun 2023 09:20:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685982057; x=1688574057; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/69EUyEBLt1NSmB16dGQ4Btl2qdg3VFOlDvv6/eJjAA=; b=c7UYfJZy6GAe9i52o6oNV9lLWm4sFN9jwy3IZfZm28M2LMmPWFMIsp4WAKLIv2MucM M3gX4107KnoRi1xd1pZmN11T66O0tnoA9kfc2kLXyVK7sZsi+BbtszCBjjObUa7Dy8zn SSTe1TAp4qwpj0C5r+IqhnhOmXl4BAe+tCJLgpJWM//vr5RbM6j1zi+aDphKC5upKSM7 6/wa2EnFS4U70gRgaMmtM5d7qv4oJ1rbvdFKCL26hcIoALCTNPFN/npr5kyFb0Zp9fE3 QBhk3yHfB6zpwg/CIcF1vn0OB8OAYcaab9vPu0AzX/2vSJJQYMd0npMo7hZSgwz0HU+f Enfw== X-Gm-Message-State: AC+VfDzNwRzv7fv0bgPO/T1TnW47bJC+gMYRdS9Qc2UAifmagwaXyOFD AN+acwAeU1zJ/JVhhMUYGbkhQFgDfmmqt28LNyHVdBMf X-Google-Smtp-Source: ACHHUZ5MCMZJnFbzuSATGDJlwJPdr4NSKtApPSXtpQgR+CiAihGLBL4PVPQmcKH5nRFKa4Cp6+kkTsFL5l9QsopsX1A= X-Received: by 2002:a2e:94cd:0:b0:2b1:a343:266f with SMTP id r13-20020a2e94cd000000b002b1a343266fmr5462126ljh.12.1685982056053; Mon, 05 Jun 2023 09:20:56 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202305301229.34UCTOoL051426@gitrepo.freebsd.org> In-Reply-To: <202305301229.34UCTOoL051426@gitrepo.freebsd.org> From: Ed Maste Date: Mon, 5 Jun 2023 12:20:44 -0400 Message-ID: Subject: Re: git: 4bf98559d9d6 - main - pf: make contents of struct pfsync_state configurable To: Kristof Provost Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Spamd-Result: default: False [-1.00 / 15.00]; NEURAL_HAM_SHORT(-0.96)[-0.958]; NEURAL_HAM_MEDIUM(-0.63)[-0.633]; NEURAL_SPAM_LONG(0.59)[0.589]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; MIME_GOOD(-0.10)[text/plain]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.208.174:from]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_IN_DNSWL_NONE(0.00)[209.85.208.174:from]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; FREEFALL_USER(0.00)[carpeddiem]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; RCPT_COUNT_THREE(0.00)[4]; RCVD_TLS_LAST(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DMARC_NA(0.00)[freebsd.org]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Queue-Id: 4QZf3v2Q5yz4P3w X-Spamd-Bar: - X-ThisMailContainsUnwantedMimeParts: N On Tue, 30 May 2023 at 08:29, Kristof Provost wrote: > > The branch main has been updated by kp: > > URL: https://cgit.FreeBSD.org/src/commit/?id=4bf98559d9d6fa7c3571d26ed6f2b18823e3a30b > > commit 4bf98559d9d6fa7c3571d26ed6f2b18823e3a30b > Author: Kajetan Staszkiewicz > AuthorDate: 2023-05-29 13:47:23 +0000 > Commit: Kristof Provost > CommitDate: 2023-05-30 12:28:56 +0000 > > pf: make contents of struct pfsync_state configurable > > ... > contrib/tcpdump/print-pfsync.c | 98 +++++---- Is this change also submitted upstream as a pull request? From nobody Mon Jun 5 16:22:32 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZf5j0MrSz4ZQtT; Mon, 5 Jun 2023 16:22:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZf5h6jj5z4PGl; Mon, 5 Jun 2023 16:22:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685982152; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r/VIe/sOmcy3SSrwwbaGzYOhfzWRvsZKVp4gamkF9kE=; b=Oc3fs6txO4L9PoPqhoYqtvWkMSCM4iIQsCSw8DygUQZYiap1mnMAZ+X1g+GukSWugkbo3V +KO7+Mvzobn/Hij9Qdxk5neFB7EFJP37j9CzQdwAIXqwcgHkFeSzIKT6b5SDXTeDkDrWQA m55MugSvvec2DmyzE6xXexgtle0LnrNEfO4DAvwXewRdRLmul2MdhOsKWszWfV6KP+Le/s 8RJTfj/sLr0SBmiebPBl/5eMEbY0qhtlDC0j1Ej3BTpSRq41MCr5hXU0H0jTLFbgtpmiyp tciVOtkS1djfXguJTQaS04umMXjDQoTPzx1K04BM6nXTyURil7/9p8cJIx7rdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685982152; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r/VIe/sOmcy3SSrwwbaGzYOhfzWRvsZKVp4gamkF9kE=; b=YuBjHcxwkjKPeRcmP/KOQa+iz/UaTLcNrPnAaAiVs72FNlok720PvzeXj34f1L3f0yrB2d xUl8YkU0ho/XczxFEg1HwInWyKH6BjTxNTg8Xery3AGe8rhmCAZDvEBd/rYWJfu70uvKfz cR2auMa5Kvt2HrT7kka2d6/mzgS7Vt4d2LmCJ0mShsUzQEWrZiah0Qu58zaeU8P1nTipzx C/Yc13BdbV4Mg/Vs6u7LKxwlIzj3ZurwAT3ngVAuseaUFB9or15rC+rGHQiS+zriBpD17P ll0mtu0PV3fC95e3kgsR+pRgs9uQquZR/+tzhn33/kLmDszQg1tpXTlrpkU6pg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685982152; a=rsa-sha256; cv=none; b=LACfT90vYu1wqP5AAQYGAzwPKmMMKG77LloTGCDygrgfJrz6SC/CQCmPUZD3LUVsynANGl 4CAiuzifSoInJjYVJ4bl46GBUFTDgZ/2u/VyAXh6lwF3xS6SWYxVX8f6z28J9srfiJPV4q Hzc57xkKpKlgvizvI8dH0b02SV8ejcA12sqkzTgQxEGqPaijqMLtEpAFoLrJt3aSHVLrt+ rWcMyH/FMf5i2v8GXwy8gBraRW1/ia26yUPFShf/pGTLr62nbLVeFj1xBA5bPJMslt5NlO D1Z7+5sgsUZIjIPAcXDPl8/xF2b0ym5GEix6+5lfYTOWPXEm62Zk0PvJsoRCKg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZf5h5nLbzvJ1; Mon, 5 Jun 2023 16:22:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 355GMWeB000110; Mon, 5 Jun 2023 16:22:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 355GMW7J000109; Mon, 5 Jun 2023 16:22:32 GMT (envelope-from git) Date: Mon, 5 Jun 2023 16:22:32 GMT Message-Id: <202306051622.355GMW7J000109@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: 6062d9faf23f - main - vm_phys: Change the return type of vm_phys_unfree_page() to bool List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6062d9faf23f11e0655f3a222c204725e3111fe8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=6062d9faf23f11e0655f3a222c204725e3111fe8 commit 6062d9faf23f11e0655f3a222c204725e3111fe8 Author: Mark Johnston AuthorDate: 2023-06-05 14:40:15 +0000 Commit: Mark Johnston CommitDate: 2023-06-05 16:22:11 +0000 vm_phys: Change the return type of vm_phys_unfree_page() to bool This is in keeping with the trend of removing uses of boolean_t, and the sole caller was implicitly converting it to a "bool". No functional change intended. Reviewed by: dougm, alc, imp, kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D40401 --- sys/vm/vm_page.c | 8 ++++---- sys/vm/vm_phys.c | 14 +++++++------- sys/vm/vm_phys.h | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 4b967a94aa1f..5d822d34ed7c 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -327,7 +327,7 @@ vm_page_blacklist_add(vm_paddr_t pa, bool verbose) { struct vm_domain *vmd; vm_page_t m; - int ret; + bool found; m = vm_phys_paddr_to_vm_page(pa); if (m == NULL) @@ -335,15 +335,15 @@ vm_page_blacklist_add(vm_paddr_t pa, bool verbose) vmd = vm_pagequeue_domain(m); vm_domain_free_lock(vmd); - ret = vm_phys_unfree_page(m); + found = vm_phys_unfree_page(m); vm_domain_free_unlock(vmd); - if (ret != 0) { + if (found) { vm_domain_freecnt_inc(vmd, -1); TAILQ_INSERT_TAIL(&blacklist_head, m, listq); if (verbose) printf("Skipping page with pa 0x%jx\n", (uintmax_t)pa); } - return (ret); + return (found); } /* diff --git a/sys/vm/vm_phys.c b/sys/vm/vm_phys.c index 42875d12ba81..8db6529b8c80 100644 --- a/sys/vm/vm_phys.c +++ b/sys/vm/vm_phys.c @@ -1291,12 +1291,12 @@ vm_phys_scan_contig(int domain, u_long npages, vm_paddr_t low, vm_paddr_t high, /* * Search for the given physical page "m" in the free lists. If the search - * succeeds, remove "m" from the free lists and return TRUE. Otherwise, return - * FALSE, indicating that "m" is not in the free lists. + * succeeds, remove "m" from the free lists and return true. Otherwise, return + * false, indicating that "m" is not in the free lists. * * The free page queues must be locked. */ -boolean_t +bool vm_phys_unfree_page(vm_page_t m) { struct vm_freelist *fl; @@ -1319,12 +1319,12 @@ vm_phys_unfree_page(vm_page_t m) if (pa >= seg->start) m_set = &seg->first_page[atop(pa - seg->start)]; else - return (FALSE); + return (false); } if (m_set->order < order) - return (FALSE); + return (false); if (m_set->order == VM_NFREEORDER) - return (FALSE); + return (false); KASSERT(m_set->order < VM_NFREEORDER, ("vm_phys_unfree_page: page %p has unexpected order %d", m_set, m_set->order)); @@ -1350,7 +1350,7 @@ vm_phys_unfree_page(vm_page_t m) vm_freelist_add(fl, m_tmp, order, 0); } KASSERT(m_set == m, ("vm_phys_unfree_page: fatal inconsistency")); - return (TRUE); + return (true); } /* diff --git a/sys/vm/vm_phys.h b/sys/vm/vm_phys.h index c1f6514e92e4..a294bbaad80a 100644 --- a/sys/vm/vm_phys.h +++ b/sys/vm/vm_phys.h @@ -79,7 +79,7 @@ void vm_phys_register_domains(int ndomains, struct mem_affinity *affinity, int *locality); vm_page_t vm_phys_scan_contig(int domain, u_long npages, vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary, int options); -boolean_t vm_phys_unfree_page(vm_page_t m); +bool vm_phys_unfree_page(vm_page_t m); int vm_phys_mem_affinity(int f, int t); void vm_phys_early_add_seg(vm_paddr_t start, vm_paddr_t end); vm_paddr_t vm_phys_early_alloc(int domain, size_t alloc_size); From nobody Mon Jun 5 16:34:55 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZfN26hKzz4ZSs4; Mon, 5 Jun 2023 16:34:58 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZfN26C5Xz3CwK; Mon, 5 Jun 2023 16:34:58 +0000 (UTC) (envelope-from kp@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685982898; 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=W8VvFevAwbWTPCbTOW1HOAGIHxIRf6GK3XgZ76spd1c=; b=g6Duyk2GdQs6SR24MznhmpFsmqkeb6QfeEmlrGX3gNTG1NyOM1kJNZAUUX6KppJyfBbm9T o168ZKvIuiEXn14gFHZpxHvGwzU77w+xglFUXaFAdMPJQ6bERqrG31g81bczrudHTWLyDj N52sPPspbCaW2pBx2/HmX/AzgCWW0yJWXMMQXKADzVVgGYzPyYImJxIQQnekL1a9JsI2Ch mEju2T6ECgbJhCZ1GA1hiUbh26GZEwcqvFAUn//jqtKdUioDnBvaVVsLH914Ifhr9wtA2K jgYp2W9xsI8scthleY1zOhtlxnYLcIoGngxzIv09Q069knCl3FU860w6CGxf5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685982898; 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=W8VvFevAwbWTPCbTOW1HOAGIHxIRf6GK3XgZ76spd1c=; b=VUjasFeie/EQbePrHmxhOSCrZAmvCdf8rNdLb0HNmIGZmXNAZGDY3u5kL4D9SDrilgBBVp mwClOfH4prR2J55IcJUKziJRRx6hRQFwWNjSBlHaZS20jQOAAbhLTk9RzQ4wK53OjIMkys qWXu3idtXOjV7RQwc5nlxHSOhA8oYj7YjlUasL3EiOA4SnuIGQtXwtpzePC3E2TQgfEuCP vP7GHxDByAvUJ98zI+F1uN92KZM+1IuOdPGAXKr6/xKweAoN4RVWw45M7REFHfxT12xUK+ yQk5yvgpmePZmbBXhCgHManMk3/5hu4qzQg5bBWKaCs3cfwO1qwR9SAeNvEhiQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685982898; a=rsa-sha256; cv=none; b=nJfEj4viTX2hU8pAyC2sNb97HGtj6+WK/L1sdA9EEcWvM45Df691ObhrppWUt6VoWRXWt9 H+xVvT2jjRwQIeU/LcnfUtTW3e9kZCtAzPuEPm+aRccFhLJ+OMQeAUueFPQM7EZ9HrySpI gziFMkXsSW2WVUxrVwUDNyGYblhwBijjeIp/l3GRAXx+Ko+gfI5qDfCeFiEN+rb6BvbHj9 K8KAZOWNchFL9Gb2XArWv9I9f1vQS5jrtuHUzrk6UANx+CBnN01vBQ1Xc0do3jqvT38EHd ZHish5PU/ZhmObHfVE0kuqudCzW28AGodGdM/GFE6zbIhKn1xNY7wAWHzOUeXA== 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 "R3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 4QZfN24YTQzLgZ; Mon, 5 Jun 2023 16:34:58 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id 68122E69E; Mon, 5 Jun 2023 18:34:56 +0200 (CEST) From: Kristof Provost To: Ed Maste Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 4bf98559d9d6 - main - pf: make contents of struct pfsync_state configurable Date: Mon, 05 Jun 2023 18:34:55 +0200 X-Mailer: MailMate (1.14r5937) Message-ID: <8C35F23C-BEC9-4CFD-B277-CB855EFCD2AF@FreeBSD.org> In-Reply-To: References: <202305301229.34UCTOoL051426@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-ThisMailContainsUnwantedMimeParts: N On 5 Jun 2023, at 18:20, Ed Maste wrote: > On Tue, 30 May 2023 at 08:29, Kristof Provost wrote: >> >> The branch main has been updated by kp: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=3D4bf98559d9d6fa7c3571d26= ed6f2b18823e3a30b >> >> commit 4bf98559d9d6fa7c3571d26ed6f2b18823e3a30b >> Author: Kajetan Staszkiewicz >> AuthorDate: 2023-05-29 13:47:23 +0000 >> Commit: Kristof Provost >> CommitDate: 2023-05-30 12:28:56 +0000 >> >> pf: make contents of struct pfsync_state configurable >> >> ... >> contrib/tcpdump/print-pfsync.c | 98 +++++---- > > Is this change also submitted upstream as a pull request? It=E2=80=99s not, no. I haven=E2=80=99t looked at what is and isn=E2=80=99t in upstream. My im= pression from jrm=E2=80=99s mails about updating is that there=E2=80=99s = a fair number of local changes around there already. For additional fun this change is very much FreeBSD-pf specific, so I=E2=80= =99m not sure how/if upstream wants to handle that. Best regards, Kristof From nobody Mon Jun 5 17:49:16 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZh1m6dTtz4Zhr0; Mon, 5 Jun 2023 17:49:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZh1m67ctz3h5b; Mon, 5 Jun 2023 17:49:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685987356; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EiUYFI7+FYqIoARXXUOeS3vPEyY2wzMt8ypLqRmEgYw=; b=kO6LeIGgU8JAdSOrGK6f+INaaR2LnEjwGbMLypdzL0u4HizWRPstBLRcqb+gfsVpirlEzT gwJ7MxeRHpyQE8dnyGqk9JIoBT00lLWpXbfQQ8Svk16oytRdw5mV838RSYsf35q/LvR4LV 6hH1JEVZVkEvmQ+WmDPRh4IllJSMSkflPHI6WMo45LEZ3SDAkfDIc7PAVqVMKDeYIvJ7dv VSyoeIl2yINhaxrYwujXbcLRB/T/yYoZdJZW2hZMVA5nUT2uSIZ96/kBUyELfsY6kNn1CK ZczurWwCuELpJvY1mfdlPeiLUcmSCiHhpwHzCKl8vsvqJKEKPJawI1WDqnUniw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685987356; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EiUYFI7+FYqIoARXXUOeS3vPEyY2wzMt8ypLqRmEgYw=; b=MaNrRBrctlXGqc5o20zAqlGSetMgijlALkFCrNf3DlhBXiBtr6WwEmhbs0IBinFUzMWgEh OQ2S9/sMSY6xq62FnGu2Cd+I0lGcfs8X2/MtcMQdLlkv18/A9SJC2OcuR3cghI7OT8UkxE IzVTddGCrRO+u5BLs5Bz8+BSS87exERMbokpjNMdGrJOtFMM4m8JAG09F8YU3QqV5No4yu TJQhEI5besV9BP2JKKqkJO//tvIo5ZQnpoCTEW8iUxkVfqbzia+lndlXTz/CzSIZfWJ3mB LaDsmen4eV4Jr9Xh3tgcyh+JfNjGIR6IEM6SKGldcJGKspd0jGMrVDXPy6OBvA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685987356; a=rsa-sha256; cv=none; b=WGQmfc4E8bbFZenbHxenwc03XZRFQ1StzPenzEXYtPq6FIN9xf6hVWtghMs7A2YFqoLfKP /747yHA6mVliFkD/wG5qMPqTqcPjR8eZT7Cr3QUSyBtOSPksPPtjVofhZg+HsDvzRI7q2t zsnucH7t09kAbgjC2CgKMDsWigucjWXnag6oNAT1Ui9sDiL102Vyaq8nCg5QZmYKOtkwof TSHwSIVApPSm8Y4VgSg5AZ+ZxnXRfi9any+vB+j7Mk6Y/JEwLMNyY4Cm1ovSsPUB2wbYqe GiCuNqzLxg8A0I9XpF4rEtvZ2GELEeGjV6zGyyU4Hyyyp6omBJAETDU4h02nLg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZh1m5Bqnzx28; Mon, 5 Jun 2023 17:49:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 355HnG3j033491; Mon, 5 Jun 2023 17:49:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 355HnGmg033490; Mon, 5 Jun 2023 17:49:16 GMT (envelope-from git) Date: Mon, 5 Jun 2023 17:49:16 GMT Message-Id: <202306051749.355HnGmg033490@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: e730066a64e6 - main - decryptcore: Request the OpenSSL 1.1 API List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e730066a64e60b3ba39b7143aa40b5ba1e9c3949 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=e730066a64e60b3ba39b7143aa40b5ba1e9c3949 commit e730066a64e60b3ba39b7143aa40b5ba1e9c3949 Author: Pierre Pronchery AuthorDate: 2023-06-01 19:07:23 +0000 Commit: Ed Maste CommitDate: 2023-06-05 17:48:05 +0000 decryptcore: Request the OpenSSL 1.1 API OPENSSL_API_COMPAT can be used to specify the OpenSSL API version in use for the purpose of hiding deprecated interfaces and enabling the appropriate deprecation notices. This change is a NFC while we're still using OpenSSL 1.1.1 but will avoid deprecation warnings upon the switch to OpenSSL 3.0. A future update may migrate to use the OpenSSL 3.0 APIs. PR: 271615 Reviewed by: emaste Sponsored by: The FreeBSD Foundation --- sbin/decryptcore/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/sbin/decryptcore/Makefile b/sbin/decryptcore/Makefile index 3a3a6a029f87..afaa0311ae50 100644 --- a/sbin/decryptcore/Makefile +++ b/sbin/decryptcore/Makefile @@ -2,6 +2,7 @@ PROG= decryptcore +CFLAGS+=-DOPENSSL_API_COMPAT=0x10100000L LIBADD= crypto pjdlog MAN= decryptcore.8 From nobody Mon Jun 5 18:11:20 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZhWD3s1jz4ZmZR; Mon, 5 Jun 2023 18:11:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZhWD3Kmsz3lN9; Mon, 5 Jun 2023 18:11:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685988680; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PdlMYyyWYOQxk33oMmYu9a7mxBrgHVw7CAhKettJlTo=; b=S/DsaNXSZt/Pfue9Del47Iir2WJqNFpU+4iREISKr6dzVrTqST5B2fwg33u4g1qnF9iUN7 ljiCi2MXrKOCF2eR/LNHHWihXBtj8VhWQ3EqibfALxtSgoogWar8JKlUecOI0GybYxieou oJs7DuYIfhPp7U/k5In34DqsGasmhHgAXCEsJx6wXLvlqohkDq3CtvhsO95BOnXs2h+o25 5qdipF9OuJOWIYBhNxRCaHOJOcdglrUKc/ATM+WvQh0ikqc4pQQFnjhaxb6hJs40JZUjYI tRVrc8ffQZ6qgmSlXIJCNgYYeB1+lOJuPrif926s9VTbAKQ2iRcHoneH9HrOXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685988680; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PdlMYyyWYOQxk33oMmYu9a7mxBrgHVw7CAhKettJlTo=; b=rioms5+K37pgWglyiGxgQ94Llyn2sB3OjuVOl93Q3qVOmXSYl4PixSGYxEA9x8dQWSeaJ5 OUcXMWHDWqlYwXwllNyBvdJ2DobIGJKvFEXL3CDLe1pc7xfvE9yhQSToOpgkMhPXBoT6vx Lav6vYrsRWeH5YlLd5AQpmq1fkQHGkkc5jIuwBtB31XSxhWuSvRIuRVkruF3Eme61faXh4 I6OHaBwYFGzMxq+NQBLKJDdM/XwXA5gB9yHguEI4Ut94mxKAwkb2Y4gu2RdLvwqBsd5VIY B17Lcabanr/7inObhuhGKwUm7IehoK8G4OTq+Vu9GhltSUFg7kNCDSNkl/CiBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685988680; a=rsa-sha256; cv=none; b=sJD9phZa1qFr1V9LaoDNwbi4tC8KW6GG29691jS9U2Iw9OujFwIBqrO+HFe6kCzQLT7YsC hd5660J6QNEfYkdpiTQhKsGtRU19gxOxJZWfxauLaizLSnsklLGS3cYFochcKEXBdFqyBK I2Yn76KsHZRMKQ8BcEZcEX24XcZbgb3BYHWZR7vuHkVXYAzYceKScEl3U+sEM863RoUW4M 1ZIbTuO8rwIVNuE0AW2sXPRWXUXTYXMBqduWPxxebQ0SEsmYYiX8/TZg6EJM+z1NGOfGxf rpoXjd4TVDRTkRjg4MXCd9R/j6YArcZemJCmm9LbTDWbxSMsVN/ZvcTS2VLd+w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZhWD2Ql2zxwW; Mon, 5 Jun 2023 18:11:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 355IBKHf081540; Mon, 5 Jun 2023 18:11:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 355IBK7U081539; Mon, 5 Jun 2023 18:11:20 GMT (envelope-from git) Date: Mon, 5 Jun 2023 18:11:20 GMT Message-Id: <202306051811.355IBK7U081539@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 792d3f16868e - stable/13 - ssh: fix leak and apply style(9) to hostname canonicalization List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 792d3f16868e5f79ab8b11803340251371515f0a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=792d3f16868e5f79ab8b11803340251371515f0a commit 792d3f16868e5f79ab8b11803340251371515f0a Author: Ed Maste AuthorDate: 2023-02-08 13:16:53 +0000 Commit: Ed Maste CommitDate: 2023-06-05 16:03:51 +0000 ssh: fix leak and apply style(9) to hostname canonicalization Fixes: bf2e2524a2ce ("ssh: canonicize the host name before...") Fixes: 3e74849a1ee2 ("ssh: canonicize the host name before...") Reviewed by: rew Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D38441 (cherry picked from commit 19aba210e1a1b5999bff10cccab5a277060c4d46) --- crypto/openssh/ssh.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crypto/openssh/ssh.c b/crypto/openssh/ssh.c index 268781518b8c..883406f7b8f9 100644 --- a/crypto/openssh/ssh.c +++ b/crypto/openssh/ssh.c @@ -1396,18 +1396,21 @@ main(int ac, char **av) cinfo->locuser = xstrdup(pw->pw_name); /* Find canonic host name. */ - if (strchr(host, '.') == 0) { + if (strchr(host, '.') == NULL) { struct addrinfo hints; struct addrinfo *ai = NULL; int errgai; + memset(&hints, 0, sizeof(hints)); hints.ai_family = options.address_family; hints.ai_flags = AI_CANONNAME; hints.ai_socktype = SOCK_STREAM; errgai = getaddrinfo(host, NULL, &hints, &ai); if (errgai == 0) { - if (ai->ai_canonname != NULL) + if (ai->ai_canonname != NULL) { + free(host); host = xstrdup(ai->ai_canonname); + } freeaddrinfo(ai); } } From nobody Mon Jun 5 18:51:23 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZjPS6y9zz4Ztx9; Mon, 5 Jun 2023 18:51:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZjPS03nbz3s6Y; Mon, 5 Jun 2023 18:51:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685991084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xfcrzt4vTDMYyS5wU5xTemGkbRkxlmAkb9QKI+D/gOg=; b=ua1OeRsMJlZX/bIpukjJaAWDAWYbpurDiAnfmOFqUc7SFdM8YyEIWwmz10fFR/83TMVANX n8OuVcHQq+odwut0Aaf80HB15uq5NT6ya3egdGGtHY8pt8uIT+0wHtBiquP0/2xAbTQ1c4 DyLeUiWclzjS5Mt3I2LLbIoSzfm3BoLM0DYNl+xhY/VQ8/gujhS2fxOA8xxh7hUelRXyKh g0BHA/reP0srPdlyQajvIomo8WpurZPLzXyf2jqqa5psD8dEoBXDmykxcWbCH3uV4VzEtZ mTgll75wwkcMcR2Sg3RMYVvX/obNNXRbF7XUWIxk7GhLfFr7oAQKjWy6+2Uk6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685991084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xfcrzt4vTDMYyS5wU5xTemGkbRkxlmAkb9QKI+D/gOg=; b=pThF2TkHBQDCjlQ0qAEbLxSFYBC3OkUulY1SluEnlHR0Canzg5V5enNgwLBOVxjDv9R4f2 8iaW2oHXImRM1od/41xU31ahD0Am23NugLL11kfnAUvrXavMkMsVRy5S9bZX1VKchzQ+IC 8di1OEoREJmfnGrkThwLxILmJ26iFN34zvOXyFz00V2l8tJC3CKgf10Z9rHZB5r5uTwT1J L3aUydcxm/uc0trMDhyiQD1GdLTINgO2T9MF/QccJjhVyAtBTS1E5yJKg1FbX77SR78VO4 F9ynMxW3o1LEDS4bOiDsDjR/lrTsLKCoo7gQ1FgDy0uHNszakCUmpe/Yn+UjfQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685991084; a=rsa-sha256; cv=none; b=HQLS48b8lBw/LbbCOdUYldNzXPTKR54pySqrf7tXEHIrQAmkbfxOmRPmblMlD7iI2LeIkb 05watJGjPU30p1hetyHj3++V1tRQ7SC88MM01IsBeiX3F8qPh88yoZYKONjt9B5/wIbVa8 2Y72AdCKOBvejEmTIOjNXbhV+zZrr/Fxhb+3z0zT5sqfblYJwQFg1NNx2uzpEtxnBiNwyK CyMXi+yuJVl8DuuLWJUOogwyA7a3t5QlTuHkog9ve2SpDB7wuUpaeMd68DYo4kmnObO9x2 F9kmkbkAFdlZcD9I7hbnfjHY5kyCmrdx0V7cbUYADXJOxiq6VpqSsBJSyTqLaA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZjPR6Gm4zyPg; Mon, 5 Jun 2023 18:51:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 355IpNt1048730; Mon, 5 Jun 2023 18:51:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 355IpNIV048729; Mon, 5 Jun 2023 18:51:23 GMT (envelope-from git) Date: Mon, 5 Jun 2023 18:51:23 GMT Message-Id: <202306051851.355IpNIV048729@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Dag-Erling=20Sm=C3=B8rgrav?= Subject: git: fbc445addf91 - main - xargs: Consistently use strtonum() to parse arguments. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fbc445addf9183d180bb8b488281617bb19d9242 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=fbc445addf9183d180bb8b488281617bb19d9242 commit fbc445addf9183d180bb8b488281617bb19d9242 Author: Dag-Erling Smørgrav AuthorDate: 2023-06-05 18:50:54 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-06-05 18:50:54 +0000 xargs: Consistently use strtonum() to parse arguments. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D40425 --- usr.bin/xargs/xargs.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/usr.bin/xargs/xargs.c b/usr.bin/xargs/xargs.c index eb496d8e09fe..e832cbb35a31 100644 --- a/usr.bin/xargs/xargs.c +++ b/usr.bin/xargs/xargs.c @@ -124,7 +124,6 @@ main(int argc, char *argv[]) int ch, Jflag, nargs, nflag, nline; size_t linelen; struct rlimit rl; - char *endptr; const char *errstr; inpline = replstr = NULL; @@ -175,23 +174,23 @@ main(int argc, char *argv[]) replstr = optarg; break; case 'L': - Lflag = strtonum(optarg, 0, INT_MAX, &errstr); + Lflag = (int)strtonum(optarg, 0, INT_MAX, &errstr); if (errstr) - errx(1, "-L %s: %s", optarg, errstr); + errx(1, "-%c %s: %s", ch, optarg, errstr); break; case 'n': nflag = 1; - nargs = strtonum(optarg, 1, INT_MAX, &errstr); + nargs = (int)strtonum(optarg, 1, INT_MAX, &errstr); if (errstr) - errx(1, "-n %s: %s", optarg, errstr); + errx(1, "-%c %s: %s", ch, optarg, errstr); break; case 'o': oflag = 1; break; case 'P': - maxprocs = strtonum(optarg, 0, INT_MAX, &errstr); + maxprocs = (int)strtonum(optarg, 0, INT_MAX, &errstr); if (errstr) - errx(1, "-P %s: %s", optarg, errstr); + errx(1, "-%c %s: %s", ch, optarg, errstr); if (getrlimit(RLIMIT_NPROC, &rl) != 0) errx(1, "getrlimit failed"); if (maxprocs == 0 || maxprocs > rl.rlim_cur) @@ -201,22 +200,22 @@ main(int argc, char *argv[]) pflag = 1; break; case 'R': - Rflag = strtol(optarg, &endptr, 10); - if (*endptr != '\0') - errx(1, "replacements must be a number"); + Rflag = (int)strtonum(optarg, 0, INT_MAX, &errstr); + if (errstr) + errx(1, "-%c %s: %s", ch, optarg, errstr); break; case 'r': /* GNU compatibility */ break; case 'S': - Sflag = strtoul(optarg, &endptr, 10); - if (*endptr != '\0') - errx(1, "replsize must be a number"); + Sflag = (int)strtonum(optarg, 0, INT_MAX, &errstr); + if (errstr) + errx(1, "-%c %s: %s", ch, optarg, errstr); break; case 's': - nline = strtonum(optarg, 0, INT_MAX, &errstr); + nline = (int)strtonum(optarg, 0, INT_MAX, &errstr); if (errstr) - errx(1, "-s %s: %s", optarg, errstr); + errx(1, "-%c %s: %s", ch, optarg, errstr); break; case 't': tflag = 1; From nobody Mon Jun 5 19:06:52 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZjlK0Xvzz4b106; Mon, 5 Jun 2023 19: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZjlJ6Vg3z3qY2; Mon, 5 Jun 2023 19: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=1685992012; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Izb86PIa/EYuOyUb8yZj4MFuBJdpi40rP+zPm8FtGe8=; b=blMFS1tP6pAPxENTy0/fe/Wso4cMcac55MGIHeoA4AbJxGTRtXodLOa4JlbwfL/D+Uakvx kfxJytL0Nsc2qLFu3C6Cr9ZC7377CkF74K8e4czr1xcDokepbNvs8+sZ9yz+QuVE0HhDuv lrL2KH/E58gAVZSOoUgvYKoL42VHzSCK7l4tIsWxzN39pgfJkJBZPcwxRADB0GPYis4hM8 yPYG6ALSpGi+B+Ueo62TXIPkdED34t3I5niRvSSBet9TAtUEKNtb3VeqCEFE8xde/izinS hiRuHCKPjOd2mHtl9bIHFeRqg1vSSkmXS3n8138qj3bPgKdl/En4sIewTxdEbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685992012; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Izb86PIa/EYuOyUb8yZj4MFuBJdpi40rP+zPm8FtGe8=; b=k00nThZoatfAfpMec8WH/sWi6zETN6rUaE0mPAJ8RwrZUg4yxFBgPuVc8EQ6SGIH6W+xxE ZYDucLDrPuwlFM1H+JHU7kTjmkE5t48yxY6ErxgzUnT2gp2KLrXX+hyQ/Iqwvwr5jauDGw 0r0SDbpsnjQY7oGyshXoaB9YsuYnkRANGqpoNKCTN39I//3tU5ZXek0+LinPLZDLDcJAnm GQuWQ6l/Ca8IBA0OtlidOqeSRRxj63QyPLQka5yOIU2sztrRn23gec+CBfcsnSPuaJdVkP jgoUyM4b3E8dKhwa/rqXQSc4ABTKSbGU9V2GF6xrLc/+ScYA0S3WPctx1AeymQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685992012; a=rsa-sha256; cv=none; b=tDc5PUxjbasc2equ4xFIiV8JlO5DKZtMDbokqfs5P7ki+hHrX6USz37amtwolhpXRKdz+e l7WcLS3irVzoZPW04BbQAkrv+HBWBchJYsv3uS54NxrSlEil9uQyg5flTkTnVCU457+p4M ZLl3Lbf+eZjyWIq/DX8onPxFJfhH5qHG9TRqL3sQYEOmBsVcPncjcQOGPG3ZLE7iL/iWGt RZYqVEV7qHSq0rxbhEqqMxdl4a7b2YGxQqQVjsgQGyG1dpfmXtzMKgGNJ6UeoPrRvwP/xB TSs+22jG7eS7FOPYbmJ09RTfR52R0uPx7avD91RS0cocL0tis4KTpPKLEjHNCA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZjlJ5VDzz10Hl; Mon, 5 Jun 2023 19:06:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 355J6qXe085713; Mon, 5 Jun 2023 19:06:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 355J6q8D085712; Mon, 5 Jun 2023 19:06:52 GMT (envelope-from git) Date: Mon, 5 Jun 2023 19:06:52 GMT Message-Id: <202306051906.355J6q8D085712@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 77d002b9cbf4 - stable/12 - ssh: fix leak and apply style(9) to hostname canonicalization List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 77d002b9cbf49168ba6261b5dc84b8e694c24b20 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=77d002b9cbf49168ba6261b5dc84b8e694c24b20 commit 77d002b9cbf49168ba6261b5dc84b8e694c24b20 Author: Ed Maste AuthorDate: 2023-02-08 13:16:53 +0000 Commit: Ed Maste CommitDate: 2023-06-05 19:05:32 +0000 ssh: fix leak and apply style(9) to hostname canonicalization Fixes: bf2e2524a2ce ("ssh: canonicize the host name before...") Fixes: 3e74849a1ee2 ("ssh: canonicize the host name before...") Reviewed by: rew Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D38441 (cherry picked from commit 19aba210e1a1b5999bff10cccab5a277060c4d46) (cherry picked from commit 792d3f16868e5f79ab8b11803340251371515f0a) --- crypto/openssh/ssh.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crypto/openssh/ssh.c b/crypto/openssh/ssh.c index c5a4326bd1c6..b058e8349c63 100644 --- a/crypto/openssh/ssh.c +++ b/crypto/openssh/ssh.c @@ -1397,18 +1397,21 @@ main(int ac, char **av) cinfo->locuser = xstrdup(pw->pw_name); /* Find canonic host name. */ - if (strchr(host, '.') == 0) { + if (strchr(host, '.') == NULL) { struct addrinfo hints; struct addrinfo *ai = NULL; int errgai; + memset(&hints, 0, sizeof(hints)); hints.ai_family = options.address_family; hints.ai_flags = AI_CANONNAME; hints.ai_socktype = SOCK_STREAM; errgai = getaddrinfo(host, NULL, &hints, &ai); if (errgai == 0) { - if (ai->ai_canonname != NULL) + if (ai->ai_canonname != NULL) { + free(host); host = xstrdup(ai->ai_canonname); + } freeaddrinfo(ai); } } From nobody Mon Jun 5 19:33:50 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZkLQ6gDqz4b2cn; Mon, 5 Jun 2023 19:33:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZkLQ63mZz3tcB; Mon, 5 Jun 2023 19:33:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685993630; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HtzPgkfRGpWFLK8unZQ5Qfl4vbkLJv9YCJU/LiGnHHU=; b=egOgx6gMlAoHjNKS1t5YlRpOWYA38bN4fKzeCUs4oK4sPnpHdfMPeag9f3MY5jZEYN/XAc 8d4aCTZ4SSXN8oe/aYlaFn/Fmhp0wBqYzqTgHYlON9BIHC49fk6FiXHgstNSQQeVc1W8XR R4EdZv+UKtLbx+hI4V2rXKZthL/H7TCoKdL0EHvYltSclQY0bnYcOUWgcNBWVjcLwB44GR H4pSK+3c0LBHkJD/JyXyX0tHyNCCr1S2vQPi6cYF3OBtSyaMAnRT3z3YmtsOooSGQ00nVx vzbeimtmrbYiHW3bKj4CZRkk4XnxqT0cyExOiYb57BBoN2C1Ajn/UwxfdI+TWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685993630; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HtzPgkfRGpWFLK8unZQ5Qfl4vbkLJv9YCJU/LiGnHHU=; b=AK0EcCylSHRvYIzIOETltViVmwXSy2x4Szdg6xJLBeSBLm3X6ulf8QTzSAvPzej39WHam2 m4FlGI6UbNZhqXi7i3WmfUt0F4pwipMod4Fcj1PNffxqahXRYXF4tM4zIRjPMpWu+pL7Oa v/TWQFv+rG9w+aF8XKFyR6Db7/aHOdnH7Gh61Hdpgj4EeM9u/6VuAet/qrgAtKTGyxqOu6 gQuhNtoSnBqppsrKhWTZRo3dPgsr2731GN3tvs9/ru0DcjPyTfjtWriHBi1o3tIg/4xBYr W+r1EJYS8G5KZ7T1GwpWGKxXxN+BH3zlEUN6CbEkBHnn3bSorBGPrmk3Y7LyhA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685993630; a=rsa-sha256; cv=none; b=DGiXMk+ktj3kMndysHuRBPXzrf0OSnXS4Qu+ff/JjisnpUaxGwf4lpQY9Do1iEFuV3Oq3p WBLlQOt6gKlne8+Eb8C3UeMnKjb11OYdJ1O4Z4D3jmwPAS04WHptiac22Z7/KEJGBCAUFH AkqJX5xktWQaIeCLpDGBFhXwCLk3TvjkUQOnzVIvwrg9nYBRimBSsGTpRu8tgePgGkm59B K8lM4jMG12b7QzseOu4wM2FSaJ7hON32PejGd1yc7BDVy92gALa/xyJV7Cqj1oSDdWVHTB wQ3raQlmBldlD+6R3xNObIoOhqYA1m4ISIKLON7fOY3azYnjPduHiZSdgFVE+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 4QZkLQ57Flz10kw; Mon, 5 Jun 2023 19:33:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 355JXokH034242; Mon, 5 Jun 2023 19:33:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 355JXoxW034241; Mon, 5 Jun 2023 19:33:50 GMT (envelope-from git) Date: Mon, 5 Jun 2023 19:33:50 GMT Message-Id: <202306051933.355JXoxW034241@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: a7bca6949252 - main - rtld_tls.h: style List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a7bca6949252f32bb39440cb2914ba23e1c01551 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a7bca6949252f32bb39440cb2914ba23e1c01551 commit a7bca6949252f32bb39440cb2914ba23e1c01551 Author: Konstantin Belousov AuthorDate: 2023-06-05 01:15:31 +0000 Commit: Konstantin Belousov CommitDate: 2023-06-05 19:33:17 +0000 rtld_tls.h: style Sponsored by: The FreeBSD Foundation MFC after: 1 week --- libexec/rtld-elf/rtld_tls.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rtld-elf/rtld_tls.h b/libexec/rtld-elf/rtld_tls.h index b7dedc3fdfee..84ee582152c7 100644 --- a/libexec/rtld-elf/rtld_tls.h +++ b/libexec/rtld-elf/rtld_tls.h @@ -58,7 +58,7 @@ * The value returned from this function is suitable for installing * directly into the thread pointer register. */ -void *_rtld_allocate_tls(void* oldtls, size_t tcbsize, size_t tcbalign) +void *_rtld_allocate_tls(void *oldtls, size_t tcbsize, size_t tcbalign) __exported; /* From nobody Mon Jun 5 19:33:51 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZkLS05yNz4b2sm; Mon, 5 Jun 2023 19:33:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZkLR6RHZz3tny; Mon, 5 Jun 2023 19:33:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685993631; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TaaR1jpeiaIrEju0CezlLbMp3eSpl4yHCx8aBdVBQvo=; b=xsxNeKjK01kyAub83fs/CDeF1+F6pwZGO9gdrZMAMm4+7fw3CibQPcRgbM6zSs6mJNccQz htWEFJPR8WGZjzvsO3KYPzEKDrF218rJayQG6ujS6iz4AryzBUaZyaiRw4seSflcS+nPRC SyDU7eYu3jyUFDUlKaCyhKVOOryk9ttVLXcvvpRKUN+/VAlqrvpEYtwAEAJeRfB8Xi3TJ1 pqU2iYaT468rI5AaXd9LS9Jbd7LuACMfzFixc2/tU0Whi9neYhgrpCya1HoUtQUd9PxwbJ XfVGyI815zTSFzWMuWPYjoXWzi1dvP1vhQeCOJnIivVNq69M0/sQz6IcV6zULQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685993631; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TaaR1jpeiaIrEju0CezlLbMp3eSpl4yHCx8aBdVBQvo=; b=e0K/OQGrQzjnFEfeaHjTKfDIoh0ZtpiY8Z0wIq2FZGmbeHv1Adgkqh739Z87UMyTRgCMyD OJwq1Xx+qosWxa3EkJAqhcgQ4FVWLLN7xtbJVtGZGkH6UBmqKwYy7w83CXyU/kikMrCe6p vj+0msnQ/aBW0/lrHe8CYrXLbmDelJIWp55xBQAcfdOVFtfazGIJokMQrTfV7tRzmlp6oH 7B/++o0FzNx3rsQSYZJnUXSiWBEU9DLeawKij7r/KR3VbuEAa6H5ex/R5k1FhZoQNu+Q0p +MtOhuZaF/foYECkXtnhnNW/j/RrsJ56QgAJ58Ij35fi3MQvyNJl+Fltddo+ZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685993631; a=rsa-sha256; cv=none; b=M8QLGtYGR7FikzxnaRGElUSOuyiuVPth7jD7kBuBYfkoEpQhwWylqJ3r4YKrJAMpV+ca2x YvxVGK2R+kbyU0yKsVlcnxOrpoCzaIEZzw3InjY3kbJLCCxW7TK7BSelIKOoxCgaytKMDF Zd6MIm36EWt5mQRBI5JkUkgYgKOs7OhiQ6nAqcgsU0PjjORYCHdjS8KbO2/oxXgEwZoFSq Uj2jEWbv0cl8U45SNNLDSTf/NpTCJ+LiaSoC96AZT/Z+aoTJKjnFp94v/KH0ubnkIj6Xqu 6RIXRMoOtYsXQfXT9rju/Rrj0b98kHYy6+meXXFqzIQQTXmmK0b6AjfQVEHGuw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZkLR5W6Nz119p; Mon, 5 Jun 2023 19:33:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 355JXpsB034261; Mon, 5 Jun 2023 19:33:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 355JXps2034260; Mon, 5 Jun 2023 19:33:51 GMT (envelope-from git) Date: Mon, 5 Jun 2023 19:33:51 GMT Message-Id: <202306051933.355JXps2034260@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: 283a4f409731 - main - rtld: rename tls_done to tls_static List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 283a4f409731ba3a4eb1be41e151c20e8a960c03 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=283a4f409731ba3a4eb1be41e151c20e8a960c03 commit 283a4f409731ba3a4eb1be41e151c20e8a960c03 Author: Konstantin Belousov AuthorDate: 2023-06-05 00:43:55 +0000 Commit: Konstantin Belousov CommitDate: 2023-06-05 19:33:17 +0000 rtld: rename tls_done to tls_static The meaning of the flag is that static TLS allocation was done. Taken from NetBSD Joerg Sonnenberger change for src/libexec/ld.elf_so/tls.c rev. 1.18. Sponsored by: The FreeBSD Foundation MFC after: 1 week --- libexec/rtld-elf/aarch64/reloc.c | 2 +- libexec/rtld-elf/amd64/reloc.c | 4 ++-- libexec/rtld-elf/arm/reloc.c | 2 +- libexec/rtld-elf/i386/reloc.c | 2 +- libexec/rtld-elf/map_object.c | 2 +- libexec/rtld-elf/powerpc/reloc.c | 2 +- libexec/rtld-elf/powerpc64/reloc.c | 2 +- libexec/rtld-elf/riscv/reloc.c | 4 ++-- libexec/rtld-elf/rtld.c | 8 ++++---- libexec/rtld-elf/rtld.h | 2 +- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/libexec/rtld-elf/aarch64/reloc.c b/libexec/rtld-elf/aarch64/reloc.c index d83da4df0ec5..f9a1ae4c2b6c 100644 --- a/libexec/rtld-elf/aarch64/reloc.c +++ b/libexec/rtld-elf/aarch64/reloc.c @@ -470,7 +470,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, * modules. If we run out of space, we generate an * error. */ - if (!defobj->tls_done) { + if (!defobj->tls_static) { if (!allocate_tls_offset( __DECONST(Obj_Entry *, defobj))) { _rtld_error( diff --git a/libexec/rtld-elf/amd64/reloc.c b/libexec/rtld-elf/amd64/reloc.c index b92d89028d4e..2fdc10ad915f 100644 --- a/libexec/rtld-elf/amd64/reloc.c +++ b/libexec/rtld-elf/amd64/reloc.c @@ -258,7 +258,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, * dynamically loaded modules. If we run out * of space, we generate an error. */ - if (!defobj->tls_done) { + if (!defobj->tls_static) { if (!allocate_tls_offset( __DECONST(Obj_Entry *, defobj))) { _rtld_error("%s: No space available " @@ -279,7 +279,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, * dynamically loaded modules. If we run out * of space, we generate an error. */ - if (!defobj->tls_done) { + if (!defobj->tls_static) { if (!allocate_tls_offset( __DECONST(Obj_Entry *, defobj))) { _rtld_error("%s: No space available " diff --git a/libexec/rtld-elf/arm/reloc.c b/libexec/rtld-elf/arm/reloc.c index cfbddaeede75..b85c8b1f4845 100644 --- a/libexec/rtld-elf/arm/reloc.c +++ b/libexec/rtld-elf/arm/reloc.c @@ -279,7 +279,7 @@ reloc_nonplt_object(Obj_Entry *obj, const Elf_Rel *rel, SymCache *cache, if (def == NULL) return -1; - if (!defobj->tls_done && !allocate_tls_offset(obj)) + if (!defobj->tls_static && !allocate_tls_offset(obj)) return -1; tmp = (Elf_Addr)def->st_value + defobj->tlsoffset; diff --git a/libexec/rtld-elf/i386/reloc.c b/libexec/rtld-elf/i386/reloc.c index ae0a256e4033..bd8595f923df 100644 --- a/libexec/rtld-elf/i386/reloc.c +++ b/libexec/rtld-elf/i386/reloc.c @@ -242,7 +242,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, * dynamically loaded modules. If we run out * of space, we generate an error. */ - if (!defobj->tls_done) { + if (!defobj->tls_static) { if (!allocate_tls_offset( __DECONST(Obj_Entry *, defobj))) { _rtld_error("%s: No space available " diff --git a/libexec/rtld-elf/map_object.c b/libexec/rtld-elf/map_object.c index ff4bd513ee59..8c04183f7bca 100644 --- a/libexec/rtld-elf/map_object.c +++ b/libexec/rtld-elf/map_object.c @@ -433,7 +433,7 @@ obj_free(Obj_Entry *obj) { Objlist_Entry *elm; - if (obj->tls_done) + if (obj->tls_static) free_tls_offset(obj); while (obj->needed != NULL) { Needed_Entry *needed = obj->needed; diff --git a/libexec/rtld-elf/powerpc/reloc.c b/libexec/rtld-elf/powerpc/reloc.c index 27796cb18277..7fd6251c7dd5 100644 --- a/libexec/rtld-elf/powerpc/reloc.c +++ b/libexec/rtld-elf/powerpc/reloc.c @@ -252,7 +252,7 @@ reloc_nonplt_object(Obj_Entry *obj_rtld __unused, Obj_Entry *obj, * modules. If we run out of space, we generate an * error. */ - if (!defobj->tls_done) { + if (!defobj->tls_static) { if (!allocate_tls_offset( __DECONST(Obj_Entry *, defobj))) { _rtld_error("%s: No space available for static " diff --git a/libexec/rtld-elf/powerpc64/reloc.c b/libexec/rtld-elf/powerpc64/reloc.c index 2ca361168e0d..732d6ddff7c9 100644 --- a/libexec/rtld-elf/powerpc64/reloc.c +++ b/libexec/rtld-elf/powerpc64/reloc.c @@ -247,7 +247,7 @@ reloc_nonplt_object(Obj_Entry *obj_rtld __unused, Obj_Entry *obj, * modules. If we run out of space, we generate an * error. */ - if (!defobj->tls_done) { + if (!defobj->tls_static) { if (!allocate_tls_offset( __DECONST(Obj_Entry *, defobj))) { _rtld_error("%s: No space available for static " diff --git a/libexec/rtld-elf/riscv/reloc.c b/libexec/rtld-elf/riscv/reloc.c index 48d513b94ec6..b5dea298b74d 100644 --- a/libexec/rtld-elf/riscv/reloc.c +++ b/libexec/rtld-elf/riscv/reloc.c @@ -325,7 +325,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, * modules. If we run out of space, we generate an * error. */ - if (!defobj->tls_done) { + if (!defobj->tls_static) { if (!allocate_tls_offset( __DECONST(Obj_Entry *, defobj))) { _rtld_error( @@ -352,7 +352,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, * modules. If we run out of space, we generate an * error. */ - if (!defobj->tls_done) { + if (!defobj->tls_static) { if (!allocate_tls_offset( __DECONST(Obj_Entry *, defobj))) { _rtld_error( diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 2b833e350e5a..9ed9a4aed4bb 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -5474,11 +5474,11 @@ allocate_tls_offset(Obj_Entry *obj) { size_t off; - if (obj->tls_done) + if (obj->tls_static) return (true); if (obj->tlssize == 0) { - obj->tls_done = true; + obj->tls_static = true; return (true); } @@ -5509,7 +5509,7 @@ allocate_tls_offset(Obj_Entry *obj) tls_last_offset = off; tls_last_size = obj->tlssize; - obj->tls_done = true; + obj->tls_static = true; return (true); } @@ -5885,7 +5885,7 @@ distribute_static_tls(Objlist *list, RtldLockState *lockstate) return; STAILQ_FOREACH(elm, list, link) { obj = elm->obj; - if (obj->marker || !obj->tls_done || obj->static_tls_copied) + if (obj->marker || !obj->tls_static || obj->static_tls_copied) continue; distrib(obj->tlsoffset, obj->tlsinit, obj->tlsinitsize, obj->tlssize); diff --git a/libexec/rtld-elf/rtld.h b/libexec/rtld-elf/rtld.h index bb5119bfb744..025bf4ff0670 100644 --- a/libexec/rtld-elf/rtld.h +++ b/libexec/rtld-elf/rtld.h @@ -245,7 +245,7 @@ typedef struct Struct_Obj_Entry { bool traced : 1; /* Already printed in ldd trace output */ bool jmpslots_done : 1; /* Already have relocated the jump slots */ bool init_done : 1; /* Already have added object to init list */ - bool tls_done : 1; /* Already allocated offset for static TLS */ + bool tls_static : 1; /* Already allocated offset for static TLS */ bool phdr_alloc : 1; /* Phdr is allocated and needs to be freed. */ bool z_origin : 1; /* Process rpath and soname tokens */ bool z_nodelete : 1; /* Do not unload the object and dependencies */ From nobody Mon Jun 5 19:33:52 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZkLT2sgmz4b2lc; Mon, 5 Jun 2023 19:33:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZkLT0Wvtz3ttG; Mon, 5 Jun 2023 19:33:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685993633; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=u18ZHq5JDUNec4jbUjtDulCMZygzKovC/Ch8DjbZ4KU=; b=v7gWFkbx7nJz8vCX/xQqAFsKjXoNXDgb7g6m3v9pBrueoE3iPZchllBzGZfbBLGTtD6kzy CjCevvAymR9Q6pyIjULDJKukrSG4xRdLVBXyafaMDZIhah+rBF/J/TflxS+Xs+dGsm5lhI EnSTFcKthFVX2wgITEATYXZvBiwoR6J+m4a5+Zx0LiHDjH7AKRfYu2BP1KOI0ZVr5F28Y1 QAx5ZqwCS9nRic/YOr11+fsbflq34fPTi2F40IbbktaIfsE5aQClr1LDKdrKafulhH40SW qnNimhNRVB9nVtw+XC5Gq1WbmX1GdnOZpditqvv18Cm4e9TMdDI8Xy63StIItQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685993633; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=u18ZHq5JDUNec4jbUjtDulCMZygzKovC/Ch8DjbZ4KU=; b=HQpPIxI4TGxgJaaD12E4soUD/3dNp8i6n+qOcus5pqB8mGzRJ5t7Dfq2s/ZL3sCx+isWef cSi7K1ASJ1qWd+Fxt8/jRaPfRN/HHroeFzZWXxh8xMXbbowQyetpITpJh4sV19Kq4yyO04 +uaT4CmIkPPxuPpLsMuLtkHblAAtThCNaGwgXicYJxHlDNH6a9qXu7XIxbZugG/K9Oh8GO tzLVtGcdCpoDXAowPoBOUYVcnsH0Ygn5Xy08MNvvtzpHQU7w/gnYGsewuZK7wmFcOppobm BwbAEaPWixNsNrtA7ebBUWNDhx8z1/nq+94fB8IU3HYNJXzSjYA0q+WpOqgc9Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685993633; a=rsa-sha256; cv=none; b=T93MrKkFfX6y4cTncQXEBowFHYM3PcxMqRG71zz2QsMH3M2UPzS8VH8Fa74NTU1TfUsvF4 /XpTOjQBBjKA9ps66kG7650GERaKCyUMXjlgHkBk+FwO6vR92FzB88T+GmuCK00UEPm7CM 4Nor+IDbFNUO0s2NgVI8GI/uAelnKu7Spx+l2Hq6GF3GyZ6ktYcj2CNOTb8o3cOz6qfdV3 mmzyC1w81PcaUIH1p57TZAkB9bkzS2av/VGa5EK9EvTFFK2nt2h9vOY1vkZ2RBOTcQrkh3 aWGJyuoXx0sK0oP/hjcNMRE93Bk99rczhgAcWhBnPg5NxvbBsnLAFG/iZFsinw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZkLS6jMmz11FY; Mon, 5 Jun 2023 19:33:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 355JXqDZ034280; Mon, 5 Jun 2023 19:33:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 355JXqQ0034279; Mon, 5 Jun 2023 19:33:52 GMT (envelope-from git) Date: Mon, 5 Jun 2023 19:33:52 GMT Message-Id: <202306051933.355JXqQ0034279@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: 91880e07f605 - main - rtld: do not allow both dynamic DTV index and static TLS offset List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 91880e07f605edb90339685bc934699a4344de3b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=91880e07f605edb90339685bc934699a4344de3b commit 91880e07f605edb90339685bc934699a4344de3b Author: Konstantin Belousov AuthorDate: 2023-06-05 00:54:46 +0000 Commit: Konstantin Belousov CommitDate: 2023-06-05 19:33:18 +0000 rtld: do not allow both dynamic DTV index and static TLS offset If we are allocating static offset for an object with dynamic index, return failure. In the opposite case, if dynamic index is requested for statically allocated TLS area, directly use the offset instead of setting the index. Taken from NetBSD Joerg Sonnenberger change for src/libexec/ld.elf_so/tls.c rev. 1.18. Sponsored by: The FreeBSD Foundation MFC after: 1 week --- libexec/rtld-elf/rtld.c | 14 ++++++++++++++ libexec/rtld-elf/rtld.h | 1 + 2 files changed, 15 insertions(+) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 9ed9a4aed4bb..72a128ccbb81 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -5463,6 +5463,17 @@ allocate_module_tls(int index) rtld_die(); } + if (obj->tls_static) { +#ifdef TLS_VARIANT_I + p = (char *)_tcb_get() + obj->tlsoffset; +#else + p = (char *)_tcb_get() - obj->tlsoffset; +#endif + return (p); + } + + obj->tls_dynamic = true; + p = malloc_aligned(obj->tlssize, obj->tlsalign, obj->tlspoffset); memcpy(p, obj->tlsinit, obj->tlsinitsize); memset(p + obj->tlsinitsize, 0, obj->tlssize - obj->tlsinitsize); @@ -5474,6 +5485,9 @@ allocate_tls_offset(Obj_Entry *obj) { size_t off; + if (obj->tls_dynamic) + return (false); + if (obj->tls_static) return (true); diff --git a/libexec/rtld-elf/rtld.h b/libexec/rtld-elf/rtld.h index 025bf4ff0670..b8b0d67bd05d 100644 --- a/libexec/rtld-elf/rtld.h +++ b/libexec/rtld-elf/rtld.h @@ -246,6 +246,7 @@ typedef struct Struct_Obj_Entry { bool jmpslots_done : 1; /* Already have relocated the jump slots */ bool init_done : 1; /* Already have added object to init list */ bool tls_static : 1; /* Already allocated offset for static TLS */ + bool tls_dynamic : 1; /* A non-static DTV entry has been allocated */ bool phdr_alloc : 1; /* Phdr is allocated and needs to be freed. */ bool z_origin : 1; /* Process rpath and soname tokens */ bool z_nodelete : 1; /* Do not unload the object and dependencies */ From nobody Mon Jun 5 20:18:33 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZlL84VpTz4b6Hm; Mon, 5 Jun 2023 20:18:40 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from glebi.us (glebi.us [162.251.186.162]) by mx1.freebsd.org (Postfix) with ESMTP id 4QZlL73sXnz400K; Mon, 5 Jun 2023 20:18:39 +0000 (UTC) (envelope-from glebius@freebsd.org) Authentication-Results: mx1.freebsd.org; dkim=none; spf=softfail (mx1.freebsd.org: 162.251.186.162 is neither permitted nor denied by domain of glebius@freebsd.org) smtp.mailfrom=glebius@freebsd.org; dmarc=none Received: by glebi.us (Postfix, from userid 1000) id 2E66C441B8; Mon, 5 Jun 2023 13:18:33 -0700 (PDT) Date: Mon, 5 Jun 2023 13:18:33 -0700 From: Gleb Smirnoff To: Cy Schubert Cc: Eric van Gyzen , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: fe590ffe40f4 - main - Import vixie cron 4.0 Message-ID: References: <202306011914.351JEPUd080685@gitrepo.freebsd.org> <63EC8D2A-EA0A-48CD-B86C-011D848A2389@vangyzen.net> <20230603175422.7d1c1fcb@slippy> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230603175422.7d1c1fcb@slippy> X-Spamd-Result: default: False [0.50 / 15.00]; VIOLATED_DIRECT_SPF(3.50)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.998]; MIME_GOOD(-0.10)[text/plain]; RCVD_NO_TLS_LAST(0.10)[]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, country:US]; ARC_NA(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; FROM_HAS_DN(0.00)[]; FREEFALL_USER(0.00)[glebius]; RCVD_COUNT_TWO(0.00)[2]; TO_DN_SOME(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; DMARC_NA(0.00)[freebsd.org]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Queue-Id: 4QZlL73sXnz400K X-Spamd-Bar: / X-ThisMailContainsUnwantedMimeParts: N On Sat, Jun 03, 2023 at 05:54:22PM -0700, Cy Schubert wrote: C> > > Given that now source of truth is in git, it could be a good idea C> > > to seed usr.bin/cron as a git subtree, as we do with other contributed C> > > software. C> > C> > Good idea. There were more good ideas on this topic in the Phab review, but I don’t have cycles to pursue any of them. C> C> This was suggested in the review (https://reviews.freebsd.org/D40260). I can do the seeding of subtree. However, I don't want to become maintainer of cron. I can prepare a git tree that has this subtree. Content wise it is going to be exactly the same as it is now. How can approve that? -- Gleb Smirnoff From nobody Mon Jun 5 20:41:08 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZlr82NS8z4b7xs; Mon, 5 Jun 2023 20:41:12 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta002.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZlr80Rjkz43T5; Mon, 5 Jun 2023 20:41:11 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4002a.ext.cloudfilter.net ([10.228.9.250]) by cmsmtp with ESMTP id 6E9lqi5WN6Nwh6H0oqQRtP; Mon, 05 Jun 2023 20:41:10 +0000 Received: from spqr.komquats.com ([70.66.148.124]) by cmsmtp with ESMTPA id 6H0mq2QwIyAOe6H0nqX4Lp; Mon, 05 Jun 2023 20:41:10 +0000 X-Authority-Analysis: v=2.4 cv=e5oV9Il/ c=1 sm=1 tr=0 ts=647e4866 a=Cwc3rblV8FOMdVN/wOAqyQ==:117 a=Cwc3rblV8FOMdVN/wOAqyQ==:17 a=8nJEP1OIZ-IA:10 a=of4jigFt-DYA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=JgTIKX8bMD4ZB-ZYPecA:9 a=wPNLvfGTeEIA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 4AB731026; Mon, 5 Jun 2023 13:41:08 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 341A142B; Mon, 5 Jun 2023 13:41:08 -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: Gleb Smirnoff cc: Cy Schubert , Eric van Gyzen , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: fe590ffe40f4 - main - Import vixie cron 4.0 In-reply-to: References: <202306011914.351JEPUd080685@gitrepo.freebsd.org> <63EC8D2A-EA0A-48CD-B86C-011D848A2389@vangyzen.net> <20230603175422.7d1c1fcb@slippy> Comments: In-reply-to Gleb Smirnoff message dated "Mon, 05 Jun 2023 13:18:33 -0700." List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Date: Mon, 05 Jun 2023 13:41:08 -0700 Message-Id: <20230605204108.341A142B@slippy.cwsent.com> X-CMAE-Envelope: MS4xfDaJsXQOGpuWwytA8kO17cLb8vcAIzzaV8o1YMQ3TdqXxFUNgcgAQI7UWZF3rXdaDYYzWkQrgBMvrdiR0SDDLxp+crYVCgVZBsmmNIqBcOp//HaYvzNN x8OKjbYpWTQdrbXLgAH4dTf2Aj5uqgEPvYVWykzT4Ig7u+VHIj95/mXuThqd9Tvoi+QbtCGQxgUUQEBIb7sR6aiJdiDroGxpgevt+6VXm98PDcbfuGbW16Vd mv992iEVJveYoTNtZZc7D7oB7SPa376ddI25jorwRKrdRZ5rScHq9HEx4T65SnrEtCQ5wZPSM4IXnQccJdJCUtApkp7NfVAgIzxAz01jJMDffw/x48sN8N80 RxPu6snd X-Rspamd-Queue-Id: 4QZlr80Rjkz43T5 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N In message , Gleb Smirnoff writes: > On Sat, Jun 03, 2023 at 05:54:22PM -0700, Cy Schubert wrote: > C> > > Given that now source of truth is in git, it could be a good idea > C> > > to seed usr.bin/cron as a git subtree, as we do with other contributed > C> > > software. > C> > > C> > Good idea. There were more good ideas on this topic in the Phab review, > but I don’t have cycles to pursue any of them. > C> > C> This was suggested in the review (https://reviews.freebsd.org/D40260). > > I can do the seeding of subtree. However, I don't want to become maintainer > of cron. > > I can prepare a git tree that has this subtree. Content wise it is going to b > e > exactly the same as it is now. > > How can approve that? IMO it probably doesn't need approval. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 From nobody Mon Jun 5 21:01:20 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZmHN4Zy6z4ZQ6c; Mon, 5 Jun 2023 21:01:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZmHN48vxz45gx; Mon, 5 Jun 2023 21:01:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685998880; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gnX3aZYr4ZZTMZhBOm2Hyu0AK8FpgXu80cT7bs6PqEg=; b=dbodMmF0fQID7n/J6E57rPVpMA5i66Fb1fDQgH8kGq1C2PJMkhVRPLb2GRlK0Oy6G+q8hH wWdXjfuc+Ya2yTguiUdae/a8iAWNQmKCZojNCwYytUC7wyzsCEH/HMyfd/XurFwQz5jGPi CDSbgLBlvSxXoO9s3PVpYv9y7KSjogmwfZ6hdjAOkfiiitaQJJzrHbgKLSiwjpcS3SZ1hG ergTx5SCh2fDZz9+l157mUpfHLbMH95hrZqM8MMUrrB3xoFRiY16d8HH+923lxfs0KAQx5 UoM9LMWDnC2saaQPzjU4X9Ga9PLTlvGePRWci43l3hWw3wG5vpWPVPNOqrPvjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685998880; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gnX3aZYr4ZZTMZhBOm2Hyu0AK8FpgXu80cT7bs6PqEg=; b=DCTgE0xM7ks1BUqHK9KBUbmHCabgOeM2Fo7CcVjrem0xUvC4YnUoOMgE9PU/QJOy7O9SAx Cw2MueAIyjMqbh9OlksX/VGd49paYg1QoZGU0XX+/XDvUVU1tED4rTOqXPhss2gbDI80s4 hobA7aNOXBdvTibrBa98l7Ovx4yt+yKFDhdAmt59sAE3a/rMxXLeH9VG53x1wsR5HYs8xK rxwhifJOtxRlz3typsvwKnGE0kdkUyZTxSXoO53wPyQs3KvT+hvrklMxtJEUhmBRj1NGNT o14lQH8FiN5HlA6k+JQYa0lKghz4KE+RAGLFEltwkSbm6qvC9p4CekGfKLYdUQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685998880; a=rsa-sha256; cv=none; b=NVAa41u/5Nmx3xmWPtkKVl/LscL85W6Fe3JVi/RIOXvJRQX+L+SoB7WQlglNafSry3Tg2U FrLNKsCXT7OmGF23al03wIXinTlsA+XYvm1VRM7LRMGvVdBXFqJi1IhcFCBnR2iVR3eRG4 kPNDnxed6Qh9/IvBItHKKZ/U/BSBRtKI8L0laovaMTOOjec0inOksosJN+xElzOA+b1vtJ q3A/E6HZZ6rb3AUFIrBVqfjoSYIyfh2EAc0/FOTz7MRXLPjScb8waI0OzNnByq+SfHqCWo VAoasfWV15dbQZ+Pm52EtJg+amWH9lOmU1hv5Ybf5WKjaeqnkbnL/ChxV4yKzQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZmHN3DVsz12nt; Mon, 5 Jun 2023 21:01:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 355L1Kx2078549; Mon, 5 Jun 2023 21:01:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 355L1K9c078548; Mon, 5 Jun 2023 21:01:20 GMT (envelope-from git) Date: Mon, 5 Jun 2023 21:01:20 GMT Message-Id: <202306052101.355L1K9c078548@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: d66540e829ec - main - tcp: improve sending of TTL/hoplimit and DSCP List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d66540e829ec22b9654cf4b9119bed9326f89fad Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=d66540e829ec22b9654cf4b9119bed9326f89fad commit d66540e829ec22b9654cf4b9119bed9326f89fad Author: Michael Tuexen AuthorDate: 2023-06-05 16:43:06 +0000 Commit: Michael Tuexen CommitDate: 2023-06-05 16:43:06 +0000 tcp: improve sending of TTL/hoplimit and DSCP Ensure that a user specified value of TTL/hoplimit and DSCP is used when sending packets. Reviewed by: cc, rscheff MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D40423 --- sys/netinet/tcp_stacks/rack.c | 27 ++------------------------- sys/netinet/tcp_subr.c | 13 ++++++++++--- 2 files changed, 12 insertions(+), 28 deletions(-) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index affd135bb453..c9b5b937cc46 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -18826,7 +18826,7 @@ rack_fast_rsm_output(struct tcpcb *tp, struct tcp_rack *rack, struct rack_sendma } #ifdef INET6 if (rack->r_is_v6) { - error = ip6_output(m, NULL, + error = ip6_output(m, inp->in6p_outputopts, &inp->inp_route6, ip_sendflag, NULL, NULL, inp); } @@ -19338,7 +19338,7 @@ again: lgb = NULL; #ifdef INET6 if (rack->r_is_v6) { - error = ip6_output(m, NULL, + error = ip6_output(m, inp->in6p_outputopts, &inp->inp_route6, 0, NULL, NULL, inp); } @@ -21792,11 +21792,7 @@ send: TCP_PROBE5(send, NULL, tp, ip6, tp, th); /* TODO: IPv6 IP6TOS_ECT bit on */ error = ip6_output(m, -#if defined(IPSEC) || defined(IPSEC_SUPPORT) inp->in6p_outputopts, -#else - NULL, -#endif &inp->inp_route6, ((rsm || sack_rxmit) ? IP_NO_SND_TAG_RL : 0), NULL, NULL, inp); @@ -23448,10 +23444,6 @@ static int rack_set_sockopt(struct tcpcb *tp, struct sockopt *sopt) { struct inpcb *inp = tptoinpcb(tp); -#ifdef INET6 - struct ip6_hdr *ip6; - int32_t mask, tclass; -#endif #ifdef INET struct ip *ip; #endif @@ -23465,9 +23457,6 @@ rack_set_sockopt(struct tcpcb *tp, struct sockopt *sopt) INP_WUNLOCK(inp); return (EINVAL); } -#ifdef INET6 - ip6 = (struct ip6_hdr *)rack->r_ctl.fsb.tcp_ip_hdr; -#endif #ifdef INET ip = (struct ip *)rack->r_ctl.fsb.tcp_ip_hdr; #endif @@ -23480,18 +23469,6 @@ rack_set_sockopt(struct tcpcb *tp, struct sockopt *sopt) case IPV6_USE_MIN_MTU: tcp6_use_min_mtu(tp); break; - case IPV6_TCLASS: - /* - * The DSCP codepoint has changed, update the fsb - * by overwriting any previous traffic class. - */ - if (inp->in6p_outputopts) { - mask = 0xfc; - tclass = inp->in6p_outputopts->ip6po_tclass; - ip6->ip6_flow &= htonl((~mask) << 20); - ip6->ip6_flow |= htonl((tclass & mask) << 20); - } - break; } INP_WUNLOCK(inp); return (0); diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index fe065fd08737..47eb2d80efd6 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -2049,9 +2049,15 @@ tcp_respond(struct tcpcb *tp, void *ipgen, struct tcphdr *th, struct mbuf *m, ulen = tlen - sizeof(struct ip); uh->uh_ulen = htons(ulen); } - ip->ip_tos = ect; ip->ip_len = htons(tlen); - ip->ip_ttl = V_ip_defttl; + if (inp != NULL) { + ip->ip_tos = inp->inp_ip_tos & ~IPTOS_ECN_MASK; + ip->ip_ttl = inp->inp_ip_ttl; + } else { + ip->ip_tos = 0; + ip->ip_ttl = V_ip_defttl; + } + ip->ip_tos |= ect; if (port) { ip->ip_p = IPPROTO_UDP; } else { @@ -2195,7 +2201,8 @@ tcp_respond(struct tcpcb *tp, void *ipgen, struct tcphdr *th, struct mbuf *m, #ifdef INET6 if (isipv6) { TCP_PROBE5(send, NULL, tp, ip6, tp, nth); - output_ret = ip6_output(m, NULL, NULL, 0, NULL, NULL, inp); + output_ret = ip6_output(m, inp ? inp->in6p_outputopts : NULL, + NULL, 0, NULL, NULL, inp); } #endif /* INET6 */ #if defined(INET) && defined(INET6) From nobody Tue Jun 6 04:06:43 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZxkC5skkz4bgYM; Tue, 6 Jun 2023 04:06:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZxkC3h86z3Lfx; Tue, 6 Jun 2023 04:06:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686024403; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p3LqbGDpxUs6rxX64INDjKS0VNlPXIfU3PATg/Wi0+k=; b=ZjSrkk2tf6QrEOxXiCENeA5tVljELWzDgYzb2Q6aPXDKTn4lksdRvHXokXLOjev/KJj2u/ RmMX9IItQEzP3oh6brghVU5Q2oV/y0kQWh9i0vbB0Dl8PRawT8/6FVyenji4WMeTc0hhf6 /W2RmAklVS+9Jda+BQlj2rvOeVrTWFINf5+VXm/JtIUtB82YYkYRBlwtIciOYXm2gzEh9Q hYfRhW7QJa1H3c5kEWSbkFc8/mguM3rLfFi5Ivkimc1Y8/yPbUTHUJk0xCUE4QJSsAigR2 P5AxJbx165dPRUjJUTSSG3JBjBiH0JvMYYzJbrWgSFNqa74ud2p1+GedCCE2ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686024403; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p3LqbGDpxUs6rxX64INDjKS0VNlPXIfU3PATg/Wi0+k=; b=Qqiw4bHtGrg1Ap3c5gj250swU9SQmLhv6sznFTtxc7c1wnvko7TKJ1RBF0sFdkUpIei9aX lZib1guzPwOPIRG23z9ctrCsQHGpOh4rO7pEKNJMuH1i3d5TQXQKJbs9ArLgRQBA+Oh6gS kKDcWkSrJVxQH10zsciQ39HMAHdOQ/DrR0HGYTmtv14aXFHZ80SmqHRvglYAnV7EAxPWAe aOAaDev/S0mcFI2OTVubgaq4xQicH6QfvusrcSroMhpmJTnJsjX5V0TRgkpaWMdTFRFUIH LAkoBWA5I/oQQ6iS8bZp0YW5fcnupGQW2MHutwRr4moOhRP5aegfU9gsuoyUKg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686024403; a=rsa-sha256; cv=none; b=jRwpEiPSPhHaX+Mwyt9VQhWhkY86kmL4mCb4kjrLHFeaeoMZS4sznR0zh0eiE6DJ6tSXHB BOPIpPaS0tb3bbpcogjvFmyf7FbHRQa3VxF7VXegSIcTPKBL4EskUtl3AJ8L5l3E2MhYoQ c0ogcd3n6oGGk7K7346fo6zP5N3Kt4/IJSixm/9/uCX4pXpFfIqBeiVEzpmhmGCni917zX vPdAvU+dB2Z4J9BT0elAivRNledhpyLtn+pfWDac4tO1RG2P02yokM9HUfmL4bdJWZKq6c xyZym2nFJjyPlhv7Xxj4zJxJdP/5TfRfAcXG/C0MfvQoV4JaASPgQZpoGBYo1w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZxkC2lcNzFsl; Tue, 6 Jun 2023 04:06:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 35646hne078042; Tue, 6 Jun 2023 04:06:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 35646hbA078041; Tue, 6 Jun 2023 04:06:43 GMT (envelope-from git) Date: Tue, 6 Jun 2023 04:06:43 GMT Message-Id: <202306060406.35646hbA078041@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Xin LI Subject: git: 1bbdfb0b4386 - main - gve: Add PNP info to PCI attachment of gve(4) driver. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1bbdfb0b438689a839e29094fcb582a104cbabd9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=1bbdfb0b438689a839e29094fcb582a104cbabd9 commit 1bbdfb0b438689a839e29094fcb582a104cbabd9 Author: Xin LI AuthorDate: 2023-06-06 00:58:43 +0000 Commit: Xin LI CommitDate: 2023-06-06 04:05:55 +0000 gve: Add PNP info to PCI attachment of gve(4) driver. Reviewed-by: imp Differential Revision: https://reviews.freebsd.org/D40429 --- sys/dev/gve/gve_main.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/sys/dev/gve/gve_main.c b/sys/dev/gve/gve_main.c index ae45a0cfc24a..383fd326d33a 100644 --- a/sys/dev/gve/gve_main.c +++ b/sys/dev/gve/gve_main.c @@ -38,6 +38,16 @@ #define GVE_DEFAULT_RX_COPYBREAK 256 +/* Devices supported by this driver. */ +static struct gve_dev { + uint16_t vendor_id; + uint16_t device_id; + const char *name; +} gve_devs[] = { + { PCI_VENDOR_ID_GOOGLE, PCI_DEV_ID_GVNIC, "gVNIC" } +}; +#define GVE_DEVS_COUNT nitems(gve_devs) + struct sx gve_global_lock; static int @@ -701,10 +711,18 @@ gve_service_task(void *arg, int pending) static int gve_probe(device_t dev) { - if (pci_get_vendor(dev) == PCI_VENDOR_ID_GOOGLE && - pci_get_device(dev) == PCI_DEV_ID_GVNIC) { - device_set_desc(dev, "gVNIC"); - return (BUS_PROBE_DEFAULT); + uint16_t deviceid, vendorid; + int i; + + vendorid = pci_get_vendor(dev); + deviceid = pci_get_device(dev); + + for (i = 0; i < GVE_DEVS_COUNT; i++) { + if (vendorid == gve_devs[i].vendor_id && + deviceid == gve_devs[i].device_id) { + device_set_desc(dev, gve_devs[i].name); + return (BUS_PROBE_DEFAULT); + } } return (ENXIO); } @@ -851,3 +869,5 @@ DRIVER_MODULE(gve, pci, gve_driver, gve_devclass, 0, 0); #else DRIVER_MODULE(gve, pci, gve_driver, 0, 0); #endif +MODULE_PNP_INFO("U16:vendor;U16:device", pci, gve, gve_devs, + GVE_DEVS_COUNT); From nobody Tue Jun 6 04:15:37 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZxwk06ZVz4bj3Y for ; Tue, 6 Jun 2023 04:15:50 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZxwj4tpnz3ND6 for ; Tue, 6 Jun 2023 04:15:49 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-3f6dfc4dffaso48736905e9.0 for ; Mon, 05 Jun 2023 21:15:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686024948; x=1688616948; 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=Q4GUGGH+zCp3wzi6W1jvMzxkwxoCrIf85Aeq3hIW7ew=; b=DpSMAzbzXL6vuWv3VJ6dBFhRUOqeA1vn7sqTWEveEIwpBFIY0QfaueXVoWrweLqSWy ZIgb38PSI6ub+iZ2BeJyjpoYW9TuPEnAjc9djLZepGBMI9n5TCSSHJn4yNy36hybpG3X 3FIEe2bXJ5AjwGG8hKmE0vuSlu+upSWUcMri7xCL1/+G9p1sF/cxoZ1IjhrrZoWgw3wr +f4BPwApCVI4jYJcd4AEPrQCI8CiKBjoV5l1bN9TYlpbQVl2pM0pHruuYN3sgDfdy8C5 d32KjUG/5gAwMgSgRUWLSPoXEE/xkgDdepoiqquC4wRLbi8SCdtmshdAylmczMxLAw0S MbAg== X-Gm-Message-State: AC+VfDyw1wwaItBIAOFo46E7PEKj41ZV2aOWPZdQ4bLElmep3nCjBo7v UKo/kL4yvTGoahGK/+Xn7EiZkw== X-Google-Smtp-Source: ACHHUZ4v0RN1v5uyNQ6DEAdh0xaDsf/5pwkZR2fXBT/PX7o1BwR3AfB3tm6k6LBlyzHtFtGPWOE9CQ== X-Received: by 2002:a7b:c407:0:b0:3f6:f56:9ad with SMTP id k7-20020a7bc407000000b003f60f5609admr918105wmi.13.1686024948113; Mon, 05 Jun 2023 21:15:48 -0700 (PDT) Received: from smtpclient.apple ([131.111.5.246]) by smtp.gmail.com with ESMTPSA id n2-20020a05600c294200b003f727764b10sm12306610wmd.4.2023.06.05.21.15.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Jun 2023 21:15:47 -0700 (PDT) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.500.231\)) Subject: Re: git: 1bbdfb0b4386 - main - gve: Add PNP info to PCI attachment of gve(4) driver. From: Jessica Clarke In-Reply-To: <202306060406.35646hbA078041@gitrepo.freebsd.org> Date: Tue, 6 Jun 2023 05:15:37 +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: <6A5F859A-033A-43E1-81CB-B364662DE2F3@freebsd.org> References: <202306060406.35646hbA078041@gitrepo.freebsd.org> To: Xin LI X-Mailer: Apple Mail (2.3731.500.231) X-Rspamd-Queue-Id: 4QZxwj4tpnz3ND6 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 6 Jun 2023, at 05:06, Xin LI wrote: >=20 > The branch main has been updated by delphij: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D1bbdfb0b438689a839e29094fcb582a1= 04cbabd9 >=20 > commit 1bbdfb0b438689a839e29094fcb582a104cbabd9 > Author: Xin LI > AuthorDate: 2023-06-06 00:58:43 +0000 > Commit: Xin LI > CommitDate: 2023-06-06 04:05:55 +0000 >=20 > gve: Add PNP info to PCI attachment of gve(4) driver. >=20 > Reviewed-by: imp > Differential Revision: https://reviews.freebsd.org/D40429 > --- > sys/dev/gve/gve_main.c | 28 ++++++++++++++++++++++++---- > 1 file changed, 24 insertions(+), 4 deletions(-) >=20 > diff --git a/sys/dev/gve/gve_main.c b/sys/dev/gve/gve_main.c > index ae45a0cfc24a..383fd326d33a 100644 > --- a/sys/dev/gve/gve_main.c > +++ b/sys/dev/gve/gve_main.c > @@ -38,6 +38,16 @@ >=20 > #define GVE_DEFAULT_RX_COPYBREAK 256 >=20 > +/* Devices supported by this driver. */ > +static struct gve_dev { > + uint16_t vendor_id; > + uint16_t device_id; > + const char *name; > +} gve_devs[] =3D { > + { PCI_VENDOR_ID_GOOGLE, PCI_DEV_ID_GVNIC, "gVNIC" } > +}; > +#define GVE_DEVS_COUNT nitems(gve_devs) IMO this obfuscates rather than helps given the loop iterates over gve_devs (and the macro references it). > + > struct sx gve_global_lock; >=20 > static int > @@ -701,10 +711,18 @@ gve_service_task(void *arg, int pending) > static int > gve_probe(device_t dev) > { > - if (pci_get_vendor(dev) =3D=3D PCI_VENDOR_ID_GOOGLE && > - pci_get_device(dev) =3D=3D PCI_DEV_ID_GVNIC) { > - device_set_desc(dev, "gVNIC"); > - return (BUS_PROBE_DEFAULT); > + uint16_t deviceid, vendorid; > + int i; > + > + vendorid =3D pci_get_vendor(dev); > + deviceid =3D pci_get_device(dev); > + > + for (i =3D 0; i < GVE_DEVS_COUNT; i++) { > + if (vendorid =3D=3D gve_devs[i].vendor_id && > + deviceid =3D=3D gve_devs[i].device_id) { > + device_set_desc(dev, gve_devs[i].name); > + return (BUS_PROBE_DEFAULT); > + } > } > return (ENXIO); > } > @@ -851,3 +869,5 @@ DRIVER_MODULE(gve, pci, gve_driver, gve_devclass, = 0, 0); > #else > DRIVER_MODULE(gve, pci, gve_driver, 0, 0); > #endif > +MODULE_PNP_INFO("U16:vendor;U16:device", pci, gve, gve_devs, This is missing ;D:# so it will break as soon as you have a second entry in the table. Jess > + GVE_DEVS_COUNT); From nobody Tue Jun 6 04:31:56 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZyHY6Zkhz4bld0 for ; Tue, 6 Jun 2023 04:32:09 +0000 (UTC) (envelope-from wlosh@bsdimp.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 "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZyHY4ZSKz3QG1 for ; Tue, 6 Jun 2023 04:32:09 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-977d02931d1so342018966b.0 for ; Mon, 05 Jun 2023 21:32:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1686025928; x=1688617928; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=II1vapOVkldguiLbfYwly/YEq8lJBMvVWYgW8C8Mwh4=; b=GnZQyp9Jbi5AgYltIdLMu5T/dZsyUmTz68heP8dMJJZ1SXm0g/K6NDyEcj43yf6yp6 A6fYMt5t1hv18OTMelgPFRarZ5nk5xnGQ4Zw4g7eSNv/sICgvSZ0xWMuxKXLSvy480Yj RM72Rgfs/Fh23fk3IHH3Xr76QGuSy9xMSWYvsP02Hv7LyOCNAgoplZhOQ2e07WxPvYI1 d0GR35Vek7ZNkrpSTNsxbS0IuI7mUPRucBPpkuqUhSAjacvdmwtmtvRiKbEzg3yd0kEP +CgPTiaXKzL4+MT8Hqe2CwM0W5EbxKnbAEyGzySnVdoJvHJSNuf8flGNje7w3Jx63V8P oinA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686025928; x=1688617928; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=II1vapOVkldguiLbfYwly/YEq8lJBMvVWYgW8C8Mwh4=; b=YtptNWM6acHuGGqG2pQg/IDAn2a7MGaOkrIQi7t8DXK45KTQ0u/uN0l3mWJxM+Vsha AHJx/P28AXIBmrRkopc0O/AhevFhdLQ5AWfmlJbmxtdnJnb/Ht90q0PLSSyJpIiq37TW +lK1KT7gtG0nhTuFHbYncATzyxoJ2oBV8C3crF64AfmfmK7gi98uhjmvI8E/wHLHJi3v eWFfJzUarc6bwl8ICzmLo2BhDeOmg/vKlkDn3LgEqyuWx7MMIb8abzpCCzp/hbddzMgN G+rx+Sqgg9FCVSEBNgqrEPdbcuJp4yGgxyrzIEjePHWEu+VJY358e6boc6rByaqhmrwm Hc/Q== X-Gm-Message-State: AC+VfDx8DOL02yrnCyU+VCAs6A+O0N9f8cKWBp/LCGZR1um7c4JjT4uU E6ieA1uQ5HPXWyjsKkEiQN4L/R8Shbec1k7p7kZdzA== X-Google-Smtp-Source: ACHHUZ6UQdlF59Sov8dtWvX1hz0r2oIIG0+vnYyrMMhzmk30E93uzMmTASC2Ngw9b/33oK0RSyWZ0NXBOxCL6pdFygg= X-Received: by 2002:a17:906:dc8e:b0:970:482:9fcd with SMTP id cs14-20020a170906dc8e00b0097004829fcdmr1143223ejc.24.1686025927900; Mon, 05 Jun 2023 21:32:07 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202306060406.35646hbA078041@gitrepo.freebsd.org> <6A5F859A-033A-43E1-81CB-B364662DE2F3@freebsd.org> In-Reply-To: <6A5F859A-033A-43E1-81CB-B364662DE2F3@freebsd.org> From: Warner Losh Date: Mon, 5 Jun 2023 22:31:56 -0600 Message-ID: Subject: Re: git: 1bbdfb0b4386 - main - gve: Add PNP info to PCI attachment of gve(4) driver. To: Jessica Clarke Cc: Xin LI , src-committers , "" , "" Content-Type: multipart/alternative; boundary="00000000000083cf7805fd6e8084" X-Rspamd-Queue-Id: 4QZyHY4ZSKz3QG1 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --00000000000083cf7805fd6e8084 Content-Type: text/plain; charset="UTF-8" On Mon, Jun 5, 2023, 10:15 PM Jessica Clarke wrote: > On 6 Jun 2023, at 05:06, Xin LI wrote: > > > > The branch main has been updated by delphij: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=1bbdfb0b438689a839e29094fcb582a104cbabd9 > > > > commit 1bbdfb0b438689a839e29094fcb582a104cbabd9 > > Author: Xin LI > > AuthorDate: 2023-06-06 00:58:43 +0000 > > Commit: Xin LI > > CommitDate: 2023-06-06 04:05:55 +0000 > > > > gve: Add PNP info to PCI attachment of gve(4) driver. > > > > Reviewed-by: imp > > Differential Revision: https://reviews.freebsd.org/D40429 > > --- > > sys/dev/gve/gve_main.c | 28 ++++++++++++++++++++++++---- > > 1 file changed, 24 insertions(+), 4 deletions(-) > > > > diff --git a/sys/dev/gve/gve_main.c b/sys/dev/gve/gve_main.c > > index ae45a0cfc24a..383fd326d33a 100644 > > --- a/sys/dev/gve/gve_main.c > > +++ b/sys/dev/gve/gve_main.c > > @@ -38,6 +38,16 @@ > > > > #define GVE_DEFAULT_RX_COPYBREAK 256 > > > > +/* Devices supported by this driver. */ > > +static struct gve_dev { > > + uint16_t vendor_id; > > + uint16_t device_id; > > + const char *name; > > +} gve_devs[] = { > > + { PCI_VENDOR_ID_GOOGLE, PCI_DEV_ID_GVNIC, "gVNIC" } > > +}; > > +#define GVE_DEVS_COUNT nitems(gve_devs) > > IMO this obfuscates rather than helps given the loop iterates over > gve_devs (and the macro references it). > > > + > > struct sx gve_global_lock; > > > > static int > > @@ -701,10 +711,18 @@ gve_service_task(void *arg, int pending) > > static int > > gve_probe(device_t dev) > > { > > - if (pci_get_vendor(dev) == PCI_VENDOR_ID_GOOGLE && > > - pci_get_device(dev) == PCI_DEV_ID_GVNIC) { > > - device_set_desc(dev, "gVNIC"); > > - return (BUS_PROBE_DEFAULT); > > + uint16_t deviceid, vendorid; > > + int i; > > + > > + vendorid = pci_get_vendor(dev); > > + deviceid = pci_get_device(dev); > > + > > + for (i = 0; i < GVE_DEVS_COUNT; i++) { > > + if (vendorid == gve_devs[i].vendor_id && > > + deviceid == gve_devs[i].device_id) { > > + device_set_desc(dev, gve_devs[i].name); > > + return (BUS_PROBE_DEFAULT); > > + } > > } > > return (ENXIO); > > } > > @@ -851,3 +869,5 @@ DRIVER_MODULE(gve, pci, gve_driver, gve_devclass, 0, > 0); > > #else > > DRIVER_MODULE(gve, pci, gve_driver, 0, 0); > > #endif > > +MODULE_PNP_INFO("U16:vendor;U16:device", pci, gve, gve_devs, > > This is missing ;D:# so it will break as soon as you have a second > entry in the table. > While the first bit is true, I though we encoded the per entry size so trailing garbage didn't matter.. d# will be more useful in the future maybe. Warner Jess > > > + GVE_DEVS_COUNT); > --00000000000083cf7805fd6e8084 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable



On Mon, Jun 5, 2023, 10:15 PM Jessica Clarke <jrtc27@freebsd.org> wrote:
On 6 Jun 2023, at 05:06, Xin LI <delphij= @FreeBSD.org> wrote:
>
> The branch main has been updated by delphij:
>
> URL: https://cgit.FreeBSD.org/src/commit/?id=3D1bbdfb0b438689a839e29094fcb582= a104cbabd9
>
> commit 1bbdfb0b438689a839e29094fcb582a104cbabd9
> Author:=C2=A0 =C2=A0 =C2=A0Xin LI <delphij@FreeBSD.org>
> AuthorDate: 2023-06-06 00:58:43 +0000
> Commit:=C2=A0 =C2=A0 =C2=A0Xin LI <delphij@FreeBSD.org>
> CommitDate: 2023-06-06 04:05:55 +0000
>
>=C2=A0 =C2=A0 gve: Add PNP info to PCI attachment of gve(4) driver.
>
>=C2=A0 =C2=A0 Reviewed-by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 imp=
>=C2=A0 =C2=A0 Differential Revision:=C2=A0 https://= reviews.freebsd.org/D40429
> ---
> sys/dev/gve/gve_main.c | 28 ++++++++++++++++++++++++----
> 1 file changed, 24 insertions(+), 4 deletions(-)
>
> diff --git a/sys/dev/gve/gve_main.c b/sys/dev/gve/gve_main.c
> index ae45a0cfc24a..383fd326d33a 100644
> --- a/sys/dev/gve/gve_main.c
> +++ b/sys/dev/gve/gve_main.c
> @@ -38,6 +38,16 @@
>
> #define GVE_DEFAULT_RX_COPYBREAK 256
>
> +/* Devices supported by this driver. */
> +static struct gve_dev {
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 uint16_t vendor_id;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 uint16_t device_id;
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 const char *name;
> +} gve_devs[] =3D {
> + { PCI_VENDOR_ID_GOOGLE, PCI_DEV_ID_GVNIC, "gVNIC" }
> +};
> +#define GVE_DEVS_COUNT nitems(gve_devs)

IMO this obfuscates rather than helps given the loop iterates over
gve_devs (and the macro references it).

> +
> struct sx gve_global_lock;
>
> static int
> @@ -701,10 +711,18 @@ gve_service_task(void *arg, int pending)
> static int
> gve_probe(device_t dev)
> {
> - if (pci_get_vendor(dev) =3D=3D PCI_VENDOR_ID_GOOGLE &&
> -=C2=A0 =C2=A0 pci_get_device(dev) =3D=3D PCI_DEV_ID_GVNIC) {
> - device_set_desc(dev, "gVNIC");
> - return (BUS_PROBE_DEFAULT);
> + uint16_t deviceid, vendorid;
> + int i;
> +
> + vendorid =3D pci_get_vendor(dev);
> + deviceid =3D pci_get_device(dev);
> +
> + for (i =3D 0; i < GVE_DEVS_COUNT; i++) {
> + if (vendorid =3D=3D gve_devs[i].vendor_id &&
> +=C2=A0 =C2=A0 deviceid =3D=3D gve_devs[i].device_id) {
> + device_set_desc(dev, gve_devs[i].name);
> + return (BUS_PROBE_DEFAULT);
> + }
> }
> return (ENXIO);
> }
> @@ -851,3 +869,5 @@ DRIVER_MODULE(gve, pci, gve_driver, gve_devclass, = 0, 0);
> #else
> DRIVER_MODULE(gve, pci, gve_driver, 0, 0);
> #endif
> +MODULE_PNP_INFO("U16:vendor;U16:device", pci, gve, gve_devs= ,

This is missing ;D:# so it will break as soon as you have a second
entry in the table.

While the first bit is true, I though we encoded the per= entry size so trailing garbage didn't matter.. d# will be more useful = in the future maybe.

War= ner

Jess

> +=C2=A0 =C2=A0 GVE_DEVS_COUNT);
--00000000000083cf7805fd6e8084-- From nobody Tue Jun 6 05:04:28 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZz151mjVz4bs5V for ; Tue, 6 Jun 2023 05:04:41 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZz150Dmvz3kBR for ; Tue, 6 Jun 2023 05:04:41 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-3f732d37d7cso28778555e9.2 for ; Mon, 05 Jun 2023 22:04:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686027879; x=1688619879; 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=zxWFVzi1HiS1qYaYSzBLzclZNUijbqqFFbZ6le2a4wE=; b=l+gG9pHSRXMHo73FQL+Za6YZtWTmckdSyST5bMFpw2l6Nd7xSkHeS2seg7tjLfmE4T 6zLKM4ZTr0xJkfbaQ5WfgCY7pX5Rrx02Df5xDLSNJ4MZYyoOg08uwloZYOyo1nsM0cI1 yIkpDDlMnE4f++HRoixFcCthQ+AM1yBlPNK8MYkIf93IKMKr6igvT6kiUFX/2rkPzfT5 nfArekosMl3gx7GRMvGUhDc4dzlM21rvAFyMndN42h3+du4AyPcDmKw6Fb03TDX+4ub1 DXYrjBoBMAcA1GiDz23AYui0L/1MjKtNJgMUQFkrGMAI80r7gsPuKjZ4mF2SUnsRLrz/ yhZg== X-Gm-Message-State: AC+VfDzELtA5yvGNRQ0BAi+FfliyYEFqe+Mf/t2Fuqa8lZv9j2uBMFtJ Gacrrn/bzBO7hI3cdX2vLUtmeg== X-Google-Smtp-Source: ACHHUZ43FVFXtqc7XVve7chBsn1/m6Z6030Hw3/CD/KAwrtxcFJascwG0IfWreSgPLpL2tg4DCO+6w== X-Received: by 2002:a1c:ed0a:0:b0:3f4:2ae5:b35d with SMTP id l10-20020a1ced0a000000b003f42ae5b35dmr1171893wmh.40.1686027879552; Mon, 05 Jun 2023 22:04:39 -0700 (PDT) Received: from smtpclient.apple ([131.111.5.246]) by smtp.gmail.com with ESMTPSA id l17-20020a1ced11000000b003f4266965fbsm16288330wmh.5.2023.06.05.22.04.38 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Jun 2023 22:04:39 -0700 (PDT) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.500.231\)) Subject: Re: git: 1bbdfb0b4386 - main - gve: Add PNP info to PCI attachment of gve(4) driver. From: Jessica Clarke In-Reply-To: Date: Tue, 6 Jun 2023 06:04:28 +0100 Cc: Xin LI , src-committers , "" , "" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202306060406.35646hbA078041@gitrepo.freebsd.org> <6A5F859A-033A-43E1-81CB-B364662DE2F3@freebsd.org> To: Warner Losh X-Mailer: Apple Mail (2.3731.500.231) X-Rspamd-Queue-Id: 4QZz150Dmvz3kBR X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 6 Jun 2023, at 05:31, Warner Losh wrote: >=20 >=20 >=20 > On Mon, Jun 5, 2023, 10:15 PM Jessica Clarke = wrote: > On 6 Jun 2023, at 05:06, Xin LI wrote: > >=20 > > The branch main has been updated by delphij: > >=20 > > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D1bbdfb0b438689a839e29094fcb582a1= 04cbabd9 > >=20 > > commit 1bbdfb0b438689a839e29094fcb582a104cbabd9 > > Author: Xin LI > > AuthorDate: 2023-06-06 00:58:43 +0000 > > Commit: Xin LI > > CommitDate: 2023-06-06 04:05:55 +0000 > >=20 > > gve: Add PNP info to PCI attachment of gve(4) driver. > >=20 > > Reviewed-by: imp > > Differential Revision: https://reviews.freebsd.org/D40429 > > --- > > sys/dev/gve/gve_main.c | 28 ++++++++++++++++++++++++---- > > 1 file changed, 24 insertions(+), 4 deletions(-) > >=20 > > diff --git a/sys/dev/gve/gve_main.c b/sys/dev/gve/gve_main.c > > index ae45a0cfc24a..383fd326d33a 100644 > > --- a/sys/dev/gve/gve_main.c > > +++ b/sys/dev/gve/gve_main.c > > @@ -38,6 +38,16 @@ > >=20 > > #define GVE_DEFAULT_RX_COPYBREAK 256 > >=20 > > +/* Devices supported by this driver. */ > > +static struct gve_dev { > > + uint16_t vendor_id; > > + uint16_t device_id; > > + const char *name; > > +} gve_devs[] =3D { > > + { PCI_VENDOR_ID_GOOGLE, PCI_DEV_ID_GVNIC, "gVNIC" } > > +}; > > +#define GVE_DEVS_COUNT nitems(gve_devs) >=20 > IMO this obfuscates rather than helps given the loop iterates over > gve_devs (and the macro references it). >=20 > > + > > struct sx gve_global_lock; > >=20 > > static int > > @@ -701,10 +711,18 @@ gve_service_task(void *arg, int pending) > > static int > > gve_probe(device_t dev) > > { > > - if (pci_get_vendor(dev) =3D=3D PCI_VENDOR_ID_GOOGLE && > > - pci_get_device(dev) =3D=3D PCI_DEV_ID_GVNIC) { > > - device_set_desc(dev, "gVNIC"); > > - return (BUS_PROBE_DEFAULT); > > + uint16_t deviceid, vendorid; > > + int i; > > + > > + vendorid =3D pci_get_vendor(dev); > > + deviceid =3D pci_get_device(dev); > > + > > + for (i =3D 0; i < GVE_DEVS_COUNT; i++) { > > + if (vendorid =3D=3D gve_devs[i].vendor_id && > > + deviceid =3D=3D gve_devs[i].device_id) { > > + device_set_desc(dev, gve_devs[i].name); > > + return (BUS_PROBE_DEFAULT); > > + } > > } > > return (ENXIO); > > } > > @@ -851,3 +869,5 @@ DRIVER_MODULE(gve, pci, gve_driver, = gve_devclass, 0, 0); > > #else > > DRIVER_MODULE(gve, pci, gve_driver, 0, 0); > > #endif > > +MODULE_PNP_INFO("U16:vendor;U16:device", pci, gve, gve_devs, >=20 > This is missing ;D:# so it will break as soon as you have a second > entry in the table. >=20 > While the first bit is true, I though we encoded the per entry size so = trailing garbage didn't matter.. d# will be more useful in the future = maybe. Hm indeed you=E2=80=99re right. Might as well include it still though. Jess > Warner >=20 > Jess >=20 > > + GVE_DEVS_COUNT); From nobody Tue Jun 6 05:20:33 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZzMT0NFXz4ZQyK; Tue, 6 Jun 2023 05:20:37 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZzMS7140z3lqt; Tue, 6 Jun 2023 05:20:36 +0000 (UTC) (envelope-from delphij@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686028837; 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=mdqVt3cZgrp4G8kfpVnIaaQImDIIeEO7udGlUVrL5/g=; b=HeW9tUBY5fkpiuYjgRNbo6mWQcnLdK3qTQnaYVPlIiHIhOX0ClPWXOmKpHSpaKpPzOVhlt IUoXWFyWwLvJ91AgSb2SttA75mmDfo4XB6yUMaNbfzjlWvB5o6Fn2HPSxsthjcW7divHTQ /SX04M41OdBzuew0p11u1U1Bq6OLHiRDTpOX4NdOZtB1yyDzeNLn8JO/NNFUP/hnoHaalb yLbsDQKeAXLws/ZB2ME2bXmqEFwgLp3KnkMcPhLwsCjsVEK6jpqacGZIaVj7jyC8zB+d3P plKQwA8urAeHKKmAil18N+UERDPrpcA6d8BFcjU7iCMmg/qysS5ABCM6woI+tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686028837; 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=mdqVt3cZgrp4G8kfpVnIaaQImDIIeEO7udGlUVrL5/g=; b=m35Sqoqa/CMGU2PB/e2Xlv0i5T3bbL422ZokCUCbdBdmKwc0ix2Mjig9IHBHB6oQd+DuJA QzbQlXFaUjcjSRJdX9tZpQhwKQ31LKsc74KegCOs5QVIhBpdYAVDM0mxAnIVyllI+GPf2E nSbDQwIDgVi9xC3btQ14kNdcoL7p+nLQc8Y7TFCaKE/qyXcOO3DNybrxmIAC3qAs1PLAHO Q2n28DQB+pT1bTGk61cTMM4v8Fpuy1LdCbJwGwzshO3JyH401MeLk5AI9IpSZjSs7COMI5 v33VMfEkQRa1Mxd+eMQ2/j3xh4lj5eahtzLubx+bT6q9mQNT689/I/Hz7pcGtQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686028837; a=rsa-sha256; cv=none; b=hvSabrXW5ZIPilOUwwS6YCEmFlcaG3XVSS6VVbuRyPJRpiRJqJ/ik7Oxj4hcifztxsFjdf hL/zRmhs7slcAdvaWiS23Sa2Pd9tRybKAFjOA515Aa3VrIELdWbOioGncwFZH7PVW84H2/ 0w+eDjncMiVrtKODfwbg/dT+LuEvBk0Fp4QJFwW9CEgEnzq/3qT5FqKt9fyfHtSonIzUQM ORv2e1QmG6L/AbFKwK9z2EqXXzCUhTrIK5rWOiWUyfzbCWODUTB3uV4/lsmuW8A9ygPcyQ Ufu1qLmWoVM/k0HrGfwCOuyNUDlvHP4SYTss7aho5wG64C+3g0N4PQxgCqxj0w== Received: from odin.corp.delphij.net (c-141-193-140-155.rev.sailinternet.net [141.193.140.155]) (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: delphij/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4QZzMS1hkkzbCY; Tue, 6 Jun 2023 05:20:36 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Message-ID: <55c01465-2c16-bc6b-d1fb-4b9f670d4503@FreeBSD.org> Date: Mon, 5 Jun 2023 22:20:33 -0700 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 User-Agent: Thunderbird Subject: Re: git: 1bbdfb0b4386 - main - gve: Add PNP info to PCI attachment of gve(4) driver. Content-Language: en-US To: Jessica Clarke , Warner Losh Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202306060406.35646hbA078041@gitrepo.freebsd.org> <6A5F859A-033A-43E1-81CB-B364662DE2F3@freebsd.org> From: Xin Li Organization: The FreeBSD Project In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ThisMailContainsUnwantedMimeParts: N On 2023-06-05 10:04 PM, Jessica Clarke wrote: > On 6 Jun 2023, at 05:31, Warner Losh wrote: >> >> >> >> On Mon, Jun 5, 2023, 10:15 PM Jessica Clarke wrote: >> On 6 Jun 2023, at 05:06, Xin LI wrote: >>> >>> The branch main has been updated by delphij: >>> >>> URL: https://cgit.FreeBSD.org/src/commit/?id=1bbdfb0b438689a839e29094fcb582a104cbabd9 >>> >>> commit 1bbdfb0b438689a839e29094fcb582a104cbabd9 >>> Author: Xin LI >>> AuthorDate: 2023-06-06 00:58:43 +0000 >>> Commit: Xin LI >>> CommitDate: 2023-06-06 04:05:55 +0000 >>> >>> gve: Add PNP info to PCI attachment of gve(4) driver. >>> >>> Reviewed-by: imp >>> Differential Revision: https://reviews.freebsd.org/D40429 >>> --- >>> sys/dev/gve/gve_main.c | 28 ++++++++++++++++++++++++---- >>> 1 file changed, 24 insertions(+), 4 deletions(-) >>> >>> diff --git a/sys/dev/gve/gve_main.c b/sys/dev/gve/gve_main.c >>> index ae45a0cfc24a..383fd326d33a 100644 >>> --- a/sys/dev/gve/gve_main.c >>> +++ b/sys/dev/gve/gve_main.c >>> @@ -38,6 +38,16 @@ >>> >>> #define GVE_DEFAULT_RX_COPYBREAK 256 >>> >>> +/* Devices supported by this driver. */ >>> +static struct gve_dev { >>> + uint16_t vendor_id; >>> + uint16_t device_id; >>> + const char *name; >>> +} gve_devs[] = { >>> + { PCI_VENDOR_ID_GOOGLE, PCI_DEV_ID_GVNIC, "gVNIC" } >>> +}; >>> +#define GVE_DEVS_COUNT nitems(gve_devs) >> >> IMO this obfuscates rather than helps given the loop iterates over >> gve_devs (and the macro references it). >> >>> + >>> struct sx gve_global_lock; >>> >>> static int >>> @@ -701,10 +711,18 @@ gve_service_task(void *arg, int pending) >>> static int >>> gve_probe(device_t dev) >>> { >>> - if (pci_get_vendor(dev) == PCI_VENDOR_ID_GOOGLE && >>> - pci_get_device(dev) == PCI_DEV_ID_GVNIC) { >>> - device_set_desc(dev, "gVNIC"); >>> - return (BUS_PROBE_DEFAULT); >>> + uint16_t deviceid, vendorid; >>> + int i; >>> + >>> + vendorid = pci_get_vendor(dev); >>> + deviceid = pci_get_device(dev); >>> + >>> + for (i = 0; i < GVE_DEVS_COUNT; i++) { >>> + if (vendorid == gve_devs[i].vendor_id && >>> + deviceid == gve_devs[i].device_id) { >>> + device_set_desc(dev, gve_devs[i].name); >>> + return (BUS_PROBE_DEFAULT); >>> + } >>> } >>> return (ENXIO); >>> } >>> @@ -851,3 +869,5 @@ DRIVER_MODULE(gve, pci, gve_driver, gve_devclass, 0, 0); >>> #else >>> DRIVER_MODULE(gve, pci, gve_driver, 0, 0); >>> #endif >>> +MODULE_PNP_INFO("U16:vendor;U16:device", pci, gve, gve_devs, >> >> This is missing ;D:# so it will break as soon as you have a second >> entry in the table. >> >> While the first bit is true, I though we encoded the per entry size so trailing garbage didn't matter.. d# will be more useful in the future maybe. > > Hm indeed you’re right. Might as well include it still though. I've created https://reviews.freebsd.org/D40430 in attempt to address both issues. After the change, the 'gVNIC' would be in linker.hints (but it's not clear to me if the data is really useful for tools today). I can split this into two changes if you like. Cheers, From nobody Tue Jun 6 08:52:27 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Qb43v54RCz4ZjKg; Tue, 6 Jun 2023 08:52:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Qb43v4bx4z47Ds; Tue, 6 Jun 2023 08:52:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686041547; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QQQT7VRmt8b+4wNUx2hM0B5hSr6DEdjRegj2Gz/kv4Q=; b=FGoTCTqKXOA/gAPg28osnvQeCUmpykN3yf85tQGwKCwwfjofUE0OSjlVAJ6bARsdyfcKui mKpG7eEVkRGVtANEb77W16e1Hljx5/Gp+gfXnYBzi70/Bjcf6WK8WlvkQWHwpgc62zpAxS PiwwG+cprn74din4+AtOgG052q0JowTdTthyNHxioUhnuOgIxn/T5fBISUmpup3PTJnbGi T7GKn5eSwrTwLD4HmHj7M9hXAUl/ajcCahMzLUWZZ8OCZt5DXNwtIbQ2Y+pRkGeAzavaPK dmxBPAqRz/tP/TN7vx02d3VPlj+Yf5ZLrq60mOIzE6IXnaNwh1G4MrLvLuIJgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686041547; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QQQT7VRmt8b+4wNUx2hM0B5hSr6DEdjRegj2Gz/kv4Q=; b=mkNbPSSFK3h4J6MGTqZ93cvh/i9yaJnpQYJjfK404Y57QJv0tLlZvXyR3t9G2eJZ4/nNa+ MFemuL517vLjE/iwqRxDFhwcOTkGP2vBW9pXbJ0cBUTc5sey0nB/3xfA7UX7gTilA4ZrCW Byg1rLqGnvv8qKpb4WuUEysrgbs6cQfJZgSOEpyvnETsJ9CZaRb7uG8RFTzi+Dg+Wz2hH0 /9vzfaXB20IQ3Pu8xhAFRRFx9GfSGsJkoSzAwST+/pjbm1jb+1xYPsmoZZfX1ZZLbOKZ8P 4XZpbufVfrHntRatlfP1mvm6yjRtgt86dWtOabfozTVrF9JW7aUPHx9uXQm9NQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686041547; a=rsa-sha256; cv=none; b=WkhOcFdVEP1mGmSHkm+G5aOxatgFCAgv6vncHVffvakHc2NpOmqT+FXQ7FUuYR5ewGAS5c 3Cl/PnIzKyj+/7FdaumqPOGePyhQgq4v52UVYBISt1UN0rBcCaHLIc0SK3yQuTLIz/WeK4 9ELAam0PtwKHHzMbKfEx2Q4e0lOpY2ODRQ1fbGkXEjCd+o0ZHRRxDxd2oruYm40hjs3SmK 4ntrUx7yASPWWE1IJzRn93nkTIfc89xqvrFU4zDR+ZGJ7WUMb73BMaqT7KPl1peUuMskg7 5/POwfWqEzn5hNclMUNC95aXIBHQYTILSh1at9PMK+p14FamzED6thwWfq0BKg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Qb43v3gpPzNy8; Tue, 6 Jun 2023 08:52:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3568qRaS051939; Tue, 6 Jun 2023 08:52:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3568qRZT051938; Tue, 6 Jun 2023 08:52:27 GMT (envelope-from git) Date: Tue, 6 Jun 2023 08:52:27 GMT Message-Id: <202306060852.3568qRZT051938@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: a9bfd080d09a - main - if_epair: do not transmit packets that exceed the interface MTU List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a9bfd080d09a915055af51103defb5c38b94a236 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=a9bfd080d09a915055af51103defb5c38b94a236 commit a9bfd080d09a915055af51103defb5c38b94a236 Author: Kristof Provost AuthorDate: 2023-06-02 14:37:09 +0000 Commit: Kristof Provost CommitDate: 2023-06-06 08:00:48 +0000 if_epair: do not transmit packets that exceed the interface MTU While if_epair has no issues doing this we should drop those packets anyway, because it improves the fidelity of the automated tests. Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D40397 --- sys/net/if_epair.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sys/net/if_epair.c b/sys/net/if_epair.c index aee5a76a046b..56bfdfbd610f 100644 --- a/sys/net/if_epair.c +++ b/sys/net/if_epair.c @@ -336,6 +336,17 @@ epair_transmit(struct ifnet *ifp, struct mbuf *m) return (0); M_ASSERTPKTHDR(m); + /* + * We could just transmit this, but it makes testing easier if we're a + * little bit more like real hardware. + * Allow just that little bit extra for ethernet (and vlan) headers. + */ + if (m->m_pkthdr.len > (ifp->if_mtu + sizeof(struct ether_vlan_header))) { + m_freem(m); + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); + return (E2BIG); + } + /* * We are not going to use the interface en/dequeue mechanism * on the TX side. We are called from ether_output_frame() From nobody Tue Jun 6 08:52:28 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Qb43w63vyz4ZjcH; Tue, 6 Jun 2023 08:52:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Qb43w573qz47Yq; Tue, 6 Jun 2023 08:52:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686041548; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vz4f9BCGseoZ/kE4lewrRfQgFpzxNoZSa2ew9OWHMAk=; b=UC2+e8MPdHgmLXIIXW+uARFyGWutik4K7bcf2XraJ0Pd3x1RfTgWI30kdht7RQNPs6Vc/w iC7RwIWCu5KnSGaln1gMBV73xmlNeXljwkXfHqVA2p7zNEQwaRcRxxOwiheB243U5PXYgA LuJwGtpM/rBluWQV1G/1arA8aahzAJRwBqW1CiZlEQwAQKhwIweJusQLv9FBPENcCj804r cV4Mlt1EPV5z/KJvvopqKab/djQmFmGYwiYe9oZqYF9zirURgha8wkamn5f6gMAcYOFQzl nOmsQ/6vH4mPcGpwe+0ckzLdgIreSy0rRu1cFzF6Ij1YLQgYC55vRkJWFTdq1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686041548; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vz4f9BCGseoZ/kE4lewrRfQgFpzxNoZSa2ew9OWHMAk=; b=MGoCPNaG1SNeTzgUMUJR135nY20Q0FsFE1hp/AURH8CYoYiyW5RAe80LGo3rT6ALBVDpak KchGBlFJsJ2CcB1ZmK//6yR5LLbgN58Sv25V1CucFN36znVtzmIsU3MV8b5CnqE2SVtqbe mW3b0STYeXnq5TtD6Vs16WPkikDC9kZWnhrgJHzD9VlNp4Yt6t9fLcEpE4sgDBk42T5zPT y+ihXqGh3j4CJcM95TdEuBIx5t3Ch86GbAaobbJHJH2pbcHwHFgC5GjjdB091CPuJzI9h3 PYH8vEhqOJF7Ci+chO0fZvcg8N1OWN8dD1/H8xihCI2OWo15g2aYU7RRlFSwjw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686041548; a=rsa-sha256; cv=none; b=C43qN8aPLP+QMzwEsrqEUebceSWCAZThuZezhBbiFko7yFD367IJID/lPv9ITIW/aMgFcr O56KbqfRPMzMBdyAdi6qRzCLdEK1CMsxjmZUpO7hTMnRA1B/ZVpA/t2YNJJqJ4Sj3LqmHc K1o1+h/UOxhTlvDmxeHpFvdPJfjqKDE6DzK8VQBEKnrs4o6CTPntq0ncQ2KP4yQdoZzF2L WXwK3HD6/SOAOMbgZ1ElxFDQCxdwO5KwBhe/PlIQEYCSh+Hm9xJ8kcJP5ex9UQU6O0kyL3 nxZSqueWp7zLIU0bv8aTj6AkQUp1wUHLxdaBTvofQvMpXOodUpe062tr4uuHJg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Qb43w44xJzP3m; Tue, 6 Jun 2023 08:52:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3568qSEm052406; Tue, 6 Jun 2023 08:52:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3568qS8k052394; Tue, 6 Jun 2023 08:52:28 GMT (envelope-from git) Date: Tue, 6 Jun 2023 08:52:28 GMT Message-Id: <202306060852.3568qS8k052394@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: 185c1cddd7ef - main - netinet: re-read IP length after PFIL hook List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 185c1cddd7ef34db82bc3a25b3c92556416a4e55 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=185c1cddd7ef34db82bc3a25b3c92556416a4e55 commit 185c1cddd7ef34db82bc3a25b3c92556416a4e55 Author: Kristof Provost AuthorDate: 2023-06-02 14:38:30 +0000 Commit: Kristof Provost CommitDate: 2023-06-06 08:01:03 +0000 netinet: re-read IP length after PFIL hook The pfil hook may modify the packet, so before we check its length (to decide if it needs to be fragmented or not) we should re-read that length. This is most likely to happen when pf is reassembling packets. In that scenario we'd receive the last fragment, which is likely to be a short packet, pf would reassemble it (likely exceeding the interface MTU) and then we'd transmit it without fragmenting, because we're comparing the MTU to the length of the last fragment, not the fully reassembled packet. See also: https://redmine.pfsense.org/issues/14396 Reviewed by: cy MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D40395 --- sys/netinet/ip_output.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index ceae756affa3..1976ab9803af 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -699,6 +699,7 @@ sendit: case 0: /* Continue normally */ ip = mtod(m, struct ip *); + ip_len = ntohs(ip->ip_len); break; case -1: /* Need to try again */ From nobody Tue Jun 6 08:52:29 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Qb43x6vQ7z4ZjSs; Tue, 6 Jun 2023 08:52:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Qb43x6BZjz47P1; Tue, 6 Jun 2023 08:52:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686041549; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hrOc2Ov+cHaAnWGFYFZcOh0vlWeFP9BB1NTZDukTh1M=; b=Q+Xleu9/0urQ7CtUzN1J7+iYQ3W8yQ9uWTb6Lp+qyUWUyVTPB2c6zA3wO4RRfHde9zb7/d h5xH0Tz6ttR4klHEUo3JNgs5fCEbEj/AmWUpsXUreyRHOCfAvQSInUCQ9n3/VGzLqH/fWq 8tObWnB5417m4KKaD7cv85jgaFQw8BN5pCycTqgkZvpK4TcU7B2AyqCSbXOocVLv5Kwz8L nPA5593n8kv6CRJjYaxiomvkbymFsDshIZy0JgYsQTh7ES7T/5W6xVtvAHbk8WBgM5pBNb NAdzUCo6B5Zr1y+TnnOob9W21TG4fEJ5RbcZ7gaioi7EPlzNEkXo0PS1n0PnGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686041549; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hrOc2Ov+cHaAnWGFYFZcOh0vlWeFP9BB1NTZDukTh1M=; b=c5qKyLUCVwmJcydBDKREUu/j6UmorIiTBuXbgDHOqHocHzKPy8pcs69/fg9l8P/bd/rjAJ 3ckJ69Dwedss6eizWOnpKak2uv0qJWrHenrt9T2+jPdaL7Vnbas7luyaw+4p0sSDMtxJ/6 /OlTixrixyu4QpKDu8KN8L23kqKOPeSAWVWo/hyk/53hNkS9FDKDndpe12SHd0EMFZtcLq vOmhlhffEld3ArQx4G3xZ6Z1e8IUmW8KYgdSsNvKl5teRXJSrHMNSFGKky35WO9b5Rf3R2 kCkWRclOI2C0irrIdZQTTRs9gle4UyDqjyBMGPd+7NrS5gXWhnd1n0+f2fsIJg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686041549; a=rsa-sha256; cv=none; b=CSvsA4vUD2xy3q/+0wOkaTFthS5AvSmRfVeV1y7oKbsgdXzwN55zMI5KyKAfYDvp7ks8tc 7AHEunkZ99Zqm16r4QDx8wNhGqOvA7RWGUcFnjAkMeFMphL1LLcRjI3AEomKuN0OJh6rW0 rtdT9/+t7zF51lA/h6Y9ghPU7Wlt7NeLD5jMZ2RvK7CxDm0YDGFKtQ5QoaQZxUK3ykdMD2 0NLgvcsvbEWp3AAzoQJzL0DXw7z6a8JqQEcEXSg8/Qmk6350+9t70va7Alj1qy9tQKQCeE mhrBRE2xn4GyCmp8g+L1k4qFVrFDqnvFatSSjfMfKoNFVdWSi6SEJCxUAjVBeQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Qb43x53sxzNTr; Tue, 6 Jun 2023 08:52:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3568qTC2054006; Tue, 6 Jun 2023 08:52:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3568qTRC053993; Tue, 6 Jun 2023 08:52:29 GMT (envelope-from git) Date: Tue, 6 Jun 2023 08:52:29 GMT Message-Id: <202306060852.3568qTRC053993@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: 657aec455f7c - main - pf tests: test reassembly in the slow path List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 657aec455f7cd960c8fa79a089f88f450c568d2d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=657aec455f7cd960c8fa79a089f88f450c568d2d commit 657aec455f7cd960c8fa79a089f88f450c568d2d Author: Kristof Provost AuthorDate: 2023-06-02 14:42:08 +0000 Commit: Kristof Provost CommitDate: 2023-06-06 08:03:50 +0000 pf tests: test reassembly in the slow path Ensure that 'fragment reassemble' works as expected, even in the IP stack's slow forwarding path. (So not via ip_tryforward()) Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D40396 --- tests/sys/netpfil/pf/fragmentation_pass.sh | 44 ++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/tests/sys/netpfil/pf/fragmentation_pass.sh b/tests/sys/netpfil/pf/fragmentation_pass.sh index 560642a189e8..d257de730d2d 100644 --- a/tests/sys/netpfil/pf/fragmentation_pass.sh +++ b/tests/sys/netpfil/pf/fragmentation_pass.sh @@ -425,6 +425,49 @@ no_df_cleanup() pft_cleanup } +atf_test_case "reassemble_slowpath" "cleanup" +reassemble_slowpath_head() +{ + atf_set descr 'Test reassembly on the slow path' + atf_set require.user root +} + +reassemble_slowpath_body() +{ + if ! sysctl -q kern.features.ipsec >/dev/null ; then + atf_skip "This test requires ipsec" + fi + + setup_router_server_ipv4 + + # Now define an ipsec policy so we end up taking the slow path. + # We don't actually need the traffic to go through ipsec, we just don't + # want to go through ip_tryforward(). + echo "flush; + spdflush; + spdadd 203.0.113.1/32 203.0.113.2/32 any -P out ipsec esp/transport//require; + add 203.0.113.1 203.0.113.2 esp 0x1001 -E aes-gcm-16 \"12345678901234567890\";" \ + | jexec router setkey -c + + # Sanity check. + ping_server_check_reply exit:0 --ping-type=icmp + + # Enable packet reassembly with clearing of the no-df flag. + pft_set_rules router \ + "scrub in on ${epair_tester}b fragment no reassemble" \ + "scrub on ${epair_server}a fragment reassemble" \ + "pass" + + # Ensure that the packet makes it through the slow path + atf_check -s exit:0 -o ignore \ + ping -c 1 -s 2000 198.51.100.2 +} + +reassemble_slowpath_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "too_many_fragments" @@ -435,4 +478,5 @@ atf_init_test_cases() atf_add_test_case "overlimit" atf_add_test_case "reassemble" atf_add_test_case "no_df" + atf_add_test_case "reassemble_slowpath" } From nobody Tue Jun 6 10:11:09 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Qb5pj3Shqz4ZrY4; Tue, 6 Jun 2023 10:11:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Qb5pj3J3tz4JCR; Tue, 6 Jun 2023 10:11:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686046269; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uF96G5F3tEOmqowUVosg+jvn7tGj09idHllE/WPXPn0=; b=EI92CYZZ906az0L5TRxIdt5ta99+qiL7QRdfiY38mowzE3WwOWHCNno1eR043QIutLoQs7 uWbHHg2YGgB0f6xoItvhy2KM5AohShrgm+bTgu0tIpA6wVpdykyfLtK6EmgJIit6HQ5rcD kAJICEeAFlEh/HOlGOqNS6Ri03oEM3KobJi/hEAgj3WMWm4M2EKUBksASICPrtaMAfShGO EERTlqOfcFVP44QgImGZxKbE0DbYCJx0H9L/PyaBUvxkHS//16uI34rz7NO+snGywF5MxN //I8FeFtQabO+sHcips4nP3OVuerrJKKFhIk/0s9e1jhSgRfLu+FvgYFkdssSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686046269; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uF96G5F3tEOmqowUVosg+jvn7tGj09idHllE/WPXPn0=; b=k6oZsGXyt5ZN19shEx/7mnaREa10OA008Vu4lx0MCDKYgd0DnAgGlswTgYcf3LgDI64E5l jAP3f1oXP8gbgQ3fZuY1dijoWiD5f2fXA15KrRbTEX7CJVupjUy33ETPqsv7XGX7w4bcPA alYtC3dzoC/aLnUWFyXwkkTNg741DASbzq2Wc49I6DqEkI0is0/XNUoIWZSYD2fq6ekFz6 HM0WbLcP8BPRC0RCxjyyD2LdaKvSGGP/vTjf+xmg3Hu5Q/XMQmjDSnZXJXP7wAlSgvGuVa 8yFMKjWBHRHyLZghyBvYIfqaviwMW5KnXax28qY+Q443YTNfK6052/BAMJto6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686046269; a=rsa-sha256; cv=none; b=WnL4+q9aPuQv+9MIiRgU9Suyn+VTvTp2TU6djGk1etTJWJx3TGqgJpk9EuUYWXxQNdjWLt VijtWmQd41+y1Ym+AIRictATXkDIe2aSDm4+t3QT/5IbqxLdjYmik2QKXmY3Yt9YCGQuV8 La0dosuuCkOy0fQ4Vc/OTYEfaTvHRfgr+dqqkLTwG3KwDGY8jtSpvy6RkXEKIB1ZXoa+8M f2Sk+HkQzVXLztC0CNHNI0PRylGTmmvV9lRYKEJqWHzWx9iH4qx3Si1DsFIC4UAV9ziaox 4DNVczezvvd06FUtRxy2UmZ9GeKfs/f/PwGqMWfGmeCPynUvpCJtuDRkp8YP9Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Qb5pj2MWSzQtN; Tue, 6 Jun 2023 10:11:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 356AB93n081907; Tue, 6 Jun 2023 10:11:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 356AB9YF081906; Tue, 6 Jun 2023 10:11:09 GMT (envelope-from git) Date: Tue, 6 Jun 2023 10:11:09 GMT Message-Id: <202306061011.356AB9YF081906@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: 62f9bcf2b427 - main - Switch to contigmalloc in the Hyper-V code List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 62f9bcf2b4271d58ccf0bd8a81c540bb99a53ef7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=62f9bcf2b4271d58ccf0bd8a81c540bb99a53ef7 commit 62f9bcf2b4271d58ccf0bd8a81c540bb99a53ef7 Author: Andrew Turner AuthorDate: 2023-05-22 18:52:54 +0000 Commit: Andrew Turner CommitDate: 2023-06-06 09:50:59 +0000 Switch to contigmalloc in the Hyper-V code In the Hyper-V drivers we need to allocate buffers shared between the host and guest. This memory has been allocated with bus_dma, however it doesn't use this correctly, e.g. it is missing calls to bus_dmamap_sync. Along with this on arm64 we need this memory to be mapped with the correct memory type that bus_dma may not use. Switch to contigmalloc to allocate this memory as this will correctly allocate cacheable memory. Reviewed by: Souradeep Chakrabarti Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D40227 --- sys/dev/hyperv/include/hyperv_busdma.h | 4 -- sys/dev/hyperv/netvsc/hn_nvs.c | 11 ++++-- sys/dev/hyperv/netvsc/hn_rndis.c | 1 - sys/dev/hyperv/netvsc/if_hn.c | 28 +++++++------- sys/dev/hyperv/netvsc/if_hnvar.h | 3 -- sys/dev/hyperv/pcib/vmbus_pcib.c | 1 - sys/dev/hyperv/vmbus/amd64/hyperv_machdep.c | 17 ++++---- sys/dev/hyperv/vmbus/hyperv_busdma.c | 47 ---------------------- sys/dev/hyperv/vmbus/hyperv_common_reg.h | 2 + sys/dev/hyperv/vmbus/vmbus.c | 60 +++++++++++++---------------- sys/dev/hyperv/vmbus/vmbus_chan.c | 29 +++++++------- sys/dev/hyperv/vmbus/vmbus_chanvar.h | 4 +- sys/dev/hyperv/vmbus/vmbus_var.h | 6 --- sys/dev/hyperv/vmbus/vmbus_xact.c | 14 ++++--- 14 files changed, 86 insertions(+), 141 deletions(-) diff --git a/sys/dev/hyperv/include/hyperv_busdma.h b/sys/dev/hyperv/include/hyperv_busdma.h index ff01b3e27a95..804e5c26a669 100644 --- a/sys/dev/hyperv/include/hyperv_busdma.h +++ b/sys/dev/hyperv/include/hyperv_busdma.h @@ -41,9 +41,5 @@ struct hyperv_dma { void hyperv_dma_map_paddr(void *arg, bus_dma_segment_t *segs, int nseg, int error); -void *hyperv_dmamem_alloc(bus_dma_tag_t parent_dtag, - bus_size_t alignment, bus_addr_t boundary, bus_size_t size, - struct hyperv_dma *dma, int flags); -void hyperv_dmamem_free(struct hyperv_dma *dma, void *ptr); #endif /* !_HYPERV_BUSDMA_H_ */ diff --git a/sys/dev/hyperv/netvsc/hn_nvs.c b/sys/dev/hyperv/netvsc/hn_nvs.c index 4dbc28996617..e1769a806c89 100644 --- a/sys/dev/hyperv/netvsc/hn_nvs.c +++ b/sys/dev/hyperv/netvsc/hn_nvs.c @@ -43,6 +43,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include + #include #include #include @@ -52,7 +56,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -166,7 +169,8 @@ hn_nvs_conn_rxbuf(struct hn_softc *sc) * just share this RXBUF. */ error = vmbus_chan_gpadl_connect(sc->hn_prichan, - sc->hn_rxbuf_dma.hv_paddr, rxbuf_size, &sc->hn_rxbuf_gpadl); + pmap_kextract((vm_offset_t)sc->hn_rxbuf), rxbuf_size, + &sc->hn_rxbuf_gpadl); if (error) { if_printf(sc->hn_ifp, "rxbuf gpadl conn failed: %d\n", error); @@ -235,7 +239,8 @@ hn_nvs_conn_chim(struct hn_softc *sc) * Sub-channels just share this chimney sending buffer. */ error = vmbus_chan_gpadl_connect(sc->hn_prichan, - sc->hn_chim_dma.hv_paddr, HN_CHIM_SIZE, &sc->hn_chim_gpadl); + pmap_kextract((vm_offset_t)sc->hn_chim), HN_CHIM_SIZE, + &sc->hn_chim_gpadl); if (error) { if_printf(sc->hn_ifp, "chim gpadl conn failed: %d\n", error); goto cleanup; diff --git a/sys/dev/hyperv/netvsc/hn_rndis.c b/sys/dev/hyperv/netvsc/hn_rndis.c index 58167312c9f3..cafe73ff519c 100644 --- a/sys/dev/hyperv/netvsc/hn_rndis.c +++ b/sys/dev/hyperv/netvsc/hn_rndis.c @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include diff --git a/sys/dev/hyperv/netvsc/if_hn.c b/sys/dev/hyperv/netvsc/if_hn.c index 5d7002b8f65f..aeb6ec22a703 100644 --- a/sys/dev/hyperv/netvsc/if_hn.c +++ b/sys/dev/hyperv/netvsc/if_hn.c @@ -85,6 +85,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include + #include #include @@ -4984,9 +4988,8 @@ hn_create_rx_data(struct hn_softc *sc, int ring_cnt) * - A large enough buffer is allocated, certain version of NVSes * may further limit the usable space. */ - sc->hn_rxbuf = hyperv_dmamem_alloc(bus_get_dma_tag(dev), - PAGE_SIZE, 0, HN_RXBUF_SIZE, &sc->hn_rxbuf_dma, - BUS_DMA_WAITOK | BUS_DMA_ZERO); + sc->hn_rxbuf = contigmalloc(HN_RXBUF_SIZE, M_DEVBUF, M_WAITOK | M_ZERO, + 0ul, ~0ul, PAGE_SIZE, 0); if (sc->hn_rxbuf == NULL) { device_printf(sc->hn_dev, "allocate rxbuf failed\n"); return (ENOMEM); @@ -5016,9 +5019,8 @@ hn_create_rx_data(struct hn_softc *sc, int ring_cnt) for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { struct hn_rx_ring *rxr = &sc->hn_rx_ring[i]; - rxr->hn_br = hyperv_dmamem_alloc(bus_get_dma_tag(dev), - PAGE_SIZE, 0, HN_TXBR_SIZE + HN_RXBR_SIZE, - &rxr->hn_br_dma, BUS_DMA_WAITOK); + rxr->hn_br = contigmalloc(HN_TXBR_SIZE + HN_RXBR_SIZE, M_DEVBUF, + M_WAITOK | M_ZERO, 0ul, ~0ul, PAGE_SIZE, 0); if (rxr->hn_br == NULL) { device_printf(dev, "allocate bufring failed\n"); return (ENOMEM); @@ -5171,7 +5173,7 @@ hn_destroy_rx_data(struct hn_softc *sc) if (sc->hn_rxbuf != NULL) { if ((sc->hn_flags & HN_FLAG_RXBUF_REF) == 0) - hyperv_dmamem_free(&sc->hn_rxbuf_dma, sc->hn_rxbuf); + contigfree(sc->hn_rxbuf, HN_RXBUF_SIZE, M_DEVBUF); else device_printf(sc->hn_dev, "RXBUF is referenced\n"); sc->hn_rxbuf = NULL; @@ -5186,7 +5188,8 @@ hn_destroy_rx_data(struct hn_softc *sc) if (rxr->hn_br == NULL) continue; if ((rxr->hn_rx_flags & HN_RX_FLAG_BR_REF) == 0) { - hyperv_dmamem_free(&rxr->hn_br_dma, rxr->hn_br); + contigfree(rxr->hn_br, HN_TXBR_SIZE + HN_RXBR_SIZE, + M_DEVBUF); } else { device_printf(sc->hn_dev, "%dth channel bufring is referenced", i); @@ -5491,9 +5494,8 @@ hn_create_tx_data(struct hn_softc *sc, int ring_cnt) * * NOTE: It is shared by all channels. */ - sc->hn_chim = hyperv_dmamem_alloc(bus_get_dma_tag(sc->hn_dev), - PAGE_SIZE, 0, HN_CHIM_SIZE, &sc->hn_chim_dma, - BUS_DMA_WAITOK | BUS_DMA_ZERO); + sc->hn_chim = contigmalloc(HN_CHIM_SIZE, M_DEVBUF, M_WAITOK | M_ZERO, + 0ul, ~0ul, PAGE_SIZE, 0); if (sc->hn_chim == NULL) { device_printf(sc->hn_dev, "allocate txbuf failed\n"); return (ENOMEM); @@ -5689,7 +5691,7 @@ hn_destroy_tx_data(struct hn_softc *sc) if (sc->hn_chim != NULL) { if ((sc->hn_flags & HN_FLAG_CHIM_REF) == 0) { - hyperv_dmamem_free(&sc->hn_chim_dma, sc->hn_chim); + contigfree(sc->hn_chim, HN_CHIM_SIZE, M_DEVBUF); } else { device_printf(sc->hn_dev, "chimney sending buffer is referenced"); @@ -6263,7 +6265,7 @@ hn_chan_attach(struct hn_softc *sc, struct vmbus_channel *chan) * Open this channel */ cbr.cbr = rxr->hn_br; - cbr.cbr_paddr = rxr->hn_br_dma.hv_paddr; + cbr.cbr_paddr = pmap_kextract((vm_offset_t)rxr->hn_br); cbr.cbr_txsz = HN_TXBR_SIZE; cbr.cbr_rxsz = HN_RXBR_SIZE; error = vmbus_chan_open_br(chan, &cbr, NULL, 0, hn_chan_callback, rxr); diff --git a/sys/dev/hyperv/netvsc/if_hnvar.h b/sys/dev/hyperv/netvsc/if_hnvar.h index b85513308267..cc1f53b91876 100644 --- a/sys/dev/hyperv/netvsc/if_hnvar.h +++ b/sys/dev/hyperv/netvsc/if_hnvar.h @@ -102,7 +102,6 @@ struct hn_rx_ring { struct sysctl_oid *hn_rx_sysctl_tree; void *hn_br; /* TX/RX bufring */ - struct hyperv_dma hn_br_dma; struct vmbus_channel *hn_chan; } __aligned(CACHE_LINE_SIZE); @@ -242,10 +241,8 @@ struct hn_softc { void *hn_rxbuf; uint32_t hn_rxbuf_gpadl; - struct hyperv_dma hn_rxbuf_dma; uint32_t hn_chim_gpadl; - struct hyperv_dma hn_chim_dma; uint32_t hn_rndis_rid; uint32_t hn_ndis_ver; diff --git a/sys/dev/hyperv/pcib/vmbus_pcib.c b/sys/dev/hyperv/pcib/vmbus_pcib.c index d68ad6821ad8..a684e79fbd14 100644 --- a/sys/dev/hyperv/pcib/vmbus_pcib.c +++ b/sys/dev/hyperv/pcib/vmbus_pcib.c @@ -77,7 +77,6 @@ __FBSDID("$FreeBSD$"); #include #endif #include -#include #include #include #include diff --git a/sys/dev/hyperv/vmbus/amd64/hyperv_machdep.c b/sys/dev/hyperv/vmbus/amd64/hyperv_machdep.c index c158f72eb9e7..9b9c240d3843 100644 --- a/sys/dev/hyperv/vmbus/amd64/hyperv_machdep.c +++ b/sys/dev/hyperv/vmbus/amd64/hyperv_machdep.c @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -41,6 +42,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include @@ -51,7 +54,6 @@ __FBSDID("$FreeBSD$"); struct hyperv_reftsc_ctx { struct hyperv_reftsc *tsc_ref; - struct hyperv_dma tsc_ref_dma; }; static uint32_t hyperv_tsc_vdso_timehands( @@ -117,7 +119,7 @@ hyperv_tsc_mmap(struct cdev *dev __unused, vm_ooffset_t offset, if (offset != 0) return (EOPNOTSUPP); - *paddr = hyperv_ref_tsc.tsc_ref_dma.hv_paddr; + *paddr = pmap_kextract((vm_offset_t)hyperv_ref_tsc.tsc_ref); return (0); } @@ -208,18 +210,17 @@ hyperv_tsc_tcinit(void *dummy __unused) return; } - hyperv_ref_tsc.tsc_ref = hyperv_dmamem_alloc(NULL, PAGE_SIZE, 0, - sizeof(struct hyperv_reftsc), &hyperv_ref_tsc.tsc_ref_dma, - BUS_DMA_WAITOK | BUS_DMA_ZERO); + hyperv_ref_tsc.tsc_ref = contigmalloc(PAGE_SIZE, M_DEVBUF, + M_WAITOK | M_ZERO, 0ul, ~0ul, PAGE_SIZE, 0); if (hyperv_ref_tsc.tsc_ref == NULL) { printf("hyperv: reftsc page allocation failed\n"); return; } orig = rdmsr(MSR_HV_REFERENCE_TSC); - val = MSR_HV_REFTSC_ENABLE | (orig & MSR_HV_REFTSC_RSVD_MASK) | - ((hyperv_ref_tsc.tsc_ref_dma.hv_paddr >> PAGE_SHIFT) << - MSR_HV_REFTSC_PGSHIFT); + val = (pmap_kextract((vm_offset_t)hyperv_ref_tsc.tsc_ref) >> + PAGE_SHIFT) << MSR_HV_REFTSC_PGSHIFT; + val |= MSR_HV_REFTSC_ENABLE | (orig & MSR_HV_REFTSC_RSVD_MASK); wrmsr(MSR_HV_REFERENCE_TSC, val); /* Register "enlightened" timecounter. */ diff --git a/sys/dev/hyperv/vmbus/hyperv_busdma.c b/sys/dev/hyperv/vmbus/hyperv_busdma.c index 9550540014c4..81817d476d29 100644 --- a/sys/dev/hyperv/vmbus/hyperv_busdma.c +++ b/sys/dev/hyperv/vmbus/hyperv_busdma.c @@ -49,50 +49,3 @@ hyperv_dma_map_paddr(void *arg, bus_dma_segment_t *segs, int nseg, int error) *paddr = segs->ds_addr; } -void * -hyperv_dmamem_alloc(bus_dma_tag_t parent_dtag, bus_size_t alignment, - bus_addr_t boundary, bus_size_t size, struct hyperv_dma *dma, int flags) -{ - void *ret; - int error; - - error = bus_dma_tag_create(parent_dtag, /* parent */ - alignment, /* alignment */ - boundary, /* boundary */ - BUS_SPACE_MAXADDR, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - size, /* maxsize */ - 1, /* nsegments */ - size, /* maxsegsize */ - 0, /* flags */ - NULL, /* lockfunc */ - NULL, /* lockfuncarg */ - &dma->hv_dtag); - if (error) - return NULL; - - error = bus_dmamem_alloc(dma->hv_dtag, &ret, - (flags & HYPERV_DMA_MASK) | BUS_DMA_COHERENT, &dma->hv_dmap); - if (error) { - bus_dma_tag_destroy(dma->hv_dtag); - return NULL; - } - - error = bus_dmamap_load(dma->hv_dtag, dma->hv_dmap, ret, size, - hyperv_dma_map_paddr, &dma->hv_paddr, BUS_DMA_NOWAIT); - if (error) { - bus_dmamem_free(dma->hv_dtag, ret, dma->hv_dmap); - bus_dma_tag_destroy(dma->hv_dtag); - return NULL; - } - return ret; -} - -void -hyperv_dmamem_free(struct hyperv_dma *dma, void *ptr) -{ - bus_dmamap_unload(dma->hv_dtag, dma->hv_dmap); - bus_dmamem_free(dma->hv_dtag, ptr, dma->hv_dmap); - bus_dma_tag_destroy(dma->hv_dtag); -} diff --git a/sys/dev/hyperv/vmbus/hyperv_common_reg.h b/sys/dev/hyperv/vmbus/hyperv_common_reg.h index 2a6437390ca6..e303d263a7fe 100644 --- a/sys/dev/hyperv/vmbus/hyperv_common_reg.h +++ b/sys/dev/hyperv/vmbus/hyperv_common_reg.h @@ -61,10 +61,12 @@ #define MSR_HV_SIEFP_ENABLE 0x0001ULL #define MSR_HV_SIEFP_RSVD_MASK 0x0ffeULL #define MSR_HV_SIEFP_PGSHIFT 12 +#define MSR_HV_SIEFP_PGMASK (~0ULL << MSR_HV_SIEFP_PGSHIFT) #define MSR_HV_SIMP_ENABLE 0x0001ULL #define MSR_HV_SIMP_RSVD_MASK 0x0ffeULL #define MSR_HV_SIMP_PGSHIFT 12 +#define MSR_HV_SIMP_PGMASK (~0ULL << MSR_HV_SIMP_PGSHIFT) #define MSR_HV_SINT_VECTOR_MASK 0x00ffULL #define MSR_HV_SINT_RSVD1_MASK 0xff00ULL diff --git a/sys/dev/hyperv/vmbus/vmbus.c b/sys/dev/hyperv/vmbus/vmbus.c index c349f862d378..ae4c466d98d9 100644 --- a/sys/dev/hyperv/vmbus/vmbus.c +++ b/sys/dev/hyperv/vmbus/vmbus.c @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -425,9 +426,9 @@ vmbus_connect(struct vmbus_softc *sc, uint32_t version) req = vmbus_msghc_dataptr(mh); req->chm_hdr.chm_type = VMBUS_CHANMSG_TYPE_CONNECT; req->chm_ver = version; - req->chm_evtflags = sc->vmbus_evtflags_dma.hv_paddr; - req->chm_mnf1 = sc->vmbus_mnf1_dma.hv_paddr; - req->chm_mnf2 = sc->vmbus_mnf2_dma.hv_paddr; + req->chm_evtflags = pmap_kextract((vm_offset_t)sc->vmbus_evtflags); + req->chm_mnf1 = pmap_kextract((vm_offset_t)sc->vmbus_mnf1); + req->chm_mnf2 = pmap_kextract((vm_offset_t)sc->vmbus_mnf2); error = vmbus_msghc_exec(sc, mh); if (error) { @@ -744,17 +745,17 @@ vmbus_synic_setup(void *xsc) * Setup the SynIC message. */ orig = RDMSR(MSR_HV_SIMP); - val = MSR_HV_SIMP_ENABLE | (orig & MSR_HV_SIMP_RSVD_MASK) | - ((VMBUS_PCPU_GET(sc, message_dma.hv_paddr, cpu) >> PAGE_SHIFT) - << MSR_HV_SIMP_PGSHIFT); + val = pmap_kextract((vm_offset_t)VMBUS_PCPU_GET(sc, message, cpu)) & + MSR_HV_SIMP_PGMASK; + val |= MSR_HV_SIMP_ENABLE | (orig & MSR_HV_SIMP_RSVD_MASK); WRMSR(MSR_HV_SIMP, val); /* * Setup the SynIC event flags. */ orig = RDMSR(MSR_HV_SIEFP); - val = MSR_HV_SIEFP_ENABLE | (orig & MSR_HV_SIEFP_RSVD_MASK) | - ((VMBUS_PCPU_GET(sc, event_flags_dma.hv_paddr, cpu) >> PAGE_SHIFT) - << MSR_HV_SIEFP_PGSHIFT); + val = pmap_kextract((vm_offset_t)VMBUS_PCPU_GET(sc, event_flags, cpu)) & + MSR_HV_SIMP_PGMASK; + val |= MSR_HV_SIEFP_ENABLE | (orig & MSR_HV_SIEFP_RSVD_MASK); WRMSR(MSR_HV_SIEFP, val); /* @@ -817,48 +818,43 @@ vmbus_synic_teardown(void *arg) static int vmbus_dma_alloc(struct vmbus_softc *sc) { - bus_dma_tag_t parent_dtag; uint8_t *evtflags; int cpu; - parent_dtag = bus_get_dma_tag(sc->vmbus_dev); CPU_FOREACH(cpu) { void *ptr; /* * Per-cpu messages and event flags. */ - ptr = hyperv_dmamem_alloc(parent_dtag, PAGE_SIZE, 0, - PAGE_SIZE, VMBUS_PCPU_PTR(sc, message_dma, cpu), - BUS_DMA_WAITOK | BUS_DMA_ZERO); + ptr = contigmalloc(PAGE_SIZE, M_DEVBUF, M_WAITOK | M_ZERO, + 0ul, ~0ul, PAGE_SIZE, 0); if (ptr == NULL) return ENOMEM; VMBUS_PCPU_GET(sc, message, cpu) = ptr; - ptr = hyperv_dmamem_alloc(parent_dtag, PAGE_SIZE, 0, - PAGE_SIZE, VMBUS_PCPU_PTR(sc, event_flags_dma, cpu), - BUS_DMA_WAITOK | BUS_DMA_ZERO); + ptr = contigmalloc(PAGE_SIZE, M_DEVBUF, M_WAITOK | M_ZERO, + 0ul, ~0ul, PAGE_SIZE, 0); if (ptr == NULL) return ENOMEM; VMBUS_PCPU_GET(sc, event_flags, cpu) = ptr; } - evtflags = hyperv_dmamem_alloc(parent_dtag, PAGE_SIZE, 0, - PAGE_SIZE, &sc->vmbus_evtflags_dma, BUS_DMA_WAITOK | BUS_DMA_ZERO); + evtflags = contigmalloc(PAGE_SIZE, M_DEVBUF, M_WAITOK | M_ZERO, + 0ul, ~0ul, PAGE_SIZE, 0); if (evtflags == NULL) return ENOMEM; sc->vmbus_rx_evtflags = (u_long *)evtflags; sc->vmbus_tx_evtflags = (u_long *)(evtflags + (PAGE_SIZE / 2)); sc->vmbus_evtflags = evtflags; - sc->vmbus_mnf1 = hyperv_dmamem_alloc(parent_dtag, PAGE_SIZE, 0, - PAGE_SIZE, &sc->vmbus_mnf1_dma, BUS_DMA_WAITOK | BUS_DMA_ZERO); + sc->vmbus_mnf1 = contigmalloc(PAGE_SIZE, M_DEVBUF, M_WAITOK | M_ZERO, + 0ul, ~0ul, PAGE_SIZE, 0); if (sc->vmbus_mnf1 == NULL) return ENOMEM; - sc->vmbus_mnf2 = hyperv_dmamem_alloc(parent_dtag, PAGE_SIZE, 0, - sizeof(struct vmbus_mnf), &sc->vmbus_mnf2_dma, - BUS_DMA_WAITOK | BUS_DMA_ZERO); + sc->vmbus_mnf2 = contigmalloc(sizeof(struct vmbus_mnf), M_DEVBUF, + M_WAITOK | M_ZERO, 0ul, ~0ul, PAGE_SIZE, 0); if (sc->vmbus_mnf2 == NULL) return ENOMEM; @@ -871,31 +867,29 @@ vmbus_dma_free(struct vmbus_softc *sc) int cpu; if (sc->vmbus_evtflags != NULL) { - hyperv_dmamem_free(&sc->vmbus_evtflags_dma, sc->vmbus_evtflags); + contigfree(sc->vmbus_evtflags, PAGE_SIZE, M_DEVBUF); sc->vmbus_evtflags = NULL; sc->vmbus_rx_evtflags = NULL; sc->vmbus_tx_evtflags = NULL; } if (sc->vmbus_mnf1 != NULL) { - hyperv_dmamem_free(&sc->vmbus_mnf1_dma, sc->vmbus_mnf1); + contigfree(sc->vmbus_mnf1, PAGE_SIZE, M_DEVBUF); sc->vmbus_mnf1 = NULL; } if (sc->vmbus_mnf2 != NULL) { - hyperv_dmamem_free(&sc->vmbus_mnf2_dma, sc->vmbus_mnf2); + contigfree(sc->vmbus_mnf2, sizeof(struct vmbus_mnf), M_DEVBUF); sc->vmbus_mnf2 = NULL; } CPU_FOREACH(cpu) { if (VMBUS_PCPU_GET(sc, message, cpu) != NULL) { - hyperv_dmamem_free( - VMBUS_PCPU_PTR(sc, message_dma, cpu), - VMBUS_PCPU_GET(sc, message, cpu)); + contigfree(VMBUS_PCPU_GET(sc, message, cpu), PAGE_SIZE, + M_DEVBUF); VMBUS_PCPU_GET(sc, message, cpu) = NULL; } if (VMBUS_PCPU_GET(sc, event_flags, cpu) != NULL) { - hyperv_dmamem_free( - VMBUS_PCPU_PTR(sc, event_flags_dma, cpu), - VMBUS_PCPU_GET(sc, event_flags, cpu)); + contigfree(VMBUS_PCPU_GET(sc, event_flags, cpu), + PAGE_SIZE, M_DEVBUF); VMBUS_PCPU_GET(sc, event_flags, cpu) = NULL; } } diff --git a/sys/dev/hyperv/vmbus/vmbus_chan.c b/sys/dev/hyperv/vmbus/vmbus_chan.c index 032e06c47c95..ff7bbc7c0dc3 100644 --- a/sys/dev/hyperv/vmbus/vmbus_chan.c +++ b/sys/dev/hyperv/vmbus/vmbus_chan.c @@ -43,7 +43,10 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include +#include +#include + #include #include #include @@ -137,7 +140,8 @@ vmbus_chan_signal(const struct vmbus_channel *chan) if (chan->ch_txflags & VMBUS_CHAN_TXF_HASMNF) atomic_set_int(chan->ch_montrig, chan->ch_montrig_mask); else - hypercall_signal_event(chan->ch_monprm_dma.hv_paddr); + hypercall_signal_event(pmap_kextract( + (vm_offset_t)chan->ch_monprm)); } static __inline void @@ -340,16 +344,16 @@ vmbus_chan_open(struct vmbus_channel *chan, int txbr_size, int rxbr_size, * Allocate the TX+RX bufrings. */ KASSERT(chan->ch_bufring == NULL, ("bufrings are allocated")); - chan->ch_bufring = hyperv_dmamem_alloc(bus_get_dma_tag(chan->ch_dev), - PAGE_SIZE, 0, txbr_size + rxbr_size, &chan->ch_bufring_dma, - BUS_DMA_WAITOK); + chan->ch_bufring_size = txbr_size + rxbr_size; + chan->ch_bufring = contigmalloc(chan->ch_bufring_size, M_DEVBUF, + M_WAITOK | M_ZERO, 0ul, ~0ul, PAGE_SIZE, 0); if (chan->ch_bufring == NULL) { vmbus_chan_printf(chan, "bufring allocation failed\n"); return (ENOMEM); } cbr.cbr = chan->ch_bufring; - cbr.cbr_paddr = chan->ch_bufring_dma.hv_paddr; + cbr.cbr_paddr = pmap_kextract((vm_offset_t)chan->ch_bufring); cbr.cbr_txsz = txbr_size; cbr.cbr_rxsz = rxbr_size; @@ -367,8 +371,8 @@ vmbus_chan_open(struct vmbus_channel *chan, int txbr_size, int rxbr_size, "leak %d bytes memory\n", chan->ch_id, txbr_size + rxbr_size); } else { - hyperv_dmamem_free(&chan->ch_bufring_dma, - chan->ch_bufring); + contigfree(chan->ch_bufring, chan->ch_bufring_size, + M_DEVBUF); } chan->ch_bufring = NULL; } @@ -938,7 +942,7 @@ disconnect: * Destroy the TX+RX bufrings. */ if (chan->ch_bufring != NULL) { - hyperv_dmamem_free(&chan->ch_bufring_dma, chan->ch_bufring); + contigfree(chan->ch_bufring, chan->ch_bufring_size, M_DEVBUF); chan->ch_bufring = NULL; } return (error); @@ -1630,9 +1634,8 @@ vmbus_chan_alloc(struct vmbus_softc *sc) chan = malloc(sizeof(*chan), M_DEVBUF, M_WAITOK | M_ZERO); - chan->ch_monprm = hyperv_dmamem_alloc(bus_get_dma_tag(sc->vmbus_dev), - HYPERCALL_PARAM_ALIGN, 0, sizeof(struct hyperv_mon_param), - &chan->ch_monprm_dma, BUS_DMA_WAITOK | BUS_DMA_ZERO); + chan->ch_monprm = contigmalloc(sizeof(struct hyperv_mon_param), + M_DEVBUF, M_WAITOK | M_ZERO, 0ul, ~0ul, HYPERCALL_PARAM_ALIGN, 0); if (chan->ch_monprm == NULL) { device_printf(sc->vmbus_dev, "monprm alloc failed\n"); free(chan, M_DEVBUF); @@ -1671,7 +1674,7 @@ vmbus_chan_free(struct vmbus_channel *chan) KASSERT(chan->ch_poll_intvl == 0, ("chan%u: polling is activated", chan->ch_id)); - hyperv_dmamem_free(&chan->ch_monprm_dma, chan->ch_monprm); + contigfree(chan->ch_monprm, sizeof(struct hyperv_mon_param), M_DEVBUF); mtx_destroy(&chan->ch_subchan_lock); sx_destroy(&chan->ch_orphan_lock); vmbus_rxbr_deinit(&chan->ch_rxbr); diff --git a/sys/dev/hyperv/vmbus/vmbus_chanvar.h b/sys/dev/hyperv/vmbus/vmbus_chanvar.h index b20b0119bc04..ba445ad2f82e 100644 --- a/sys/dev/hyperv/vmbus/vmbus_chanvar.h +++ b/sys/dev/hyperv/vmbus/vmbus_chanvar.h @@ -39,7 +39,6 @@ #include #include -#include #include #include @@ -99,7 +98,6 @@ struct vmbus_channel { */ struct hyperv_mon_param *ch_monprm; - struct hyperv_dma ch_monprm_dma; uint32_t ch_id; /* channel id */ device_t ch_dev; @@ -127,7 +125,7 @@ struct vmbus_channel { struct vmbus_channel *ch_prichan; /* owner primary chan */ void *ch_bufring; /* TX+RX bufrings */ - struct hyperv_dma ch_bufring_dma; + size_t ch_bufring_size; uint32_t ch_bufring_gpadl; struct task ch_attach_task; /* run in ch_mgmt_tq */ diff --git a/sys/dev/hyperv/vmbus/vmbus_var.h b/sys/dev/hyperv/vmbus/vmbus_var.h index c89d26d7aaf5..c50eeaca956d 100644 --- a/sys/dev/hyperv/vmbus/vmbus_var.h +++ b/sys/dev/hyperv/vmbus/vmbus_var.h @@ -34,7 +34,6 @@ #include #include -#include #include #include @@ -74,8 +73,6 @@ struct vmbus_pcpu_data { struct vmbus_evtflags *event_flags; /* event flags from host */ /* Rarely used fields */ - struct hyperv_dma message_dma; /* busdma glue */ - struct hyperv_dma event_flags_dma;/* busdma glue */ struct taskqueue *event_tq; /* event taskq */ struct taskqueue *message_tq; /* message taskq */ struct task message_task; /* message task */ @@ -105,11 +102,8 @@ struct vmbus_softc { /* Shared memory for vmbus_{rx,tx}_evtflags */ void *vmbus_evtflags; - struct hyperv_dma vmbus_evtflags_dma; void *vmbus_mnf1; /* monitored by VM, unused */ - struct hyperv_dma vmbus_mnf1_dma; - struct hyperv_dma vmbus_mnf2_dma; bool vmbus_scandone; struct task vmbus_scandone_task; diff --git a/sys/dev/hyperv/vmbus/vmbus_xact.c b/sys/dev/hyperv/vmbus/vmbus_xact.c index 90bdba7e1058..df6d8b45f9b1 100644 --- a/sys/dev/hyperv/vmbus/vmbus_xact.c +++ b/sys/dev/hyperv/vmbus/vmbus_xact.c @@ -34,7 +34,10 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include +#include +#include + #include struct vmbus_xact { @@ -42,7 +45,6 @@ struct vmbus_xact { void *x_priv; void *x_req; - struct hyperv_dma x_req_dma; const void *x_resp; size_t x_resp_len; @@ -88,8 +90,8 @@ vmbus_xact_alloc(struct vmbus_xact_ctx *ctx, bus_dma_tag_t parent_dtag) xact->x_ctx = ctx; /* XXX assume that page aligned is enough */ - xact->x_req = hyperv_dmamem_alloc(parent_dtag, PAGE_SIZE, 0, - ctx->xc_req_size, &xact->x_req_dma, BUS_DMA_WAITOK); + xact->x_req = contigmalloc(ctx->xc_req_size, M_DEVBUF, + M_WAITOK | M_ZERO, 0ul, ~0ul, PAGE_SIZE, 0); if (xact->x_req == NULL) { free(xact, M_DEVBUF); return (NULL); @@ -105,7 +107,7 @@ static void vmbus_xact_free(struct vmbus_xact *xact) { - hyperv_dmamem_free(&xact->x_req_dma, xact->x_req); + contigfree(xact->x_req, xact->x_ctx->xc_req_size, M_DEVBUF); free(xact->x_resp0, M_DEVBUF); if (xact->x_priv != NULL) free(xact->x_priv, M_DEVBUF); @@ -243,7 +245,7 @@ bus_addr_t vmbus_xact_req_paddr(const struct vmbus_xact *xact) { - return (xact->x_req_dma.hv_paddr); + return (pmap_kextract((vm_offset_t)xact->x_req)); } void * From nobody Tue Jun 6 10:19:11 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Qb60H5MQTz4Zrsc; Tue, 6 Jun 2023 10:19:27 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Qb60H4d3zz4K0q; Tue, 6 Jun 2023 10:19:27 +0000 (UTC) (envelope-from markm@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686046767; 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=6zcCTVRN5K8bpbsy1RnDB/geLJ9YC5tVb+jGgdUAjm0=; b=n9jJFfIH7vc94vYB53HvwmjhOe9IrOoVfgfIkb3nqVxGSGZHo507SivYRjf6O3DNq248PL MySZCjcKDXBsVlijOJEQUTm5xomF9z0rZ/3Eax90cG+76MZ6P1VWZndD8mGzgsq5JD9DL0 Y04+DHbSa+7dbtRHxfS2TxKvzSdMholXgwA4AEfeFkEQhWmVEwaA0XQHeEFsRYNV4UNfK0 zPELAlFC8ibL7KZuUwr8LgwGEigOhav1v+1nHbmhHv9ZCugw65p0DA9Eg5gcjb6Y7X0+9x zcbdVxRRZGSAaIaGqX0b2Lx3CQKnrEW19jWhQm9MhWWN3IHUATnQ7MLHazV7Hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686046767; 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=6zcCTVRN5K8bpbsy1RnDB/geLJ9YC5tVb+jGgdUAjm0=; b=we/v5DfAjWNKiDPvV6rXnZTHuW5EueYy4MOyDIy9VcYqdcOdbX39yl+b9TdHcRSH6XSXth QJQcjvR8esosSMyBC7U7KZCT+rz2wHTurR6pE9mnpdb5RNV3sbCXrs3qq9TwR46Hv2hddu gAFHO/Zbv7XMOQIEGFOXG7JJccOBU63fMqw4eJYehIOx/T19Xq/Ttj39Mau+KiaJPC+02q SyRq6cJEihJBzZMIQRFQAZp0DHZQX42nJNPBRVf8lnN8+lguBEcb2bLU3yLjq/ueG6Llee ZToWMkOZe2NzDFPm62ML2tusn9cUiATU6fHdFYpO3ZkKKBinE0BtFJlBZRZ+4A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686046767; a=rsa-sha256; cv=none; b=p812SU/thDYOHSAm/FAGRp+/Fd5IQJTX8yCLXvypM5akZ9nTy3tyehRzkseT1u8mOZ59Ta QAOBFPzSRj4QMz+vdTDbfKLNfwcoI1+gAtcEXx5LS8abMVk2bLTxx65QANrSP032eEtk+D oaKOPMJhTivBX97km5UypakOa9Q8uPwgnyX0YVOqwwr85Iz8Y8e5YTEQdc34SLBeP10eyj 0Go54ONj/UAT83uzbqlS2ykOirp/DzvgN6vvRqREbQwxgQkAcL6ygBHqCRxOoZ/DR8IUok OSB9cGB7cIu67YkJyvbGqokYmJsOu5iJP61tYDdK0tjrcv2QXLTJCmNN8YYUvQ== Received: from smtpclient.apple (unknown [IPv6:2a02:8011:300b:42:3df6:911e:8c5f:d52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: markm) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Qb60G75Qvzh04; Tue, 6 Jun 2023 10:19:26 +0000 (UTC) (envelope-from markm@FreeBSD.org) Content-Type: multipart/signed; boundary="Apple-Mail=_07A87620-5DF6-48E5-A683-167AF465984F"; protocol="application/pgp-signature"; micalg=pgp-sha512 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.600.7\)) Subject: Re: git: 9d5a47e13c17 - main - ossl: Provide a fallback definition of __uint128_t when needed From: Mark Murray In-Reply-To: <202306041639.354Gdu2O043884@gitrepo.freebsd.org> Date: Tue, 6 Jun 2023 11:19:11 +0100 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Message-Id: <0D94F493-2C78-4604-A6B4-422741929862@FreeBSD.org> References: <202306041639.354Gdu2O043884@gitrepo.freebsd.org> To: Mark Johnston X-Mailer: Apple Mail (2.3731.600.7) X-ThisMailContainsUnwantedMimeParts: N --Apple-Mail=_07A87620-5DF6-48E5-A683-167AF465984F Content-Type: multipart/alternative; boundary="Apple-Mail=_D2FA5B17-A905-46C3-A53A-3D16FA44BD37" --Apple-Mail=_D2FA5B17-A905-46C3-A53A-3D16FA44BD37 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hi I see some duplication here; in sys/dev/random/uint128.h I solved the = same problem, except I needed some very basic functionality as well. = Maybe we combine these two somehow? M -- Mark R V Murray > On 4 Jun 2023, at 17:39, Mark Johnston wrote: >=20 > The branch main has been updated by markj: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D9d5a47e13c175adf7486956847c3d060= fe059f2c >=20 > commit 9d5a47e13c175adf7486956847c3d060fe059f2c > Author: Mark Johnston > AuthorDate: 2023-06-02 22:18:05 +0000 > Commit: Mark Johnston > CommitDate: 2023-06-04 16:39:44 +0000 >=20 > ossl: Provide a fallback definition of __uint128_t when needed >=20 > This is required on i386. The patch has no functional change, = since > AES-GCM isn't implemented for that platform. >=20 > Fixes: 9a3444d91c70 ("ossl: Add a VAES-based AES-GCM = implementation for amd64") > Reported by: Jenkins > --- > sys/crypto/openssl/ossl_aes_gcm.h | 4 ++++ > 1 file changed, 4 insertions(+) >=20 > diff --git a/sys/crypto/openssl/ossl_aes_gcm.h = b/sys/crypto/openssl/ossl_aes_gcm.h > index 9ce8ee193483..cd0c1e324354 100644 > --- a/sys/crypto/openssl/ossl_aes_gcm.h > +++ b/sys/crypto/openssl/ossl_aes_gcm.h > @@ -49,6 +49,10 @@ struct ossl_aes_gcm_ops { > size_t len); > }; >=20 > +#ifndef __SIZEOF_INT128__ > +typedef struct { uint64_t v[2]; } __uint128_t; > +#endif > + > struct ossl_gcm_context { > struct { > union { >=20 -- Mark R V Murray --Apple-Mail=_D2FA5B17-A905-46C3-A53A-3D16FA44BD37 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii Hi

I see some duplication here; = in sys/dev/random/uint128.h I solved the same problem, except I needed = some very basic functionality as well. Maybe we combine these two = somehow?

M
-- 
Mark R V = Murray



On 4 Jun 2023, at 17:39, = Mark Johnston <markj@FreeBSD.org> wrote:

The branch main has been = updated by markj:

URL: = https://cgit.FreeBSD.org/src/commit/?id=3D9d5a47e13c175adf7486956847c3d060= fe059f2c

commit = 9d5a47e13c175adf7486956847c3d060fe059f2c
Author: =     Mark Johnston = <markj@FreeBSD.org>
AuthorDate: 2023-06-02 22:18:05 = +0000
Commit:     Mark Johnston = <markj@FreeBSD.org>
CommitDate: 2023-06-04 16:39:44 = +0000

   ossl: Provide a fallback definition of = __uint128_t when needed

   This is required on = i386.  The patch has no functional change, since
=    AES-GCM isn't implemented for that platform.

=    Fixes:  9a3444d91c70 ("ossl: Add a VAES-based = AES-GCM implementation for amd64")
   Reported by: =    Jenkins
---
sys/crypto/openssl/ossl_aes_gcm.h | = 4 ++++
1 file changed, 4 insertions(+)

diff --git = a/sys/crypto/openssl/ossl_aes_gcm.h = b/sys/crypto/openssl/ossl_aes_gcm.h
index 9ce8ee193483..cd0c1e324354 = 100644
--- a/sys/crypto/openssl/ossl_aes_gcm.h
+++ = b/sys/crypto/openssl/ossl_aes_gcm.h
@@ -49,6 +49,10 @@ struct = ossl_aes_gcm_ops {
   size_t = len);
};

+#ifndef __SIZEOF_INT128__
+typedef struct { = uint64_t v[2]; } __uint128_t;
+#endif
+
struct = ossl_gcm_context {
struct {
union = {




-- 
Mark R V Murray

= --Apple-Mail=_D2FA5B17-A905-46C3-A53A-3D16FA44BD37-- --Apple-Mail=_07A87620-5DF6-48E5-A683-167AF465984F Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 Comment: GPGTools - http://gpgtools.org iQEzBAEBCgAdFiEEyzPHvybPbOpU9MCxQlsJDh9CUqAFAmR/CB8ACgkQQlsJDh9C UqBl7gf/Z4/jvJuJ5NKDTmYCotcZU5iwP8+bTkj4FmOnC75+UZZtIz7JbtzTIH6u qzGWtqe3Mej3xC5rRa0Kyqrr3x9IiPqsbf3eo77z+d4xhP0v9E5INp4WLBJDTouH AkKtNW766wWO+WQQCwQu8rwWXJgBatV/x9th4M2HVz5OpfM6nLY/Bs0QSHibLmRF ca/eew3boMRtUSFCcCczAUJraTWvmaUrcOj3BKx+Zm0k2o0+bi9xm7haHl3p0On2 SAkL0noz2uXlArNixaD9NTDJZruFnQVPJL5rKyFxtL1UsDeTW6ybVUdGfMIQ4UwV gXab/9b6rwTDKHj1v62ojH8Fw4+jTw== =2XBq -----END PGP SIGNATURE----- --Apple-Mail=_07A87620-5DF6-48E5-A683-167AF465984F-- From nobody Tue Jun 6 12:27:46 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Qb8rL31Lvz4bPsg for ; Tue, 6 Jun 2023 12:27:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Qb8rL2KfYz3J0y; Tue, 6 Jun 2023 12:27:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686054466; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LgPY7hLQ02weaM3EpkrqnKK5KKqiQoEmXTWWY73Z0Qg=; b=N9k6t+/FbawdK3w4oHNkPXVJcJvBKdLpPMEWuOGDC3ko/z2uQmWs/VQU87jNKN2iaf0WQU B6Elbaba/tifKXnYejPuGycbkRrHCEUGFl/BrykFZM/bEKzrIL3F7ykCVvIlKfxSE8sOi8 T3L7KM7xdUNooAfFzIriG0XZP7DVFOxGbOStAaXxhbE9hyg2EaB+RrNZWK+7js/LkGWVGw AjpW4oMoKCJeKfCPMAlphOTMFKoUdYs9izj7ddsXig6HUhTBHkD7MTX9zpVmeN+jutFs8N n/MQqUUi1uAP1yiyk6t2FaTZQJroSWFO/u+v9Eq4ey46WW4Ovh6pZYHp4CpqBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686054466; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LgPY7hLQ02weaM3EpkrqnKK5KKqiQoEmXTWWY73Z0Qg=; b=Kc7zFy1XP+yyx4vwzl2uMCn6kEfhcqGdeCEInQrnuxXTcIajz4uwxm1Hen8CM9ohGJugPT C6BGZlpqDkiCsIZURJwI1iqF6RdVIw4O98nLUv1DtWxwEfEOky2XTZN2JL/v3qm3QIL9wB 39bLMR21LgjXXJVZlrWC59n4dLxCqiJPZ4hxhVttAVJTE5TnW0zdWPLSfVZnt9GDJA/VY7 NqxFnSjyDHxe7MEgjU1re4BkHGjwF7WIFxYFElRNLbQ++FwCqoVGXlYB/2mFNSR8OtkyNS ONpWUl77BjqobSZ9cVzgBugyMO4UUeUBRvYq1MIF/R1x94JlMSYTZXJ1ZICECg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686054466; a=rsa-sha256; cv=none; b=PRx44exoV7ArhrvUH/gcMgWdYYYBD4ANdYu7Vmtjol8PD90fgGiO/zkUak6jAcEKqae99S U49AbrzIng6xVQvoHrUZWEMybDCsvU8y34vN5ZZQTHHZdR1E0xr+xfBPIsDgOgqYT9FIts H0wrKqd9eMTbtuYF8v7ehYUCD/1f/5dCmxFx6Pg/Txd9BD0orq/7Cf7CO8PYW3oecfXLZZ ECiqVt7oEjej17y9iDRYl8H+aLKVOxz5fRgqFj3cqXKcGoM9A3BgoCBbcuE25xau7BNNPq Vq72Dc6D78sxZMlZrqmy3idPokpJb6YxDFyYZyhNyJunvCEfHgp+DLUTsHlT4w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Qb8rL160LzVJ7; Tue, 6 Jun 2023 12:27:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 356CRkLv001776; Tue, 6 Jun 2023 12:27:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 356CRkAY001775; Tue, 6 Jun 2023 12:27:46 GMT (envelope-from git) Date: Tue, 6 Jun 2023 12:27:46 GMT Message-Id: <202306061227.356CRkAY001775@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Cy Schubert Subject: git: 26fd3d5616df..ab1f1aa83333 - vendor/ntp - vendor branch updated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/vendor/ntp X-Git-Reftype: branch X-Git-Commit: ab1f1aa8333369a83ff284848fc3fc2e52d5f29f X-Git-Oldrev: 26fd3d5616df1ccc17b6e487b1db4633dfdd555b X-Git-Newrev: ab1f1aa8333369a83ff284848fc3fc2e52d5f29f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch vendor/ntp has been updated by cy: URL: https://cgit.FreeBSD.org/src/log/?id=26fd3d5616df..ab1f1aa83333 ab1f1aa83333 ntp: import ntp-4.2.8p17 From nobody Tue Jun 6 12:27:46 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Qb8rL3ky0z4bQ68 for ; Tue, 6 Jun 2023 12:27:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Qb8rL37vYz3JDL; Tue, 6 Jun 2023 12:27:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686054466; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BJ5l3U3lfwNlScXYleWnc2VX8qWIZqtuu8yQxM4YoOM=; b=iSFCHU5rfFR4KwCMyKkYf4iiwXceYxxR6Znz7F8PigtEKbe9npYt0ZLW/drmYY1x+2UGPt 3PKTN5xCm6uTkOyOh7252WBJPJV5eNVml8PStPu5geA8lbPFG3fgfNAEZ4Pf4ef33O+dmC Q8RRhnqLxSuvn34sD/PGjNy2ZhpjVkdmbA4AmuRfgLVYaSnHi9YQP4ejuBax0//AnJqqC3 g+RbH3y6MUl1Kag5yv1r9Gp/8DluUcYerJF76uVNu+TPQj2BtLx3pieA3MNeRPuGV/5WB5 cU2aqDrpIQvYw8V+wXM87w1ndKfcSu5y1VHFB0mnajveKgqXn+rKDBqYvU7b+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686054466; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BJ5l3U3lfwNlScXYleWnc2VX8qWIZqtuu8yQxM4YoOM=; b=gm7EgkiZ15bGgseq9K9iQAE16TaTWt+NMAcufmuv5Rcnngrr9uuWAZujuNtdLsiHwR+J69 zXnmSlyLxqKdYpKuae6NB14sclTwesWCX7twex8T12RiDxvRbi0PbBQoFZEhC4zPb5yqQS c7/TV5O8j2sJDo0/cGp8SqWWjm7YVWReq4yN1lOct3iwQ8Ppxo8TRuwFe9/85QMtN6x2FN U/3KfZctwmrseNZX29sVRuxRwRPCmKSZPwrU41+NunzL/PFFl7XG4S30ZqRH2NVITecK+c bWAnP9wZfg3jWYIyem7asvykLQ6skAWph38Y8A0p03qGytmutm5ldqQGjBOM3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686054466; a=rsa-sha256; cv=none; b=JhI9rp8iJ5NHQ82vgLLeJPtMgbPqYX0n5NVe/yKys+/qK4V3g1PCb75th1sisWOxKyjJhG oCa/tbdTrumFNGSSeCMglA86dSt8uRhK+cbyR4m/m3ldxnBifhGQGEfvZfGxWac3N9W+yN earajU+PGgEA7N74nXhU4VPUt2OfoYaZfbb90sk0yO0akIqlD7Sl99jIeVTqEESpSzqTVd HdC53M3e3xyGEPsTpRKrFzLFvCJPhBM86mO+QHU41qed+bYUc5IZ+0BPtzq9lugNWFMiMC f6HOscK21/hdRtU90CEFbXW8uQzUO+GAkzO8OktByVx9Y88cqKtbnV8xcSGanQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Qb8rL1pDmzVcV; Tue, 6 Jun 2023 12:27:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 356CRkw5001795; Tue, 6 Jun 2023 12:27:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 356CRkZV001794; Tue, 6 Jun 2023 12:27:46 GMT (envelope-from git) Date: Tue, 6 Jun 2023 12:27:46 GMT Message-Id: <202306061227.356CRkZV001794@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Cy Schubert Subject: git: 74bda61e35f3 - Create tag vendor/ntp/4.2.8p17 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/tags/vendor/ntp/4.2.8p17 X-Git-Reftype: annotated tag X-Git-Commit: 74bda61e35f3ad64bec74b0c05e2a88a847fc6c1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The annotated tag vendor/ntp/4.2.8p17 has been created by cy: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/ntp/4.2.8p17 tag vendor/ntp/4.2.8p17 Tagger: Cy Schubert TaggerDate: 2023-06-06 12:27:10 +0000 ntp: tag 4.2.8p17 commit ab1f1aa8333369a83ff284848fc3fc2e52d5f29f Author: Cy Schubert AuthorDate: 2023-06-06 12:26:44 +0000 Commit: Cy Schubert CommitDate: 2023-06-06 12:26:44 +0000 ntp: import ntp-4.2.8p17 From nobody Tue Jun 6 12:45:33 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Qb9Dt0vtTz4bSpl; Tue, 6 Jun 2023 12:45:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Qb9Dt0MBwz3LCD; Tue, 6 Jun 2023 12:45:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686055534; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4jn3SJWJCo9ND2vkyE8bep7hsm6Ua6HCJQWuAlcVovA=; b=sHTZl3K8BD7iU/G1HQmSz2lSodLdJk0f+TWoW7uFyZS5aqHrt2CKaruDZ2jqEbLr4rnA9k FbXnzWakoAIpoWwLIHElQz361Lua37j4/S8derUL+5F/IrlCfalRZBM2SGVyglB91z24dh 5CRwA6OPtVAkXjk4sMsF5MuMkaEwVgtaQ3D6SwsEC7X6SxgnaEBtjeUDCT9Ij8s1kWkPbm n04NwwaDvSubb/KgwC8FmkTV5QnUNuLJkZKEBT4UPSF3fLrJRuXZZgZAKBCNqwCafkTwUB i3eLC5HE0ALId1Fyd64x0UkEsUQ6/5yHC95mPGY0svtqkJMr31e4QzC43mseLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686055534; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4jn3SJWJCo9ND2vkyE8bep7hsm6Ua6HCJQWuAlcVovA=; b=Hdox4RT6BEqYtjp3A1LXaeK1klXJ01lPPqkXIz+V3M6iTfQ98bvTW+yKXqXDXh2adWuyZY 5idj7+lmOW1G/rQy5zNydyF+8jcV6uk7XIBZ8BQPfW0CJg2/zwlj5j3y5h4nBUfpks230t XlNSm67Vfc4vdt36PCZo4S8MHqQuXa87UqHOg2uKKAFhKyT25AcczcFiEGU4vngILdfb98 TdVP7bRcv58OM2SwWYoAqTi7u+LjyIl5oFjQsXpC1VvVHH9uwKRszyPKg7I+oKrafNXIu8 8Ys0A5DTrYKrR+ceJMUCBwdFm7rtNXg7qQdtjDI8Jpyf1JHImoJX6+RQLDqVBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686055534; a=rsa-sha256; cv=none; b=OpOd6wWHy8GC55G1RFJ99fqG2wJUllXH8wbxQXXrqcAnfwblUWcZj9EcBhKeFK2wpdidco HD+A7rQZCDG/JkmjFC6M8Z8jf3ehYasSpwZ5vRKwi/MNPnUEhyz5cL/Yd4ef/Q3sQa+SeX K08qTp5yhXyopp84UL6mTdh8HLdNo8+0Lw904XdUHhO50Ip5NB6suM3fY0vwctDoSI/QTA XAjHmX4WY2pyl8msjAwHL+POoSdwUl0jp1wewvgonDMnuBgtIsNf6RNDFcj6jr1zMDicyb tYIMHgi9ZcUlrfb3o2NPKdZbdjyFiOI0Jd+8djcUBqOIWt/rau+nyg8Hsfkwyw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Qb9Ds6R7gzVdZ; Tue, 6 Jun 2023 12:45:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 356CjXG1034794; Tue, 6 Jun 2023 12:45:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 356CjXmc034793; Tue, 6 Jun 2023 12:45:33 GMT (envelope-from git) Date: Tue, 6 Jun 2023 12:45:33 GMT Message-Id: <202306061245.356CjXmc034793@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 52503c4477cc - stable/12 - sftp: avoid leaking path arg in calls to make_absolute_pwd_glob List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 52503c4477ccba162baca69fb2801f26ff5a5572 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=52503c4477ccba162baca69fb2801f26ff5a5572 commit 52503c4477ccba162baca69fb2801f26ff5a5572 Author: Ed Maste AuthorDate: 2022-11-03 17:17:40 +0000 Commit: Ed Maste CommitDate: 2023-06-05 19:07:56 +0000 sftp: avoid leaking path arg in calls to make_absolute_pwd_glob As Coverity reports: Overwriting tmp in tmp = make_absolute_pwd_glob(tmp, remote_path) leaks the storage that tmp points to. Consume the first arg in make_absolute_pwd_glob, and add xstrdup() to the one case which did not assign to the same variable that was passed in. With this change make_absolute() and make_absolute_pwd_glob() have the same semantics with respect to freeing the input string. This change was reported to OpenSSH in https://lists.mindrot.org/pipermail/openssh-unix-dev/2022-November/040497.html [and was later adopted upstream]. Reported by: Coverity Scan CID: 1500409 Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D37253 (cherry picked from commit 69c72a57af843267b220f8367c4cc7162a12d696) (cherry picked from commit 533a942a213c9e852265f94d27f1e9768294eaa6) --- crypto/openssh/sftp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crypto/openssh/sftp.c b/crypto/openssh/sftp.c index c3c347e087e4..630e7773af75 100644 --- a/crypto/openssh/sftp.c +++ b/crypto/openssh/sftp.c @@ -621,14 +621,14 @@ escape_glob(const char *s) } static char * -make_absolute_pwd_glob(const char *p, const char *pwd) +make_absolute_pwd_glob(char *p, const char *pwd) { char *ret, *escpwd; escpwd = escape_glob(pwd); if (p == NULL) return escpwd; - ret = make_absolute(xstrdup(p), escpwd); + ret = make_absolute(p, escpwd); free(escpwd); return ret; } @@ -641,7 +641,7 @@ process_get(struct sftp_conn *conn, const char *src, const char *dst, glob_t g; int i, r, err = 0; - abs_src = make_absolute_pwd_glob(src, pwd); + abs_src = make_absolute_pwd_glob(xstrdup(src), pwd); memset(&g, 0, sizeof(g)); debug3("Looking up %s", abs_src); From nobody Tue Jun 6 12:57:49 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Qb9W15wgvz4bVP6; Tue, 6 Jun 2023 12:57:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Qb9W15lhLz3MDB; Tue, 6 Jun 2023 12:57:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686056269; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4R8yulU3DBhD6qAWpUar0LcBAjDBG1TWdfqNCgpjPF0=; b=guj5vsa9FahwgJnin+U3YSjHBPEJH/nIX9KNZbAjgA8XMD9mWguaJJ4EuWj0cr22+d2zi/ v1B9bSojFlPKx6n3m3R2o3GiO8oC6G6PeLBshRIyOgCr1ZSxgDkZhFi64GINYPeRZ1q9bD r1LTjf/1tjv2k6hAaTyJIBsqmHm1QzBNzVAGou3cYWU4UZmfg8CfS8gvhljFeIRnPGveAn dtgoaiqDiDSxgJuanNatHCDHSa7dYwh9HprcSq6FkegMLuLnEuHzD3G5XiLl/dg1sJofRf NFGob5Z28S06F5Cy+YVOdz+RfpwM6gfmqGsZlrHvFCr6PGrcf1bfXpqLT77PlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686056269; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4R8yulU3DBhD6qAWpUar0LcBAjDBG1TWdfqNCgpjPF0=; b=idk+2nwUXm7XIeKRyib4zVtHdDYwXDwZoVMJnKEQzjjmxLTloHOFYBWFSdlpkO1H1e7ASy yMxqnRqopAeHRFgj5DSOGIMg8juO2yhWekdcqotE4rLrNIQtSHAhmYws6mc8NIMuTlpVuv GVAi8L6wOGSQ4NwsReWUJ50gKLFWeVVZFVRXoU87+7AMSI6zKHFuf8kiTYjZEicJvASiUf +/7QckU1CEWsCC5u7pS3rvZIZurj8jVYsUyigtHEaNayGOieNa+8FTHkxqYB6aHZT3mcdf SwU2m6u19EPfDapHnk22d1hc810TVFXCDMoa9OOWcHDGin/Dz0C9B/wKYoD1DA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686056269; a=rsa-sha256; cv=none; b=ZjliHNFsaUJrgyxJ0arjS6y6lRpHyfRK0HgUnoS7Fo6cjcf7ZFeqQa69mn/mMWeWDDwO7v +vz0uXsnpSzR/5r/ri4ZyN7R+xdHsZk8irNUb+WEoSDFL1Ned8/aXo4nYEdGZEtudXLGj8 owQCGNcaskAH9wbMLXT8IXYMnaVWCLCPaeFJGndhT2ZhZJ4Uij8FW2FFUX2duO1m1doeIs 7URLkz4JAwNk5ND435IkHhEwxF7Vteb0LiXyMvGqsvoxcx0HfoHgEO96pynsH0Z+m+RAVB EEK2RjDaw/yVuX44WXdK5OLzIDtgh4PBRfcymIyyCnGxyQ/XdMB8ad2CLbrZvw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Qb9W14qBDzWGl; Tue, 6 Jun 2023 12:57:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 356CvnqO051150; Tue, 6 Jun 2023 12:57:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 356CvnAx051149; Tue, 6 Jun 2023 12:57:49 GMT (envelope-from git) Date: Tue, 6 Jun 2023 12:57:49 GMT Message-Id: <202306061257.356CvnAx051149@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: e6bfd18d21b2 - main - ntp: import ntp-4.2.8p17 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e6bfd18d21b225af6a0ed67ceeaf1293b7b9eba5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=e6bfd18d21b225af6a0ed67ceeaf1293b7b9eba5 commit e6bfd18d21b225af6a0ed67ceeaf1293b7b9eba5 Merge: 62f9bcf2b427 ab1f1aa83333 Author: Cy Schubert AuthorDate: 2023-06-06 12:43:04 +0000 Commit: Cy Schubert CommitDate: 2023-06-06 12:44:51 +0000 ntp: import ntp-4.2.8p17 Fixes two small bugs including one regression. MFC after: 3 days Merge commit 'ab1f1aa8333369a83ff284848fc3fc2e52d5f29f' contrib/ntp/ChangeLog | 14 + contrib/ntp/CommitLog | 464 +++++++++++++++++++++ contrib/ntp/NEWS | 25 ++ contrib/ntp/configure | 20 +- contrib/ntp/include/ntp.h | 2 +- contrib/ntp/include/ntp_md5.h | 4 + contrib/ntp/include/ntp_stdlib.h | 39 +- contrib/ntp/libntp/a_md5encrypt.c | 23 +- contrib/ntp/libntp/authkeys.c | 27 +- contrib/ntp/libntp/authreadkeys.c | 12 +- contrib/ntp/libntp/msyslog.c | 5 +- contrib/ntp/libparse/clk_hopf6021.c | 5 +- contrib/ntp/libparse/clk_wharton.c | 5 +- contrib/ntp/ntpd/invoke-ntp.conf.texi | 2 +- contrib/ntp/ntpd/invoke-ntp.keys.texi | 2 +- contrib/ntp/ntpd/invoke-ntpd.texi | 4 +- contrib/ntp/ntpd/ntp.conf.5man | 4 +- contrib/ntp/ntpd/ntp.conf.5mdoc | 4 +- contrib/ntp/ntpd/ntp.conf.html | 2 +- contrib/ntp/ntpd/ntp.conf.man.in | 4 +- contrib/ntp/ntpd/ntp.conf.mdoc.in | 4 +- contrib/ntp/ntpd/ntp.keys.5man | 4 +- contrib/ntp/ntpd/ntp.keys.5mdoc | 4 +- contrib/ntp/ntpd/ntp.keys.html | 2 +- contrib/ntp/ntpd/ntp.keys.man.in | 4 +- contrib/ntp/ntpd/ntp.keys.mdoc.in | 4 +- contrib/ntp/ntpd/ntp_config.c | 18 + contrib/ntp/ntpd/ntp_control.c | 1 - contrib/ntp/ntpd/ntp_loopfilter.c | 3 - contrib/ntp/ntpd/ntp_proto.c | 5 +- contrib/ntp/ntpd/ntpd-opts.c | 14 +- contrib/ntp/ntpd/ntpd-opts.h | 6 +- contrib/ntp/ntpd/ntpd.1ntpdman | 4 +- contrib/ntp/ntpd/ntpd.1ntpdmdoc | 4 +- contrib/ntp/ntpd/ntpd.c | 6 +- contrib/ntp/ntpd/ntpd.html | 4 +- contrib/ntp/ntpd/ntpd.man.in | 4 +- contrib/ntp/ntpd/ntpd.mdoc.in | 4 +- contrib/ntp/ntpdc/invoke-ntpdc.texi | 4 +- contrib/ntp/ntpdc/ntpdc-opts.c | 14 +- contrib/ntp/ntpdc/ntpdc-opts.h | 6 +- contrib/ntp/ntpdc/ntpdc.1ntpdcman | 4 +- contrib/ntp/ntpdc/ntpdc.1ntpdcmdoc | 4 +- contrib/ntp/ntpdc/ntpdc.html | 4 +- contrib/ntp/ntpdc/ntpdc.man.in | 4 +- contrib/ntp/ntpdc/ntpdc.mdoc.in | 4 +- contrib/ntp/ntpq/invoke-ntpq.texi | 4 +- contrib/ntp/ntpq/ntpq-opts.c | 14 +- contrib/ntp/ntpq/ntpq-opts.h | 6 +- contrib/ntp/ntpq/ntpq.1ntpqman | 4 +- contrib/ntp/ntpq/ntpq.1ntpqmdoc | 4 +- contrib/ntp/ntpq/ntpq.html | 4 +- contrib/ntp/ntpq/ntpq.man.in | 4 +- contrib/ntp/ntpq/ntpq.mdoc.in | 4 +- contrib/ntp/ntpsnmpd/invoke-ntpsnmpd.texi | 2 +- contrib/ntp/ntpsnmpd/ntpsnmpd-opts.c | 14 +- contrib/ntp/ntpsnmpd/ntpsnmpd-opts.h | 6 +- contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdman | 4 +- contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc | 4 +- contrib/ntp/ntpsnmpd/ntpsnmpd.html | 2 +- contrib/ntp/ntpsnmpd/ntpsnmpd.man.in | 4 +- contrib/ntp/ntpsnmpd/ntpsnmpd.mdoc.in | 4 +- contrib/ntp/packageinfo.sh | 2 +- .../calc_tickadj/calc_tickadj.1calc_tickadjman | 4 +- .../calc_tickadj/calc_tickadj.1calc_tickadjmdoc | 4 +- contrib/ntp/scripts/calc_tickadj/calc_tickadj.html | 2 +- .../ntp/scripts/calc_tickadj/calc_tickadj.man.in | 4 +- .../ntp/scripts/calc_tickadj/calc_tickadj.mdoc.in | 4 +- .../scripts/calc_tickadj/invoke-calc_tickadj.texi | 2 +- contrib/ntp/scripts/invoke-plot_summary.texi | 4 +- contrib/ntp/scripts/invoke-summary.texi | 4 +- contrib/ntp/scripts/ntp-wait/invoke-ntp-wait.texi | 4 +- contrib/ntp/scripts/ntp-wait/ntp-wait-opts | 4 +- contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitman | 4 +- .../ntp/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc | 4 +- contrib/ntp/scripts/ntp-wait/ntp-wait.html | 4 +- contrib/ntp/scripts/ntp-wait/ntp-wait.man.in | 4 +- contrib/ntp/scripts/ntp-wait/ntp-wait.mdoc.in | 4 +- contrib/ntp/scripts/ntpsweep/invoke-ntpsweep.texi | 4 +- contrib/ntp/scripts/ntpsweep/ntpsweep-opts | 4 +- contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepman | 4 +- .../ntp/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc | 4 +- contrib/ntp/scripts/ntpsweep/ntpsweep.html | 4 +- contrib/ntp/scripts/ntpsweep/ntpsweep.man.in | 4 +- contrib/ntp/scripts/ntpsweep/ntpsweep.mdoc.in | 4 +- contrib/ntp/scripts/ntptrace/invoke-ntptrace.texi | 4 +- contrib/ntp/scripts/ntptrace/ntptrace-opts | 4 +- contrib/ntp/scripts/ntptrace/ntptrace.1ntptraceman | 4 +- .../ntp/scripts/ntptrace/ntptrace.1ntptracemdoc | 4 +- contrib/ntp/scripts/ntptrace/ntptrace.html | 4 +- contrib/ntp/scripts/ntptrace/ntptrace.man.in | 4 +- contrib/ntp/scripts/ntptrace/ntptrace.mdoc.in | 4 +- contrib/ntp/scripts/plot_summary-opts | 4 +- contrib/ntp/scripts/plot_summary.1plot_summaryman | 4 +- contrib/ntp/scripts/plot_summary.1plot_summarymdoc | 4 +- contrib/ntp/scripts/plot_summary.html | 4 +- contrib/ntp/scripts/plot_summary.man.in | 4 +- contrib/ntp/scripts/plot_summary.mdoc.in | 4 +- contrib/ntp/scripts/summary-opts | 4 +- contrib/ntp/scripts/summary.1summaryman | 4 +- contrib/ntp/scripts/summary.1summarymdoc | 4 +- contrib/ntp/scripts/summary.html | 4 +- contrib/ntp/scripts/summary.man.in | 4 +- contrib/ntp/scripts/summary.mdoc.in | 4 +- .../scripts/update-leap/invoke-update-leap.texi | 2 +- contrib/ntp/scripts/update-leap/update-leap-opts | 4 +- .../update-leap/update-leap.1update-leapman | 4 +- .../update-leap/update-leap.1update-leapmdoc | 4 +- contrib/ntp/scripts/update-leap/update-leap.html | 2 +- contrib/ntp/scripts/update-leap/update-leap.man.in | 4 +- .../ntp/scripts/update-leap/update-leap.mdoc.in | 4 +- contrib/ntp/sntp/configure | 20 +- contrib/ntp/sntp/crypto.c | 5 - contrib/ntp/sntp/crypto.h | 1 - contrib/ntp/sntp/include/version.def | 2 +- contrib/ntp/sntp/include/version.texi | 6 +- contrib/ntp/sntp/invoke-sntp.texi | 4 +- contrib/ntp/sntp/m4/version.m4 | 2 +- contrib/ntp/sntp/scm-rev | 2 +- contrib/ntp/sntp/sntp-opts.c | 14 +- contrib/ntp/sntp/sntp-opts.h | 6 +- contrib/ntp/sntp/sntp.1sntpman | 4 +- contrib/ntp/sntp/sntp.1sntpmdoc | 4 +- contrib/ntp/sntp/sntp.html | 4 +- contrib/ntp/sntp/sntp.man.in | 4 +- contrib/ntp/sntp/sntp.mdoc.in | 4 +- contrib/ntp/tests/libntp/data/mills,david-03.jpg | Bin 0 -> 40964 bytes contrib/ntp/tests/libntp/data/ntp.keys | 34 ++ contrib/ntp/tests/libntp/digests.c | 415 ++++++++++++++++++ contrib/ntp/tests/libntp/run-digests.c | 80 ++++ contrib/ntp/util/invoke-ntp-keygen.texi | 4 +- contrib/ntp/util/ntp-keygen-opts.c | 14 +- contrib/ntp/util/ntp-keygen-opts.h | 6 +- contrib/ntp/util/ntp-keygen.1ntp-keygenman | 4 +- contrib/ntp/util/ntp-keygen.1ntp-keygenmdoc | 4 +- contrib/ntp/util/ntp-keygen.html | 4 +- contrib/ntp/util/ntp-keygen.man.in | 4 +- contrib/ntp/util/ntp-keygen.mdoc.in | 4 +- usr.sbin/ntp/config.h | 6 +- 139 files changed, 1400 insertions(+), 337 deletions(-) diff --cc contrib/ntp/tests/libntp/data/mills,david-03.jpg index 000000000000,c164eea2cf33..c164eea2cf33 mode 000000,100644..100644 Binary files differ diff --cc contrib/ntp/tests/libntp/data/ntp.keys index 000000000000,6c8c743fd7d2..6c8c743fd7d2 mode 000000,100644..100644 --- a/contrib/ntp/tests/libntp/data/ntp.keys +++ b/contrib/ntp/tests/libntp/data/ntp.keys diff --cc contrib/ntp/tests/libntp/digests.c index 000000000000,03e9ef1b838e..03e9ef1b838e mode 000000,100644..100644 --- a/contrib/ntp/tests/libntp/digests.c +++ b/contrib/ntp/tests/libntp/digests.c diff --cc contrib/ntp/tests/libntp/run-digests.c index 000000000000,ae574d0e239e..ae574d0e239e mode 000000,100644..100644 --- a/contrib/ntp/tests/libntp/run-digests.c +++ b/contrib/ntp/tests/libntp/run-digests.c diff --cc usr.sbin/ntp/config.h index a2d3025cd9cf,000000000000..d5a4c080c5ef mode 100644,000000..100644 --- a/usr.sbin/ntp/config.h +++ b/usr.sbin/ntp/config.h @@@ -1,1829 -1,0 +1,1829 @@@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ +/* $FreeBSD$ */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Is adjtime() accurate? */ +/* #undef ADJTIME_IS_ACCURATE */ + +/* Support NTP Autokey protocol? */ +/* #define AUTOKEY 1 */ + +/* why not HAVE_P_S? */ +/* #undef CALL_PTHREAD_SETCONCURRENCY */ + +/* ACTS modem service */ +#define CLOCK_ACTS 1 + +/* Arbiter 1088A/B GPS receiver */ +#define CLOCK_ARBITER 1 + +/* ARCRON support? */ +#define CLOCK_ARCRON_MSF 1 + +/* Austron 2200A/2201A GPS receiver? */ +#define CLOCK_AS2201 1 + +/* PPS interface? */ +#define CLOCK_ATOM 1 + +/* Datum/Bancomm bc635/VME interface? */ +/* #undef CLOCK_BANC */ + +/* Chronolog K-series WWVB receiver? */ +#define CLOCK_CHRONOLOG 1 + +/* CHU modem/decoder */ +#define CLOCK_CHU 1 + +/* Diems Computime Radio Clock? */ +/* #undef CLOCK_COMPUTIME */ + +/* Datum Programmable Time System? */ +#define CLOCK_DATUM 1 + +/* ELV/DCF7000 clock? */ +/* #undef CLOCK_DCF7000 */ + +/* Dumb generic hh:mm:ss local clock? */ +#define CLOCK_DUMBCLOCK 1 + +/* Forum Graphic GPS datating station driver? */ +#define CLOCK_FG 1 + +/* GPSD JSON receiver */ +#define CLOCK_GPSDJSON 1 + +/* TrueTime GPS receiver/VME interface? */ +/* #undef CLOCK_GPSVME */ + +/* Heath GC-1000 WWV/WWVH receiver? */ +#define CLOCK_HEATH 1 + +/* HOPF 6021 clock? */ +/* #undef CLOCK_HOPF6021 */ + +/* HOPF PCI clock device? */ +#define CLOCK_HOPF_PCI 1 + +/* HOPF serial clock device? */ +#define CLOCK_HOPF_SERIAL 1 + +/* HP 58503A GPS receiver? */ +#define CLOCK_HPGPS 1 + +/* IRIG audio decoder? */ +#define CLOCK_IRIG 1 + +/* JJY receiver? */ +#define CLOCK_JJY 1 + +/* Rockwell Jupiter GPS clock? */ +#define CLOCK_JUPITER 1 + +/* Leitch CSD 5300 Master Clock System Driver? */ +#define CLOCK_LEITCH 1 + +/* local clock reference? */ +#define CLOCK_LOCAL 1 + +/* Meinberg clocks */ +#define CLOCK_MEINBERG 1 + +/* Magnavox MX4200 GPS receiver */ +/* #undef CLOCK_MX4200 */ + +/* NeoClock4X */ +#define CLOCK_NEOCLOCK4X 1 + +/* NMEA GPS receiver */ +#define CLOCK_NMEA 1 + +/* Motorola UT Oncore GPS */ +#define CLOCK_ONCORE 1 + +/* Palisade clock */ +#define CLOCK_PALISADE 1 + +/* PARSE driver interface */ +#define CLOCK_PARSE 1 + +/* Conrad parallel port radio clock */ +#define CLOCK_PCF 1 + +/* PCL 720 clock support */ +/* #undef CLOCK_PPS720 */ + +/* PST/Traconex 1020 WWV/WWVH receiver */ +#define CLOCK_PST 1 + +/* DCF77 raw time code */ +#define CLOCK_RAWDCF 1 + +/* RCC 8000 clock */ +/* #undef CLOCK_RCC8000 */ + +/* RIPE NCC Trimble clock */ +/* #undef CLOCK_RIPENCC */ + +/* Schmid DCF77 clock */ +/* #undef CLOCK_SCHMID */ + +/* SEL240X protocol */ +/* #undef CLOCK_SEL240X */ + +/* clock thru shared memory */ +#define CLOCK_SHM 1 + +/* Spectracom 8170/Netclock/2 WWVB receiver */ +#define CLOCK_SPECTRACOM 1 + +/* KSI/Odetics TPRO/S GPS receiver/IRIG interface */ +/* #undef CLOCK_TPRO */ + +/* Trimble GPS receiver/TAIP protocol */ +/* #undef CLOCK_TRIMTAIP */ + +/* Trimble GPS receiver/TSIP protocol */ +/* #undef CLOCK_TRIMTSIP */ + +/* Kinemetrics/TrueTime receivers */ +#define CLOCK_TRUETIME 1 + +/* Spectracom TSYNC timing board */ +/* #undef CLOCK_TSYNCPCI */ + +/* TrueTime 560 IRIG-B decoder? */ +/* #undef CLOCK_TT560 */ + +/* Ultralink M320 WWVB receiver? */ +#define CLOCK_ULINK 1 + +/* VARITEXT clock */ +/* #undef CLOCK_VARITEXT */ + +/* WHARTON 400A Series clock */ +/* #undef CLOCK_WHARTON_400A */ + +/* WWV audio driver */ +#define CLOCK_WWV 1 + +/* Zyfer GPStarplus */ +#define CLOCK_ZYFER 1 + +/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP + systems. This function is required for `alloca.c' support on those systems. + */ +/* #undef CRAY_STACKSEG_END */ + +/* Define to 1 if using `alloca.c'. */ +/* #undef C_ALLOCA */ + +/* Enable debugging code? */ +/* #undef DEBUG */ + +/* Enable processing time debugging? */ +/* #undef DEBUG_TIMING */ + +/* Declaration style */ +/* #undef DECL_ADJTIME_0 */ + +/* Declaration style */ +/* #undef DECL_BCOPY_0 */ + +/* Declaration style */ +/* #undef DECL_BZERO_0 */ + +/* Declaration style */ +/* #undef DECL_CFSETISPEED_0 */ + +/* Declare errno? */ +/* #undef DECL_ERRNO */ + +/* Declaration style */ +/* #undef DECL_HSTRERROR_0 */ + +/* Declare h_errno? */ +#define DECL_H_ERRNO 1 + +/* Declaration style */ +/* #undef DECL_INET_NTOA_0 */ + +/* Declaration style */ +/* #undef DECL_IOCTL_0 */ + +/* Declaration style */ +/* #undef DECL_IPC_0 */ + +/* Declaration style */ +/* #undef DECL_MEMMOVE_0 */ + +/* Declaration style */ +/* #undef DECL_MKSTEMP_0 */ + +/* Declaration style */ +/* #undef DECL_MKTEMP_0 */ + +/* Declaration style */ +/* #undef DECL_NLIST_0 */ + +/* Declaration style */ +/* #undef DECL_PLOCK_0 */ + +/* Declaration style */ +/* #undef DECL_RENAME_0 */ + +/* Declaration style */ +/* #undef DECL_SELECT_0 */ + +/* Declaration style */ +/* #undef DECL_SETITIMER_0 */ + +/* Declaration style */ +/* #undef DECL_SETPRIORITY_0 */ + +/* Declaration style */ +/* #undef DECL_SETPRIORITY_1 */ + +/* Declaration style */ +/* #undef DECL_SIGVEC_0 */ + +/* Declaration style */ +/* #undef DECL_STDIO_0 */ + +/* Declaration style */ +/* #undef DECL_STIME_0 */ + +/* Declaration style */ +/* #undef DECL_STIME_1 */ + +/* Declaration style */ +/* #undef DECL_STRERROR_0 */ + +/* Declaration style */ +/* #undef DECL_STRTOL_0 */ + +/* Declare syscall()? */ +/* #undef DECL_SYSCALL */ + +/* Declaration style */ +/* #undef DECL_SYSLOG_0 */ + +/* Declaration style */ +/* #undef DECL_TIMEOFDAY_0 */ + +/* Declaration style */ +/* #undef DECL_TIME_0 */ + +/* Declaration style */ +/* #undef DECL_TOLOWER_0 */ + +/* Declaration style */ +/* #undef DECL_TOUPPER_0 */ + +/* What is the fallback value for HZ? */ +#define DEFAULT_HZ 100 + +/* Default number of megabytes for RLIMIT_MEMLOCK */ +#define DFLT_RLIMIT_MEMLOCK -1 + +/* Default number of 4k pages for RLIMIT_STACK */ +#define DFLT_RLIMIT_STACK 50 + +/* Directory separator character, usually / or \\ */ +#define DIR_SEP '/' + +/* use old autokey session key behavior? */ +/* #undef DISABLE_BUG1243_FIX */ + +/* synch TODR hourly? */ +/* #undef DOSYNCTODR */ + +/* The number of minutes in a DST adjustment */ +#define DSTMINUTES 60 + +/* support dynamic interleave? */ +#define DYNAMIC_INTERLEAVE 0 + +/* number of args to el_init() */ +#define EL_INIT_ARGS 4 + +/* Provide the explicit 127.0.0.0/8 martian filter? */ +#define ENABLE_BUG3020_FIX 1 + +/* Enable CMAC support? */ +#define ENABLE_CMAC 1 + +/* nls support in libopts */ +/* #undef ENABLE_NLS */ + +/* force ntpdate to step the clock if !defined(STEP_SLEW) ? */ +/* #undef FORCE_NTPDATE_STEP */ + +/* What is getsockname()'s socklen type? */ +#define GETSOCKNAME_SOCKLEN_TYPE socklen_t + +/* Do we have a routing socket (rt_msghdr or rtattr)? */ +#define HAS_ROUTING_SOCKET 1 + +/* via __adjtimex */ +/* #undef HAVE_ADJTIMEX */ + +/* Define to 1 if you have `alloca', as a function or macro. */ +#define HAVE_ALLOCA 1 + +/* Define to 1 if you have and it should be used (not on Ultrix). + */ +/* #undef HAVE_ALLOCA_H */ + +/* Define to 1 if you have the `arc4random_buf' function. */ +#define HAVE_ARC4RANDOM_BUF 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ARPA_NAMESER_H 1 + +/* Define to 1 if you have the `atomic_thread_fence' function. */ +/* #undef HAVE_ATOMIC_THREAD_FENCE */ + +/* Do we have audio support? */ +#define HAVE_AUDIO /**/ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_BSTRING_H */ + +/* Define to 1 if you have the `canonicalize_file_name' function. */ +/* #undef HAVE_CANONICALIZE_FILE_NAME */ + +/* Define to 1 if you have the `chmod' function. */ +#define HAVE_CHMOD 1 + +/* Do we have the CIOGETEV ioctl (SunOS, Linux)? */ +/* #undef HAVE_CIOGETEV */ + +/* Define to 1 if you have the `clock_getres' function. */ +#define HAVE_CLOCK_GETRES 1 + +/* Define to 1 if you have the `clock_gettime' function. */ +#define HAVE_CLOCK_GETTIME 1 + +/* Define to 1 if you have the `clock_settime' function. */ +#define HAVE_CLOCK_SETTIME 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_CTHREADS_H */ + +/* Define to 1 if you have the `daemon' function. */ +#define HAVE_DAEMON 1 + +/* Define to 1 if you have the declaration of `siglongjmp', and to 0 if you + don't. */ +#define HAVE_DECL_SIGLONGJMP 1 + +/* Define to 1 if you have the declaration of `sigsetjmp', and to 0 if you + don't. */ +#define HAVE_DECL_SIGSETJMP 1 + +/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you + don't. */ +#define HAVE_DECL_STRERROR_R 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#define HAVE_DIRENT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Use Rendezvous/DNS-SD registration */ +/* #undef HAVE_DNSREGISTRATION */ + +/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ +/* #undef HAVE_DOPRNT */ + +/* Can we drop root privileges? */ +#define HAVE_DROPROOT + +/* Define to 1 if you have the header file. */ +#define HAVE_ERRNO_H 1 + +/* Define to 1 if you have the `EVP_MD_do_all_sorted' function. */ +#define HAVE_EVP_MD_DO_ALL_SORTED 1 + +/* Define to 1 if you have the `fchmod' function. */ +#define HAVE_FCHMOD 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define to 1 if you have the `finite' function. */ +/* #undef HAVE_FINITE */ + +/* Define to 1 if you have the `fnmatch' function. */ +#define HAVE_FNMATCH 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_FNMATCH_H 1 + +/* Define to 1 if you have the `fork' function. */ +#define HAVE_FORK 1 + +/* Define to 1 if you have the `fstat' function. */ +#define HAVE_FSTAT 1 + +/* Define to 1 if you have the `getbootfile' function. */ +#define HAVE_GETBOOTFILE 1 + +/* Define to 1 if you have the `getclock' function. */ +/* #undef HAVE_GETCLOCK */ + +/* Define to 1 if you have the `getdtablesize' function. */ +#define HAVE_GETDTABLESIZE 1 + +/* Define to 1 if you have the `getifaddrs' function. */ +#define HAVE_GETIFADDRS 1 + +/* Define to 1 if you have the `getpassphrase' function. */ +/* #undef HAVE_GETPASSPHRASE */ + +/* Define to 1 if you have the `getrusage' function. */ +#define HAVE_GETRUSAGE 1 + +/* Define to 1 if you have the `getuid' function. */ +#define HAVE_GETUID 1 + +/* if you have GNU Pth */ +/* #undef HAVE_GNU_PTH */ + +/* Define to 1 if you have the header file. */ +#define HAVE_HISTEDIT_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_HISTORY_H */ + +/* Obvious */ +#define HAVE_HZ_IN_STRUCT_CLOCKINFO 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_IEEEFP_H 1 + +/* have iflist_sysctl? */ +#define HAVE_IFLIST_SYSCTL 1 + +/* Define to 1 if you have the `if_nametoindex' function. */ +#define HAVE_IF_NAMETOINDEX 1 + +/* inline keyword or macro available */ +#define HAVE_INLINE 1 + +/* Define to 1 if the system has the type `int16_t'. */ +#define HAVE_INT16_T 1 + +/* Define to 1 if the system has the type `int32'. */ +/* #undef HAVE_INT32 */ + +/* int32 type in DNS headers, not others. */ +/* #undef HAVE_INT32_ONLY_WITH_DNS */ + +/* Define to 1 if the system has the type `int32_t'. */ +#define HAVE_INT32_T 1 + +/* Define to 1 if the system has the type `int8_t'. */ +#define HAVE_INT8_T 1 + +/* Define to 1 if the system has the type `intmax_t'. */ +/* #undef HAVE_INTMAX_T */ + +/* Define to 1 if the system has the type `intptr_t'. */ +#define HAVE_INTPTR_T 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `isfinite' function. */ +#define HAVE_ISFINITE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_KVM_H 1 + +/* Define to 1 if you have the `kvm_open' function. */ +/* #undef HAVE_KVM_OPEN */ + +/* Define to 1 if you have the `gen' library (-lgen). */ +/* #undef HAVE_LIBGEN */ + +/* Define to 1 if you have the header file. */ +#define HAVE_LIBGEN_H 1 + +/* Define to 1 if you have the `intl' library (-lintl). */ +/* #undef HAVE_LIBINTL */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LIBINTL_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LIBSCF_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* using Linux pthread? */ +/* #undef HAVE_LINUXTHREADS */ + +/* Do we have Linux capabilities? */ +/* #undef HAVE_LINUX_CAPABILITIES */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LINUX_IF_ADDR_H */ + +/* if you have LinuxThreads */ +/* #undef HAVE_LINUX_THREADS */ + +/* Define to 1 if you have the `localeconv' function. */ +/* #undef HAVE_LOCALECONV */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LOCALE_H */ + +/* Define to 1 if the system has the type `long double'. */ +/* #undef HAVE_LONG_DOUBLE */ + +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + +/* Define to 1 if the system has the type `long long int'. */ +/* #undef HAVE_LONG_LONG_INT */ + +/* if you have SunOS LWP package */ +/* #undef HAVE_LWP */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LWP_LWP_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MACHINE_INLINE_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MACHINE_SOUNDCARD_H */ + +/* define if you have Mach Cthreads */ +/* #undef HAVE_MACH_CTHREADS */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MACH_CTHREADS_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_MATH_H 1 + +/* Define to 1 if you have the `MD5Init' function. */ +#define HAVE_MD5INIT 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MD5_H 1 + +/* Define to 1 if you have the `memlk' function. */ +/* #undef HAVE_MEMLK */ + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `mkstemp' function. */ +#define HAVE_MKSTEMP 1 + +/* Define to 1 if you have the `mktime' function. */ +#define HAVE_MKTIME 1 + +/* Define to 1 if you have the `mlockall' function. */ +#define HAVE_MLOCKALL 1 + +/* Define to 1 if you have the `mmap' function. */ +#define HAVE_MMAP 1 + +/* Define to 1 if you have the `nanosleep' function. */ +#define HAVE_NANOSLEEP 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +/* #undef HAVE_NDIR_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_NETDB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_NETINET_IN_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NETINET_IN_SYSTEM_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_NETINET_IN_SYSTM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_NETINET_IN_VAR_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_NETINET_IP_H 1 + +/* NetInfo support? */ +/* #undef HAVE_NETINFO */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NETINFO_NI_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NET_IF6_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_NET_IF_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_NET_IF_VAR_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_NET_ROUTE_H 1 + +/* Define to 1 if you have the `nice' function. */ +#define HAVE_NICE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_NLIST_H 1 + +/* via __adjtimex */ +#define HAVE_NTP_ADJTIME 1 + +/* via __ntp_gettime */ +#define HAVE_NTP_GETTIME 1 + +/* Do we want support for Samba's signing daemon? */ +#define HAVE_NTP_SIGND 1 + +/* if you have NT Event Log */ +/* #undef HAVE_NT_EVENT_LOG */ + +/* if you have NT Service Manager */ +/* #undef HAVE_NT_SERVICE_MANAGER */ + +/* if you have NT Threads */ +/* #undef HAVE_NT_THREADS */ + +/* Define to 1 if you have the header file. */ +#define HAVE_OPENSSL_CMAC_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_OPENSSL_HMAC_H 1 + +/* Define to 1 if the system has the type `pid_t'. */ +#define HAVE_PID_T 1 + +/* Define to 1 if you have the `plock' function. */ +/* #undef HAVE_PLOCK */ + +/* Define to 1 if you have the header file. */ +#define HAVE_POLL_H 1 + +/* Do we have the PPS API per the Draft RFC? */ +#define HAVE_PPSAPI 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_PRIV_H */ + +/* Define if you have POSIX threads libraries and header files. */ +/* #undef HAVE_PTHREAD */ + +/* define to pthreads API spec revision */ +#define HAVE_PTHREADS 10 + +/* Define to 1 if you have the `pthread_attr_getstacksize' function. */ +#define HAVE_PTHREAD_ATTR_GETSTACKSIZE 1 + +/* Define to 1 if you have the `pthread_attr_setstacksize' function. */ +#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1 + +/* define if you have pthread_detach function */ +#define HAVE_PTHREAD_DETACH 1 + +/* Define to 1 if you have the `pthread_getconcurrency' function. */ +#define HAVE_PTHREAD_GETCONCURRENCY 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_PTHREAD_H 1 + +/* Define to 1 if you have the `pthread_kill' function. */ +#define HAVE_PTHREAD_KILL 1 + +/* Define to 1 if you have the `pthread_kill_other_threads_np' function. */ +/* #undef HAVE_PTHREAD_KILL_OTHER_THREADS_NP */ + +/* define if you have pthread_rwlock_destroy function */ +#define HAVE_PTHREAD_RWLOCK_DESTROY 1 + +/* Define to 1 if you have the `pthread_setconcurrency' function. */ +#define HAVE_PTHREAD_SETCONCURRENCY 1 + +/* Define to 1 if you have the `pthread_yield' function. */ +#define HAVE_PTHREAD_YIELD 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_PTH_H */ + +/* Define to 1 if the system has the type `ptrdiff_t'. */ +#define HAVE_PTRDIFF_T 1 + +/* Define to 1 if you have the `pututline' function. */ +/* #undef HAVE_PUTUTLINE */ + +/* Define to 1 if you have the `pututxline' function. */ +#define HAVE_PUTUTXLINE 1 + +/* Define to 1 if you have the `RAND_bytes' function. */ +#define HAVE_RAND_BYTES 1 + +/* Define to 1 if you have the `RAND_poll' function. */ +#define HAVE_RAND_POLL 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_READLINE_H */ + +/* Define if your readline library has \`add_history' */ +#define HAVE_READLINE_HISTORY 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_READLINE_HISTORY_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_READLINE_READLINE_H 1 + +/* Define to 1 if you have the `readlink' function. */ +#define HAVE_READLINK 1 + +/* Define to 1 if you have the `recvmsg' function. */ +#define HAVE_RECVMSG 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_RESOLV_H 1 + +/* Define to 1 if you have the `res_init' function. */ +#define HAVE_RES_INIT 1 + +/* Do we have Linux routing socket? */ +/* #undef HAVE_RTNETLINK */ + +/* Define to 1 if you have the `rtprio' function. */ +#define HAVE_RTPRIO 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_RUNETYPE_H 1 + +/* Obvious */ +#define HAVE_SA_SIGACTION_IN_STRUCT_SIGACTION 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SCHED_H 1 + +/* Define to 1 if you have the `sched_setscheduler' function. */ +#define HAVE_SCHED_SETSCHEDULER 1 + +/* Define to 1 if you have the `sched_yield' function. */ +#define HAVE_SCHED_YIELD 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SEMAPHORE_H 1 + +/* Define to 1 if you have the `sem_timedwait' function. */ +#define HAVE_SEM_TIMEDWAIT 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SETJMP_H 1 + +/* Define to 1 if you have the `setlinebuf' function. */ +#define HAVE_SETLINEBUF 1 + +/* Define to 1 if you have the `setpgid' function. */ +#define HAVE_SETPGID 1 *** 1030 LINES SKIPPED *** From nobody Tue Jun 6 13:30:04 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QbBDF19LPz4bb98; Tue, 6 Jun 2023 13:30:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QbBDF0hrjz3kQ3; Tue, 6 Jun 2023 13:30:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686058205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=T8kvCBRr6G4Tn00FNzEN5p9/PfXIkNjS131RZeqI0/o=; b=PxrLBDbJg//Vl4YSRiKP6tmEmxu1fxros/p3yobPCppZsqIYaiy7qte8NR7kRH5AeabvOM A4MQVi/snrucCGQvjlno4qRFYLUc9JCw/nkybGjuoQ3KlgXxRb5FyB23JXQko8uSIy2ar6 rbghMpW8ulI4b8Ge6N6UjhXwtnlpTX7STh8DuYaiEI1LWECzKYgX9GWlHOtwgTa3ZOWK1B fPH88lTm6mR5zw6PpjxVuSiPL3xOKLfXikAs4Aiui6DLhzYzrg2N7rNbDems9/M+DodLbe M5PY88ImiErZQgRzKolHQCTLPB9Dlgh2p3Us7AzLOBvB7QvmlycUla2QZS0ihA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686058205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=T8kvCBRr6G4Tn00FNzEN5p9/PfXIkNjS131RZeqI0/o=; b=MdqyctCEBUygcHHylmx0K0kJA+NMtT0wbjqaUGssmd/7QJuDM0916EsvL4ePqIigSB3O+1 BYP4DHmFlRBL3mBaiTC8J8nLQ0oQPWGeXLqrovwfnQAJfc0jKFQTFJqbrwIYjJuJJPufN5 ZpQG6NFt4BO4Pccvugp8xxVAb5RShBofohi0XRne2RqY/U32hcNKEYDEmVrWIjvk1SzIdb HX9VOI8ATaE3Y1QqkVBpAW7B+VNLVuBxNwyThsg2mJYWSncv/vWJHKKOKOcRQO9E373ZRZ ESfPoxOCB9gA6RY99hnu3jkyGUKoe2LWzRFZ8IBF8oWWqfQbzcrDtwXp0q3hmQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686058205; a=rsa-sha256; cv=none; b=lhxuFARf1P15u88MDNvMysAC2CRWMLhDQbZXAnFxFhCUeCmHPwaoc8Gv/dSlc9+vv3uEPz p8L28fIb8uSIJBZ2K8EiH9qoktSgZ1/ghKP6LzK0OH9W1/+WdO+cpFfG7F7iq/IxlPcL49 lVX/UbOUqHVsLygHTBiAXi5e57NgMbCNXSqauePQAXF8tq7QZ/EZDU1vVTt76Faz61gnAy v71DIgcxwEtREXqToBedztX6XOlh6NPaFVHktiNwHUghtmsS3wMy7ondPj0LbFqJLAOUWH CxJ7Jxn3BFJB098KancCJro/VRFrZ6B9BNS3eIiQbzNlbMJwVU/btkgOBVv5Zg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QbBDD6vGyzWvZ; Tue, 6 Jun 2023 13:30:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 356DU48X004119; Tue, 6 Jun 2023 13:30:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 356DU4GR004116; Tue, 6 Jun 2023 13:30:04 GMT (envelope-from git) Date: Tue, 6 Jun 2023 13:30:04 GMT Message-Id: <202306061330.356DU4GR004116@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: 82aa1470c94c - main - ntp: Fix build List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 82aa1470c94c55db31c0168d65f8a08fa1d41378 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=82aa1470c94c55db31c0168d65f8a08fa1d41378 commit 82aa1470c94c55db31c0168d65f8a08fa1d41378 Author: Cy Schubert AuthorDate: 2023-06-06 13:27:05 +0000 Commit: Cy Schubert CommitDate: 2023-06-06 13:27:05 +0000 ntp: Fix build Two files used to obtain time from reference clocks did not include ntp_types.h resulting in an undefined NONEMPTY_TRANSLATION_UNIT. Fixes: e6bfd18d21b2 MFC after: 3 days X-MFC-with: e6bfd18d21b2 --- contrib/ntp/libparse/clk_hopf6021.c | 2 ++ contrib/ntp/libparse/clk_wharton.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/contrib/ntp/libparse/clk_hopf6021.c b/contrib/ntp/libparse/clk_hopf6021.c index b0b0c1ff2a73..a747581b75dc 100644 --- a/contrib/ntp/libparse/clk_hopf6021.c +++ b/contrib/ntp/libparse/clk_hopf6021.c @@ -20,6 +20,8 @@ # include #endif +#include + #if defined(REFCLOCK) && defined(CLOCK_PARSE) && defined(CLOCK_HOPF6021) #include "ntp_fp.h" diff --git a/contrib/ntp/libparse/clk_wharton.c b/contrib/ntp/libparse/clk_wharton.c index fbe9cc95f5f7..e1ef61d55bdb 100644 --- a/contrib/ntp/libparse/clk_wharton.c +++ b/contrib/ntp/libparse/clk_wharton.c @@ -9,6 +9,8 @@ #include #endif +#include + #if defined(REFCLOCK) && defined(CLOCK_PARSE) && defined(CLOCK_WHARTON_400A) /* * Support for WHARTON 400A Series clock + 404.2 serial interface. From nobody Tue Jun 6 13:34:14 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QbBK61bnpz4bbCv; Tue, 6 Jun 2023 13:34:18 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta001.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QbBK60njwz3lMR; Tue, 6 Jun 2023 13:34:18 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4004a.ext.cloudfilter.net ([10.228.9.227]) by cmsmtp with ESMTP id 6UvWqqViWLAoI6WpFqcYte; Tue, 06 Jun 2023 13:34:17 +0000 Received: from spqr.komquats.com ([70.66.148.124]) by cmsmtp with ESMTPA id 6WpDqmWSe3fOS6WpEqa4sM; Tue, 06 Jun 2023 13:34:17 +0000 X-Authority-Analysis: v=2.4 cv=J8G5USrS c=1 sm=1 tr=0 ts=647f35d9 a=Cwc3rblV8FOMdVN/wOAqyQ==:117 a=Cwc3rblV8FOMdVN/wOAqyQ==:17 a=kj9zAlcOel0A:10 a=of4jigFt-DYA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=Y23xFIO_nhPO6ogQ8UcA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id E4C221023; Tue, 6 Jun 2023 06:34:14 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id D8CF43B2; Tue, 6 Jun 2023 06:34:14 -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: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 82aa1470c94c - main - ntp: Fix build In-reply-to: <202306061330.356DU4GR004116@gitrepo.freebsd.org> References: <202306061330.356DU4GR004116@gitrepo.freebsd.org> Comments: In-reply-to Cy Schubert message dated "Tue, 06 Jun 2023 13:30:04 +0000." List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 06 Jun 2023 06:34:14 -0700 Message-Id: <20230606133414.D8CF43B2@slippy.cwsent.com> X-CMAE-Envelope: MS4xfPatLWe8Ze0ArWzjhJ6J8crmRaUuU+UhbbgXmXWwDkf2H0MJZPEH1OrIhGBKyeuq3XN7IBKOEzF3x7ME+4IQKFutNRA4Dhwh8YX8bFaLyiSfmXYM3H1N MuZ6OX5Hv4FmJZps4R3b10I1x5uAYBB/u6M3VM1dEGIUaJ9gGGuC0PVaTWqDNwEGT+3bYbcINyYlDDW+9NlpcDBAM67ErdQoPFx8AAruXLsf0YpHaHp/eMro CF+9Ue4ndhI+PP33lR5Uf+dD2p0jNTkNj9+MxdE+ERCGdwRXRzUNOu9dbcQnfrV/4yFSeo1lk6LXMAM5lcKlujAT4ffMUcsCMSBcbcug/d4= X-Rspamd-Queue-Id: 4QbBK60njwz3lMR X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N In message <202306061330.356DU4GR004116@gitrepo.freebsd.org>, Cy Schubert write s: > The branch main has been updated by cy: > > URL: https://cgit.FreeBSD.org/src/commit/?id=82aa1470c94c55db31c0168d65f8a08f > a1d41378 > > commit 82aa1470c94c55db31c0168d65f8a08fa1d41378 > Author: Cy Schubert > AuthorDate: 2023-06-06 13:27:05 +0000 > Commit: Cy Schubert > CommitDate: 2023-06-06 13:27:05 +0000 > > ntp: Fix build > > Two files used to obtain time from reference clocks did not include > ntp_types.h resulting in an undefined NONEMPTY_TRANSLATION_UNIT. BTW, the base NTP should not include support for reference clocks. Those wishing to use reference clocks should use the port. Base support for reference clocks will be removed at some point. > > Fixes: e6bfd18d21b2 > MFC after: 3 days > X-MFC-with: e6bfd18d21b2 -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 From nobody Tue Jun 6 20:01:58 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QbLwQ3JM2z4bMwB; Tue, 6 Jun 2023 20:01:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QbLwQ2sx6z3GV2; Tue, 6 Jun 2023 20:01:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686081718; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z6CBqxBU1ftgiYoMAvsC7HHzGKETghsOdJ3b/1rRSFA=; b=cAd3aM0snSENonVZ6P154TON2jfOts1LlXn/Vq5imeN86M71aJGoNAVJplmB5FVv1O2n5Z a1GeiV8iJgwEkQxsxW0gZvSGT2M1qoPZhByUHNlflPtCKeBYI8NkvjEHyTE5itKTkbdpPN ovi9Fc7LEmzsXkbZVSjv7mMFRjIO7jYQd/DleSKDi/BLEAzQLc4rOY76rjbjqtDc9j4rEA y8N1H3z7Ymm0CNSf+pIkbVX/ZmdQRwa4W1fUFNrN53HUJRn3wlKk37x19S4TY4wwq3BH3e THujCK1nFDlRMTcaExcob7DBk7OWnloxednbI3SJNNpWYdTdfeOcRseEdDWlYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686081718; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z6CBqxBU1ftgiYoMAvsC7HHzGKETghsOdJ3b/1rRSFA=; b=XSaTxgHSyuLC9hQuItWrer3fabmCu1qRTOzj3JBueyQ9WcqfRDGjZ/QAvTuyESEsO69UNY OcDNCv5eaDerjbidFOT4T3pB6trqRRqq5vKKTrrRqjHkfhNd77siO68Nl5V8NCyaX7Mcpc yxopKAZJwo7slq48ORsb2c3N1VTb9VT4P88nQzsUUOoT2B890BpowfLRotmMfaWv+fOqjS JphA/FarhvNxtnAWt4w3i1rdFnSMZJvwiCBLUHFdjO0PHHGkuo1iSqxQ0+DviqOB/nHz74 bviHoOyo5Pn566mLs1AKCUAMEgZYo3kS7qY5kYv9q6KiazhpaeLArFJarzzuwA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686081718; a=rsa-sha256; cv=none; b=Jt15sKReETnALr/UteGXdt1zdAko73yXp81E4+gB2uL+zjWvGKQHs5a02HUnmDYLmr0K3c yb7/cVUlw9U+3+t4TiCUQTzydX3Lffdu1tJHGeAIWT6dpmNsW+QeClucc6AzBLvxJLshI+ NhF/JJhTiLYHuTO4VyA3y16rDdAtA6de9Moj+lU7G3b4ilfOMLgIiAnWu0Rn6yrMME0+4r wOjwLx61T1Rf3ghNSoDEcUoQxtdT5fpUjexVUqzyKHv2lc+TpKA7VP5tzmC0ODpXvAseU3 x+U3jso1wGBAmu0D7EBa2tpuY3naritzAgw0yMvzCjXOko2Lv4AWk4PslIuY+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 4QbLwQ1xPTzjQD; Tue, 6 Jun 2023 20:01:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 356K1wtJ057466; Tue, 6 Jun 2023 20:01:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 356K1wO0057465; Tue, 6 Jun 2023 20:01:58 GMT (envelope-from git) Date: Tue, 6 Jun 2023 20:01:58 GMT Message-Id: <202306062001.356K1wO0057465@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: 84617f6fccd4 - main - linux(4) rt_sendsig: Remove the use of caddr_t List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 84617f6fccd45505f3eeebad1c8cdce1140b7f8e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=84617f6fccd45505f3eeebad1c8cdce1140b7f8e commit 84617f6fccd45505f3eeebad1c8cdce1140b7f8e Author: Dmitry Chagin AuthorDate: 2023-06-06 20:01:39 +0000 Commit: Dmitry Chagin CommitDate: 2023-06-06 20:01:39 +0000 linux(4) rt_sendsig: Remove the use of caddr_t Replace caddr_t by more appropriate char *. MFC after: 2 weeks --- sys/amd64/linux/linux_sysvec.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/amd64/linux/linux_sysvec.c b/sys/amd64/linux/linux_sysvec.c index 943df00328fc..547777127d2a 100644 --- a/sys/amd64/linux/linux_sysvec.c +++ b/sys/amd64/linux/linux_sysvec.c @@ -410,7 +410,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) struct proc *p; struct thread *td; struct sigacts *psp; - caddr_t sp; + char *sp; struct trapframe *regs; struct savefpu *svfp; mcontext_t mc; @@ -440,9 +440,9 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) /* Allocate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { - sp = (caddr_t)td->td_sigstk.ss_sp + td->td_sigstk.ss_size; + sp = (char *)td->td_sigstk.ss_sp + td->td_sigstk.ss_size; } else - sp = (caddr_t)regs->tf_rsp - 128; + sp = (char *)regs->tf_rsp - 128; mtx_unlock(&psp->ps_mtx); PROC_UNLOCK(p); @@ -497,7 +497,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) for (i = 0; i < nitems(svfp->sv_xmm); ++i) bcopy(svfp->sv_xmm[i].xmm_bytes, &sf.sf_fs.xmm[i], sizeof(svfp->sv_xmm[i].xmm_bytes)); - sf.sf_uc.uc_mcontext.sc_fpstate = (struct l_fpstate *)((caddr_t)sfp + + sf.sf_uc.uc_mcontext.sc_fpstate = (struct l_fpstate *)((char *)sfp + offsetof(struct l_rt_sigframe, sf_fs)); /* Translate the signal. */ From nobody Tue Jun 6 21:02:40 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QbNGT0gMFz4bYm3; Tue, 6 Jun 2023 21:02:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QbNGT07TBz3QL0; Tue, 6 Jun 2023 21:02:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686085361; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6gZ48wv4PnQiFXiIWm5d9nndZXwo+gHqBCNUZkUfs40=; b=ZnbyfDrNp5Uq/BRCstPhCj+Xzw84ZLk5vWVHK55JvXZtH0URThhq81aT1XFLvDBceYDBAP grfRY3n3qwSSGJBIxN6lOCh/Sc8E+JnTf595KCMFVF6iK+ABrxgMYzxH1DcAY3ODLE/DrW k56pkcejRqh5E2qR0Jj1WocNsJCn4JullYpQiDM4QY8kQOj88Lht1CqMCBn3Iqos103f/I ixhBu7tg56dy7hnHLfIzgZk9ZkXz3uQNcQvxe2jW+e8u3bP9EbuLz4WDl7rSWkBTSE+as/ jD/udIObtneBA6tm2Bn5Paa5wENmyzwONmboWOZhoe4z4hPphCoD2r6sRfbm8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686085361; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6gZ48wv4PnQiFXiIWm5d9nndZXwo+gHqBCNUZkUfs40=; b=k3MIgevDnijem3mmZVv70c6FI4MECLoELUbaxn6xtpvhiiypeYYS3ujxhdqMjtkAyKYOGX 3RXNSfm4tm6fhkiVTo+b7P9gsx/uj2K9ik1Fm0C3Rxyti36qN+Xr9I1oyhvTBe9kCqnmOb XkGc+J/LESa2Dj+cpTifINkTfviBjdwDOYGUY00mozPP3QmZfVMAKJkLArHwXaVALcII6J VRAzlWEat11t/tfdMfBFFWztXKTLb2gy3jmQcJ4gIFkZt/eYA3Dq0eDpdKlt9AE5mVWHd8 R74WmrF+GzHlvlPbhaHmfu5KKzK7sl9k7dqUTiYhmLs8egtX4SoBQI70f8UdEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686085361; a=rsa-sha256; cv=none; b=qqkFEka4KvEo3zYFjsAcJMJN48G+3nzt9hP7gBBv30PEYscFWK96oVswMg39InCAnm8MCd iOttZ1dUF3WiMp59kNYOczEelQBOuKw6NuEHzNAj1yaTx6wOmeybtviXXprpF1WXeU2FFQ TYCQvbekL92SKAdAjiPXnfXJAwDDuX/znYcdTimqF//Yk+B5Zk7tBIIPwPB12lecJJyR3S rsu5+EO1h2TGUWiUYlRfQNkI9IcbMASj1Ms2svGulm2yIyISxlTl+84GpD+lVak2qr3JwR eQxxEKKqnXB8cRMsBZMxt4g8i0K1LMwW98/aoVyDJbPNYXkerm6+YbhnJG71mg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QbNGS6LX1zl82; Tue, 6 Jun 2023 21:02:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 356L2ejQ059796; Tue, 6 Jun 2023 21:02:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 356L2ejk059795; Tue, 6 Jun 2023 21:02:40 GMT (envelope-from git) Date: Tue, 6 Jun 2023 21:02:40 GMT Message-Id: <202306062102.356L2ejk059795@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Richard Scheffenegger Subject: git: 43b117f88f30 - main - tcp: make the maximum number of retransmissions tunable per VNET List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 43b117f88f3044d5f08e70b0daf0bb964f9ecb4b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=43b117f88f3044d5f08e70b0daf0bb964f9ecb4b commit 43b117f88f3044d5f08e70b0daf0bb964f9ecb4b Author: Richard Scheffenegger AuthorDate: 2023-06-06 20:56:44 +0000 Commit: Richard Scheffenegger CommitDate: 2023-06-06 20:58:54 +0000 tcp: make the maximum number of retransmissions tunable per VNET Both Windows (TcpMaxDataRetransmissions) and Linux (tcp_retries2) allow to restrict the maximum number of consecutive timer based retransmissions. Add that same capability on a per-VNet basis to FreeBSD. Reviewed By: cc, tuexen, #transport Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D40424 --- share/man/man4/tcp.4 | 5 ++++- sys/netinet/tcp_output.c | 2 +- sys/netinet/tcp_stacks/bbr.c | 8 ++++---- sys/netinet/tcp_stacks/rack.c | 8 ++++---- sys/netinet/tcp_timer.c | 30 ++++++++++++++++++++++++++---- sys/netinet/tcp_var.h | 2 ++ 6 files changed, 41 insertions(+), 14 deletions(-) diff --git a/share/man/man4/tcp.4 b/share/man/man4/tcp.4 index ce27705f7eda..382e39a4355d 100644 --- a/share/man/man4/tcp.4 +++ b/share/man/man4/tcp.4 @@ -34,7 +34,7 @@ .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd February 3, 2023 +.Dd June 6, 2023 .Dt TCP 4 .Os .Sh NAME @@ -843,6 +843,9 @@ Maximum size of automatic receive buffer. Initial .Tn TCP receive window (buffer size). +.It Va retries +Maximum number of consecutive timer based retransmits sent after a data +segment is lost (default and maximum is 12). .It Va rexmit_drop_options Drop TCP options from third and later retransmitted SYN segments of a connection. diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index abfab1a62176..800480413586 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -1766,7 +1766,7 @@ tcp_setpersist(struct tcpcb *tp) tt = maxunacktime; } tcp_timer_activate(tp, TT_PERSIST, tt); - if (tp->t_rxtshift < TCP_MAXRXTSHIFT) + if (tp->t_rxtshift < V_tcp_retries) tp->t_rxtshift++; } diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c index 5ecb558dadb3..1e8053afc45c 100644 --- a/sys/netinet/tcp_stacks/bbr.c +++ b/sys/netinet/tcp_stacks/bbr.c @@ -4763,7 +4763,7 @@ bbr_timeout_persist(struct tcpcb *tp, struct tcp_bbr *bbr, uint32_t cts) * the idle time (no responses to probes) reaches the maximum * backoff that we would use if retransmitting. */ - if (tp->t_rxtshift == TCP_MAXRXTSHIFT && + if (tp->t_rxtshift >= V_tcp_retries && (ticks - tp->t_rcvtime >= tcp_maxpersistidle || ticks - tp->t_rcvtime >= TCP_REXMTVAL(tp) * tcp_totbackoff)) { KMOD_TCPSTAT_INC(tcps_persistdrop); @@ -4796,7 +4796,7 @@ bbr_timeout_persist(struct tcpcb *tp, struct tcp_bbr *bbr, uint32_t cts) tp->t_flags &= ~TF_DELACK; free(t_template, M_TEMP); } - if (tp->t_rxtshift < TCP_MAXRXTSHIFT) + if (tp->t_rxtshift < V_tcp_retries) tp->t_rxtshift++; bbr_start_hpts_timer(bbr, tp, cts, 3, 0, 0); out: @@ -4990,8 +4990,8 @@ bbr_timeout_rxt(struct tcpcb *tp, struct tcp_bbr *bbr, uint32_t cts) */ tp->t_rxtshift++; } - if (tp->t_rxtshift > TCP_MAXRXTSHIFT) { - tp->t_rxtshift = TCP_MAXRXTSHIFT; + if (tp->t_rxtshift > V_tcp_retries) { + tp->t_rxtshift = V_tcp_retries; KMOD_TCPSTAT_INC(tcps_timeoutdrop); tcp_log_end_status(tp, TCP_EI_STATUS_RETRAN); /* XXXGL: previously t_softerror was casted to uint16_t */ diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index c9b5b937cc46..36fd5daf07dd 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -7445,7 +7445,7 @@ rack_timeout_persist(struct tcpcb *tp, struct tcp_rack *rack, uint32_t cts) * the idle time (no responses to probes) reaches the maximum * backoff that we would use if retransmitting. */ - if (tp->t_rxtshift == TCP_MAXRXTSHIFT && + if (tp->t_rxtshift >= V_tcp_retries && (ticks - tp->t_rcvtime >= tcp_maxpersistidle || TICKS_2_USEC(ticks - tp->t_rcvtime) >= RACK_REXMTVAL(tp) * tcp_totbackoff)) { KMOD_TCPSTAT_INC(tcps_persistdrop); @@ -7491,7 +7491,7 @@ rack_timeout_persist(struct tcpcb *tp, struct tcp_rack *rack, uint32_t cts) tp->t_flags &= ~TF_DELACK; free(t_template, M_TEMP); } - if (tp->t_rxtshift < TCP_MAXRXTSHIFT) + if (tp->t_rxtshift < V_tcp_retries) tp->t_rxtshift++; out: rack_log_to_event(rack, RACK_TO_FRM_PERSIST, NULL); @@ -7783,10 +7783,10 @@ rack_timeout_rxt(struct tcpcb *tp, struct tcp_rack *rack, uint32_t cts) */ tp->t_rxtshift++; } - if (tp->t_rxtshift > TCP_MAXRXTSHIFT) { + if (tp->t_rxtshift > V_tcp_retries) { tcp_log_end_status(tp, TCP_EI_STATUS_RETRAN); drop_it: - tp->t_rxtshift = TCP_MAXRXTSHIFT; + tp->t_rxtshift = V_tcp_retries; KMOD_TCPSTAT_INC(tcps_timeoutdrop); /* XXXGL: previously t_softerror was casted to uint16_t */ MPASS(tp->t_softerror >= 0); diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c index d1301c18d54f..6126d85c7565 100644 --- a/sys/netinet/tcp_timer.c +++ b/sys/netinet/tcp_timer.c @@ -201,6 +201,28 @@ static int per_cpu_timers = 0; SYSCTL_INT(_net_inet_tcp, OID_AUTO, per_cpu_timers, CTLFLAG_RW, &per_cpu_timers , 0, "run tcp timers on all cpus"); +static int +sysctl_net_inet_tcp_retries(SYSCTL_HANDLER_ARGS) +{ + int error, new; + + new = V_tcp_retries; + error = sysctl_handle_int(oidp, &new, 0, req); + if (error == 0 && req->newptr) { + if ((new < 1) || (new > TCP_MAXRXTSHIFT)) + error = EINVAL; + else + V_tcp_retries = new; + } + return (error); +} + +VNET_DEFINE(int, tcp_retries) = TCP_MAXRXTSHIFT; +SYSCTL_PROC(_net_inet_tcp, OID_AUTO, retries, + CTLTYPE_INT | CTLFLAG_VNET | CTLFLAG_RW, + &VNET_NAME(tcp_retries), 0, sysctl_net_inet_tcp_retries, "I", + "maximum number of consecutive timer based retransmissions"); + /* * Map the given inp to a CPU id. * @@ -492,7 +514,7 @@ tcp_timer_persist(struct tcpcb *tp) * progress. */ progdrop = tcp_maxunacktime_check(tp); - if (progdrop || (tp->t_rxtshift == TCP_MAXRXTSHIFT && + if (progdrop || (tp->t_rxtshift >= V_tcp_retries && (ticks - tp->t_rcvtime >= tcp_maxpersistidle || ticks - tp->t_rcvtime >= TCP_REXMTVAL(tp) * tcp_totbackoff))) { if (!progdrop) @@ -555,10 +577,10 @@ tcp_timer_rexmt(struct tcpcb *tp) * or we've gone long enough without making progress, then drop * the session. */ - if (++tp->t_rxtshift > TCP_MAXRXTSHIFT || tcp_maxunacktime_check(tp)) { - if (tp->t_rxtshift > TCP_MAXRXTSHIFT) + if (++tp->t_rxtshift > V_tcp_retries || tcp_maxunacktime_check(tp)) { + if (tp->t_rxtshift > V_tcp_retries) TCPSTAT_INC(tcps_timeoutdrop); - tp->t_rxtshift = TCP_MAXRXTSHIFT; + tp->t_rxtshift = V_tcp_retries; tcp_log_end_status(tp, TCP_EI_STATUS_RETRAN); NET_EPOCH_ENTER(et); tp = tcp_drop(tp, ETIMEDOUT); diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 86345b2aa630..587998331fbf 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -1289,6 +1289,7 @@ VNET_DECLARE(int, tcp_perconn_stats_dflt_tpl); VNET_DECLARE(int, tcp_perconn_stats_enable); #endif /* STATS */ VNET_DECLARE(int, tcp_recvspace); +VNET_DECLARE(int, tcp_retries); VNET_DECLARE(int, tcp_sack_globalholes); VNET_DECLARE(int, tcp_sack_globalmaxholes); VNET_DECLARE(int, tcp_sack_maxholes); @@ -1335,6 +1336,7 @@ VNET_DECLARE(struct inpcbinfo, tcbinfo); #define V_tcp_perconn_stats_enable VNET(tcp_perconn_stats_enable) #endif /* STATS */ #define V_tcp_recvspace VNET(tcp_recvspace) +#define V_tcp_retries VNET(tcp_retries) #define V_tcp_sack_globalholes VNET(tcp_sack_globalholes) #define V_tcp_sack_globalmaxholes VNET(tcp_sack_globalmaxholes) #define V_tcp_sack_maxholes VNET(tcp_sack_maxholes) From nobody Tue Jun 6 21:14:33 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QbNXB0xRCz4bbgg; Tue, 6 Jun 2023 21:14:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QbNXB0nbYz3hQv; Tue, 6 Jun 2023 21:14:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686086074; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M4F452Qcu6Z5/qzHKv296NsKHPcfeqkw+mK7pQM4DDQ=; b=iIgOgjuForgAZtK68XmTS2zdBswEgVCe7t3wRs83VXNuc6rNtW/LALEMCUSmwfqgUnGE5H aoi/LeW1eHjTEJZhYpw3lf2NyqRSfRKeZFf+8sJIWUY2n2maFe6uCve6+xB1UKq2AoYfby Jsl1AKX2dF7TyY+SEMwp5iDjlh321w4M+zFntYAhleDUWy/b5b1oCOkAQBRT4f0tEkExd7 K9lUP4Pb6/TnwwaThhk0inm710Caf69s1Zu73EXFakcVSAfdvS0maoWGzzViyYgGwQ4AmS zInIXa745ilPSJM8b8PGjzmyVJj3MJYE/tAz8LcPWS08agBf1l4D2GeFs26o5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686086074; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M4F452Qcu6Z5/qzHKv296NsKHPcfeqkw+mK7pQM4DDQ=; b=ofX+s2ReM/0D74wFL6Ap7Bwb8yb9xKtQouS/tGJXHJHFgWjR8tFHP8nfN0ixiBtCNJd1Kg Apt5SJ/gNF9OymS7w0HjOtWWlMNptXa8SHqVsmB0YsG4lOxXh6cSpR1dNnbaaNkpYXlDCv I4jAzQ+UqG/8sZikQ2BTwmQ/y24CotnDgXXFUnSKRsMM15HEJr2kwH+G2DL4nZN4Es6Q/7 7srVNlEonhkDA1F9TUokdsojD/ohUS8kDocsHY4QULtO1BlQth0BjFnr1JHr5ffw0vAFEs tKG0o72ooZC/ogDNRawy2wtBfJrlbrXC/Go6orQXx5zaWK6L6LLRUXASBtSFjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686086074; a=rsa-sha256; cv=none; b=q1ld/jEyOOz+K0+L+sBlqfj2dJQNepMwnMxQHZTpEq3wUg9N+upGOVs+8iQqSz34RnY8b7 PjWKTtVbha5MVtxPLEYhu3CJvY8FZ+B9dDkMqppzNNzliARXWOqceaY0c/t9xKjVBtJgOo xje8ayKi1FuFPG98etDsXfzP2tCNwWivuKz73xYK+U7LXSqAzmYeQjE/CFnvENIpE8kbCW pIPGpXsFMJH31WiHgD2Fx6vTFNiVYy7otAAmfeB2LzU8RUbdFuDYnQgqV0VdMue4XGzErx 0hpL+wH2JzsOAEgEPThBSE/2GKGSQ8UQlRjuYzjxjp0+a6ahsMjxk6+itJsFMA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QbNX96xwwzlHZ; Tue, 6 Jun 2023 21:14:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 356LEXP2076833; Tue, 6 Jun 2023 21:14:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 356LEXOq076832; Tue, 6 Jun 2023 21:14:33 GMT (envelope-from git) Date: Tue, 6 Jun 2023 21:14:33 GMT Message-Id: <202306062114.356LEXOq076832@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Richard Scheffenegger Subject: git: eb5bfdd06565 - main - tcp: Add and update cubic module variable names List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: eb5bfdd06565b38939079bf29265264efb1e21c0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=eb5bfdd06565b38939079bf29265264efb1e21c0 commit eb5bfdd06565b38939079bf29265264efb1e21c0 Author: Richard Scheffenegger AuthorDate: 2023-06-06 21:03:30 +0000 Commit: Richard Scheffenegger CommitDate: 2023-06-06 21:09:28 +0000 tcp: Add and update cubic module variable names Prepare the cubic congestion control module to better align with the specifications in RFC8312bis. Rename a few cubic state variables to the variable names found in the RFC8312bis specification. This makes the code more understandable for someone reading the RFC and the code. It also makes the variable naming convention more uniform. Add some variables needed subsequently. No functional change. Submitted By: Bhaskar Pardeshi, VMware Inc. Reviewed By: tuexen, #transport Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D40436 --- sys/netinet/cc/cc_cubic.c | 121 +++++++++++++++++++++++++--------------------- sys/netinet/cc/cc_cubic.h | 62 ++++++++++++++---------- 2 files changed, 103 insertions(+), 80 deletions(-) diff --git a/sys/netinet/cc/cc_cubic.c b/sys/netinet/cc/cc_cubic.c index be9bd9859122..77bb0daadcb1 100644 --- a/sys/netinet/cc/cc_cubic.c +++ b/sys/netinet/cc/cc_cubic.c @@ -239,8 +239,8 @@ static void cubic_ack_received(struct cc_var *ccv, uint16_t type) { struct cubic *cubic_data; - unsigned long w_tf, w_cubic_next; - int usecs_since_cong; + unsigned long W_est, W_cubic; + int usecs_since_epoch; cubic_data = ccv->cc_data; cubic_record_rtt(ccv); @@ -272,57 +272,56 @@ cubic_ack_received(struct cc_var *ccv, uint16_t type) /* RFC8312 Section 4.7 */ cubic_data->flags &= ~(CUBICFLAG_RTO_EVENT | CUBICFLAG_IN_SLOWSTART); - cubic_data->max_cwnd = CCV(ccv, snd_cwnd); + cubic_data->W_max = CCV(ccv, snd_cwnd); cubic_data->K = 0; } else if (cubic_data->flags & (CUBICFLAG_IN_SLOWSTART | CUBICFLAG_IN_APPLIMIT)) { cubic_data->flags &= ~(CUBICFLAG_IN_SLOWSTART | CUBICFLAG_IN_APPLIMIT); - cubic_data->t_last_cong = ticks; - cubic_data->K = cubic_k(cubic_data->max_cwnd / + cubic_data->t_epoch = ticks; + cubic_data->K = cubic_k(cubic_data->W_max / CCV(ccv, t_maxseg)); } - usecs_since_cong = (ticks - cubic_data->t_last_cong) * tick; - if (usecs_since_cong < 0) { + usecs_since_epoch = (ticks - cubic_data->t_epoch) * tick; + if (usecs_since_epoch < 0) { /* - * dragging t_last_cong along + * dragging t_epoch along */ - usecs_since_cong = INT_MAX; - cubic_data->t_last_cong = ticks - INT_MAX; + usecs_since_epoch = INT_MAX; + cubic_data->t_epoch = ticks - INT_MAX; } /* * The mean RTT is used to best reflect the equations in * the I-D. Using min_rtt in the tf_cwnd calculation - * causes w_tf to grow much faster than it should if the + * causes W_est to grow much faster than it should if the * RTT is dominated by network buffering rather than * propagation delay. */ - w_tf = tf_cwnd(usecs_since_cong, cubic_data->mean_rtt_usecs, - cubic_data->max_cwnd, CCV(ccv, t_maxseg)); + W_est = tf_cwnd(usecs_since_epoch, cubic_data->mean_rtt_usecs, + cubic_data->W_max, CCV(ccv, t_maxseg)); - w_cubic_next = cubic_cwnd(usecs_since_cong + - cubic_data->mean_rtt_usecs, - cubic_data->max_cwnd, - CCV(ccv, t_maxseg), - cubic_data->K); + W_cubic = cubic_cwnd(usecs_since_epoch + + cubic_data->mean_rtt_usecs, + cubic_data->W_max, + CCV(ccv, t_maxseg), + cubic_data->K); ccv->flags &= ~CCF_ABC_SENTAWND; - if (w_cubic_next < w_tf) { + if (W_cubic < W_est) { /* * TCP-friendly region, follow tf * cwnd growth. */ - if (CCV(ccv, snd_cwnd) < w_tf) - CCV(ccv, snd_cwnd) = ulmin(w_tf, INT_MAX); - } else if (CCV(ccv, snd_cwnd) < w_cubic_next) { + if (CCV(ccv, snd_cwnd) < W_est) + CCV(ccv, snd_cwnd) = ulmin(W_est, INT_MAX); + } else if (CCV(ccv, snd_cwnd) < W_cubic) { /* * Concave or convex region, follow CUBIC * cwnd growth. * Only update snd_cwnd, if it doesn't shrink. */ - CCV(ccv, snd_cwnd) = ulmin(w_cubic_next, - INT_MAX); + CCV(ccv, snd_cwnd) = ulmin(W_cubic, INT_MAX); } /* @@ -330,12 +329,12 @@ cubic_ack_received(struct cc_var *ccv, uint16_t type) * new cwnd limit at the start of a connection * (happens when hostcache has a relevant entry), * keep updating our current estimate of the - * max_cwnd. + * W_max. */ if (((cubic_data->flags & CUBICFLAG_CONG_EVENT) == 0) && - cubic_data->max_cwnd < CCV(ccv, snd_cwnd)) { - cubic_data->max_cwnd = CCV(ccv, snd_cwnd); - cubic_data->K = cubic_k(cubic_data->max_cwnd / + cubic_data->W_max < CCV(ccv, snd_cwnd)) { + cubic_data->W_max = CCV(ccv, snd_cwnd); + cubic_data->K = cubic_k(cubic_data->W_max / CCV(ccv, t_maxseg)); } } @@ -348,7 +347,7 @@ cubic_ack_received(struct cc_var *ccv, uint16_t type) /* * This is a CUBIC specific implementation of after_idle. * - Reset cwnd by calling New Reno implementation of after_idle. - * - Reset t_last_cong. + * - Reset t_epoch. */ static void cubic_after_idle(struct cc_var *ccv) @@ -357,8 +356,8 @@ cubic_after_idle(struct cc_var *ccv) cubic_data = ccv->cc_data; - cubic_data->max_cwnd = ulmax(cubic_data->max_cwnd, CCV(ccv, snd_cwnd)); - cubic_data->K = cubic_k(cubic_data->max_cwnd / CCV(ccv, t_maxseg)); + cubic_data->W_max = ulmax(cubic_data->W_max, CCV(ccv, snd_cwnd)); + cubic_data->K = cubic_k(cubic_data->W_max / CCV(ccv, t_maxseg)); if ((cubic_data->flags & CUBICFLAG_HYSTART_ENABLED) == 0) { /* * Re-enable hystart if we have been idle. @@ -368,7 +367,7 @@ cubic_after_idle(struct cc_var *ccv) cubic_log_hystart_event(ccv, cubic_data, 12, CCV(ccv, snd_ssthresh)); } newreno_cc_after_idle(ccv); - cubic_data->t_last_cong = ticks; + cubic_data->t_epoch = ticks; } static void @@ -397,7 +396,7 @@ cubic_cb_init(struct cc_var *ccv, void *ptr) cubic_data = ptr; /* Init some key variables with sensible defaults. */ - cubic_data->t_last_cong = ticks; + cubic_data->t_epoch = ticks; cubic_data->min_rtt_usecs = TCPTV_SRTTBASE; cubic_data->mean_rtt_usecs = 1; @@ -441,8 +440,8 @@ cubic_cong_signal(struct cc_var *ccv, uint32_t type) if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) { cubic_ssthresh_update(ccv, mss); cubic_data->flags |= CUBICFLAG_CONG_EVENT; - cubic_data->t_last_cong = ticks; - cubic_data->K = cubic_k(cubic_data->max_cwnd / mss); + cubic_data->t_epoch = ticks; + cubic_data->K = cubic_k(cubic_data->W_max / mss); } ENTER_RECOVERY(CCV(ccv, t_flags)); } @@ -458,8 +457,8 @@ cubic_cong_signal(struct cc_var *ccv, uint32_t type) if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) { cubic_ssthresh_update(ccv, mss); cubic_data->flags |= CUBICFLAG_CONG_EVENT; - cubic_data->t_last_cong = ticks; - cubic_data->K = cubic_k(cubic_data->max_cwnd / mss); + cubic_data->t_epoch = ticks; + cubic_data->K = cubic_k(cubic_data->W_max / mss); CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh); ENTER_CONGRECOVERY(CCV(ccv, t_flags)); } @@ -468,22 +467,36 @@ cubic_cong_signal(struct cc_var *ccv, uint32_t type) case CC_RTO: /* RFC8312 Section 4.7 */ if (CCV(ccv, t_rxtshift) == 1) { - cubic_data->t_last_cong_prev = cubic_data->t_last_cong; - cubic_data->prev_max_cwnd_cp = cubic_data->prev_max_cwnd; + /* + * Remember the state only for the first RTO event. This + * will help us restore the state to the values seen + * at the most recent congestion avoidance stage before + * the current RTO event. + */ + cubic_data->undo_t_epoch = cubic_data->t_epoch; + cubic_data->undo_cwnd_epoch = cubic_data->cwnd_epoch; + cubic_data->undo_W_est = cubic_data->W_est; + cubic_data->undo_cwnd_prior = cubic_data->cwnd_prior; + cubic_data->undo_W_max = cubic_data->W_max; + cubic_data->undo_K = cubic_data->K; } cubic_data->flags |= CUBICFLAG_CONG_EVENT | CUBICFLAG_RTO_EVENT; - cubic_data->prev_max_cwnd = cubic_data->max_cwnd; - CCV(ccv, snd_ssthresh) = ((uint64_t)CCV(ccv, snd_cwnd) * + cubic_data->undo_W_max = cubic_data->W_max; + cubic_data->num_cong_events++; + CCV(ccv, snd_ssthresh) = ((uint64_t)CCV(ccv, snd_cwnd) * CUBIC_BETA) >> CUBIC_SHIFT; CCV(ccv, snd_cwnd) = mss; break; case CC_RTO_ERR: cubic_data->flags &= ~(CUBICFLAG_CONG_EVENT | CUBICFLAG_RTO_EVENT); - cubic_data->max_cwnd = cubic_data->prev_max_cwnd; - cubic_data->prev_max_cwnd = cubic_data->prev_max_cwnd_cp; - cubic_data->t_last_cong = cubic_data->t_last_cong_prev; - cubic_data->K = cubic_k(cubic_data->max_cwnd / mss); + cubic_data->num_cong_events--; + cubic_data->K = cubic_data->undo_K; + cubic_data->cwnd_prior = cubic_data->undo_cwnd_prior; + cubic_data->W_max = cubic_data->undo_W_max; + cubic_data->W_est = cubic_data->undo_W_est; + cubic_data->cwnd_epoch = cubic_data->undo_cwnd_epoch; + cubic_data->t_epoch = cubic_data->undo_t_epoch; break; } } @@ -496,11 +509,11 @@ cubic_conn_init(struct cc_var *ccv) cubic_data = ccv->cc_data; /* - * Ensure we have a sane initial value for max_cwnd recorded. Without + * Ensure we have a sane initial value for W_max recorded. Without * this here bad things happen when entries from the TCP hostcache * get used. */ - cubic_data->max_cwnd = CCV(ccv, snd_cwnd); + cubic_data->W_max = CCV(ccv, snd_cwnd); } static int @@ -542,8 +555,8 @@ cubic_post_recovery(struct cc_var *ccv) CCV(ccv, snd_cwnd) = max(pipe, CCV(ccv, t_maxseg)) + CCV(ccv, t_maxseg); else - /* Update cwnd based on beta and adjusted max_cwnd. */ - CCV(ccv, snd_cwnd) = max(((uint64_t)cubic_data->max_cwnd * + /* Update cwnd based on beta and adjusted W_max. */ + CCV(ccv, snd_cwnd) = max(((uint64_t)cubic_data->W_max * CUBIC_BETA) >> CUBIC_SHIFT, 2 * CCV(ccv, t_maxseg)); } @@ -619,21 +632,21 @@ cubic_ssthresh_update(struct cc_var *ccv, uint32_t maxseg) cwnd = CCV(ccv, snd_cwnd); /* Fast convergence heuristic. */ - if (cwnd < cubic_data->max_cwnd) { + if (cwnd < cubic_data->W_max) { cwnd = ((uint64_t)cwnd * CUBIC_FC_FACTOR) >> CUBIC_SHIFT; } - cubic_data->prev_max_cwnd = cubic_data->max_cwnd; - cubic_data->max_cwnd = cwnd; + cubic_data->undo_W_max = cubic_data->W_max; + cubic_data->W_max = cwnd; /* * On the first congestion event, set ssthresh to cwnd * 0.5 - * and reduce max_cwnd to cwnd * beta. This aligns the cubic concave + * and reduce W_max to cwnd * beta. This aligns the cubic concave * region appropriately. On subsequent congestion events, set * ssthresh to cwnd * beta. */ if ((cubic_data->flags & CUBICFLAG_CONG_EVENT) == 0) { ssthresh = cwnd >> 1; - cubic_data->max_cwnd = ((uint64_t)cwnd * + cubic_data->W_max = ((uint64_t)cwnd * CUBIC_BETA) >> CUBIC_SHIFT; } else { ssthresh = ((uint64_t)cwnd * diff --git a/sys/netinet/cc/cc_cubic.h b/sys/netinet/cc/cc_cubic.h index 3d408154c1a5..694de4a19833 100644 --- a/sys/netinet/cc/cc_cubic.h +++ b/sys/netinet/cc/cc_cubic.h @@ -93,12 +93,18 @@ struct cubic { int64_t K; /* Sum of RTT samples across an epoch in usecs. */ int64_t sum_rtt_usecs; - /* cwnd at the most recent congestion event. */ - unsigned long max_cwnd; - /* cwnd at the previous congestion event. */ - unsigned long prev_max_cwnd; - /* A copy of prev_max_cwnd. Used for CC_RTO_ERR */ - unsigned long prev_max_cwnd_cp; + /* Size of cwnd just before cwnd was reduced in the last congestion event */ + uint64_t W_max; + /* An estimate for the congestion window in the Reno-friendly region */ + uint64_t W_est; + /* The cwnd at the beginning of the current congestion avoidance stage */ + uint64_t cwnd_epoch; + /* + * Size of cwnd at the time of setting ssthresh most recently, + * either upon exiting the first slow start, or just before cwnd + * was reduced in the last congestion event + */ + uint64_t cwnd_prior; /* various flags */ uint32_t flags; /* Minimum observed rtt in usecs. */ @@ -107,14 +113,18 @@ struct cubic { int mean_rtt_usecs; /* ACKs since last congestion event. */ int epoch_ack_count; - /* Timestamp (in ticks) of arriving in congestion avoidance from last - * congestion event. - */ - int t_last_cong; - /* Timestamp (in ticks) of a previous congestion event. Used for - * CC_RTO_ERR. - */ - int t_last_cong_prev; + /* Timestamp (in ticks) at which the current CA epoch started. */ + int t_epoch; + /* Timestamp (in ticks) at which the previous CA epoch started. */ + int undo_t_epoch; + /* Few variables to restore the state after RTO_ERR */ + int64_t undo_K; + uint64_t undo_cwnd_prior; + uint64_t undo_W_max; + uint64_t undo_W_est; + uint64_t undo_cwnd_epoch; + /* Number of congestion events experienced */ + uint64_t num_cong_events; uint32_t css_baseline_minrtt; uint32_t css_current_round_minrtt; uint32_t css_lastround_minrtt; @@ -149,7 +159,7 @@ theoretical_cubic_k(double wmax_pkts) } static __inline unsigned long -theoretical_cubic_cwnd(int ticks_since_cong, unsigned long wmax, uint32_t smss) +theoretical_cubic_cwnd(int ticks_since_epoch, unsigned long wmax, uint32_t smss) { double C, wmax_pkts; @@ -157,25 +167,25 @@ theoretical_cubic_cwnd(int ticks_since_cong, unsigned long wmax, uint32_t smss) wmax_pkts = wmax / (double)smss; return (smss * (wmax_pkts + - (C * pow(ticks_since_cong / (double)hz - + (C * pow(ticks_since_epoch / (double)hz - theoretical_cubic_k(wmax_pkts) / pow(2, CUBIC_SHIFT), 3.0)))); } static __inline unsigned long -theoretical_reno_cwnd(int ticks_since_cong, int rtt_ticks, unsigned long wmax, +theoretical_reno_cwnd(int ticks_since_epoch, int rtt_ticks, unsigned long wmax, uint32_t smss) { - return ((wmax * 0.5) + ((ticks_since_cong / (float)rtt_ticks) * smss)); + return ((wmax * 0.5) + ((ticks_since_epoch / (float)rtt_ticks) * smss)); } static __inline unsigned long -theoretical_tf_cwnd(int ticks_since_cong, int rtt_ticks, unsigned long wmax, +theoretical_tf_cwnd(int ticks_since_epoch, int rtt_ticks, unsigned long wmax, uint32_t smss) { return ((wmax * 0.7) + ((3 * 0.3) / (2 - 0.3) * - (ticks_since_cong / (float)rtt_ticks) * smss)); + (ticks_since_epoch / (float)rtt_ticks) * smss)); } #endif /* !_KERNEL */ @@ -222,14 +232,14 @@ cubic_k(unsigned long wmax_pkts) * XXXLAS: Characterise bounds for overflow. */ static __inline unsigned long -cubic_cwnd(int usecs_since_cong, unsigned long wmax, uint32_t smss, int64_t K) +cubic_cwnd(int usecs_since_epoch, unsigned long wmax, uint32_t smss, int64_t K) { int64_t cwnd; /* K is in fixed point form with CUBIC_SHIFT worth of precision. */ /* t - K, with CUBIC_SHIFT worth of precision. */ - cwnd = (((int64_t)usecs_since_cong << CUBIC_SHIFT) - (K * hz * tick)) / + cwnd = (((int64_t)usecs_since_epoch << CUBIC_SHIFT) - (K * hz * tick)) / (hz * tick); if (cwnd > CUBED_ROOT_MAX_ULONG) @@ -266,7 +276,7 @@ cubic_cwnd(int usecs_since_cong, unsigned long wmax, uint32_t smss, int64_t K) * XXX: Not used */ static __inline unsigned long -reno_cwnd(int usecs_since_cong, int rtt_usecs, unsigned long wmax, +reno_cwnd(int usecs_since_epoch, int rtt_usecs, unsigned long wmax, uint32_t smss) { @@ -275,7 +285,7 @@ reno_cwnd(int usecs_since_cong, int rtt_usecs, unsigned long wmax, * W_tcp(t) deals with cwnd/wmax in pkts, so because our cwnd is in * bytes, we have to multiply by smss. */ - return (((wmax * RENO_BETA) + (((usecs_since_cong * smss) + return (((wmax * RENO_BETA) + (((usecs_since_epoch * smss) << CUBIC_SHIFT) / rtt_usecs)) >> CUBIC_SHIFT); } @@ -287,13 +297,13 @@ reno_cwnd(int usecs_since_cong, int rtt_usecs, unsigned long wmax, * the value of cwnd at the last congestion event. */ static __inline unsigned long -tf_cwnd(int usecs_since_cong, int rtt_usecs, unsigned long wmax, +tf_cwnd(int usecs_since_epoch, int rtt_usecs, unsigned long wmax, uint32_t smss) { /* Equation 4 of I-D. */ return (((wmax * CUBIC_BETA) + - (((THREE_X_PT3 * (unsigned long)usecs_since_cong * + (((THREE_X_PT3 * (unsigned long)usecs_since_epoch * (unsigned long)smss) << CUBIC_SHIFT) / (TWO_SUB_PT3 * rtt_usecs))) >> CUBIC_SHIFT); } From nobody Wed Jun 7 00:21:53 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QbShK5cVWz4ZVMm; Wed, 7 Jun 2023 00: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QbShK5BLKz3wRm; Wed, 7 Jun 2023 00: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=1686097313; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1vlG5cY3bfP0KpXo/vGJOToM7eZKNYya4VZyqyhD5Gc=; b=Qpa4/To5oXmlFl0spyK8sN/857QWL762jnQWwlw37OTDeaE0Uf6tehrQ7UQhSfqkPDKKPt kOzX7y/rcGm2yOOMGCwbINtTKOb+4eBlLm2kOhxcDbUbngXEyRFUkEJRtWn0ZRIcQS+3sZ NWxsYqGSbczDBShan74bfZJhG+uLoIpuhbWBpwN5umFvXbrowEUaVPLD207PyB+6ZydLYU Km1e7/QzwRw/r5sLmQt3rir2jIy2vmAkJv1tBVdB0R4nHyaT7UKfDJhxdYGcBguqO/HB1y zlaQI1FVOihVJ5OLrpEt9tqkOeAeG3elcoMFECHaGL4awGBT3iePMGpu/UXkbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686097313; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1vlG5cY3bfP0KpXo/vGJOToM7eZKNYya4VZyqyhD5Gc=; b=EPBiGk7o1Csiv51K6qOSrSRgY8tIRIRkVPWJKJCtcE1n0e67etaAoibR6gZy8CfzExLxab HtozUquZXXWyYN6c62vyW6Q07MMx5YEbmm/yc5LNtSLwq8RH+fIsEhE5+G1jlUaVLPP5Vv vwozsdBUUXHzwlhaVol235ISNbDohrE7ihssCAN6DqPuNcJPC71sSljFjIsP0PTH6nyK86 XKOfNMS/9CcPcZDYXJcUVPDoH9rao0s/D0xsJDS4kR4RryJ88kPSuabElmw54LeNXFGebW 6z4Ww5qeayu8+N386hatlIvjIXyLCXUHroGlU34xOHKPkXOLCi9ZzZ3Y3YU4vA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686097313; a=rsa-sha256; cv=none; b=DJF4IoCrIVumEd87jPjPYjrD1rVezHmFwjo4DTO07wjMGloyIkqcImNT8eg3w9O0WuJMRA ZSENWidrBQCNb+nAgR1MjgSfYcXlxyy9GG9Lc60mXOfn2lcicZ4izTSd6MiHTCC1AzFeip Vv84HaikYrwtxS5Aq+j5SB0O3/TQ/Tg+dPIKVCJfSZqNquEpR40dCfbcV7aA6TdDStc+aN 4GlGG6iwJxmkf5Yu7At5lcKdO7lxCQ/1bU0v5C8+CVdjFy2/4k0zkrVOWSaMvqQEeecpAE eQIblB6bG738zx6TrsX2WryloFL0/CofJieEfWmcz6lcruwFAXXvS4Dv6foz9g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QbShK4F50zrB9; Wed, 7 Jun 2023 00:21:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3570Lrca089001; Wed, 7 Jun 2023 00:21:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3570LrQB089000; Wed, 7 Jun 2023 00:21:53 GMT (envelope-from git) Date: Wed, 7 Jun 2023 00:21:53 GMT Message-Id: <202306070021.3570LrQB089000@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jamie Gritton Subject: git: e82a62943529 - main - jail: add ".include" directive to jail.conf List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jamie X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e82a62943529d1a7c1fcec39aec13eba69c671d6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jamie: URL: https://cgit.FreeBSD.org/src/commit/?id=e82a62943529d1a7c1fcec39aec13eba69c671d6 commit e82a62943529d1a7c1fcec39aec13eba69c671d6 Author: Jamie Gritton AuthorDate: 2023-06-07 00:19:12 +0000 Commit: Jamie Gritton CommitDate: 2023-06-07 00:19:12 +0000 jail: add ".include" directive to jail.conf Jail config files can now include literal filenames and file globs. They can not (yet) include files based on variables/parameters. --- usr.sbin/jail/config.c | 86 ++++++++++++++++++++++++++++++++++++----------- usr.sbin/jail/jail.conf.5 | 17 +++++++++- usr.sbin/jail/jailp.h | 27 ++++++++++----- usr.sbin/jail/jailparse.y | 47 ++++++++++++++++++++------ 4 files changed, 137 insertions(+), 40 deletions(-) diff --git a/usr.sbin/jail/config.c b/usr.sbin/jail/config.c index 52e1cbf05c28..35f40c123042 100644 --- a/usr.sbin/jail/config.c +++ b/usr.sbin/jail/config.c @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -46,6 +47,8 @@ __FBSDID("$FreeBSD$"); #include "jailp.h" +#define MAX_INCLUDE_DEPTH 32 + struct ipspec { const char *name; unsigned flags; @@ -58,8 +61,8 @@ extern int yyset_in(FILE *fp, void *scanner); struct cfjails cfjails = TAILQ_HEAD_INITIALIZER(cfjails); +static void parse_config(const char *fname, int is_stdin); static void free_param(struct cfparams *pp, struct cfparam *p); -static void free_param_strings(struct cfparam *p); static const struct ipspec intparams[] = { [IP_ALLOW_DYING] = {"allow.dying", PF_INTERNAL | PF_BOOL}, @@ -135,26 +138,10 @@ load_config(const char *cfname) struct cfparam *p, *vp, *tp; struct cfstring *s, *vs, *ns; struct cfvar *v, *vv; - struct cflex cflex; char *ep; - void *scanner; int did_self, jseq, pgen; - cflex.cfname = cfname; - cflex.error = 0; - yylex_init_extra(&cflex, &scanner); - if (!strcmp(cfname, "-")) { - cflex.cfname = "STDIN"; - yyset_in(stdin, scanner); - } else { - FILE *yfp = fopen(cfname, "r"); - if (!yfp) - err(1, "%s", cfname); - yyset_in(yfp, scanner); - } - if (yyparse(scanner) || cflex.error) - exit(1); - yylex_destroy(scanner); + parse_config(cfname, !strcmp(cfname, "-")); /* Separate the wildcard jails out from the actual jails. */ jseq = 0; @@ -281,6 +268,67 @@ load_config(const char *cfname) } } +void +include_config(void *scanner, const char *cfname) +{ + static unsigned int depth; + glob_t g = {0}; + const char *slash; + char *fullpath = NULL; + + /* Simple sanity check for include loops. */ + if (++depth > MAX_INCLUDE_DEPTH) + errx(1, "maximum include depth exceeded"); + /* Base relative pathnames on the current config file. */ + if (yyget_in(scanner) != stdin && cfname[0] != '/') { + const char *outer_cfname = yyget_extra(scanner)->cfname; + if ((slash = strrchr(outer_cfname, '/')) != NULL) { + size_t dirlen = (slash - outer_cfname) + 1; + + fullpath = emalloc(dirlen + strlen(cfname) + 1); + strncpy(fullpath, outer_cfname, dirlen); + strcpy(fullpath + dirlen, cfname); + cfname = fullpath; + } + } + /* + * Check if the include statement had a filename glob. + * Globbing doesn't need to catch any files, but a non-glob + * file needs to exist (enforced by parse_config). + */ + if (glob(cfname, GLOB_NOCHECK, NULL, &g) != 0) + errx(1, "%s: filename glob failed", cfname); + if (g.gl_flags & GLOB_MAGCHAR) { + for (size_t gi = 0; gi < g.gl_matchc; gi++) + parse_config(g.gl_pathv[gi], 0); + } else + parse_config(cfname, 0); + if (fullpath) + free(fullpath); + --depth; +} + +static void +parse_config(const char *cfname, int is_stdin) +{ + struct cflex cflex = {.cfname = cfname, .error = 0}; + void *scanner; + + yylex_init_extra(&cflex, &scanner); + if (is_stdin) { + cflex.cfname = "STDIN"; + yyset_in(stdin, scanner); + } else { + FILE *yfp = fopen(cfname, "r"); + if (!yfp) + err(1, "%s", cfname); + yyset_in(yfp, scanner); + } + if (yyparse(scanner) || cflex.error) + exit(1); + yylex_destroy(scanner); +} + /* * Create a new jail record. */ @@ -843,7 +891,7 @@ free_param(struct cfparams *pp, struct cfparam *p) free(p); } -static void +void free_param_strings(struct cfparam *p) { struct cfstring *s; diff --git a/usr.sbin/jail/jail.conf.5 b/usr.sbin/jail/jail.conf.5 index 67277e6d78ce..a6990c081a3b 100644 --- a/usr.sbin/jail/jail.conf.5 +++ b/usr.sbin/jail/jail.conf.5 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 8, 2022 +.Dd Jun 3, 2023 .Dt JAIL.CONF 5 .Os .Sh NAME @@ -163,6 +163,14 @@ would apply to jails with names like .Dq foo.bar and .Dq foo.bar.baz . +.Ss Includes +A line of the form +.Bd -literal -offset ident +.include "filename"; +.Ed +.Pp +will include another file in the configuration. The filename must be +a literal string, and cannot contain variable expansions. .Ss Comments The configuration file may contain comments in the common C, C++, and shell formats: @@ -212,6 +220,13 @@ bar { mount.nodevfs; persist; // Required because there are no processes } + +# Include configurations from standard locations. +\[char46]include "/etc/jail.conf.d/*.conf"; +\[char46]include "/etc/jail.*.conf"; +\[char46]include "/usr/local/etc/jail[.]conf"; +\[char46]include "/usr/local/etc/jail.conf.d/*.conf"; +\[char46]include "/usr/local/etc/jail.*.conf"; .Ed .Sh SEE ALSO .Xr jail_set 2 , diff --git a/usr.sbin/jail/jailp.h b/usr.sbin/jail/jailp.h index 6ea4e3ec09a3..cd97063507c8 100644 --- a/usr.sbin/jail/jailp.h +++ b/usr.sbin/jail/jailp.h @@ -35,6 +35,7 @@ #include #include +#include #define CONF_FILE "/etc/jail.conf" @@ -45,15 +46,16 @@ #define DF_LIGHT 0x02 /* Implied dependency on jail existence only */ #define DF_NOFAIL 0x04 /* Don't propagate failed jails */ -#define PF_VAR 0x01 /* This is a variable, not a true parameter */ -#define PF_APPEND 0x02 /* Append to existing parameter list */ -#define PF_BAD 0x04 /* Unable to resolve parameter value */ -#define PF_INTERNAL 0x08 /* Internal parameter, not passed to kernel */ -#define PF_BOOL 0x10 /* Boolean parameter */ -#define PF_INT 0x20 /* Integer parameter */ -#define PF_CONV 0x40 /* Parameter duplicated in converted form */ -#define PF_REV 0x80 /* Run commands in reverse order on stopping */ -#define PF_IMMUTABLE 0x100 /* Immutable parameter */ +#define PF_VAR 0x0001 /* This is a variable, not a true parameter */ +#define PF_APPEND 0x0002 /* Append to existing parameter list */ +#define PF_BAD 0x0004 /* Unable to resolve parameter value */ +#define PF_INTERNAL 0x0008 /* Internal parameter, not passed to kernel */ +#define PF_BOOL 0x0010 /* Boolean parameter */ +#define PF_INT 0x0020 /* Integer parameter */ +#define PF_CONV 0x0040 /* Parameter duplicated in converted form */ +#define PF_REV 0x0080 /* Run commands in reverse order on stopping */ +#define PF_IMMUTABLE 0x0100 /* Immutable parameter */ +#define PF_NAMEVAL 0x0200 /* Parameter is in "name value" form */ #define JF_START 0x0001 /* -c */ #define JF_SET 0x0002 /* -m */ @@ -215,6 +217,7 @@ extern int finish_command(struct cfjail *j); extern struct cfjail *next_proc(int nonblock); extern void load_config(const char *cfname); +extern void include_config(void *scanner, const char *cfname); extern struct cfjail *add_jail(void); extern void add_param(struct cfjail *j, const struct cfparam *p, enum intparam ipnum, const char *value); @@ -226,6 +229,7 @@ extern int import_params(struct cfjail *j); extern int equalopts(const char *opt1, const char *opt2); extern int wild_jail_name(const char *wname); extern int wild_jail_match(const char *jname, const char *wname); +extern void free_param_strings(struct cfparam *p); extern void dep_setup(int docf); extern int dep_check(struct cfjail *j); @@ -237,6 +241,11 @@ extern int start_state(const char *target, int docf, unsigned state, extern void requeue(struct cfjail *j, struct cfjails *queue); extern void requeue_head(struct cfjail *j, struct cfjails *queue); +extern struct cflex *yyget_extra(void *scanner); +extern FILE *yyget_in(void *scanner); +extern int yyget_lineno(void *scanner); +extern char *yyget_text(void *scanner); + extern struct cfjails cfjails; extern struct cfjails ready; extern struct cfjails depend; diff --git a/usr.sbin/jail/jailparse.y b/usr.sbin/jail/jailparse.y index ccc311a76223..e4f2310c7fb4 100644 --- a/usr.sbin/jail/jailparse.y +++ b/usr.sbin/jail/jailparse.y @@ -73,16 +73,18 @@ conf : | conf jail | conf param ';' { - struct cfjail *j = current_jail; + if (!special_param($2, scanner)) { + struct cfjail *j = current_jail; - if (j == NULL) { - if (global_jail == NULL) { - global_jail = add_jail(); - global_jail->name = estrdup("*"); + if (j == NULL) { + if (global_jail == NULL) { + global_jail = add_jail(); + global_jail->name = estrdup("*"); + } + j = global_jail; } - j = global_jail; + TAILQ_INSERT_TAIL(&j->params, $2, tq); } - TAILQ_INSERT_TAIL(&j->params, $2, tq); } | conf ';' ; @@ -141,6 +143,7 @@ param : name { $$ = $1; TAILQ_CONCAT(&$$->val, $2, tq); + $$->flags |= PF_NAMEVAL; free($2); } | error @@ -230,10 +233,6 @@ string : STR extern int YYLEX_DECL(); -extern struct cflex *yyget_extra(void *scanner); -extern int yyget_lineno(void *scanner); -extern char *yyget_text(void *scanner); - static void YYERROR_DECL() { @@ -248,3 +247,29 @@ YYERROR_DECL() yyget_extra(scanner)->cfname, yyget_lineno(scanner), yyget_text(scanner), s); } + +/* Handle special parameters (i.e. the include directive). + * Return true if the parameter was specially handled. + */ +static int +special_param(struct cfparam *p, void *scanner) +{ + if ((p->flags & (PF_VAR | PF_APPEND | PF_NAMEVAL)) != PF_NAMEVAL + || strcmp(p->name, ".include")) + return 0; + struct cfstring *s; + TAILQ_FOREACH(s, &p->val, tq) { + if (STAILQ_EMPTY(&s->vars)) + include_config(scanner, s->s); + else { + warnx("%s line %d: " + "variables not permitted in '.include' filename", + yyget_extra(scanner)->cfname, + yyget_lineno(scanner)); + yyget_extra(scanner)->error = 1; + } + } + free_param_strings(p); + free(p); + return 1; +} From nobody Wed Jun 7 01:52:10 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QbVhV53cLz4Zmvr; Wed, 7 Jun 2023 01:52:10 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QbVhV4LZGz46N7; Wed, 7 Jun 2023 01:52:10 +0000 (UTC) (envelope-from danfe@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686102730; 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=KTZvBj3dCnKwupY9pWvOO7B/gSEmGoWUUJYg1pkp+CQ=; b=y0AcLmGAEn4HxWWUYq4JCrYiPtqEbeBeL46vryWjdbUlp4v1gGYy0YN8CfChplGBR7EgUD dN+yyz0CmuEfqmNip1vUWg1mU3qOC3SGjfEhksioRTMYOnxsOv4+bG2mC8iVoeX1Y85uLX g9yNpwUbivVXRUkuP62Q+q0fLDfDH7UYxgSmai3u+sTUYCuAiumHRH6bi0TDhRcIOLKLa0 lMl6i31+x+2mcPC0l8ok9XB17R7R3dF3fMiVkmzN550pCmBZCY9/HORhyawTouuSul9sSo VJ7QUldgM2gQ5w0UjRPoB7bevwUTYCQF0jH7dNBbG8vnIj05MYs6fSwhJIjvSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686102730; 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=KTZvBj3dCnKwupY9pWvOO7B/gSEmGoWUUJYg1pkp+CQ=; b=O8+fnrnWpmZKmHxNc0GI9ptMblkASYoVzKPx6Z/qPg9pufNxaNuEuACyf6CLLJ1ITAVemN aBA5n6Rf7buhRc3jhEcg3iiCQBZSx2u5GNk63MJCO61lhGdZJ/yDTJWuY56OXFf3BefG80 hejL5Vzibkx0+K9ZYCaNSYcO1j8cBTtTHhDVhvd6NyCIF+4TZpcHXlXVQWW+hpr2dzX6Hu NhLStJ4ykYdQTkYgrw4zARPLbmf0Yj9L+8FVZcj8g6tfl+dJ/OULVvTE1TFib2xMybjO/z ZAC3WTZmBkeCfp016LbywXjww8uajZvLniwA99mmTDnz+9CnIqvply3TENXqbQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686102730; a=rsa-sha256; cv=none; b=s9zgApZqWTGlBKoMVZ4ynpfjFPnjzHURvRiU6RNBBFanHJktTkwwZwItS0N1gsam9Q7GhX vJ6LZ0AYjXITma3//2f97S1mwv4GbYBJqJ6sIqxU1/HXrfopnfYS5gN6i+BBTq9YYjQIHP trJoyApSiRztX+Ft85CS4a9Pm52y0ZyM/Nb9s+T6h0UV7FDGOZRd1qgdN1ER/tiDpyR5Ae 5AN/ZqG+skonjJ+ZUIsh6iI5oJbb+G3QVYWYUvJEWZhvte+Y0yRpEQGK1EMMqHJJyFybMC kzvHuhWwPg6So2YilVVoVBWPOHN17RJGjo3bpIyqrzMOVZeeU95kPG0UWJZltA== Received: by freefall.freebsd.org (Postfix, from userid 1033) id 82CEC1F46F; Wed, 7 Jun 2023 01:52:10 +0000 (UTC) Date: Wed, 7 Jun 2023 01:52:10 +0000 From: Alexey Dokuchaev To: Dmitry Chagin Cc: Jessica Clarke , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: 1b0d96f3c43a - main - xregs_sig: Finish renaming simd to xregs before adding avx Message-ID: References: <202306031713.353HDY7D036200@gitrepo.freebsd.org> <3F83B6B8-7A16-488B-9594-50A7426931F5@freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ThisMailContainsUnwantedMimeParts: N On Sat, Jun 03, 2023 at 10:29:12PM +0300, Dmitry Chagin wrote: > On Sat, Jun 03, 2023 at 07:57:03PM +0100, Jessica Clarke wrote: > > ... > > But the AArch64 registers are called x0 through x30. They are x > > registers. So calling the SIMD registers X registers is both incorrect > > and highly confusing. It is not general, it is specific to x86's notion > > of SIMD. > > Naming is hard (c) especially for non-native :), > I just need an avx registers test to fix golang issues in the Linuxulator. > Feel free to join D40410, D40384, propose you naming variant, may be > x->ext or ngprs What was wrong with SIMD (simd)? ./danfe From nobody Wed Jun 7 04:14:45 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QbYs14rlvz4bT5r; Wed, 7 Jun 2023 04:14:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QbYs14M8Hz4N5R; Wed, 7 Jun 2023 04:14:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686111285; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bDbP6/XNUE2YnsPMV0ReN0AaPyd2Ctr4w7V04WLOlEw=; b=MiYZjXatL5AvhCUWBr8IiSBGuUMc4+pv9o6qDTw4I7ok6IwE6XLa6y5hePnK7VN2GRmi8v l6rTdcFP0n2Wl/t02favdnL39gmTUnbh+B7oM3/oDNqLu80gByDLPl8sT2CpeAP6AnBj7j ZMI5VJ5CKdU9TYWXhMzNYbHf98qECNed/I25bpeavzmN5LPCMlaE+oaCDEqxPOrbeG8HwX /BHCHl/JKyOAvgc92XEB5lWRLi8UG3yo18URLR7h3+9pic+HY8aXD8yHXfKhhtqi86poTN shIdsXD05tZntp9+k0YTcoPge9+gDxwQp74DRY9p8msffDN2IZ0VSc69cvNKcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686111285; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bDbP6/XNUE2YnsPMV0ReN0AaPyd2Ctr4w7V04WLOlEw=; b=TjRdNdBpxz9QGvuhjcdRRPvgzWc81dGmIO4C+WxIDBOTD98IfpvSlRKMCF/h4uHMt7dV5Q 2Ew/gfF8Mt6PyR+KeUsDCFZlIbos+qmEVe2ynNIiBAp93zOW/TiWga/SerhguH/EcH3zkm 8Q5MluCdrVAHbjixwu0kvq8EVZMjHiJUPao/Z9/fL1Ycg79JiyBjg+1+lvHFN0dR3SlOlc +KwF3zDC0OmRtrZZoJeABCs473XWt9TzH1jQOt65sLSHHXm8uO/UAS4OTBMAyrJzfVqS/K ftva49ZZGH7xEhTCvDnt5rgHxiLlIzJb1vCfOtRu41ZyqnKyHzbTScYV2izUAA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686111285; a=rsa-sha256; cv=none; b=rFGZpnt1iwVDfgXyOFDqPjc4lbEv9SekiUAoNb2Qoaoy29oUmWv0U3Us+ObBP1TvPUI8IY 4vzw+JB/xd2Ff/4xHYGh0L1lbPCtpNq7lgZ62DAchwqAOqsB2tnHDYOFsh2KWaPq9yNEIG etNZEATatgMt9lezXEUDFaKeo6rg8rFteBLxN17vY0AtFoAp4UXzCVq2tNkcHZZBQ7uqhK OGYXk2wTgeq7Uw49fj8bGyPhFcxE0vebTkcuSQsOq0NeR5c6A3bAnlJTLSp5Ue90IRRaSW wHJuL0VPf01vqwfLpb+PXKuXSR1sUZfjOcglOhtFSyaG5rC9EnWPryq1gn02nw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QbYs13RX9zx8F; Wed, 7 Jun 2023 04:14:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3574EjA1071535; Wed, 7 Jun 2023 04:14:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3574Ej1I071534; Wed, 7 Jun 2023 04:14:45 GMT (envelope-from git) Date: Wed, 7 Jun 2023 04:14:45 GMT Message-Id: <202306070414.3574Ej1I071534@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Xin LI Subject: git: 1177a6c8dcfd - main - gve: Unobfuscate code by using nitems directly for loop. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1177a6c8dcfd6625c541d6ffc3c6915b8b6354f7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=1177a6c8dcfd6625c541d6ffc3c6915b8b6354f7 commit 1177a6c8dcfd6625c541d6ffc3c6915b8b6354f7 Author: Xin LI AuthorDate: 2023-06-07 04:14:30 +0000 Commit: Xin LI CommitDate: 2023-06-07 04:14:30 +0000 gve: Unobfuscate code by using nitems directly for loop. While there, also make MODULE_PNP_INFO to reflect that the device description is provided. Reported-by: jrtc27 Reviewed-by: jrtc27, imp Differential Revision: https://reviews.freebsd.org/D40430 --- sys/dev/gve/gve_main.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/dev/gve/gve_main.c b/sys/dev/gve/gve_main.c index 383fd326d33a..c3ee6d5c3433 100644 --- a/sys/dev/gve/gve_main.c +++ b/sys/dev/gve/gve_main.c @@ -46,7 +46,6 @@ static struct gve_dev { } gve_devs[] = { { PCI_VENDOR_ID_GOOGLE, PCI_DEV_ID_GVNIC, "gVNIC" } }; -#define GVE_DEVS_COUNT nitems(gve_devs) struct sx gve_global_lock; @@ -717,7 +716,7 @@ gve_probe(device_t dev) vendorid = pci_get_vendor(dev); deviceid = pci_get_device(dev); - for (i = 0; i < GVE_DEVS_COUNT; i++) { + for (i = 0; i < nitems(gve_devs); i++) { if (vendorid == gve_devs[i].vendor_id && deviceid == gve_devs[i].device_id) { device_set_desc(dev, gve_devs[i].name); @@ -869,5 +868,5 @@ DRIVER_MODULE(gve, pci, gve_driver, gve_devclass, 0, 0); #else DRIVER_MODULE(gve, pci, gve_driver, 0, 0); #endif -MODULE_PNP_INFO("U16:vendor;U16:device", pci, gve, gve_devs, - GVE_DEVS_COUNT); +MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, gve, gve_devs, + nitems(gve_devs)); From nobody Wed Jun 7 08:24:50 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QbgPZ5DLKz4bFPV; Wed, 7 Jun 2023 08:24:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QbgPZ4Qhvz3QVR; Wed, 7 Jun 2023 08:24:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686126290; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HsH3mbogkLC6MR+2svuL5Y0XWWhG7yqU/3+7Uf0rxPc=; b=Wejgl6SwvzQ3v+RRGLmjsIFmE6AjEvnsh5gW3hk9Xq1JT+KpahSsBqw8f0IBCiojyEVs4V q2/MR/d37VoQ7Jl1DqJKSV8wvNGzzwAgSbAoRteGiT0RZkI/L7cN5VSZ4sFAntEcY/72Ut C3hJwV2fHXzJml+xK0r2IENgOdRTJRUfkjWsDNqSMRMHIV4GugcujYxZx/vsfEAZzkgjrg lo396wN8pzj3s5ZtcQDegkjgTy4R2kb/XkrNXYkiXDj7j+56OhblVmWpVuA6GHRfuMmtLo spEz0VSjrYkNuMPyU09uIE5b8qjwuYYZorSpBrfJaA3klEWk4hTwcvl8PVKbsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686126290; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HsH3mbogkLC6MR+2svuL5Y0XWWhG7yqU/3+7Uf0rxPc=; b=LlQCLJUR/O5ucvGRGQnlk5HFmPAsK3aNwuKGV5vKxCicic7m2muecsVpu4dV7uAnv8nQ14 UOFtaI1W3X4jgUJHqhXAfdZcxHM940q7f2UZohZGcUp9o9ofFxUPmJaxPbx/HUdpzDyBfa cwinlaSiY3g1tjfbnIwANvvUgXdz/ixXqhytzOempg7HoyzI+pS8vCOqk1qxRAAW4OXU4G fZTQaKAT7YhO2Z0WPm/50E/v502YN94fEMDqyzEG09E36i8jRzP5UDGgkEip+Irb4lPRlm t7noffdZBEf1W1M13v7Wq5bzO/v7tt51F1AlhJpKd25RCMASGSSj5Gm4rOiq1w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686126290; a=rsa-sha256; cv=none; b=OJ5fmPAqxUDU5wrY6zms7xWFHfxgXGcqHYhitGxbTKfQMlCrl2GgGiCumHOP5JZoLb4Um8 Ad972LoWA34An4cE1l6ak4PCvj+Uq8fdM1+IutVxPvAo0zpQH5QyZvOa3GYdTHcs2zIytg Ygk6Lmz0IUZKDldUKakfFH9QTvnDRyyW2TTY3E+asPNNQNe9qsW0ocUjOm1x7dZ5oyAuUu iFgMTZ17m951yiXp4CqXY3Qgs2JRCWLC0CTvfEmRozIuKlLYSXH8k1faJscpc2YZQ5IZmQ Y6TsH157TAsVFOWTCA1Im0WAn5SZ3vDUsZNO1gUCoF1zcuvfvgUx/fnauy0Uhg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QbgPZ3W8bz14RB; Wed, 7 Jun 2023 08:24:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3578Oorv084278; Wed, 7 Jun 2023 08:24:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3578OoJF084277; Wed, 7 Jun 2023 08:24:50 GMT (envelope-from git) Date: Wed, 7 Jun 2023 08:24:50 GMT Message-Id: <202306070824.3578OoJF084277@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wei Hu Subject: git: 4f8c634de09f - main - arm64 Hyper-V: enable Hyper-V SMP for ARM64 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: whu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4f8c634de09ffa2583306821e235f6f92104e729 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by whu: URL: https://cgit.FreeBSD.org/src/commit/?id=4f8c634de09ffa2583306821e235f6f92104e729 commit 4f8c634de09ffa2583306821e235f6f92104e729 Author: Wei Hu AuthorDate: 2023-06-07 08:03:59 +0000 Commit: Wei Hu CommitDate: 2023-06-07 08:24:13 +0000 arm64 Hyper-V: enable Hyper-V SMP for ARM64 Vmbus_synic_setup() is invoked via vmbus_intrhook -> vmbus_doattach -> smp_rendezvous. On !EARLY_AP_STARTUP (e.g., aarch64), SMP isn't functional in intrhooks and smp_rendezvous() will just call vmbus_synic_setup() on the boot processor. There's nothing that will initialize the pcpu data on every other AP. To fix it we need to use SI_SUB_SMP for vmbus_doattach(). With this patch the vmbus interrupt should work on all arm64 cpus on HyperV. Reported by: kevans Reviewed by: kevans, whu Tested by: Souradeep Chakrabarti Obtained from: Souradeep Chakrabarti Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D40279 --- sys/dev/hyperv/vmbus/vmbus.c | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/sys/dev/hyperv/vmbus/vmbus.c b/sys/dev/hyperv/vmbus/vmbus.c index ae4c466d98d9..cc37d84ff151 100644 --- a/sys/dev/hyperv/vmbus/vmbus.c +++ b/sys/dev/hyperv/vmbus/vmbus.c @@ -114,7 +114,7 @@ static uint32_t vmbus_get_vcpu_id_method(device_t bus, device_t dev, int cpu); static struct taskqueue *vmbus_get_eventtq_method(device_t, device_t, int); -#if defined(EARLY_AP_STARTUP) || defined(__aarch64__) +#if defined(EARLY_AP_STARTUP) static void vmbus_intrhook(void *); #endif @@ -1482,7 +1482,7 @@ vmbus_event_proc_dummy(struct vmbus_softc *sc __unused, int cpu __unused) { } -#if defined(EARLY_AP_STARTUP) || defined(__aarch64__) +#if defined(EARLY_AP_STARTUP) static void vmbus_intrhook(void *xsc) @@ -1495,7 +1495,7 @@ vmbus_intrhook(void *xsc) config_intrhook_disestablish(&sc->vmbus_intrhook); } -#endif /* EARLY_AP_STARTUP aarch64 */ +#endif /* EARLY_AP_STARTUP */ static int vmbus_attach(device_t dev) @@ -1511,22 +1511,13 @@ vmbus_attach(device_t dev) */ vmbus_sc->vmbus_event_proc = vmbus_event_proc_dummy; -#if defined(EARLY_AP_STARTUP) || defined(__aarch64__) +#if defined(EARLY_AP_STARTUP) /* * Defer the real attach until the pause(9) works as expected. */ vmbus_sc->vmbus_intrhook.ich_func = vmbus_intrhook; vmbus_sc->vmbus_intrhook.ich_arg = vmbus_sc; config_intrhook_establish(&vmbus_sc->vmbus_intrhook); -#else /* !EARLY_AP_STARTUP */ - /* - * If the system has already booted and thread - * scheduling is possible indicated by the global - * cold set to zero, we just call the driver - * initialization directly. - */ - if (!cold) - vmbus_doattach(vmbus_sc); #endif /* EARLY_AP_STARTUP and aarch64 */ return (0); @@ -1572,7 +1563,7 @@ vmbus_detach(device_t dev) return (0); } -#if !defined(EARLY_AP_STARTUP) && !defined(__aarch64__) +#if !defined(EARLY_AP_STARTUP) static void vmbus_sysinit(void *arg __unused) @@ -1582,14 +1573,7 @@ vmbus_sysinit(void *arg __unused) if (vm_guest != VM_GUEST_HV || sc == NULL) return; - /* - * If the system has already booted and thread - * scheduling is possible, as indicated by the - * global cold set to zero, we just call the driver - * initialization directly. - */ - if (!cold) - vmbus_doattach(sc); + vmbus_doattach(sc); } /* * NOTE: From nobody Wed Jun 7 08:35:40 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QbgfH0fWkz4bHRN; Wed, 7 Jun 2023 08:35:51 +0000 (UTC) (envelope-from dchagin@heemeyer.club) Received: from heemeyer.club (heemeyer.club [195.93.173.158]) (using TLSv1.3 with cipher TLS_AES_256_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 4QbgfG0qVbz3hHV; Wed, 7 Jun 2023 08:35:49 +0000 (UTC) (envelope-from dchagin@heemeyer.club) Authentication-Results: mx1.freebsd.org; none Received: from heemeyer.club (localhost [127.0.0.1]) by heemeyer.club (8.17.1/8.16.1) with ESMTP id 3578Zemk074700; Wed, 7 Jun 2023 11:35:40 +0300 (MSK) (envelope-from dchagin@heemeyer.club) Received: (from dchagin@localhost) by heemeyer.club (8.17.1/8.16.1/Submit) id 3578Zegk074699; Wed, 7 Jun 2023 11:35:40 +0300 (MSK) (envelope-from dchagin) Date: Wed, 7 Jun 2023 11:35:40 +0300 From: Dmitry Chagin To: Alexey Dokuchaev Cc: Jessica Clarke , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: 1b0d96f3c43a - main - xregs_sig: Finish renaming simd to xregs before adding avx Message-ID: References: <202306031713.353HDY7D036200@gitrepo.freebsd.org> <3F83B6B8-7A16-488B-9594-50A7426931F5@freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4QbgfG0qVbz3hHV X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:61400, ipnet:195.93.173.0/24, country:RU] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Wed, Jun 07, 2023 at 01:52:10AM +0000, Alexey Dokuchaev wrote: > On Sat, Jun 03, 2023 at 10:29:12PM +0300, Dmitry Chagin wrote: > > On Sat, Jun 03, 2023 at 07:57:03PM +0100, Jessica Clarke wrote: > > > ... > > > But the AArch64 registers are called x0 through x30. They are x > > > registers. So calling the SIMD registers X registers is both incorrect > > > and highly confusing. It is not general, it is specific to x86's notion > > > of SIMD. > > > > Naming is hard (c) especially for non-native :), > > I just need an avx registers test to fix golang issues in the Linuxulator. > > Feel free to join D40410, D40384, propose you naming variant, may be > > x->ext or ngprs > > What was wrong with SIMD (simd)? Strictly speaking test is about the fact that signal context properly saves/restores machine context including gprs, simd registers, on x86 xsave area including many things, whch can be added later > > ./danfe From nobody Wed Jun 7 09:33:16 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QbhwX24jqz4bSMZ; Wed, 7 Jun 2023 09:33:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QbhwX1w36z3p1Q; Wed, 7 Jun 2023 09:33:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686130396; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wkBBu4b9PMiuNDV6ZshsoY0o/N57+3zKqFBGXexxQxo=; b=fvGdAp7kFUNMBzncmNfSnIm6d6LYsaLF6LB/haglBlPb1+U+y21YHIfXoBNcrTGkpBumzd i5QtDf4CZ9ZYka0EyrpxTblO0HKvEIn13H2E0dkZLBgJ6ML+j7ugbqIvCyamPDWarkt3QR MLckUyV7a9QoaCCA7BpyE0McIWRqy64TJudGFOQMQKO9Ha3MEeJ5UnNCu8QRtHMJmC87AN VLcqQWCi/7pkoBQXj2uvER8K/x9TDV6YWpxsxu/Zh/HKol1fRvQLsrDtBSeU+2g2HtjCeG Bc5Wqym4m8hY5wlOqnkpGyYBsOi9IU4mc6sz/RYgYsHjlk4Ar0cth92TdgEt6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686130396; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wkBBu4b9PMiuNDV6ZshsoY0o/N57+3zKqFBGXexxQxo=; b=NOEsVuVmpqAUEcS0u5oeSil6yVC6JxUVeWtQqsuoLxB4oFxowRXv5pr8pEaMvh8pMv5/20 z+fKWAB6jgAa/aCfEPWX114zoIE6VXq9UVlSSDkKTy2TinOqq+oO1PhhgGTLzNx46zzH7B U5t59fi+mwt7Q7yQX2T10KIX4+cw/j/XVNlC98KYbn5LlquChV8NlANeSxtpzWFamTZ3MS g6u6SJPjpC9iMq5co/pUH27183emScwDrH7dOVSAhmQ8WlhGuRtFaMA0FuL6Vrmtae6TcY 0FBnY5EoCeOg+dZgf+smNITRqLNfX3MIabddJQDvQEmZJp2G4dRWLd6TIx/jfA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686130396; a=rsa-sha256; cv=none; b=dvgSnIczRMiD+D1kr0SjD3hJkOJokWPHx1Qj8BFIfrRTH82rf4YbUGCxBprgv8Xco5oeVO Wo5kpohenbe/G5s5Tw1/3nV9YAqzyLgUe5rik+8r8DyunzCSdDhmwG+Z4Lg56wbyJFI4Z9 Je7FzAoOxozeRuwGcOeLB6VHstB1pzChWyilywtsrhAjZkW87pulaolj2gd+BMsHohvFNU eqBHXbsiYeUIAARlf/IF+PVccpbxK9/OomJk0mTsXQXmIKXtVIYladZvivhGLaHfLd3Gtz ZToMr1KjgQPl4OzbqFAqcPId6tZP5dRa0Z4GBKAMdNlAvjxPGyM4xPHgJW8wnQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QbhwX0zSbz15xB; Wed, 7 Jun 2023 09:33:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3579XGoq098637; Wed, 7 Jun 2023 09:33:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3579XGcj098636; Wed, 7 Jun 2023 09:33:16 GMT (envelope-from git) Date: Wed, 7 Jun 2023 09:33:16 GMT Message-Id: <202306070933.3579XGcj098636@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Andrey V. Elsukov" Subject: git: 1f166509895d - main - ipmi: add Block Transfer interface support List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ae X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1f166509895dd90fcaaa08b557f9bc106e3f7e71 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by ae: URL: https://cgit.FreeBSD.org/src/commit/?id=1f166509895dd90fcaaa08b557f9bc106e3f7e71 commit 1f166509895dd90fcaaa08b557f9bc106e3f7e71 Author: Andrey V. Elsukov AuthorDate: 2023-06-07 09:30:47 +0000 Commit: Andrey V. Elsukov CommitDate: 2023-06-07 09:30:47 +0000 ipmi: add Block Transfer interface support Reviewed by: ambrisko Obtained from: Yandex LLC MFC after: 2 weeks Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D40421 --- sys/conf/files.arm64 | 1 + sys/conf/files.x86 | 1 + sys/dev/ipmi/ipmi_acpi.c | 19 +-- sys/dev/ipmi/ipmi_bt.c | 296 +++++++++++++++++++++++++++++++++++++++++++++ sys/dev/ipmi/ipmi_isa.c | 19 +-- sys/dev/ipmi/ipmi_pci.c | 28 +++-- sys/dev/ipmi/ipmi_smbios.c | 1 + sys/dev/ipmi/ipmivars.h | 19 ++- sys/modules/ipmi/Makefile | 2 +- 9 files changed, 353 insertions(+), 33 deletions(-) diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index 9218336d154d..1fed31af0761 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -338,6 +338,7 @@ dev/iicbus/twsi/twsi.c optional twsi fdt dev/ipmi/ipmi.c optional ipmi dev/ipmi/ipmi_acpi.c optional ipmi acpi +dev/ipmi/ipmi_bt.c optional ipmi dev/ipmi/ipmi_kcs.c optional ipmi dev/ipmi/ipmi_smic.c optional ipmi diff --git a/sys/conf/files.x86 b/sys/conf/files.x86 index f80638f98f95..7f455b4c9bb3 100644 --- a/sys/conf/files.x86 +++ b/sys/conf/files.x86 @@ -153,6 +153,7 @@ dev/iommu/iommu_gas.c optional acpi iommu pci dev/ipmi/ipmi.c optional ipmi dev/ipmi/ipmi_acpi.c optional ipmi acpi dev/ipmi/ipmi_isa.c optional ipmi isa +dev/ipmi/ipmi_bt.c optional ipmi dev/ipmi/ipmi_kcs.c optional ipmi dev/ipmi/ipmi_smic.c optional ipmi dev/ipmi/ipmi_smbus.c optional ipmi smbus diff --git a/sys/dev/ipmi/ipmi_acpi.c b/sys/dev/ipmi/ipmi_acpi.c index e06f929c80b9..bfebac6c92d6 100644 --- a/sys/dev/ipmi/ipmi_acpi.c +++ b/sys/dev/ipmi/ipmi_acpi.c @@ -94,16 +94,17 @@ ipmi_acpi_attach(device_t dev) switch (interface_type) { case KCS_MODE: - count = 2; + count = IPMI_IF_KCS_NRES; mode = "KCS"; break; case SMIC_MODE: - count = 3; + count = IPMI_IF_SMIC_NRES; mode = "SMIC"; break; case BT_MODE: - device_printf(dev, "BT interface not supported\n"); - return (ENXIO); + count = IPMI_IF_BT_NRES; + mode = "BT"; + break; case SSIF_MODE: device_printf(dev, "SSIF interface not supported on ACPI\n"); return (0); @@ -170,18 +171,20 @@ ipmi_acpi_attach(device_t dev) * We assume an alignment of 1 byte as currently the IPMI spec * doesn't provide any way to determine the alignment via ACPI. */ + error = ENXIO; switch (interface_type) { case KCS_MODE: error = ipmi_kcs_attach(sc); - if (error) - goto bad; break; case SMIC_MODE: error = ipmi_smic_attach(sc); - if (error) - goto bad; + break; + case BT_MODE: + error = ipmi_bt_attach(sc); break; } + if (error) + goto bad; error = ipmi_attach(dev); if (error) goto bad; diff --git a/sys/dev/ipmi/ipmi_bt.c b/sys/dev/ipmi/ipmi_bt.c new file mode 100644 index 000000000000..0f970d966731 --- /dev/null +++ b/sys/dev/ipmi/ipmi_bt.c @@ -0,0 +1,296 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2023 Yandex LLC + * Copyright (c) 2023 Andrey V. Elsukov + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +/* + * BT interface + */ + +#define DMSG0(sc, fmt, ...) do { \ + device_printf((sc)->ipmi_dev, "BT: %s: " fmt "\n", \ + __func__, ## __VA_ARGS__); \ +} while (0) + +#define DMSGV(...) if (bootverbose) { \ + DMSG0(__VA_ARGS__); \ +} + +#ifdef IPMI_BT_DEBUG +#define DMSG(...) DMSG0(__VA_ARGS__) +#else +#define DMSG(...) +#endif + +#define BT_IO_BASE 0xe4 + +#define BT_CTRL_REG 0 +#define BT_C_CLR_WR_PTR (1L << 0) +#define BT_C_CLR_RD_PTR (1L << 1) +#define BT_C_H2B_ATN (1L << 2) +#define BT_C_B2H_ATN (1L << 3) +#define BT_C_SMS_ATN (1L << 4) +#define BT_C_OEM0 (1L << 5) +#define BT_C_H_BUSY (1L << 6) +#define BT_C_B_BUSY (1L << 7) + +#define BT_CTRL_BITS "\20\01CLR_WR_PTR\02CLR_RD_PTR\03H2B_ATN\04B2H_ATN"\ + "\05SMS_ATN\06OEM0\07H_BUSY\010B_BUSY" + +#define BT_DATA_REG 1 +#define BTMSG_REQLEN 3 +#define BTMSG_REPLEN 4 + +#define BT_INTMASK_REG 2 +#define BT_IM_B2H_IRQ_EN (1L << 0) +#define BT_IM_B2H_IRQ (1L << 1) +#define BT_IM_BMC_HWRST (1L << 7) + +static int bt_polled_request(struct ipmi_softc *, struct ipmi_request *); +static int bt_driver_request(struct ipmi_softc *, struct ipmi_request *, int); +static int bt_wait(struct ipmi_softc *, uint8_t, uint8_t); +static int bt_reset(struct ipmi_softc *); + +static void bt_loop(void *); +static int bt_startup(struct ipmi_softc *); + +#define BT_DELAY_MIN 1 +#define BT_DELAY_MAX 256 + +static int +bt_wait(struct ipmi_softc *sc, uint8_t mask, uint8_t wanted) +{ + volatile uint8_t value; + int delay = BT_DELAY_MIN; + int count = 20000; /* about 5 seconds */ + + while (count--) { + value = INB(sc, BT_CTRL_REG); + if ((value & mask) == wanted) + return (value); + /* + * The wait delay is increased exponentially to avoid putting + * significant load on I/O bus. + */ + DELAY(delay); + if (delay < BT_DELAY_MAX) + delay <<= 1; + } + DMSGV(sc, "failed: m=%b w=%b v=0x%02x\n", + mask, BT_CTRL_BITS, wanted, BT_CTRL_BITS, value); + return (-1); + +} + +static int +bt_reset(struct ipmi_softc *sc) +{ + uint8_t v; + + v = INB(sc, BT_CTRL_REG); + DMSG(sc, "ctrl: %b", v, BT_CTRL_BITS); + v &= BT_C_H_BUSY; /* clear H_BUSY iff it set */ + v |= BT_C_CLR_WR_PTR | BT_C_CLR_RD_PTR | BT_C_B2H_ATN | BT_C_H2B_ATN; + + bt_wait(sc, BT_C_B_BUSY, 0); + OUTB(sc, BT_CTRL_REG, v); + + v = BT_IM_B2H_IRQ | BT_IM_BMC_HWRST; + OUTB(sc, BT_INTMASK_REG, v); + + return (0); +} + +/* + * Send a request message and collect the reply. Returns 1 if we + * succeed. + */ +static int +bt_polled_request(struct ipmi_softc *sc, struct ipmi_request *req) +{ + uint8_t addr, cmd, seq, v; + int i; + + IPMI_IO_LOCK(sc); + + /* + * Send the request: + * + * Byte 1 | Byte 2 | Byte 3 | Byte 4 | Byte 5:N + * -------+-----------+--------+--------+--------- + * Length | NetFn/LUN | Seq | Cmd | Data + */ + + if (bt_wait(sc, BT_C_B_BUSY | BT_C_H2B_ATN, 0) < 0) { + DMSG(sc, "failed to start write transfer"); + goto fail; + } + DMSG(sc, "request: length=%d, addr=0x%02x, seq=%u, cmd=0x%02x", + (int)req->ir_requestlen, req->ir_addr, sc->ipmi_bt_seq, req->ir_command); + OUTB(sc, BT_CTRL_REG, BT_C_CLR_WR_PTR); + OUTB(sc, BT_DATA_REG, req->ir_requestlen + BTMSG_REQLEN); + OUTB(sc, BT_DATA_REG, req->ir_addr); + OUTB(sc, BT_DATA_REG, sc->ipmi_bt_seq); + OUTB(sc, BT_DATA_REG, req->ir_command); + for (i = 0; i < req->ir_requestlen; i++) + OUTB(sc, BT_DATA_REG, req->ir_request[i]); + OUTB(sc, BT_CTRL_REG, BT_C_H2B_ATN); + + if (bt_wait(sc, BT_C_B_BUSY | BT_C_H2B_ATN, 0) < 0) { + DMSG(sc, "failed to finish write transfer"); + goto fail; + } + + /* + * Read the reply: + * + * Byte 1 | Byte 2 | Byte 3 | Byte 4 | Byte 5 | Byte 6:N + * -------+-----------+--------+--------+-----------------+--------- + * Length | NetFn/LUN | Seq | Cmd | Completion code | Data + */ + if (bt_wait(sc, BT_C_B2H_ATN, BT_C_B2H_ATN) < 0) { + DMSG(sc, "got no reply from BMC"); + goto fail; + } + OUTB(sc, BT_CTRL_REG, BT_C_H_BUSY); + OUTB(sc, BT_CTRL_REG, BT_C_B2H_ATN); + OUTB(sc, BT_CTRL_REG, BT_C_CLR_RD_PTR); + + i = INB(sc, BT_DATA_REG); + if (i < BTMSG_REPLEN) { + DMSG(sc, "wrong data length: %d", i); + goto fail; + } + req->ir_replylen = i - BTMSG_REPLEN; + DMSG(sc, "data length: %d, frame length: %d", req->ir_replylen, i); + + addr = INB(sc, BT_DATA_REG); + if (addr != IPMI_REPLY_ADDR(req->ir_addr)) { + DMSGV(sc, "address doesn't match: addr=0x%02x vs. 0x%02x", + req->ir_addr, addr); + } + + seq = INB(sc, BT_DATA_REG); + if (seq != sc->ipmi_bt_seq) { + DMSGV(sc, "seq number doesn't match: seq=0x%02x vs. 0x%02x", + sc->ipmi_bt_seq, seq); + } + + cmd = INB(sc, BT_DATA_REG); + if (cmd != req->ir_command) { + DMSGV(sc, "command doesn't match: cmd=0x%02x vs. 0x%02x", + req->ir_command, cmd); + } + + req->ir_compcode = INB(sc, BT_DATA_REG); + for (i = 0; i < req->ir_replylen; i++) { + v = INB(sc, BT_DATA_REG); + if (i < req->ir_replybuflen) + req->ir_reply[i] = v; + } + + OUTB(sc, BT_CTRL_REG, BT_C_H_BUSY); + IPMI_IO_UNLOCK(sc); + DMSG(sc, "reply: length=%d, addr=0x%02x, seq=%u, cmd=0x%02x, code=0x%02x", + (int)req->ir_replylen, addr, seq, req->ir_command, req->ir_compcode); + return (1); +fail: + bt_reset(sc); + IPMI_IO_UNLOCK(sc); + return (0); +} + +static void +bt_loop(void *arg) +{ + struct ipmi_softc *sc = arg; + struct ipmi_request *req; + + IPMI_LOCK(sc); + while ((req = ipmi_dequeue_request(sc)) != NULL) { + IPMI_UNLOCK(sc); + (void)bt_driver_request(sc, req, 0); + IPMI_LOCK(sc); + sc->ipmi_bt_seq++; + ipmi_complete_request(sc, req); + } + IPMI_UNLOCK(sc); + kproc_exit(0); +} + +static int +bt_startup(struct ipmi_softc *sc) +{ + + return (kproc_create(bt_loop, sc, &sc->ipmi_kthread, 0, 0, "%s: bt", + device_get_nameunit(sc->ipmi_dev))); +} + +static int +bt_driver_request(struct ipmi_softc *sc, struct ipmi_request *req, int timo __unused) +{ + int i, ok; + + ok = 0; + for (i = 0; i < 3 && !ok; i++) + ok = bt_polled_request(sc, req); + if (ok) + req->ir_error = 0; + else + req->ir_error = EIO; + return (req->ir_error); +} + +int +ipmi_bt_attach(struct ipmi_softc *sc) +{ + /* Setup function pointers. */ + sc->ipmi_startup = bt_startup; + sc->ipmi_enqueue_request = ipmi_polled_enqueue_request; + sc->ipmi_driver_request = bt_driver_request; + sc->ipmi_driver_requests_polled = 1; + sc->ipmi_bt_seq = 1; + + return (bt_reset(sc)); +} diff --git a/sys/dev/ipmi/ipmi_isa.c b/sys/dev/ipmi/ipmi_isa.c index 275c2f5523f9..06fe10e87286 100644 --- a/sys/dev/ipmi/ipmi_isa.c +++ b/sys/dev/ipmi/ipmi_isa.c @@ -188,16 +188,17 @@ ipmi_isa_attach(device_t dev) switch (info.iface_type) { case KCS_MODE: - count = 2; + count = IPMI_IF_KCS_NRES; mode = "KCS"; break; case SMIC_MODE: - count = 3; + count = IPMI_IF_SMIC_NRES; mode = "SMIC"; break; case BT_MODE: - device_printf(dev, "BT mode is unsupported\n"); - return (ENXIO); + count = IPMI_IF_BT_NRES; + mode = "BT"; + break; default: return (ENXIO); } @@ -248,19 +249,21 @@ ipmi_isa_attach(device_t dev) RF_SHAREABLE | RF_ACTIVE); } + error = ENXIO; switch (info.iface_type) { case KCS_MODE: error = ipmi_kcs_attach(sc); - if (error) - goto bad; break; case SMIC_MODE: error = ipmi_smic_attach(sc); - if (error) - goto bad; + break; + case BT_MODE: + error = ipmi_bt_attach(sc); break; } + if (error) + goto bad; error = ipmi_attach(dev); if (error) goto bad; diff --git a/sys/dev/ipmi/ipmi_pci.c b/sys/dev/ipmi/ipmi_pci.c index 72a1c84f9b71..9417caa40c78 100644 --- a/sys/dev/ipmi/ipmi_pci.c +++ b/sys/dev/ipmi/ipmi_pci.c @@ -112,8 +112,8 @@ ipmi_pci_attach(device_t dev) mode = "SMIC"; break; case BT_MODE: - device_printf(dev, "BT mode is unsupported\n"); - return (ENXIO); + mode = "BT"; + break; default: device_printf(dev, "No IPMI interface found\n"); return (ENXIO); @@ -143,18 +143,20 @@ ipmi_pci_attach(device_t dev) sc->ipmi_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->ipmi_irq_rid, RF_SHAREABLE | RF_ACTIVE); + error = ENXIO; switch (info.iface_type) { case KCS_MODE: error = ipmi_kcs_attach(sc); - if (error) - goto bad; break; case SMIC_MODE: error = ipmi_smic_attach(sc); - if (error) - goto bad; + break; + case BT_MODE: + error = ipmi_bt_attach(sc); break; } + if (error) + goto bad; error = ipmi_attach(dev); if (error) goto bad; @@ -215,8 +217,7 @@ ipmi2_pci_attach(device_t dev) break; case PCIP_SERIALBUS_IPMI_BT: iface = BT_MODE; - device_printf(dev, "BT interface unsupported\n"); - return (ENXIO); + break; default: device_printf(dev, "Unsupported interface: %d\n", pci_get_progif(dev)); @@ -242,6 +243,7 @@ ipmi2_pci_attach(device_t dev) sc->ipmi_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->ipmi_irq_rid, RF_SHAREABLE | RF_ACTIVE); + error = ENXIO; switch (iface) { case KCS_MODE: device_printf(dev, "using KSC interface\n"); @@ -252,7 +254,6 @@ ipmi2_pci_attach(device_t dev) */ if (!ipmi_kcs_probe_align(sc)) { device_printf(dev, "Unable to determine alignment\n"); - error = ENXIO; goto bad; } @@ -262,12 +263,15 @@ ipmi2_pci_attach(device_t dev) break; case SMIC_MODE: device_printf(dev, "using SMIC interface\n"); - error = ipmi_smic_attach(sc); - if (error) - goto bad; + break; + case BT_MODE: + device_printf(dev, "using BT interface\n"); + error = ipmi_bt_attach(sc); break; } + if (error) + goto bad; error = ipmi_attach(dev); if (error) goto bad; diff --git a/sys/dev/ipmi/ipmi_smbios.c b/sys/dev/ipmi/ipmi_smbios.c index db15a853e5ea..66b7b63087b0 100644 --- a/sys/dev/ipmi/ipmi_smbios.c +++ b/sys/dev/ipmi/ipmi_smbios.c @@ -104,6 +104,7 @@ smbios_ipmi_info(struct smbios_structure_header *h, void *arg) switch (s->interface_type) { case KCS_MODE: case SMIC_MODE: + case BT_MODE: info->address = IPMI_BAR_ADDR(s->base_address) | IPMI_BAM_ADDR_LSB(s->base_address_modifier); info->io_mode = IPMI_BAR_MODE(s->base_address); diff --git a/sys/dev/ipmi/ipmivars.h b/sys/dev/ipmi/ipmivars.h index 3a20f5a9de1c..be684957122a 100644 --- a/sys/dev/ipmi/ipmivars.h +++ b/sys/dev/ipmi/ipmivars.h @@ -59,6 +59,10 @@ struct ipmi_request { uint8_t ir_ipmb_command; }; +#define IPMI_IF_KCS_NRES 2 +#define IPMI_IF_SMIC_NRES 3 +#define IPMI_IF_BT_NRES 3 + #define MAX_RES 3 #define KCS_DATA 0 #define KCS_CTL_STS 1 @@ -80,6 +84,10 @@ struct ipmi_device { u_char ipmi_lun; }; +struct ipmi_bt { + uint8_t seq; +}; + struct ipmi_kcs { }; @@ -94,6 +102,7 @@ struct ipmi_ssif { struct ipmi_softc { device_t ipmi_dev; union { + struct ipmi_bt bt; struct ipmi_kcs kcs; struct ipmi_smic smic; struct ipmi_ssif ssif; @@ -131,11 +140,12 @@ struct ipmi_softc { #define ipmi_ssif_smbus_address _iface.ssif.smbus_address #define ipmi_ssif_smbus _iface.ssif.smbus +#define ipmi_bt_seq _iface.bt.seq -#define KCS_MODE 0x01 -#define SMIC_MODE 0x02 -#define BT_MODE 0x03 -#define SSIF_MODE 0x04 +#define KCS_MODE 0x01 +#define SMIC_MODE 0x02 +#define BT_MODE 0x03 +#define SSIF_MODE 0x04 /* KCS status flags */ #define KCS_STATUS_OBF 0x01 /* Data Out ready from BMC */ @@ -252,6 +262,7 @@ const char *ipmi_pci_match(uint16_t, uint16_t); int ipmi_kcs_attach(struct ipmi_softc *); int ipmi_kcs_probe_align(struct ipmi_softc *); int ipmi_smic_attach(struct ipmi_softc *); +int ipmi_bt_attach(struct ipmi_softc *); int ipmi_ssif_attach(struct ipmi_softc *, device_t, int); extern int ipmi_attached; diff --git a/sys/modules/ipmi/Makefile b/sys/modules/ipmi/Makefile index 733ac6f30222..3d0414fc3807 100644 --- a/sys/modules/ipmi/Makefile +++ b/sys/modules/ipmi/Makefile @@ -10,7 +10,7 @@ SRCS+= bus_if.h device_if.h .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" || \ ${MACHINE_CPUARCH} == "aarch64" -SRCS+= ipmi_kcs.c ipmi_smic.c +SRCS+= ipmi_kcs.c ipmi_smic.c ipmi_bt.c SRCS+= ipmi_acpi.c SRCS+= opt_acpi.h SRCS+= acpi_if.h From nobody Wed Jun 7 14:26:22 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QbqQk6z3sz4Zrc7; Wed, 7 Jun 2023 14:26:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QbqQk6KS7z4M3G; Wed, 7 Jun 2023 14:26:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686147982; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Av+TtQOG5dvXzDuBcty1OtxJUAYAJKGTNAMvd9lY/1E=; b=J6e7H/NZspeFeYeYiIJXFu77Hrz0B0ESiMUWTbqP4uOhOAumLU3tFFVbfKtyiKr5THvRex +PGhFvETxZ0k7tfkaBhouOihl/hxmQkpotp5qsDiM8jO3fSxUskuFfMcaisbdRgxqFmGzS putP1PI0Uujmr/lixWr5JBUFgFa/eZ3KbtcIt6wbOHHI+CawWJMlBcX8OatCXLpqPYxjuv Rp88MYJlmfnggXK6hLtxHXMaxrx33nqQwwwYFwlG2mg0b40toQHQa306SLwxLYJy+yYUTu 1LgdI4ApdVh5z6SXHOasPCPkYl6lBpclMzs/2raZYwl/BK249604vtL2ZPd0gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686147982; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Av+TtQOG5dvXzDuBcty1OtxJUAYAJKGTNAMvd9lY/1E=; b=mnNcaDnA1otCySaHspPUn8JVj7fNKdxGJaDp51vpRFxphOQw/yDxt56soRTPJM11/7F+SY q+aKP3jSQivowZC5ZnMBcY0cZOVCT25cmKVqnIDXzJH927eWADdMJDjrKo9LJj25dLQGhk J1Nw0peRZvvyC93Fgz0xYRZU+VGbPoUMzHIKlNsx+GRGMoIcyYTGqrWCEwlGB/gpbFeKIU EWXXHSvOnloYo61Wi0rNfolYpXV28QzBobEllrksQnAc5Db7TMQr+orY/GxK1Hkmx8zi/P WATacbcV9Yb+45/6bDl1PQtE9nhv27tfFTg+nBArkcZoUHfXLkDah+L/MRnjFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686147982; a=rsa-sha256; cv=none; b=E8oUGMmqDOSnF+CKrTmdgz6a1neqykdB+m1cJyaoCxVexdg1QgkBiksdyheigs0r7VvMX4 ighlU/vB2DUnhYOlSbf/zOCiemK8g12CbUmQFn63UBDUoCBYNr1XTgPUtrmcya1Y7/s89j 5XDO/YdlDpP9U1hVWGDLaplpbyuIO3iJRF2omv1821oXnFKIs9RtACL8YpgjOSPdBIxN1b YmY4FXq6ATirJa+6eEckDIxHP/bJVXpRcY3ZzSz+srxOwqECd7aYT22mP88Ipfl7wVlDQe 5WOBeT4KhzlgvP8Gx0gNczNlOt6+pYgrIBYnBPqjXICEPu+7DfctM0Wg8qGcEg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QbqQk5MYNzFW4; Wed, 7 Jun 2023 14:26:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 357EQMBP076405; Wed, 7 Jun 2023 14:26:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 357EQMJx076404; Wed, 7 Jun 2023 14:26:22 GMT (envelope-from git) Date: Wed, 7 Jun 2023 14:26:22 GMT Message-Id: <202306071426.357EQMJx076404@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: 7a706aad8349 - main - hwpmc: Update manpage date List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7a706aad83494fe702c0c97fd85b3b3285ce54a2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=7a706aad83494fe702c0c97fd85b3b3285ce54a2 commit 7a706aad83494fe702c0c97fd85b3b3285ce54a2 Author: Jessica Clarke AuthorDate: 2023-05-31 00:17:52 +0000 Commit: Jessica Clarke CommitDate: 2023-06-07 14:24:29 +0000 hwpmc: Update manpage date Fixes: 8e63e787abbd ("pmc: Initialise and check the pm_flags field for CONFIGURELOG") --- share/man/man4/hwpmc.4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man4/hwpmc.4 b/share/man/man4/hwpmc.4 index 4500e168b021..05fecf816a10 100644 --- a/share/man/man4/hwpmc.4 +++ b/share/man/man4/hwpmc.4 @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 3, 2021 +.Dd May 31, 2023 .Dt HWPMC 4 .Os .Sh NAME From nobody Wed Jun 7 14:26:23 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QbqQm1BNDz4ZrrR; Wed, 7 Jun 2023 14:26:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QbqQm0DVtz4MM1; Wed, 7 Jun 2023 14:26:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686147984; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qCrFP2a1aqH8A/twGJ3BgQm2RcZe+zZIcAStV/ZOIgs=; b=tXTjAomd04G50cYYJdKeOUTmus5TvV1Ws8J2y2XeiNlnkIDe17zI2WBulleu5I24rUF//g t8E9y6kRHooqaExpepwhTYAevEu9aH/kHI0i/wgI+w4l5D8kakVA+4GWv3CadAhOSrVDrf fWFHEMA3lQxQAZ4NpD7FRf0kXw/9GdyFE704/YzCfNSWDLNjRVatNGV7bQljjgF6/jTry1 R+T2OtLxVkyiRq1X2jfpCh8+iXZtAJPjlepOp1huYwP8qqPFGBIcqblDIBmAh3IE8HphUc GmsQHr2tI7gAgdeEA76NFQGV4/vpMpGYNbRfvvLr7e52HNrghcotFSd+glqboA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686147984; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qCrFP2a1aqH8A/twGJ3BgQm2RcZe+zZIcAStV/ZOIgs=; b=XIQ6kvE2wALIE0ueqfvKlfXdE38CbjkK0sofOPORVioLfWKWARoa9HquJIjRyRQ6bIZnXL mQnOBaOIt/6g2U4+Y6AXWX+3MiYF3hczKah7fH8U+yq1evoQ5EZ3TCSIvTgGxI7tXvww0N OFQufrcXLc5kPnv3zTl1PZboC1WzofASws3qt8/1cAk/YmneZoMND46C9YBHQ1ArX3bOAO S1JTLX+3SLlShHd6DTTQ9eVugmTEZHUBVMgTHak+TirFN/rRDEwjNETOcwhVGNl74MNkAk F31owhaiSWiTGlNDvH6yFyiV+ZENhzayIhnKYxIcjL63gRYqc/uyJpOX0/k4Zw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686147984; a=rsa-sha256; cv=none; b=ZyfTcoUaQiADQ0pb3eG+9EVCDXIPsVXPIfHwxuRxiihnsxr28lnEI6O7jNJUjfxNQtmRza 52HPsKiZgTFeWCLVGuDwvt0kr6gZltuewlWVBViD0Z5YvUl2m7Pxi5SltO3BW3w8h8knz9 FqM3uXKP/HKeR+Ea3/WfQBKJX9TrpPrpqLK7GNw2STv1xwjEy49q7sN8ieeE+drmAFgXGL A7DINSVcyiqeT2O3evyKQYOekDBVoOR1Z50pJfaneR4b5clP39kk8LTbpt0iz0OX5zmzmj 2R9EW53lH+wJ+HwWDvWaYKMDHrs/PeE5TiA/Qsj/MZ37pX5sERPgEBUcYHsNUw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QbqQl62ZNzFt4; Wed, 7 Jun 2023 14:26:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 357EQNuk076425; Wed, 7 Jun 2023 14:26:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 357EQNR8076424; Wed, 7 Jun 2023 14:26:23 GMT (envelope-from git) Date: Wed, 7 Jun 2023 14:26:23 GMT Message-Id: <202306071426.357EQNR8076424@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: 296a0987be59 - main - pmcstat: Update manpage date List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 296a0987be590e73784e4c313d28a61ff310f1a3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=296a0987be590e73784e4c313d28a61ff310f1a3 commit 296a0987be590e73784e4c313d28a61ff310f1a3 Author: Jessica Clarke AuthorDate: 2023-05-31 00:18:49 +0000 Commit: Jessica Clarke CommitDate: 2023-06-07 14:24:29 +0000 pmcstat: Update manpage date Fixes: 53d0b9e438bc ("pmc: Provide full path to modules from kernel linker") --- usr.sbin/pmcstat/pmcstat.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/pmcstat/pmcstat.8 b/usr.sbin/pmcstat/pmcstat.8 index 8e0a077f5115..8835ae3c8c7a 100644 --- a/usr.sbin/pmcstat/pmcstat.8 +++ b/usr.sbin/pmcstat/pmcstat.8 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 24, 2023 +.Dd May 31, 2023 .Dt PMCSTAT 8 .Os .Sh NAME From nobody Wed Jun 7 14:26:24 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QbqQn269Pz4ZrjD; Wed, 7 Jun 2023 14:26:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QbqQn0kNdz4MH3; Wed, 7 Jun 2023 14:26:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686147985; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gy2veYEH4xLJbd1IfttNpO1qjtO+kWlZHYJZPJTSyhY=; b=XGayyQLWEuP5tkF4yy/WuGOd8sjvsy/N94P+jGqZp81EnVFJHbi/xlq4Zpfr6R0OrLVj+b PFaaE3zkuuERdf9OBgYF0UahY55or3aCvqn/QCDob/uFD7DAccbWwgq0t72+ZHN8l+ceUl +Vmzo/JF8MIG9blwDU+6BqviE5wCi9pmMqRJne1oTNtyguqI8pb+rPIR0Q2G9B4Hlneiuq VV+ocLuDs/WcQTFYH+kuMBHKwlD7hdT4kO6qKOVcDkHfJJN0UHQEY8abIKBEzYKIIOCrIQ GRoCGjM8RzVBsdzvVpHGqU7XmLTBIQK178Ivl78RrEL5povjJtfxDLasx+1jTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686147985; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gy2veYEH4xLJbd1IfttNpO1qjtO+kWlZHYJZPJTSyhY=; b=T4cRHDjjX9n3PGWbhJUw58IZRm9wqDrbPn3WfttoeG3u5QcFpI0s55bpB1lZY4j085Ye71 imA3XJeEpTGlu+iSiTPzF5ww0ETHmdn//6osxlPo5j+BfkOiX6RAAbgxGfxuJrIlu9MvGN DOPcXA1c+MTKPj41AfePh0C0IXVjJe1U4k0Lguwvh5cvwF+qUIcrupLjHin4WQvCi4vECG 3R8eRcmJ+HLFY0uOb+wL55cnhFAt4VfDMQpY9PJKtKsLq/XIt6HO5FoVYMpeUN9a+poqMc Hd2/6vnaIGk1BHQice8Ks5GY9rvRm9zd4qc8Njp7m1SsgBcjLC18QdVaO+cyAA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686147985; a=rsa-sha256; cv=none; b=gaVwipVxesimLuK5gSfaEqEuM1TxryUD94acJvDkISY2Gd5SUe+cCxQXWygIoDLcSdIHSo InekuWuOfHG+qg+mj1Kr5yXWNWp1fXaiqL0ZCEU9XQjhVrRbckOr4oJ9Ta7UytADWsbZWB hx6GiDXqfNdHqp3auSDQ9FkMSOSUB4pbweGUDGizrssLZ7oQRmr86+uetbNfvJ8MluADfA 7zHCxGYC1RasF62zhcZ3tmVgigjYA3bhRrPR0yI5t547q5EAfgdhEDVQsR+8sbDsg24j5L 69XmoRQklGFXI8XPifPSa1vBNC7Tzdo23s44BqiB1Q+LR5jUL+NvKw31IRmVFA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QbqQm6r51zFW5; Wed, 7 Jun 2023 14:26:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 357EQOh6076446; Wed, 7 Jun 2023 14:26:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 357EQOgl076445; Wed, 7 Jun 2023 14:26:24 GMT (envelope-from git) Date: Wed, 7 Jun 2023 14:26:24 GMT Message-Id: <202306071426.357EQOgl076445@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: 21f7397a61f7 - main - libpmc: Handle PMCALLOCATE log with PMC code on PMU event system List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 21f7397a61f7bff61a1221cc6340cd980a922540 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=21f7397a61f7bff61a1221cc6340cd980a922540 commit 21f7397a61f7bff61a1221cc6340cd980a922540 Author: Jessica Clarke AuthorDate: 2023-06-07 14:21:18 +0000 Commit: Jessica Clarke CommitDate: 2023-06-07 14:24:29 +0000 libpmc: Handle PMCALLOCATE log with PMC code on PMU event system On an arm64 system that reports as a Cortex A72 r0p3, running pmcstat -P CPU_CYCLES command works, but pmcstat -P cpu-cycles command does not. This is because the former uses the PMU event from the JSON source, resulting in pl_event in the log event being a small index (here, 5) into the generated events table, whilst the latter does not match any of the JSON events and falls back on PMC's own tables, mapping it to the PMC event 0x14111, i.e. PMC_EV_ARMV8_EVENT_11H. Then, when libpmc gets the PMCALLOCATE event, it tries to use the event as an index into the JSON-derived table, but doing so only makes sense for the former, whilst for the latter it will go way out of bounds and either read junk (which may trigger the != NULL assertion) or segfault. As far as I can tell we don't have anything lying around to tell us which of the two cases we're in, but we can exploit the fact that the first 0x1000 PMC event codes are reserved, and that none of our PMU events tables reach that number of entries yet. PR: 268857 Reviewed by: mhorne MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D39592 --- lib/libpmc/libpmc.c | 9 ++++++++- lib/libpmc/pmclog.c | 27 +++++++++++++++++++++------ 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/lib/libpmc/libpmc.c b/lib/libpmc/libpmc.c index 57b9c90de256..003d9615a44a 100644 --- a/lib/libpmc/libpmc.c +++ b/lib/libpmc/libpmc.c @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -1084,8 +1085,14 @@ pmc_allocate(const char *ctrspec, enum pmc_mode mode, r = spec_copy = strdup(ctrspec); ctrname = strsep(&r, ","); if (pmc_pmu_enabled()) { - if (pmc_pmu_pmcallocate(ctrname, &pmc_config) == 0) + if (pmc_pmu_pmcallocate(ctrname, &pmc_config) == 0) { + /* + * XXX: pmclog_get_event exploits this to disambiguate + * PMU from PMC event codes in PMCALLOCATE events. + */ + assert(pmc_config.pm_ev < PMC_EVENT_FIRST); goto found; + } /* Otherwise, reset any changes */ pmc_config.pm_ev = 0; diff --git a/lib/libpmc/pmclog.c b/lib/libpmc/pmclog.c index 0db91cf51bc2..92bcb1c2b161 100644 --- a/lib/libpmc/pmclog.c +++ b/lib/libpmc/pmclog.c @@ -356,12 +356,27 @@ pmclog_get_event(void *cookie, char **data, ssize_t *len, PMCLOG_READ32(le,ev->pl_u.pl_a.pl_flags); PMCLOG_READ32(le,noop); PMCLOG_READ64(le,ev->pl_u.pl_a.pl_rate); - ev->pl_u.pl_a.pl_evname = pmc_pmu_event_get_by_idx(ps->ps_cpuid, ev->pl_u.pl_a.pl_event); - if (ev->pl_u.pl_a.pl_evname != NULL) - break; - else if ((ev->pl_u.pl_a.pl_evname = - _pmc_name_of_event(ev->pl_u.pl_a.pl_event, ps->ps_arch)) - == NULL) { + + /* + * Could be either a PMC event code or a PMU event index; + * assume that their encodings don't overlap (i.e. no PMU event + * table is more than 0x1000 entries) to distinguish them here. + * Otherwise pmc_pmu_event_get_by_idx will go out of bounds if + * given a PMC event code when it knows about that CPU. + * + * XXX: Ideally we'd have user flags to give us that context. + */ + if (ev->pl_u.pl_a.pl_event < PMC_EVENT_FIRST) + ev->pl_u.pl_a.pl_evname = + pmc_pmu_event_get_by_idx(ps->ps_cpuid, + ev->pl_u.pl_a.pl_event); + else if (ev->pl_u.pl_a.pl_event <= PMC_EVENT_LAST) + ev->pl_u.pl_a.pl_evname = + _pmc_name_of_event(ev->pl_u.pl_a.pl_event, + ps->ps_arch); + else + ev->pl_u.pl_a.pl_evname = NULL; + if (ev->pl_u.pl_a.pl_evname == NULL) { printf("unknown event\n"); goto error; } From nobody Wed Jun 7 18:01:29 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QbwC00cM8z4blHn; Wed, 7 Jun 2023 18:01:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QbwC009yGz3lnb; Wed, 7 Jun 2023 18:01:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686160892; 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=WXxDXi9aNideDTkIqFEEYLXoOhjJ4UhVw9rZhinR2FA=; b=QScCyqTUl3bXxekocmGwyQxnRw068bRy4Gu/4DAOtJyRPvysJyBC18FaffUuCGlhRm9amA cMBPQ9y5fzIGE6h5ZBQQWcC9aHRpPeYNxr2aM7O7l95tcjhbTkfGy+Eyj4tYqhueJi74Ab 0nVmuGOaNsrVH6P0kipweOzx5ZqRqlIuXDoZXuvb7aI5dqnlRQqPh/T65I+8iDo2HWM3HL 1to9/b8UW3E+fJ3HZ5/sBxoqVZL5AkalLCIuovdpp7S3QG3zEep9Emyqu8qG9eGoKPmmSd 5vqlgiXB9kVi6lsR9+cXEwPjV0hDTl5bUP1Z45uuOLanaUGLk0Rq1L4O2Dl5Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686160892; 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=WXxDXi9aNideDTkIqFEEYLXoOhjJ4UhVw9rZhinR2FA=; b=uqhpE3ERvJhyqfSEt9yNiVxEBzRJA5ldn+OL+QNS769K8w7qowTlq2Udk/ZE8nDajD3ime oBFYqOLVV/pSK5YDvhY6gECbOVU4zbi3X/OWjGKdj/AaXvXSEPPxHL2w/V2WOOTkJhUSxL W0knjD6oP3eFJUnk8hi7etx3K9qtXCV68CwRQs0ihD88Uf2d+plYZbSoQlIGLA0NDJrk/C dkGHPwv64JohFKx3Fr/qmEmrj87MlU8sGv8m74+7vL8ly+QVK3N2tHrHCF5c9fTiyk2H0X R7kWBl4+r7gH3jl8Ov2qxOYcHPxvYCcXPetyHiLOBrFPQkEK3C9peERaFvNn+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686160892; a=rsa-sha256; cv=none; b=jUig+nK+QTufNGhfy3ER5qKeN/0sd2mYCriLCngixGyMbDAEvFQrPNs0Yw4UO5nTaXGBcB 0u3oAeSt386SU0lmKJe2a2Y/wS202nAamt+23viSK2SGfXbfWdMjIoJCxljf/GC5L60LmU 7rerUsV//p4La9Z78Ocf6GMwp0NXzCUrXFA+Rv7FEtgpZSILfBjBEo/ZjjZUeBU2fMWf7C Ole+rUo8isJSCt5EJaJv4tlq+zGhT18VfUC5dXMHnXJqyqY5RwtdYnNzYt6Cu04ckWYnOQ Nj+HFc3fn5whoIOJUQaReq+5o9ZC5wPCDF8y3nWOSkgkEtpuPKW9U8qaKu2p6Q== Received: from [IPV6:2601:648:8680:16b0:240e:dd1a:5053:4aca] (unknown [IPv6:2601:648:8680:16b0:240e:dd1a:5053:4aca]) (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 4QbwBz25ktzM2n; Wed, 7 Jun 2023 18:01:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <59a6e27d-4844-204a-215a-28ccec683f6d@FreeBSD.org> Date: Wed, 7 Jun 2023 11:01:29 -0700 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 Subject: Re: git: 1b0d96f3c43a - main - xregs_sig: Finish renaming simd to xregs before adding avx Content-Language: en-US To: Dmitry Chagin , Alexey Dokuchaev Cc: Jessica Clarke , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" References: <202306031713.353HDY7D036200@gitrepo.freebsd.org> <3F83B6B8-7A16-488B-9594-50A7426931F5@freebsd.org> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ThisMailContainsUnwantedMimeParts: N On 6/7/23 1:35 AM, Dmitry Chagin wrote: > On Wed, Jun 07, 2023 at 01:52:10AM +0000, Alexey Dokuchaev wrote: >> On Sat, Jun 03, 2023 at 10:29:12PM +0300, Dmitry Chagin wrote: >>> On Sat, Jun 03, 2023 at 07:57:03PM +0100, Jessica Clarke wrote: >>>> ... >>>> But the AArch64 registers are called x0 through x30. They are x >>>> registers. So calling the SIMD registers X registers is both incorrect >>>> and highly confusing. It is not general, it is specific to x86's notion >>>> of SIMD. >>> >>> Naming is hard (c) especially for non-native :), >>> I just need an avx registers test to fix golang issues in the Linuxulator. >>> Feel free to join D40410, D40384, propose you naming variant, may be >>> x->ext or ngprs >> >> What was wrong with SIMD (simd)? > > Strictly speaking test is about the fact that signal context properly > saves/restores machine context including gprs, simd registers, on x86 > xsave area including many things, whch can be added later For example, PKRU on x86 is a non-simd register that this test could be verifying. -- John Baldwin From nobody Wed Jun 7 18:04:19 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QbwGD0VQxz4blhl; Wed, 7 Jun 2023 18:04:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QbwGC75Zfz3lt2; Wed, 7 Jun 2023 18:04:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686161060; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NIUyvlyA1oUJxvg9hAwK/CWn1Xu7TT9FszuNzEGZm10=; b=aRVB4Zm46tj99DWnndJpYJkLLrECkmW0JEQ0djkGaksoLPa8tM34ob+byBw10b7vyluU6z FTDKn2wWqkMgum3AuDv7RS7Vu2LEiMuz2F3hQPS9qtdiDh+NcwwzdUdvO00wlTm4SWd2bJ 2RtOH5YNgi6+KuTaqqo46tOLYp6myivJkxDcBzoEjHlk7lCiialkPXs76pSzbeyQrYXFm3 F7olF2R4L087rqyCcDPf6ZXqQvMyEbGn4GWFJ2A6FHg8Eqz1b/4H//plC6x5TIpkft40PH t+WeQ9YFN99IA0H3tGoaOPssmvoNQhssBkVxqU0Kv3wUkhfAfrqCh0LEVpYG/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686161060; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NIUyvlyA1oUJxvg9hAwK/CWn1Xu7TT9FszuNzEGZm10=; b=dwRTxnz/z0RMog3627nCFxpwT0AJ5evO4mRrm7drRAckyye0IvMqwsFw4FUq0gXV5EzWty 7q6rCI4SRJn+7OeMqC6St7NcOB7+u/nu4kC0cYWvzF5MrNi1Xwviv2L4vd2WY9UDKqFSgn kL1NsTekUyrooOP0ZeZnQ/1homzaJbrH5ZOKGveXwabJ6PbndipbHiBvN/G4XHsRpSRA5a WXO+Nv/fAh0eEj+T+ACuGX8cdXZzC/rMeHLDhQT0j6r5IAUlbI6ygqkSNzu39JfKKxrnuZ uznuNmeU++BOWOb+N3OuPKIRMl4B9GOmyuSVNTJZ/bUbv0wkj2HNn+b6slmwsA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686161060; a=rsa-sha256; cv=none; b=AOMuVPW0Nhv0dDXfTxOwh5MBalCvt5BxTgFH/yR5G/m0v5wC63I4FgXwNufJUlNSAwJpl3 3hvsZjvRJsHinySwne/DcTZ9OfHPLDlXREIoFaQqX2as6HoJO+6sFsm7+BOsfEzk9pykkH NkSZcRQoSlhy3QPJReNOWNVkurJidStYW7EC+9qfl2et3jwrQUxOFe828WwJzTjv8IB5pi 92gtn2ZKoA73/FeNlE152dNzF+al6rJk7/nu+NxmVDATjn8XWyUpV08ZoXsXS8P/NFO4wr 3dPFMGiiGBaYYeCH/a70QsEKJvbWO6Sc39w6CEtUtbey/Wa2UjDgscaPnj5A1g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QbwGC61DKzLrj; Wed, 7 Jun 2023 18:04:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 357I4J98038741; Wed, 7 Jun 2023 18:04:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 357I4Jg0038740; Wed, 7 Jun 2023 18:04:19 GMT (envelope-from git) Date: Wed, 7 Jun 2023 18:04:19 GMT Message-Id: <202306071804.357I4Jg0038740@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: aee3611fecba - main - pmcstat: Tweak typo fix. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aee3611fecba4202c944803b43042ab701dac153 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=aee3611fecba4202c944803b43042ab701dac153 commit aee3611fecba4202c944803b43042ab701dac153 Author: John Baldwin AuthorDate: 2023-06-07 18:03:02 +0000 Commit: John Baldwin CommitDate: 2023-06-07 18:03:02 +0000 pmcstat: Tweak typo fix. Reviewed by: imp --- usr.sbin/pmcstat/pmcstat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/pmcstat/pmcstat.c b/usr.sbin/pmcstat/pmcstat.c index decb2c5af953..634085a95335 100644 --- a/usr.sbin/pmcstat/pmcstat.c +++ b/usr.sbin/pmcstat/pmcstat.c @@ -96,7 +96,7 @@ __FBSDID("$FreeBSD$"); * * /Parent/ /Child/ * - * - Wait for children token. + * - Wait for child's token. * - Sends token. * - Awaits signal to start. * - Attaches PMCs to the child's pid From nobody Wed Jun 7 19:29:01 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Qby7y1YBjz4Zm6l; Wed, 7 Jun 2023 19: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Qby7y119bz3xGn; Wed, 7 Jun 2023 19: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=1686166142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dX0dh0I206s5FcKN+Hjmpyv5BZxRcAzdDtLQky6NY30=; b=TWXIFSmueVZLuKYm/TZsSqazyFNZFzq/H/fKgcRPNryh09Mp+g21yVNXYOW9rbU4u+3qkE MQLBk5ZzESkTNRuTP7l975YDsTXo6Wxb901B3CFWtolt5tlnsxcvAoNNTFtB4ZKUwdILKJ 9gRe29gvReUA8WXyZskN0lTLWfaksXIcz8UnuTzwJmGEQmCRlspBbdcDORCXmcoJvpP/Au YAsnKDEd6/0FJ9gS5GKYBPKq9/Ee3ZJS9KPnSBp9FezvRu8HiCxx/GZTq7nAo+EpnLIqUz G4/oh9JAujJb1T5JlJO1q4rVO13eHas3416V4axz9BDisGPs20g61D8BjzvreQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686166142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dX0dh0I206s5FcKN+Hjmpyv5BZxRcAzdDtLQky6NY30=; b=G0DRlNlDMlzq5j0YBBU3HQ8p1l3amu3o/bwuDlfhLDrQmjUNVWcL7P8FQtOANKNDmFG0DZ kxY2+AponWuez/AlX+bhQ0gQ2oMdeXzBAypCPRjw8cq9JzTSrdXL3VTter+ynB0m8rK7+g /AZrxJI3PKMVMNrCbVoEtIx4y2s9J7tQx/WUsP+hfoYRpim2fzYIt7cFyHMfwYvFg/97zb m/qEQviVX20AX7RVSq3pXUpeH87n698SdlXliPnygas8r25m8qCvVCTtTUdDkbQDo4uiMQ JBZgLsXEBYrajoEj0l+dqgWnEc9eMyV1BldkQhPY71BbonX3gEr0247m47QGrQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686166142; a=rsa-sha256; cv=none; b=Mb3krnF9zZzSVRY7b1wdhe1z5nHQ4DZe4z38wQS1wxWXRTlCQ33NAaNZZJXz2RX1Ds6BB8 Lw7mpi8TPs5qkw49Xzj3tc3nvw1qvpQCcJFWBY9yjQaD8/JlLIECSynrEPSpmVc8OF/D7F HbuTvriMIvSO9C9ksaQAl1vuxngkU+WhW52rKqufP1JwcKJzvttrXe4AAvGVUYj05UmF0F Pzsf5xi0eLvoT+7A1rc8pMJN/tjdaWSFzqNnORcmSFPwWYrqn+9u7CasM/q6HJLbCsVd0c QWtOVAdSa3SKl+l4wbwtg/dx+/KCI94ZnMRYobvJt2Tsxa7y/0c39jyt27f7vA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Qby7y055HzNl6; Wed, 7 Jun 2023 19:29:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 357JT1LA070239; Wed, 7 Jun 2023 19:29:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 357JT1fL070237; Wed, 7 Jun 2023 19:29:01 GMT (envelope-from git) Date: Wed, 7 Jun 2023 19:29:01 GMT Message-Id: <202306071929.357JT1fL070237@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 653738e895ba - main - ptrace: Clear TDB_BORN during PT_DETACH. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 653738e895ba022be1179a95a85089e7bc66dbbe Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=653738e895ba022be1179a95a85089e7bc66dbbe commit 653738e895ba022be1179a95a85089e7bc66dbbe Author: John Baldwin AuthorDate: 2023-06-07 19:26:57 +0000 Commit: John Baldwin CommitDate: 2023-06-07 19:28:36 +0000 ptrace: Clear TDB_BORN during PT_DETACH. If a debugger detaches from a process that has a new thread that has not yet executed, the new thread will raise a SIGTRAP signal to report it's thread birth event even after the detach. With the debugger detached, this results in a SIGTRAP sent to the process and typically a core dump. Fix this by clearing TDB_BORN from any new threads during detach. Bump __FreeBSD_version for debuggers to notice when the fix is present. Reported by: GDB's testsuite Reviewed by: kib, markj (previous version) Differential Revision: https://reviews.freebsd.org/D39856 --- sys/kern/kern_fork.c | 2 +- sys/kern/sys_process.c | 2 +- sys/sys/param.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index f981747aaf70..944ecf494736 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -1144,7 +1144,7 @@ fork_return(struct thread *td, struct trapframe *frame) td->td_dbgflags &= ~TDB_STOPATFORK; } PROC_UNLOCK(p); - } else if (p->p_flag & P_TRACED || td->td_dbgflags & TDB_BORN) { + } else if (p->p_flag & P_TRACED) { /* * This is the start of a new thread in a traced * process. Report a system call exit event. diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index 47fdf91b87d5..41434da783c8 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -1288,7 +1288,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) SIGSTOP); } td3->td_dbgflags &= ~(TDB_XSIG | TDB_FSTP | - TDB_SUSPEND); + TDB_SUSPEND | TDB_BORN); } if ((p->p_flag2 & P2_PTRACE_FSTP) != 0) { diff --git a/sys/sys/param.h b/sys/sys/param.h index 5bdc3e2ebee4..d3577411e998 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -76,7 +76,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1400089 +#define __FreeBSD_version 1400090 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Wed Jun 7 22:35:10 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Qc2Gk6yM4z4bZhN; Wed, 7 Jun 2023 22:35:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Qc2Gk6M22z4MY1; Wed, 7 Jun 2023 22:35:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686177310; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VbyyFD1jHmSYJSaPxzLtOcbQh/h6jojz71idngLWrN8=; b=CvqX+bsxFY1saWJ2GBWKUwEznD04BVQAGv8cqjlceGob9TPfsTw5+y2ZdkZMTzr0ZHOMjX Dim+t2QRr3DikMpYEIakd3D0PkIaJVuLFvjmd3YgFaxi6yPFs9b9OhjK/RaGbOnfn7DnwI ZGwzOiR2BIgghs+MUdUmAPBeyoy2q68T/9euLWu68GQ3S1dxoDSXoFSv9R3XCn2PqiZ+U6 APkthNhzInn2mmLaemIiKyFco5CuPuncuG+FnRw6rpvkLsdWOXKLyLZ/TAeF0ey1SoKOPJ ZFXXOTBskyH8hizdq7cZ3Jj2vFKEfu/13CS6Bydhls6lzd1SQ912BdAbSRl1QQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686177310; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VbyyFD1jHmSYJSaPxzLtOcbQh/h6jojz71idngLWrN8=; b=AoJIWKVwGQfVyG75Ly6C0SnSwEURCESLlb+gL9kaL98eHnruxdxfXyFPuqFGk17i8oJODO SposaC8D3tkbKu9Z6o83I0Jnvfpj5zQupvny1Hh1OI/xnprjXT8Ve7XfCYd7Ty4IZi2ANO 7AWMUEXH9HWofYdwm7Nyog3jWDUG9+qsb3CK30kGUKyC5jrw0xAFfVbf5ZqifUkJGWHFbN bgv03rC2yCL1fOgGJafuI3pXbqHQAGM0BLk060hJnByo+qsz5BZbxdKmcEffBqZq3z1iPl 9gfKP9K+Q7/ZCubhe2lDNDJiu59xgCXWlU9jTzSE9DNbFTWfnFYFZWUiV66U1g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686177310; a=rsa-sha256; cv=none; b=t/u8GpMHVZN9MiGV1gUhWEVbRqGbXuw0SA4l4ZHNifFTsWfcCTaoKVjtGlSOSweSypHsxG 1QI4kJiFXZxYTmWu6MQ34k+8SnmvVgZtznD4ddO4Exrgpd2VgEEWZtAU9hgsMJwdNwE1Sm 7ycd4eNuRMkyKFxLRa170WW3muly0ZUnFYJKtLKGGr7cckseOJSfYLPBlqd31dl7u6gW7F REae2UjldeyHTtr3/6XvhV4XG6Q1JUHcDbsOfSMQ++DywVJQ//xT50X1XJ9UTmGRKeM3As ++j85m7uHCYDEmdpX4c/2bKagdEtWsr10Y0fe0krSq9ZLG3ywOML+dsZ/Nhuhg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Qc2Gk56hWzVDQ; Wed, 7 Jun 2023 22:35:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 357MZAKS081839; Wed, 7 Jun 2023 22:35:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 357MZALh081838; Wed, 7 Jun 2023 22:35:10 GMT (envelope-from git) Date: Wed, 7 Jun 2023 22:35:10 GMT Message-Id: <202306072235.357MZALh081838@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: 007322a94cee - stable/13 - Add the ability to adjust directory depths to background fsck_ffs(8). List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 007322a94ceeca654c3bb3bf1fdf6e2bea30d683 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=007322a94ceeca654c3bb3bf1fdf6e2bea30d683 commit 007322a94ceeca654c3bb3bf1fdf6e2bea30d683 Author: Kirk McKusick AuthorDate: 2023-05-26 02:27:04 +0000 Commit: Kirk McKusick CommitDate: 2023-06-07 22:34:39 +0000 Add the ability to adjust directory depths to background fsck_ffs(8). Sponsored by: The FreeBSD Foundation (cherry picked from commit e4a905d1e0d94ddb8e15de50d37e67f13e058047) --- sbin/fsck_ffs/dir.c | 26 +++++++++++++++++++++----- sbin/fsck_ffs/fsck.h | 1 + sbin/fsck_ffs/globs.c | 2 ++ sys/ufs/ffs/ffs_alloc.c | 28 ++++++++++++++++++++++++++++ sys/ufs/ffs/fs.h | 3 ++- 5 files changed, 54 insertions(+), 6 deletions(-) diff --git a/sbin/fsck_ffs/dir.c b/sbin/fsck_ffs/dir.c index cc5305c390a4..e5f0e1e7e7f4 100644 --- a/sbin/fsck_ffs/dir.c +++ b/sbin/fsck_ffs/dir.c @@ -105,6 +105,7 @@ check_dirdepth(struct inoinfo *inp) struct inode ip; union dinode *dp; int saveresolved; + size_t size; static int updateasked, dirdepthupdate; if ((parentinp = getinoinfo(inp->i_parent)) == NULL) { @@ -141,9 +142,11 @@ check_dirdepth(struct inoinfo *inp) } } /* - * If we are not converting, nothing more to do. + * If we are not converting or we are running in no-write mode + * there is nothing more to do. */ - if (inp->i_depth == 0 && dirdepthupdate == 0) + if ((inp->i_depth == 0 && dirdepthupdate == 0) || + (fswritefd < 0 && bkgrdflag == 0)) return; /* * Individual directory at wrong depth. Report it and correct if @@ -174,8 +177,20 @@ check_dirdepth(struct inoinfo *inp) printf(" (ADJUSTED)\n"); } inp->i_depth = parentinp->i_depth + 1; - DIP_SET(dp, di_dirdepth, inp->i_depth); - inodirty(&ip); + if (bkgrdflag == 0) { + DIP_SET(dp, di_dirdepth, inp->i_depth); + inodirty(&ip); + } else { + cmd.value = inp->i_number; + cmd.size = (int64_t)inp->i_depth - DIP(dp, di_dirdepth); + if (debug) + printf("adjdepth ino %ld amt %jd\n", (long)cmd.value, + (intmax_t)cmd.size); + size = MIBSIZE; + if (sysctlnametomib("vfs.ffs.adjdepth", adjdepth, &size) < 0 || + sysctl(adjdepth, MIBSIZE, 0, 0, &cmd, sizeof cmd) == -1) + rwerror("ADJUST INODE DEPTH", cmd.value); + } irelse(&ip); } @@ -506,7 +521,8 @@ adjust(struct inodesc *idesc, int lcnt) (long long)cmd.size); if (sysctl(adjrefcnt, MIBSIZE, 0, 0, &cmd, sizeof cmd) == -1) - rwerror("ADJUST INODE", cmd.value); + rwerror("ADJUST INODE LINK COUNT", + cmd.value); } } } diff --git a/sbin/fsck_ffs/fsck.h b/sbin/fsck_ffs/fsck.h index 4e5878b0b12f..9f9b1e0a8857 100644 --- a/sbin/fsck_ffs/fsck.h +++ b/sbin/fsck_ffs/fsck.h @@ -333,6 +333,7 @@ extern int adjnbfree[MIBSIZE]; /* MIB cmd to adjust number of free blocks */ extern int adjnifree[MIBSIZE]; /* MIB cmd to adjust number of free inodes */ extern int adjnffree[MIBSIZE]; /* MIB cmd to adjust number of free frags */ extern int adjnumclusters[MIBSIZE]; /* MIB cmd adjust number of free clusters */ +extern int adjdepth[MIBSIZE]; /* MIB cmd to adjust directory depth count */ extern int freefiles[MIBSIZE]; /* MIB cmd to free a set of files */ extern int freedirs[MIBSIZE]; /* MIB cmd to free a set of directories */ extern int freeblks[MIBSIZE]; /* MIB cmd to free a set of data blocks */ diff --git a/sbin/fsck_ffs/globs.c b/sbin/fsck_ffs/globs.c index 92e77b61f9d4..2340636fe3a9 100644 --- a/sbin/fsck_ffs/globs.c +++ b/sbin/fsck_ffs/globs.c @@ -68,6 +68,7 @@ int adjnbfree[MIBSIZE]; /* MIB command to adjust number of free blocks */ int adjnifree[MIBSIZE]; /* MIB command to adjust number of free inodes */ int adjnffree[MIBSIZE]; /* MIB command to adjust number of free frags */ int adjnumclusters[MIBSIZE]; /* MIB command to adjust number of free clusters */ +int adjdepth[MIBSIZE]; /* MIB cmd to adjust directory depth count */ int freefiles[MIBSIZE]; /* MIB command to free a set of files */ int freedirs[MIBSIZE]; /* MIB command to free a set of directories */ int freeblks[MIBSIZE]; /* MIB command to free a set of data blocks */ @@ -141,6 +142,7 @@ fsckinit(void) bzero(adjnifree, sizeof(int) * MIBSIZE); bzero(adjnffree, sizeof(int) * MIBSIZE); bzero(adjnumclusters, sizeof(int) * MIBSIZE); + bzero(adjdepth, sizeof(int) * MIBSIZE); bzero(freefiles, sizeof(int) * MIBSIZE); bzero(freedirs, sizeof(int) * MIBSIZE); bzero(freeblks, sizeof(int) * MIBSIZE); diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c index 6d37afcfadf6..195ba9f8a299 100644 --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -3108,6 +3108,8 @@ ffs_fserr(struct fs *fs, * the count to zero will cause the inode to be freed. * adjblkcnt(inode, amt) - adjust the number of blocks used by the * inode by the specified amount. + * adjdepth(inode, amt) - adjust the depth of the specified directory + * inode by the specified amount. * setsize(inode, size) - set the size of the inode to the * specified size. * adjndir, adjbfree, adjifree, adjffree, adjnumclusters(amt) - @@ -3142,6 +3144,10 @@ static SYSCTL_NODE(_vfs_ffs, FFS_ADJ_BLKCNT, adjblkcnt, CTLFLAG_WR | CTLFLAG_NEEDGIANT, sysctl_ffs_fsck, "Adjust Inode Used Blocks Count"); +static SYSCTL_NODE(_vfs_ffs, FFS_ADJ_DEPTH, adjdepth, + CTLFLAG_WR | CTLFLAG_NEEDGIANT, sysctl_ffs_fsck, + "Adjust Directory Inode Depth"); + static SYSCTL_NODE(_vfs_ffs, FFS_SET_SIZE, setsize, CTLFLAG_WR | CTLFLAG_NEEDGIANT, sysctl_ffs_fsck, "Set the inode size"); @@ -3299,6 +3305,28 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) vput(vp); break; + case FFS_ADJ_DEPTH: +#ifdef DIAGNOSTIC + if (fsckcmds) { + printf("%s: adjust directory inode %jd depth by %jd\n", + mp->mnt_stat.f_mntonname, (intmax_t)cmd.value, + (intmax_t)cmd.size); + } +#endif /* DIAGNOSTIC */ + if ((error = ffs_vget(mp, (ino_t)cmd.value, LK_EXCLUSIVE, &vp))) + break; + if (vp->v_type != VDIR) { + vput(vp); + error = ENOTDIR; + break; + } + ip = VTOI(vp); + DIP_SET(ip, i_dirdepth, DIP(ip, i_dirdepth) + cmd.size); + UFS_INODE_SET_FLAG(ip, IN_CHANGE | IN_MODIFIED); + error = ffs_update(vp, 1); + vput(vp); + break; + case FFS_SET_SIZE: #ifdef DIAGNOSTIC if (fsckcmds) { diff --git a/sys/ufs/ffs/fs.h b/sys/ufs/ffs/fs.h index b2ed2051471c..70e24242b01b 100644 --- a/sys/ufs/ffs/fs.h +++ b/sys/ufs/ffs/fs.h @@ -224,7 +224,8 @@ /* Was FFS_SET_INODE 15 */ /* Was FFS_SET_BUFOUTPUT 16 */ #define FFS_SET_SIZE 17 /* set inode size */ -#define FFS_MAXID 17 /* number of valid ffs ids */ +#define FFS_ADJ_DEPTH 18 /* adjust directory inode depth */ +#define FFS_MAXID 18 /* number of valid ffs ids */ /* * Command structure passed in to the filesystem to adjust filesystem values. From nobody Wed Jun 7 22:37:25 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Qc2KL26mDz4bZmD; Wed, 7 Jun 2023 22:37:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Qc2KL19Rsz4N29; Wed, 7 Jun 2023 22:37:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686177446; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mBuxoxQ4xJfraKV8PlVFA0eq+k6/ZpQ5CI3Y5TxMebY=; b=dZG8RcGSea+q2tilzHygt/t+y6rIjuUm7u8yxdvAfwyPOmuoXA72sIbnCZFJfafel580PZ CkkUaHFS6no1Z4m9arpEKETti5ZlDuw/KJ4h9sSu1+RsTCda5E/bhQ/DYEiQ+bJimHE31h KbV9CknF0JTqu95nA+w8AIqYn1IwxgOxX04P0VGsRbqBc5buJ5icad+388AUbmGTFBrGUi p9WLvu0//Mi8Gx45Yg3SvVkx1/T8KZ7RSD6rCG7cuA1oI9ZTqWaSl1h7OaW/7MI2bQVMSx +FWGTSabHOlpfgF2f0WD/RckzHgLSDnDOWkx4Qx+hWmAyJC1uajPJMvKiaI4iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686177446; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mBuxoxQ4xJfraKV8PlVFA0eq+k6/ZpQ5CI3Y5TxMebY=; b=oLnM3lK/9fee7oyq1iQIdoTNDjeEg4hAS1ZFcaT18vS52FmixKsT6VSPjaqQnSK/ROWZww AkrkPzRXga1aiEBuFEJIoyaJvZ4BuSaHq5WwDOK4eaPPHutTkGGFW482nuu6077qMu4QBo QU7KfR3dSSDhmV8SFtBrD2fm1z4a/TA4EbHpVOZgyZKrTFnD2caPalzodiNGMc/3FQgcn1 OvnfDLwGhZLmQOFYq5PnuSamyt0uq8bToE7b7eqEaFn928cUh8nL3HDGi7bp2SNQTUHwVn Y71OtPifAiMJk2IhYeSOJaq/ZPLl+FykAUxhOuvmL8haX15Df4UQOT6kkmNliA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686177446; a=rsa-sha256; cv=none; b=cLUqQeXcOcVRw58/V/fb5NogIMEFJAWiCQm7dEZhBeWWnte7m/tA0rlBZJafCLO+2HXFNy lCGApwMwf5jLU5pSbKlWXwaIUA0KSr1rlsTWwWolNaQ74L6E2blzdsOOCQmq0JMlPUNvRI gv3t9pFhDejZ1dBpGVVfcGE7dHPWF2n+QkfwuOJio7jp+OJYAGT2sTBNBGhRu3ZRQN1zfR DpWGSUT8Q1kfC4hIXB95ySlQ8FVf61ilywGH5hDMvFs4vlpsWaE9XGncrv2spPt5Lw1jfh YXBChUXAA9hghZYvekiN+mQgdy6OxdUgQ5Zr979LlZ+mQNaoCahSujCqO3/4AA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Qc2KL0Cj3zV9y; Wed, 7 Jun 2023 22:37:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 357MbP3b082205; Wed, 7 Jun 2023 22:37:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 357MbPTO082204; Wed, 7 Jun 2023 22:37:25 GMT (envelope-from git) Date: Wed, 7 Jun 2023 22:37:25 GMT Message-Id: <202306072237.357MbPTO082204@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: 77cbed11b2ea - stable/13 - Do not try to adjust a directory depth when its reconnection is declined. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 77cbed11b2eabaa811963c60e83e83fd6677fca3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=77cbed11b2eabaa811963c60e83e83fd6677fca3 commit 77cbed11b2eabaa811963c60e83e83fd6677fca3 Author: Kirk McKusick AuthorDate: 2023-05-27 05:55:11 +0000 Commit: Kirk McKusick CommitDate: 2023-06-07 22:36:39 +0000 Do not try to adjust a directory depth when its reconnection is declined. Sponsored by: The FreeBSD Foundation (cherry picked from commit 49943856eb2710c6a6debdfa40d89d31d3fdb8ea) --- sbin/fsck_ffs/pass3.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sbin/fsck_ffs/pass3.c b/sbin/fsck_ffs/pass3.c index b9d24f18371b..49cb43620392 100644 --- a/sbin/fsck_ffs/pass3.c +++ b/sbin/fsck_ffs/pass3.c @@ -100,10 +100,10 @@ pass3(void) if (linkup(orphan, inp->i_dotdot, NULL)) { inp->i_parent = inp->i_dotdot = lfdir; inoinfo(lfdir)->ino_linkcnt--; + inoinfo(orphan)->ino_state = DFOUND; + check_dirdepth(inp); + propagate(); } - inoinfo(orphan)->ino_state = DFOUND; - check_dirdepth(inp); - propagate(); continue; } pfatal("ORPHANED DIRECTORY LOOP DETECTED I=%lu", From nobody Wed Jun 7 23:15:34 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Qc39L6lvvz4bhRm; Wed, 7 Jun 2023 23:15:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Qc39L6HhWz3Cw6; Wed, 7 Jun 2023 23:15:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686179734; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=T3Q/JLCxW5eWncLJTFrQxpOlxVeBdWp7NpdCKPZAyA0=; b=rmuUSw1OmW5McZNIwIvz2QKSlHN0h91zG0rU84JClpmsJdcCLxahtkVOtNXgN7sDFe5ieM IHyKp3J8BOKAVQt10hys/e0ZU9/1y+xaCNBA/awHsMhY1rww1W854LMNqMMsIccOLoao1Y EeLjdSUeVyG4Ij5DOYAxayn94CXBLODsatRBUrtA9y/tLWQch+L0hPO3OaT90rjxufibFb 2RwKP2hk3baf9y9E5OdE4XAx0LnKu/YAqmgJg+StusLHCN+xYxtXlZ9tIaj8s3JYgeHH4q 6gKsooYpxtuBg3XyaMFCdEUdSEu38FnyRJ9zYw+cfZFp2mfWxd24vZyhyEgogQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686179734; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=T3Q/JLCxW5eWncLJTFrQxpOlxVeBdWp7NpdCKPZAyA0=; b=W0Q8/QyY6VAlz7RepPw5qUTzOTvObsQLZhyRgCaqRKozhKl8AkQT19QyHHoIF/EEtUYuhB eFaglm2gUCe1AGhxdb+wwkYK7kOXgJxnqv1v2GFa/YXpgu9zIBid7z9mjxInNF4lBKCxCL zeYN8R+JkJfur/ecoqQjh6PLXZNq248RO+KMC0HTcXBQmwN3DzZJJ2jBWbzZGHQ8qGoozI b4fnKcrgYOTNFpYt/rN/ccJG2W2w7COp0O0gI+16ifgQCWbDQSW2rSi+5zAlR1leFxvkak fQSf249FDBqHjUwpoJ+i/t91bc8e04ljA56FZLg++pdAba59mHcdZTw37HWyzg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686179734; a=rsa-sha256; cv=none; b=KgaeJcWrSQnT7iUGrR44Sn9ue310BrPPULE6dZFuWbLZtzPXHttARjRwzS4HcoMpXlnHcM jYk1kGTVLOMsmhDdw168p8SPCR2kuZPUeTXIb3SERm8whRL25RQggBRSTaA7j98SUzKwnu fx74EftnBdSSI7QNver3zOtYsrSX88hGMYa2kL9NxZVQ3lQ6MPiISx4AD0jov/EwSdSaFh fgmh+hSyQ8LYcjcGKTgwhc2ilOFbHlVRjI8WdT3atUMQBP2+9fdrOb+82ZKrMq9aYVFjD+ B9t90mx9qK2Feboba7mlmj8VcSvBGHJ+/jMqpFQoTXOBGTvSXU4Sqawl0jr5bw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Qc39L5MNBzWGG; Wed, 7 Jun 2023 23:15:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 357NFYpC048376; Wed, 7 Jun 2023 23:15:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 357NFYo6048375; Wed, 7 Jun 2023 23:15:34 GMT (envelope-from git) Date: Wed, 7 Jun 2023 23:15:34 GMT Message-Id: <202306072315.357NFYo6048375@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: 52f50301aaab - stable/13 - Correct two bugs in fsck_ffs(8) triggered by corrupted filesystems. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 52f50301aaabddc6e3c1bc8c354101cfd7ea0463 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=52f50301aaabddc6e3c1bc8c354101cfd7ea0463 commit 52f50301aaabddc6e3c1bc8c354101cfd7ea0463 Author: Kirk McKusick AuthorDate: 2023-05-27 05:41:57 +0000 Commit: Kirk McKusick CommitDate: 2023-06-07 22:40:35 +0000 Correct two bugs in fsck_ffs(8) triggered by corrupted filesystems. Reported-by: Robert Morris PR: 271310 PR: 271354 Sponsored-by: The FreeBSD Foundation (cherry picked from commit 03a8680202ef7d7e68adc70625633c490b4ed637) --- sbin/fsck_ffs/pass1.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sbin/fsck_ffs/pass1.c b/sbin/fsck_ffs/pass1.c index e784fd29dc1c..863bf34ff0fc 100644 --- a/sbin/fsck_ffs/pass1.c +++ b/sbin/fsck_ffs/pass1.c @@ -400,13 +400,13 @@ checkinode(ino_t inumber, struct inodesc *idesc, int rebuiltcg) if (mode == IFDIR) { if (DIP(dp, di_size) == 0) { inoinfo(inumber)->ino_state = DCLEAR; - } else if (DIP(dp, di_nlink) <= 0) { + } else if (DIP(dp, di_nlink) == 0) { inoinfo(inumber)->ino_state = DZLINK; } else { inoinfo(inumber)->ino_state = DSTATE; - cacheino(dp, inumber); - countdirs++; } + cacheino(dp, inumber); + countdirs++; } else if (DIP(dp, di_nlink) <= 0) inoinfo(inumber)->ino_state = FZLINK; else From nobody Wed Jun 7 23:15:35 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Qc39N1hFGz4bhlX; Wed, 7 Jun 2023 23:15:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Qc39N0hGdz3CwR; Wed, 7 Jun 2023 23:15:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686179736; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1Wkjd8LdrLkLgun+BB9ZfMp9qPA08w9lGRwWlPl4GZ8=; b=Ci2SRY/gWPaMhZ9VCeB5apKvNvdJq8Tkim96IMNPvH+Q5FVj8J70ugYtLEojwQRcWdvzm2 Lv8AAEUQq8FcBlXpOMS9dg5Ot7ZhIA9P5VYROXO31PawBjFhp+zIH0AdSMAnDIDBeTB1xg oYo4N4WfzCEcxSuVqFrbY1kYSc+Ce/aObItm3szKvUhvV6S+WBGru3koimlv6Q53XURdZ7 shtLPDs+byJt8M8S8vgytA/ni1SaQ5WzmzXpmTNXj2wHBJfQy9k0hJXNs7KYaKeLbwVPby M/pju8HQ2mEMvJtcnPyLzIJp9sBjtN+7n598iOcd/xDBvrHDxsX1rmtiRnCKuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686179736; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1Wkjd8LdrLkLgun+BB9ZfMp9qPA08w9lGRwWlPl4GZ8=; b=BYnCaH83wyZRmFoqjMARFwFXsNPGSZo1YYrJ7VpBbS7bgZ56Dyx5G+cjVtr1k5HMXQu0W4 xdzkYPUISbq4JRACfH0qQeP0pYhMNMLuCOt9gDoB2j1oqPZZAP/NDMXLTR0PWBs0/Dq228 uJ6M+GFX2wJIo4gnKsabwesWzgJFMUzDGv8mwR6/zCHPIDDhj2B80pGxTyAOcqfvObdO8H szpVV9VjlGd3S+iSNg3e4ajfu2BU/n3OFwkFDrd9qxZ/TsH5UOHYKRCJWL2DDkFZzL3Ima 1rzTNJtuM7emZzPoQmyS8b9w3QDNNbDrUFzq3XriMotUDrOhhi6Qy8JkFRM0VQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686179736; a=rsa-sha256; cv=none; b=kYFw2sxZ08SzHIdaHdxeFTJoiRCyfL8LRvihsxSuPt5LVY8YC1mh5f3gPev0N7B4Kwm587 BZ9E7L1UnnRPl7IYPyKWj5FK+YAdnm6z0lmD1RENggozs/IPdMCtgv7ie7aWDcfyZX/fGa FkDVtp6njL0jyuU/8HEz6N7JAL0UolssW73rmEpEz0VPmJMLuTYsoxw8MYUcgPNFh4U5oh bFJcswc6JSVvA7A3ZWM4IOzgUCTMnk9BoR7SGVDZy4Qk+czzIdu3kKadiYh0tt6GUViowt hs+Tl7HAV0mAE8xNlt2xfzGpmqimwolFOTGmLQQp0n9Ge+y5Pwejfc3/CsfiOg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Qc39M6HQVzWGH; Wed, 7 Jun 2023 23:15:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 357NFZG1048398; Wed, 7 Jun 2023 23:15:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 357NFZrR048397; Wed, 7 Jun 2023 23:15:35 GMT (envelope-from git) Date: Wed, 7 Jun 2023 23:15:35 GMT Message-Id: <202306072315.357NFZrR048397@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: fbfbd0638a5a - stable/13 - Fix a bug in fsck_ffs(8) triggered by corrupted filesystems. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fbfbd0638a5a3dd4f76eaf17f81450cc09d48e5b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=fbfbd0638a5a3dd4f76eaf17f81450cc09d48e5b commit fbfbd0638a5a3dd4f76eaf17f81450cc09d48e5b Author: Kirk McKusick AuthorDate: 2023-05-27 23:07:09 +0000 Commit: Kirk McKusick CommitDate: 2023-06-07 22:44:12 +0000 Fix a bug in fsck_ffs(8) triggered by corrupted filesystems. The last valid inode in the filesystem is maxino - 1, not maxino. Thus validity checks should ino < maxino, not ino <= maxino. Reported-by: Robert Morris PR: 271312 Sponsored-by: The FreeBSD Foundation (cherry picked from commit 11ce203e0535c1c8f520c9bda81ab9326cf5db80) --- sbin/fsck_ffs/dir.c | 4 ++-- sbin/fsck_ffs/fsutil.c | 2 +- sbin/fsck_ffs/inode.c | 14 ++++++++------ sbin/fsck_ffs/pass2.c | 4 ++-- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/sbin/fsck_ffs/dir.c b/sbin/fsck_ffs/dir.c index e5f0e1e7e7f4..7ea471bcb30a 100644 --- a/sbin/fsck_ffs/dir.c +++ b/sbin/fsck_ffs/dir.c @@ -126,7 +126,7 @@ check_dirdepth(struct inoinfo *inp) if (inp->i_depth == 0 && updateasked == 0) { updateasked = 1; if (preen) { - pwarn("UPDATING FILESYSTEM TO TRACK DIRECTORY DEPTH"); + pwarn("UPDATING FILESYSTEM TO TRACK DIRECTORY DEPTH\n"); dirdepthupdate = 1; } else { /* @@ -437,7 +437,7 @@ fileerror(ino_t cwd, ino_t ino, const char *errmesg) char pathbuf[MAXPATHLEN + 1]; pwarn("%s ", errmesg); - if (ino < UFS_ROOTINO || ino > maxino) { + if (ino < UFS_ROOTINO || ino >= maxino) { pfatal("out-of-range inode number %ju", (uintmax_t)ino); return; } diff --git a/sbin/fsck_ffs/fsutil.c b/sbin/fsck_ffs/fsutil.c index bed87299a3cf..419d0e91a1df 100644 --- a/sbin/fsck_ffs/fsutil.c +++ b/sbin/fsck_ffs/fsutil.c @@ -169,7 +169,7 @@ inoinfo(ino_t inum) struct inostatlist *ilp; int iloff; - if (inum > maxino) + if (inum >= maxino) errx(EEXIT, "inoinfo: inumber %ju out of range", (uintmax_t)inum); ilp = &inostathead[inum / sblock.fs_ipg]; diff --git a/sbin/fsck_ffs/inode.c b/sbin/fsck_ffs/inode.c index 00a60157138c..7dca95129ed1 100644 --- a/sbin/fsck_ffs/inode.c +++ b/sbin/fsck_ffs/inode.c @@ -433,8 +433,9 @@ void ginode(ino_t inumber, struct inode *ip) { ufs2_daddr_t iblk; + struct ufs2_dinode *dp; - if (inumber < UFS_ROOTINO || inumber > maxino) + if (inumber < UFS_ROOTINO || inumber >= maxino) errx(EEXIT, "bad inode number %ju to ginode", (uintmax_t)inumber); ip->i_number = inumber; @@ -473,14 +474,15 @@ ginode(ino_t inumber, struct inode *ip) } ip->i_dp = (union dinode *) &ip->i_bp->b_un.b_dinode2[inumber - ip->i_bp->b_index]; - if (ffs_verify_dinode_ckhash(&sblock, (struct ufs2_dinode *)ip->i_dp)) { + dp = (struct ufs2_dinode *)ip->i_dp; + /* Do not check hash of inodes being created */ + if (dp->di_mode != 0 && ffs_verify_dinode_ckhash(&sblock, dp)) { pwarn("INODE CHECK-HASH FAILED"); prtinode(ip); if (preen || reply("FIX") != 0) { if (preen) printf(" (FIXED)\n"); - ffs_update_dinode_ckhash(&sblock, - (struct ufs2_dinode *)ip->i_dp); + ffs_update_dinode_ckhash(&sblock, dp); inodirty(ip); } } @@ -1292,7 +1294,7 @@ findino(struct inodesc *idesc) if (dirp->d_ino == 0) return (KEEPON); if (strcmp(dirp->d_name, idesc->id_name) == 0 && - dirp->d_ino >= UFS_ROOTINO && dirp->d_ino <= maxino) { + dirp->d_ino >= UFS_ROOTINO && dirp->d_ino < maxino) { idesc->id_parent = dirp->d_ino; return (STOP|FOUND); } @@ -1322,7 +1324,7 @@ prtinode(struct inode *ip) dp = ip->i_dp; printf(" I=%lu ", (u_long)ip->i_number); - if (ip->i_number < UFS_ROOTINO || ip->i_number > maxino) + if (ip->i_number < UFS_ROOTINO || ip->i_number >= maxino) return; printf(" OWNER="); if ((pw = getpwuid((int)DIP(dp, di_uid))) != NULL) diff --git a/sbin/fsck_ffs/pass2.c b/sbin/fsck_ffs/pass2.c index 8200209cc03e..48bf27a8b142 100644 --- a/sbin/fsck_ffs/pass2.c +++ b/sbin/fsck_ffs/pass2.c @@ -371,7 +371,7 @@ chk1: dirp->d_reclen = proto.d_reclen; } if (dirp->d_ino != 0 && strcmp(dirp->d_name, "..") == 0) { - if (dirp->d_ino > maxino) { + if (dirp->d_ino >= maxino) { direrror(idesc->id_number, "BAD INODE NUMBER FOR '..'"); /* * If we know parent set it now, otherwise let it @@ -471,7 +471,7 @@ chk2: } idesc->id_entryno++; n = 0; - if (dirp->d_ino > maxino) { + if (dirp->d_ino >= maxino) { fileerror(idesc->id_number, dirp->d_ino, "I OUT OF RANGE"); n = reply("REMOVE"); } else if (((dirp->d_ino == UFS_WINO && dirp->d_type != DT_WHT) || From nobody Wed Jun 7 23:15:36 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Qc39P1KsNz4bhV9; Wed, 7 Jun 2023 23:15:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Qc39P0t8Vz3CqJ; Wed, 7 Jun 2023 23:15:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686179737; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xpPaRajNb1mK3yTkuQolV1hswqguQ+k48eWAJcINGeY=; b=ob7qNmZbNTaoZuV8I+rQ0pGojOPXmhvKbG1UvuSRUGNRy04NvfXaQhwj/Yg2i4fRyeSPTp 6Z2cjIaas5OB7R+6JYZ8i5nXISgHXQU991oyKIxGDU476dGfUcX+HZkhyJBpEmgta1Jxo8 YQZk4qO7N0v+KLHbcCrnyaGQn/Y8wQ5JuHplMr9CxhIp+kbbMbt/7o2RwpFAldA1F+mBTC 2xYYOjL3d93CAqZm//BY8jb64iP+yP1sxq5aefqu2svUDB1iet0ZZzTMguqt/08C8y+lAE 1hDpIeDFDznKxlpTHhJ+l+o3F+cN7/n65UihlPyFZz18oi/jAxEdNbrWSweG1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686179737; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xpPaRajNb1mK3yTkuQolV1hswqguQ+k48eWAJcINGeY=; b=xktGH4p7Du/SvgV41e31H8LkLvRlrJmTLspHvU6yCAvmLJhoO2kGVQuMxQPmPtsCz9B+6q WfPQzaWkI3B4saPVgSOlwoCuWMuXY+4i4LTekZ/YUn+kEn8vlU+To5piqW37ff+cVgvDd1 cEvLuiUiqi2gCpsdCb1lPcndGVPAAOV9Fgn48XQO+XJku2PiVoc/nhPC+6+vEA+SDcdLV2 gnb23bpKZaBjNBA2S9WGuMjcc+cyNrHNBqFPWMk70HpR1rqNtO4IbXgkB6SoBRpVcMIS6b kpzB7X1ZlJM+1K/nyVDFupBOhElzfXNOJTWjPELzEVi7M8LYWh+G/kADnKTP1g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686179737; a=rsa-sha256; cv=none; b=Vgq6oNHgWd6wTgleEag5Kic5ntcAHgUsbFLY3VS8T9AP4NWeFhiS21dNfbdPtJnc6v9Yfl +5uc2BUMOANp2RCEMbi7eyYKrcDh9JxDs9L9pTKfPSDz4Bns+bKAQzf/V9KJhQTbdY0lyN jQw/dVxS3pwp2Vwdzi7yrXjL4HT8Av42NQzFt1Y5koZM8y0mRBX3CIarT/gpzdwxYfsQHw RW2UpWykvruofyF1UfRoVhaObuVq9SfEW8fIWoOzmgDrEPK2F5XR6MLDBluXmTaxQmo183 PSzZbYaG/Q1OHI7QN7thl4NozqjzMvZEqh1GXMVgBelNFhp7cxtTz2ARmqc1VQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Qc39N721BzWGJ; Wed, 7 Jun 2023 23:15:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 357NFaHK048422; Wed, 7 Jun 2023 23:15:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 357NFaHD048421; Wed, 7 Jun 2023 23:15:36 GMT (envelope-from git) Date: Wed, 7 Jun 2023 23:15:36 GMT Message-Id: <202306072315.357NFaHD048421@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: 3035f98d56eb - stable/13 - Fix a bug in fsck_ffs(8) triggered by corrupted filesystems. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3035f98d56eb72240c6260d667427ab4ade08b45 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=3035f98d56eb72240c6260d667427ab4ade08b45 commit 3035f98d56eb72240c6260d667427ab4ade08b45 Author: Kirk McKusick AuthorDate: 2023-05-28 00:09:02 +0000 Commit: Kirk McKusick CommitDate: 2023-06-07 22:46:53 +0000 Fix a bug in fsck_ffs(8) triggered by corrupted filesystems. Reported-by: Robert Morris PR: 271378 Sponsored-by: The FreeBSD Foundation (cherry picked from commit 101a9ac07128a17d8797cc3e93978d2cfa457e99) --- sbin/fsck_ffs/fsck.h | 1 + sbin/fsck_ffs/fsutil.c | 25 +++++++++++++++++++++++++ sbin/fsck_ffs/pass1.c | 12 +----------- sbin/fsck_ffs/suj.c | 3 +++ 4 files changed, 30 insertions(+), 11 deletions(-) diff --git a/sbin/fsck_ffs/fsck.h b/sbin/fsck_ffs/fsck.h index 9f9b1e0a8857..4f77fc39f3f7 100644 --- a/sbin/fsck_ffs/fsck.h +++ b/sbin/fsck_ffs/fsck.h @@ -471,6 +471,7 @@ void check_blkcnt(struct inode *ip); int check_cgmagic(int cg, struct bufarea *cgbp); void rebuild_cg(int cg, struct bufarea *cgbp); void check_dirdepth(struct inoinfo *inp); +int chkfilesize(mode_t mode, u_int64_t filesize); int chkrange(ufs2_daddr_t blk, int cnt); void ckfini(int markclean); int ckinode(union dinode *dp, struct inodesc *); diff --git a/sbin/fsck_ffs/fsutil.c b/sbin/fsck_ffs/fsutil.c index 419d0e91a1df..ab55bdfbb37a 100644 --- a/sbin/fsck_ffs/fsutil.c +++ b/sbin/fsck_ffs/fsutil.c @@ -1206,6 +1206,31 @@ std_checkblkavail(ufs2_daddr_t blkno, long frags) return (0); } +/* + * Check whether a file size is within the limits for the filesystem. + * Return 1 when valid and 0 when too big. + * + * This should match the file size limit in ffs_mountfs(). + */ +int +chkfilesize(mode_t mode, u_int64_t filesize) +{ + u_int64_t kernmaxfilesize; + + if (sblock.fs_magic == FS_UFS1_MAGIC) + kernmaxfilesize = (off_t)0x40000000 * sblock.fs_bsize - 1; + else + kernmaxfilesize = sblock.fs_maxfilesize; + if (filesize > kernmaxfilesize || + filesize > sblock.fs_maxfilesize || + (mode == IFDIR && filesize > MAXDIRSIZE)) { + if (debug) + printf("bad file size %ju:", (uintmax_t)filesize); + return (0); + } + return (1); +} + /* * Slow down IO so as to leave some disk bandwidth for other processes */ diff --git a/sbin/fsck_ffs/pass1.c b/sbin/fsck_ffs/pass1.c index 863bf34ff0fc..d328234220ad 100644 --- a/sbin/fsck_ffs/pass1.c +++ b/sbin/fsck_ffs/pass1.c @@ -256,7 +256,6 @@ checkinode(ino_t inumber, struct inodesc *idesc, int rebuiltcg) { struct inode ip; union dinode *dp; - off_t kernmaxfilesize; ufs2_daddr_t ndb; mode_t mode; intmax_t size, fixsize; @@ -293,16 +292,7 @@ checkinode(ino_t inumber, struct inodesc *idesc, int rebuiltcg) return (1); } lastino = inumber; - /* This should match the file size limit in ffs_mountfs(). */ - if (sblock.fs_magic == FS_UFS1_MAGIC) - kernmaxfilesize = (off_t)0x40000000 * sblock.fs_bsize - 1; - else - kernmaxfilesize = sblock.fs_maxfilesize; - if (DIP(dp, di_size) > kernmaxfilesize || - DIP(dp, di_size) > sblock.fs_maxfilesize || - (mode == IFDIR && DIP(dp, di_size) > MAXDIRSIZE)) { - if (debug) - printf("bad size %ju:", (uintmax_t)DIP(dp, di_size)); + if (chkfilesize(mode, DIP(dp, di_size)) == 0) { pfatal("BAD FILE SIZE"); goto unknown; } diff --git a/sbin/fsck_ffs/suj.c b/sbin/fsck_ffs/suj.c index 8bcee7c54c85..cbb6e597dfee 100644 --- a/sbin/fsck_ffs/suj.c +++ b/sbin/fsck_ffs/suj.c @@ -1963,6 +1963,9 @@ ino_build_trunc(struct jtrncrec *rec) printf("ino_build_trunc: op %d ino %ju, size %jd\n", rec->jt_op, (uintmax_t)rec->jt_ino, (uintmax_t)rec->jt_size); + if (chkfilesize(IFREG, rec->jt_size) == 0) + err_suj("ino_build: truncation size too large %ju\n", + (intmax_t)rec->jt_size); sino = ino_lookup(rec->jt_ino, 1); if (rec->jt_op == JOP_SYNC) { sino->si_trunc = NULL; From nobody Wed Jun 7 23:15:38 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Qc39Q2BsTz4bhjr; Wed, 7 Jun 2023 23:15:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Qc39Q1kSQz3D89; Wed, 7 Jun 2023 23:15:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686179738; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5JC9sIryRifeboHj4oaY8NMk+i7nJMk7GbnjWKKYOPc=; b=xpWqiYAS1QF+jvdkUCBR1nWS7otS7JQnQ8FlqsyzqEVHHScgYZITMcFZy6Pd3pbD5OC38Y BHrauVAxm7FM/MTVAkU22Ocuyk3vm9GvLFjLfk1B0VkzYtwSQeI0cR+vrirAATC2RJ+mCj ACgnanSuKf6cRadm1GkGYXvzWPwbVa4ndOuWaM0nqTjT4ExcID81EW0mqnUw1ZxK3ylbQ4 al2SmcZQVM9uWhoXxzYFwqb22PDxQ19/iSOySojRmmRKycuYN9WpSxhAgfgrLrYRdzpUfh WugmN4C71WR3LPZDhBAj1xpEBAUgTBK9p9VXYpCRzSHsoQUx2ifDJZ5G+2zvhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686179738; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5JC9sIryRifeboHj4oaY8NMk+i7nJMk7GbnjWKKYOPc=; b=eavbM3iEUYF5JjEoHMjmTp2P1G6J+mCLsNXaAAKjjEWDpMXVmNaMbOL817KV2Z5UyTZNEq 1NG4I7zQGhSZKD4QXBc5x7E4UTdha7nDS/qDRfAAXqbKDPfZ4dUgmFnBvciw1BPC/0XPqb SEdOzJtRobeMc7xOQxcb3p5d05HQIYHMeWcV3rotTFTtiPVEEPR5Q4s2Eb9j5S1HDUrX2K OnpWZD8lUu5Wg8CcmXndd9Np9wTiwxiIdWbQxF2OhUHuDS+yDNP71d6apDJrw5J3tWhWfd TfK0uRnxLI+Fgy1iuqXAoDglPgZcePBXRM0+Y0T904q15ctLHGoVmRQz91ixVw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686179738; a=rsa-sha256; cv=none; b=ObgEG7uALBVfNh7iz96EsmPe83KLA6GqNWjGL66H7PvbqNzDFzLHYtU/1167EMUWWvo0uG PC8WzyulLzXEshb/3z8kXJGvaxb99lKlLsf9zRAzhnwsP9z4sVJnZ7d87+ACSZUcyxd0Wn gUBaTakhuyIAD+bJbip2e6F4zTIhNxg6Jb0kvhZQmeiwl/sufda6pFFTqxbNkJkNM9JZgr C3qrDRTyZfBAEJyClWkmiHo84GPGllvrwnHco81bExGppnzoBjeYACE5l9zmvKcCmRabYY QNcPYmris/reKRbQKgZyJCFJBKonXK6S0rN/i7lhOvNrv3EDGoHOzpMCLI+7yQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Qc39Q0r4szWGK; Wed, 7 Jun 2023 23:15:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 357NFcO2048441; Wed, 7 Jun 2023 23:15:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 357NFcgR048440; Wed, 7 Jun 2023 23:15:38 GMT (envelope-from git) Date: Wed, 7 Jun 2023 23:15:38 GMT Message-Id: <202306072315.357NFcgR048440@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: da8749afdca8 - stable/13 - Fix a bug in fsck_ffs(8) triggered by corrupted filesystems. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: da8749afdca81a435b76f8f54e7642e5ee232958 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=da8749afdca81a435b76f8f54e7642e5ee232958 commit da8749afdca81a435b76f8f54e7642e5ee232958 Author: Kirk McKusick AuthorDate: 2023-05-28 22:23:16 +0000 Commit: Kirk McKusick CommitDate: 2023-06-07 22:48:47 +0000 Fix a bug in fsck_ffs(8) triggered by corrupted filesystems. Reported-by: Robert Morris PR: 271383 Sponsored-by: The FreeBSD Foundation (cherry picked from commit b796bfce48698449470b751de6b0d96ae7047202) --- sbin/fsck_ffs/suj.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sbin/fsck_ffs/suj.c b/sbin/fsck_ffs/suj.c index cbb6e597dfee..5a09943406c8 100644 --- a/sbin/fsck_ffs/suj.c +++ b/sbin/fsck_ffs/suj.c @@ -734,7 +734,7 @@ indir_visit(ino_t ino, ufs_lbn_t lbn, ufs2_daddr_t blk, uint64_t *frags, lbnadd *= NINDIR(fs); bp = getdatablk(blk, fs->fs_bsize, BT_LEVEL1 + level); if (bp->b_errs != 0) - err_suj("indir_visit: UNRECOVERABLE I/O ERROR"); + err_suj("indir_visit: UNRECOVERABLE I/O ERROR\n"); for (i = 0; i < NINDIR(fs); i++) { if ((nblk = IBLK(bp, i)) == 0) continue; @@ -1916,6 +1916,9 @@ blk_build(struct jblkrec *blkrec) blk = blknum(fs, blkrec->jb_blkno); frag = fragnum(fs, blkrec->jb_blkno); + if (blkrec->jb_blkno < 0 || blk + fs->fs_frag - frag > fs->fs_size) + err_suj("Out-of-bounds journal block number %jd\n", + blkrec->jb_blkno); sblk = blk_lookup(blk, 1); /* * Rewrite the record using oldfrags to indicate the offset into From nobody Wed Jun 7 23:15:39 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Qc39R3Cgwz4bhXs; Wed, 7 Jun 2023 23:15:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Qc39R2ghBz3D8m; Wed, 7 Jun 2023 23:15:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686179739; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/RFXUQR2OAv8w0oRRCeYG+hlZpKN4HD5IuTVDLWY3rw=; b=VpXD2ur0ZH2TUnLNYxZbFsoe6z1c8cXwVl1zP00MGQAXU838sDSgOfzkuotlUyyEWpWqdf 2zl45q7sv3O7P/ZEQoPD7ANAORe1hP10Tl7HcyjaK4kOPJ5d0j6Ufx07PPY/3hLPVs2RZN HAbKlsDMQ0sV0u2FsMJWTw+jfNXhZApSOlpk5Vk/lXRUvSKLoomGXfWCMK4BKDPQDkSWBL yjXTKQGn+94hRbeLRIja8zfBHNifJYjH4b3sqHe74HnOqBUldQfwfSwpzLxS/Elxtn01WJ HgX2jwPaQqkV4iEFnQAua0e9dvvvAhof3bjzPg3oNWpdrQAbH66nKmLbPKY26A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686179739; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/RFXUQR2OAv8w0oRRCeYG+hlZpKN4HD5IuTVDLWY3rw=; b=mKlthAoL+zBsjHS9GsizwwgcgSYYNWXH1hA0AfpJ7ra182jIZNDAg9WPdSQaX/HCIT+RdS gkNvT2TewsVE/OOZvRFPAUGhrPBzszM44jp3j0ITTSXqgWZoUOFZ/VuguiV0pcvQAGQ4Z7 kLT/bBzxcFp6sbHP8BnVSkq+Pc+0mRFVBDM0SGfCKQUjkkb1U++/vPrhmBIppviY4Eih+k s2NcPKo6r1uTuLtcZ538UN4Bm+6VzEswetxOWAj/Ime3WA/Kf+YbRajeMXk3JwW8kPqGVq KArHaQyee5/Ru+vVIMZO2VbEbN4KwaRU/AmGR4QlHMzas/p6Zh8vyqlVvrGZqw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686179739; a=rsa-sha256; cv=none; b=Da0PWOGrSzqtCRUtpgvCEg4rm3/GOEltvWgvlpDpgAaTPXEbKXrewxgOv/wfwG108j3iov Ph8diwQT9IAcM+zI4qh5fEWDvNyRYL77Ghmqgvys5nncqWV1VTEM2UldcjY52BdBJZiJFt SivNcbNuBiy2kNez55Um11p0rt+PZGe5EyTWr4G9ui+BbT/XsgKrG/Eoq2OLOT9tIowFwM Lgy9/QzKUMz7qgZBwzd5XFKsn8Ofl1SczahpaiByT6R3rKM+5/3lZGJekmFEwycBqLPdEM d/RsE3bwhGBn0wFAzykgeQQcpG1SncqXDrc0ftqybP+/Sg4jR5seWbd2BIXLww== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Qc39R1dF5zWQt; Wed, 7 Jun 2023 23:15:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 357NFdBl048460; Wed, 7 Jun 2023 23:15:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 357NFdUV048459; Wed, 7 Jun 2023 23:15:39 GMT (envelope-from git) Date: Wed, 7 Jun 2023 23:15:39 GMT Message-Id: <202306072315.357NFdUV048459@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: 90532db778dc - stable/13 - Cleanups to fsck_ffs(8). List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 90532db778dc2bca557d5be43c5b9813ba44d80a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=90532db778dc2bca557d5be43c5b9813ba44d80a commit 90532db778dc2bca557d5be43c5b9813ba44d80a Author: Kirk McKusick AuthorDate: 2023-05-29 21:54:52 +0000 Commit: Kirk McKusick CommitDate: 2023-06-07 22:54:13 +0000 Cleanups to fsck_ffs(8). Sponsored-by: The FreeBSD Foundation (cherry picked from commit 5267120645fa52eac771c9bd8e28d68620a3bb89) --- sbin/fsck_ffs/dir.c | 3 +++ sbin/fsck_ffs/inode.c | 17 +++++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/sbin/fsck_ffs/dir.c b/sbin/fsck_ffs/dir.c index 7ea471bcb30a..3ff6c467ee08 100644 --- a/sbin/fsck_ffs/dir.c +++ b/sbin/fsck_ffs/dir.c @@ -725,6 +725,7 @@ changeino(ino_t dir, const char *name, ino_t newnum, int depth) ginode(dir, &ip); if (((error = ckinode(ip.i_dp, &idesc)) & ALTERED) && newnum != 0) { DIP_SET(ip.i_dp, di_dirdepth, depth); + inodirty(&ip); getinoinfo(dir)->i_depth = depth; } free(idesc.id_name); @@ -879,6 +880,7 @@ expanddir(struct inode *ip, char *name) DIP_SET(dp, di_ib[0], indirblk); DIP_SET(dp, di_blocks, DIP(dp, di_blocks) + btodb(sblock.fs_bsize)); + inodirty(ip); } IBLK_SET(nbp, lastlbn - UFS_NDADDR, newblk); dirty(nbp); @@ -969,6 +971,7 @@ allocdir(ino_t parent, ino_t request, int mode) } else { inp->i_depth = parentinp->i_depth + 1; DIP_SET(dp, di_dirdepth, inp->i_depth); + inodirty(&ip); } inoinfo(ino)->ino_type = DT_DIR; inoinfo(ino)->ino_state = inoinfo(parent)->ino_state; diff --git a/sbin/fsck_ffs/inode.c b/sbin/fsck_ffs/inode.c index 7dca95129ed1..c56d938cce41 100644 --- a/sbin/fsck_ffs/inode.c +++ b/sbin/fsck_ffs/inode.c @@ -90,6 +90,10 @@ ckinode(union dinode *dp, struct inodesc *idesc) dino.dp1 = dp->dp1; else dino.dp2 = dp->dp2; + if (DIP(&dino, di_size) < 0) { + pfatal("NEGATIVE INODE SIZE %jd\n", DIP(&dino, di_size)); + return (STOP); + } ndb = howmany(DIP(&dino, di_size), sblock.fs_bsize); for (i = 0; i < UFS_NDADDR; i++) { idesc->id_lbn++; @@ -116,6 +120,7 @@ ckinode(union dinode *dp, struct inodesc *idesc) inodirty(&ip); irelse(&ip); } + return (STOP); } continue; } @@ -498,6 +503,11 @@ irelse(struct inode *ip) /* Check for failed inode read */ if (ip->i_bp == NULL) return; + if (debug && sblock.fs_magic == FS_UFS2_MAGIC && + ffs_verify_dinode_ckhash(&sblock, (struct ufs2_dinode *)ip->i_dp)) { + pwarn("irelse: releasing inode with bad check-hash"); + prtinode(ip); + } if (ip->i_bp->b_refcnt <= 0) pfatal("irelse: releasing unreferenced ino %ju\n", (uintmax_t) ip->i_number); @@ -1419,21 +1429,20 @@ retry: cgdirty(cgbp); ginode(ino, &ip); dp = ip.i_dp; + memset(dp, 0, ((sblock.fs_magic == FS_UFS1_MAGIC) ? + sizeof(struct ufs1_dinode) : sizeof(struct ufs2_dinode))); DIP_SET(dp, di_db[0], allocblk(ino_to_cg(&sblock, ino), (long)1, std_checkblkavail)); if (DIP(dp, di_db[0]) == 0) { inoinfo(ino)->ino_state = USTATE; + inodirty(&ip); irelse(&ip); return (0); } DIP_SET(dp, di_mode, type); - DIP_SET(dp, di_flags, 0); DIP_SET(dp, di_atime, time(NULL)); DIP_SET(dp, di_ctime, DIP(dp, di_atime)); DIP_SET(dp, di_mtime, DIP(dp, di_ctime)); - DIP_SET(dp, di_mtimensec, 0); - DIP_SET(dp, di_ctimensec, 0); - DIP_SET(dp, di_atimensec, 0); DIP_SET(dp, di_size, sblock.fs_fsize); DIP_SET(dp, di_blocks, btodb(sblock.fs_fsize)); n_files++; From nobody Wed Jun 7 23:15:40 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Qc39S50Kpz4bhlk; Wed, 7 Jun 2023 23:15:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Qc39S31ncz3DHZ; Wed, 7 Jun 2023 23:15:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686179740; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m/H9HTceWSS15lPHRie91DBOC58jmt/Mon+xjvMrdLQ=; b=RwALpXiy+1SZ43uag8ruh5Iy25WaryEmSstzShUj91G6meMcFgYdw/3ArNelVkrRQgbGPh p3v0PbjkKXnIxOWTigM6R+EJoquOJ3ltssCLRzLv1MhUaeLJwl/dGfesZYp8R63Chtf2zN NcE2XD1oVqKQ8Z72dt0mK1DfNkAMsW7x0PwFXhLZ9TJyyxrSz6xiEKW7A0Y0+CKGiI2uwY izP+gv1XEo4L6fg11zs+LIk3Vvy4zMAVVQx+ADBFaf9z1G1pJFO8T8Zda+rftb/DrDyU9E fAP6Tzl2272c6uNAVVSINr1CP/mWWDHVDszZrMsC5LzOuSWtU0PFp4yOtRlK1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686179740; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m/H9HTceWSS15lPHRie91DBOC58jmt/Mon+xjvMrdLQ=; b=l1DCB0JBzXl7UyQ0CdzkEgQ2178k6OId8j4CReFd5fGsTP21GPzbmQLQLAMHsXPwp5DRyT /XK3u7ivoVepTb9RCMo2ZmG00sLeyxHTk4KsIj9zKqw1bZBPoouJqJYGYwPDLgHp/x7Fmt JZtSsD82Vlp2iNdD96UY21dE52c2FXFf8laM0W2dhpQoZ4X3x6hDnmImOLFHzWBe2O0PLb Um0WUGlEwFN7NUrrI463XFBPS7vq7+4kwUNWYBEVeKB4iD4jflWhuAZMGhq1GnZ5J/dH76 EmdKw8NSMGPKWu89bBxJJCPzSSbSiIevoteDy8Jf2QN1EpKvov0B0Ew1jpwdpQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686179740; a=rsa-sha256; cv=none; b=QQ/R8L2C2r82nbZICsQBq72xP6Wz53GLO8h74o2hWEGkkefIMTqO+Rb/fDdnx7UP1mAliq qTWzzWajo+YjrMyjgTBv3Z4OEOiJdOFMfSgHBoL9d+XB98VJQetFjNRJlr/mD40CP00tcw IuTpnWfMIal2gU4yITn0TvBBLuBwdaLRgVaEOqq+PDWfq1NZNnPEFb+I1F+vCj/EKzVyEr X9JhzZNf1XRBsE31Xukkqc1rm8FMYfhC7LBKusuLpKOchAFl6ccv3s4iACib/XTfHKDDO8 Jm8YTJzmhgqfp7NKFnHm6t7MrKVxms1kGqunmKLHTITQ107xPd/lzuvu8Fndiw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Qc39S26P6zVx0; Wed, 7 Jun 2023 23:15:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 357NFeha048486; Wed, 7 Jun 2023 23:15:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 357NFert048485; Wed, 7 Jun 2023 23:15:40 GMT (envelope-from git) Date: Wed, 7 Jun 2023 23:15:40 GMT Message-Id: <202306072315.357NFert048485@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: a4bea5c479d8 - stable/13 - Fix a bug in fsck_ffs(8) triggered by corrupted filesystems. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a4bea5c479d84d5fb10c6d78abce504253fe8e1d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=a4bea5c479d84d5fb10c6d78abce504253fe8e1d commit a4bea5c479d84d5fb10c6d78abce504253fe8e1d Author: Kirk McKusick AuthorDate: 2023-05-29 21:58:20 +0000 Commit: Kirk McKusick CommitDate: 2023-06-07 22:56:12 +0000 Fix a bug in fsck_ffs(8) triggered by corrupted filesystems. Reported-by: Robert Morris PR: 271414 Sponsored-by: The FreeBSD Foundation (cherry picked from commit 6a71277c3037df2c3a70464c2e2bf20dec2c128a) --- sbin/fsck_ffs/suj.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/sbin/fsck_ffs/suj.c b/sbin/fsck_ffs/suj.c index 5a09943406c8..d1b6d8530ce6 100644 --- a/sbin/fsck_ffs/suj.c +++ b/sbin/fsck_ffs/suj.c @@ -2375,7 +2375,7 @@ suj_check(const char *filesys) { struct inodesc idesc; struct csum *cgsum; - union dinode *jip; + union dinode *dp, *jip; struct inode ip; uint64_t blocks; int i, retval; @@ -2417,7 +2417,17 @@ suj_check(const char *filesys) idesc.id_func = findino; idesc.id_name = SUJ_FILE; ginode(UFS_ROOTINO, &ip); - if ((ckinode(ip.i_dp, &idesc) & FOUND) == FOUND) { + dp = ip.i_dp; + if ((DIP(dp, di_mode) & IFMT) != IFDIR) { + irelse(&ip); + err_suj("root inode is not a directory\n"); + } + if (DIP(dp, di_size) < 0 || DIP(dp, di_size) > MAXDIRSIZE) { + irelse(&ip); + err_suj("negative or oversized root directory %jd\n", + (uintmax_t)DIP(dp, di_size)); + } + if ((ckinode(dp, &idesc) & FOUND) == FOUND) { sujino = idesc.id_parent; irelse(&ip); } else { From nobody Wed Jun 7 23:15:41 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Qc39V0HBWz4bhd8; Wed, 7 Jun 2023 23:15:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Qc39T3nMVz3DFW; Wed, 7 Jun 2023 23:15:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686179741; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lZqlqeDQB5ao7y/pXatcDzeSyxnaEWf2AgN40cq0Sx0=; b=YbDyU09RjixcllURSnTj9AOtTJkthR3zdik2TCe8GJ63NmsZdpidHBPpkP2Fwc/8S3hExy 5TYbHCBPogjyvVClKr8uYLouTlYsidvKf0dG2lAIUPrU+4i4dl7oKOQfUZw+cUwuZQl75o CcGkQO7prZgvds2DfpW8igyeWaN8NAOXNEgZR+URfuxI152ktnQXddH7M/QsRQcjxMs4Gc eVuTDqIwbEyi6EEagS1s/bSn2SMKuOZnjhBkbNPJmRi7NQk0VPhfLxzzAnyhaXNIiJYULK 6nG8vFYzZ1HeJFpIfbLs5WMjsMYhTjOSFmh/lwb96Ap5Lo5K69rLnTdk5oGmaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686179741; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lZqlqeDQB5ao7y/pXatcDzeSyxnaEWf2AgN40cq0Sx0=; b=CcdYbTHIX+AzCWKpE6Id3NBfJ2mSb1wEDCJb8N6FUADMrfmye41ECjCUxj2h8E2Fx4RdSM ZhuQffxIqNHbrubG9tA/GfOmhdVr24nPgzY0zZ4hC7bSAk7O5DtKKFUqVxIEtFWmrJazLc xESQUu49P0VWGPtr0dVI9OpwXpMFsWEkGKgirj8Tb4GCNIRzEvj1u2WFBdJZz1KkDAuOK/ xf19mZaPkFKczZ+Yf/AOAKb/H+Qa6nW2fAtQ9rsDqd7RB1iCUqayjQ1SRLckpRM3vYpQz8 eroFhQ++hfsmX/G8ldZBIdgkvptM6Yw12uLVhxCrx+OIYDejEauocIoTgxE+Zg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686179741; a=rsa-sha256; cv=none; b=rrJxSjAdIxg6NmCIUlebtTBUqGkwAymTbveB7meWeXoxZa8vxZHa8vAPtVJPgSQmZBAvbU nh+eXcrWED4JhSwYgjW0IAjU/jcCJgAnuPfIRXTD3E1UggIHUcO3L/2qvDDre+z/okacH1 vGXwtBqxAhuFHq7WXOpGlQ4o5tp084kdVxoxbqWlJZRrarrIawzKmmsHe5R5H+4nV2fx9u tluFVWexmc++e1dDTeVNM/aiTOqbWonPGVx+2l7jQdDubAW8+PCSsgvqGorr1PKGuOoxmw k1GxuNGfbfepu8EL+GT2ydY1Xz1XuWgOAGD1PTIZeNls6kVIGe8Yvj1hFK/Smw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Qc39T2tPTzWQv; Wed, 7 Jun 2023 23:15:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 357NFfZX048505; Wed, 7 Jun 2023 23:15:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 357NFfup048504; Wed, 7 Jun 2023 23:15:41 GMT (envelope-from git) Date: Wed, 7 Jun 2023 23:15:41 GMT Message-Id: <202306072315.357NFfup048504@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: 95fc911fe9f2 - stable/13 - Updates to UFS/FFS superblock integrity checks when reading a superblock. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 95fc911fe9f258ab9baa6b9fa1b1643f86b103b6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=95fc911fe9f258ab9baa6b9fa1b1643f86b103b6 commit 95fc911fe9f258ab9baa6b9fa1b1643f86b103b6 Author: Kirk McKusick AuthorDate: 2023-06-07 23:12:12 +0000 Commit: Kirk McKusick CommitDate: 2023-06-07 23:12:12 +0000 Updates to UFS/FFS superblock integrity checks when reading a superblock. Reported-by: Robert Morris PR: 271351 Sponsored-by: The FreeBSD Foundation (cherry picked from commit c79a1416955a260424a5dd2013b114ff864bc926) --- sys/ufs/ffs/ffs_subr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/ufs/ffs/ffs_subr.c b/sys/ufs/ffs/ffs_subr.c index 4ba452b05ec9..813736c9d070 100644 --- a/sys/ufs/ffs/ffs_subr.c +++ b/sys/ufs/ffs/ffs_subr.c @@ -505,7 +505,8 @@ validate_sblock(struct fs *fs, int isaltsblk) CHK(fs->fs_csaddr, <, 0, %jd); CHK(fs->fs_cssize, !=, fragroundup(fs, fs->fs_ncg * sizeof(struct csum)), %jd); - CHK(dtog(fs, fs->fs_csaddr), >, fs->fs_ncg, %jd); + CHK(fs->fs_csaddr + howmany(fs->fs_cssize, fs->fs_fsize), >, + fs->fs_size, %jd); CHK(fs->fs_csaddr, <, cgdmin(fs, dtog(fs, fs->fs_csaddr)), %jd); CHK(dtog(fs, fs->fs_csaddr + howmany(fs->fs_cssize, fs->fs_fsize)), >, dtog(fs, fs->fs_csaddr), %jd); From nobody Thu Jun 8 01:06:18 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Qc5d62J6yz4c0h2; Thu, 8 Jun 2023 01:06:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Qc5d61gnTz3kYq; Thu, 8 Jun 2023 01:06:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686186378; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VlL03gOBO/p7CbqznPitxHlGFQ9SRS6cH99fwqpTf7s=; b=fQ4mB+EwYI1c84x68R2gi7C7TwT2k8tQ3RmN0jHz6yRUtbMMNF0NqOBYcrDbaLnPIEWdTT BTTvn5ezo6SrctBde4xL44puwsZTJ0cvW1JHqZH3nTfP8BRS7iL9M3faYDHuIRhLtBh2vT 8oEd759PkoQXlNaUHyxL/uFFVGDnl6p3Bzj3RiNMR08Z+N/fDTbYhsqBPyayCW/VbSSkP4 g6CvYDjZaRjEkZ7CwP/sGa62CaWjHCz4rrkIKuJGuGo14JO7ZdONHD4L2xKo6WqGQH6w+T TJ7VQgaZny/tGP1gxz+PJSYtsgIgPp+xUstBu+t6DLVqHtZmZw2cyAY2NuN1LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686186378; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VlL03gOBO/p7CbqznPitxHlGFQ9SRS6cH99fwqpTf7s=; b=ELVEL4fRc6Vk+TM4ENA79UdaLVxo+EpJWae41M1zgNxtsRUp1bkyr2ngaenC+IB3924B4t 4U96IPyOxenS66nR4augQFz3gex4s4dBShx9LBiWLElEa48F0kHsEJguVESH9hpwi+F/0h ziU8INlrpOdZ0sqpDFpQyOqmaugimhY1tcbuGMLNvx4FIOfSpPKsxSh6aM0Re/57uDnVHS 0LTchcj+UH4eI9uoHwq0L2oE+Q+jqDNVIDnNyxUG+O6x9CTvpPGOu2ySVTJrcgv7T17NNa +wZZZJMMqxV8edG5bNWlZihEemhF9/2MrxA1gNMo8R1/sNsuhXr9M2Op74/PPg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686186378; a=rsa-sha256; cv=none; b=TCOO4jfLxCD38Nf9fb2nBVhFoD6tvg6HLUuK3DVx4ci68SzU2U7hjhe8qo2jtIUwCBmCLM CKQCj1x9B7ZgmjYbm4lYeeN/SyCxXEeRrUpcyhdcRyKtTbErknPk4umgKNrRf870GSAN5U 0RHUVLIcSFjg3S/jGFF6KMI9M+1jzLiEcke1oujax880QenkRASJsAI9K1wQh1lU5cXAUC qvATTOqBu5hD/ufCAX5KIOTp26EoFw7uwmsA9sV7B8o2PT/spt06Co7LNWnO9FgT8XHHde 6b5MPkxLHz2pnIoJ1Fr9Zh2RqAINV3C6NxsuweTTaUFWiqvnGEMlR7kkSRe9kQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Qc5d60kf4zZ3h; Thu, 8 Jun 2023 01:06:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 35816IUt030757; Thu, 8 Jun 2023 01:06:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 35816I1F030756; Thu, 8 Jun 2023 01:06:18 GMT (envelope-from git) Date: Thu, 8 Jun 2023 01:06:18 GMT Message-Id: <202306080106.35816I1F030756@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Xin LI Subject: git: 1232c7884d4a - main - od(1): Fix skip value handling List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1232c7884d4a9bc69d4dd71cd293f92bb1ae6197 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=1232c7884d4a9bc69d4dd71cd293f92bb1ae6197 commit 1232c7884d4a9bc69d4dd71cd293f92bb1ae6197 Author: Xin LI AuthorDate: 2023-06-08 01:06:07 +0000 Commit: Xin LI CommitDate: 2023-06-08 01:06:07 +0000 od(1): Fix skip value handling POSIX defines -j as the number of bytes that od(1) should skip over the concatenated input files. The existing code tries to implement this behavior by checking if the current address was smaller than the skip value. However, this is not correct, because we adjust both the skip value and the address at the same time when we do fseeko (when file is seekable) or getchar (when file is not seekable). This commit fixes the problem by expecting the skip value to be zero upon return of next(). If the condition is not satisfied, a diagnostic message will be issued. Reported-by: Mohamed Akram Reviewed-by: emaste PR: 271832 MFC-after: 2 weeks Differential Revision: https://reviews.freebsd.org/D40446 --- usr.bin/hexdump/display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/hexdump/display.c b/usr.bin/hexdump/display.c index cad548e1ec41..36306ededfc6 100644 --- a/usr.bin/hexdump/display.c +++ b/usr.bin/hexdump/display.c @@ -263,7 +263,7 @@ get(void) * block and set the end flag. */ if (!length || (ateof && !next((char **)NULL))) { - if (odmode && address < skip) + if (odmode && skip > 0) errx(1, "cannot skip past end of input"); if (need == blocksize) return((u_char *)NULL); From nobody Thu Jun 8 01:59:22 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Qc6pL71TDz4ZfVk; Thu, 8 Jun 2023 01:59:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Qc6pL6LRqz3qF0; Thu, 8 Jun 2023 01:59:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686189562; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mH+NjnC35uROMCHVY2nhoLNB+W63PDxEXckImepI2Qg=; b=pu+GgnwMvtjl0I6ulWGnxwSWBdpLB3pp48C9c02Gyz3vya9qeEtICGzz6inty+uj489pWX SizVxQeKdSGk8PPdX2EU1Hnxt6l+gCaFs0jtAsF6zrN+iJzrdwdtx4j1b9ofG+zp1UZkfk RYhQo5oy8oUCfnLUeXaQZwYWy6+me2ajMOEaHXEGaAAEtiqTDcfhPt8iyDLNvrz+7E89nB xKB9NUF22vs0Qb4voOldAFRYlm0CanaM2tGe3ph2iM/Dn0SEWsSwJ2KUKAoTKZruSNoI01 EXN1AUahEi+vCx7mkI5es9VIulfLgRZz8c1/0yXDhAHkKWgsxF/QG/wDy1irqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686189562; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mH+NjnC35uROMCHVY2nhoLNB+W63PDxEXckImepI2Qg=; b=h1Wd/rYxw9D+2i1iCGcWXcUkXVwi0w4wBnttNzrJ3uNiReF8mRpXpHbJ7aXXghVyGWBjD7 Z3bQX+5Fmx8b3ZgE6aYsQzdmh9G/F2TVKKTXLCDS5ckpbbgiENyJzUkh3avHvgE5UrC7d2 z2eoYeCUXOyuSVZHj/kcZzD7n3kkDkMLJ3S7mtLo1kPLoEcWzQJHD52dw16nap8FgQLW3D hWOvJ0jVuE7aNoUWMy4X0wcMidHgF/q0Mo6ZZujJTd5v2j+KIIXR3X4UlMU62taQJwxAja k1l3R03L6lIWPhXK6+WcM188qn+t6NcsbYNE8rUTJZvW2ogZM23sKdMm+bN2mw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686189562; a=rsa-sha256; cv=none; b=ZHDZO4n2P74sLgZmEhuNFLJ0Fe2tbb4mZTJ4mLqzVgNgBK92sey5IolETLl/ZRIsM7siCo aEAjEoTnrEy/Fzr6gbe663HXSzMd6/LHQj4QmLqT7auQbGBl8WhRX5FEjUMumzOxzhpbqZ VsSPCq8rvSkL1pqCoqnA5sQnpIFkq/ENYXp0sLFUuEXuqoVWsyU8p89iVXmi67t6RaurIF dfNVOF1nVUWjfYqA0AG9T2bfES6wrLXdaqKeqcb8g/9vKLrv16MDeTFd1hkO7QVI8PC50M +K3Qc7DfnW3RTiX/42mEIbDkXPTQP5ITL/bAYNmkQmUTTLaIn72bYTTVTKYrqQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Qc6pL566WzbJh; Thu, 8 Jun 2023 01:59:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3581xMCV012859; Thu, 8 Jun 2023 01:59:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3581xMYL012858; Thu, 8 Jun 2023 01:59:22 GMT (envelope-from git) Date: Thu, 8 Jun 2023 01:59:22 GMT Message-Id: <202306080159.3581xMYL012858@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Joseph Mingrone Subject: git: 1cdec2832d05 - main - ndp: Prepare for pending tcpdump update List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1cdec2832d051ddcb1417f3f2601e6212aff2613 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jrm: URL: https://cgit.FreeBSD.org/src/commit/?id=1cdec2832d051ddcb1417f3f2601e6212aff2613 commit 1cdec2832d051ddcb1417f3f2601e6212aff2613 Author: Joseph Mingrone AuthorDate: 2023-06-07 02:21:27 +0000 Commit: Joseph Mingrone CommitDate: 2023-06-08 01:57:20 +0000 ndp: Prepare for pending tcpdump update ndp makes use of gmt2local, however that library has been removed from tcpdump. Add utc_offset() as a substitute. Reviewed by: emaste, jhb, melifaro Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40445 --- usr.sbin/ndp/Makefile | 6 ++---- usr.sbin/ndp/ndp.c | 20 ++++++++++++++++++-- usr.sbin/ndp/ndp_netlink.c | 1 - 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/usr.sbin/ndp/Makefile b/usr.sbin/ndp/Makefile index 1722f4a5a2ef..f66c4ec846a8 100644 --- a/usr.sbin/ndp/Makefile +++ b/usr.sbin/ndp/Makefile @@ -15,15 +15,13 @@ .include -.PATH: ${SRCTOP}/contrib/tcpdump - PROG= ndp MAN= ndp.8 -SRCS= ndp.c gmt2local.c +SRCS= ndp.c LIBADD= xo -CFLAGS+= -I. -I${.CURDIR} -I${SRCTOP}/contrib/tcpdump +CFLAGS+= -I. -I${.CURDIR} CFLAGS+= -D_U_="" .if ${MK_EXPERIMENTAL} != "no" diff --git a/usr.sbin/ndp/ndp.c b/usr.sbin/ndp/ndp.c index 23e186466c22..112fd099e3e0 100644 --- a/usr.sbin/ndp/ndp.c +++ b/usr.sbin/ndp/ndp.c @@ -98,6 +98,7 @@ #include +#include #include #include #include @@ -107,11 +108,12 @@ #include #include #include +#include #include #include #include #include -#include "gmt2local.h" +#include #include "ndp.h" @@ -181,6 +183,20 @@ valid_type(int if_type) return (false); } +static int32_t +utc_offset(void) +{ + time_t t; + struct tm *tm; + + t = time(NULL); + tm = localtime(&t); + + assert(tm->tm_gmtoff > INT32_MIN && tm->tm_gmtoff < INT32_MAX); + + return (tm->tm_gmtoff); +} + int main(int argc, char **argv) { @@ -188,7 +204,7 @@ main(int argc, char **argv) char *arg = NULL; pid = getpid(); - thiszone = gmt2local(0); + thiszone = utc_offset(); argc = xo_parse_args(argc, argv); if (argc < 0) diff --git a/usr.sbin/ndp/ndp_netlink.c b/usr.sbin/ndp/ndp_netlink.c index a34359a4343f..ace3e5e5fa11 100644 --- a/usr.sbin/ndp/ndp_netlink.c +++ b/usr.sbin/ndp/ndp_netlink.c @@ -33,7 +33,6 @@ #include #include #include -#include "gmt2local.h" #include From nobody Thu Jun 8 04:23:41 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QcB0s25LKz4bNcl; Thu, 8 Jun 2023 04:23:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QcB0s1gPCz49Nl; Thu, 8 Jun 2023 04:23:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686198221; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SgflMWeeafnrhTjH2UVagyNzfgyUjzS9Bnr6hNX6cUU=; b=jrC6+vQ4ve29whRXi3n4pjLacLivccE6zaDDRNth1NC5ERTvAyIBMGDISWgNdbUpZIPDrK eLRGvHEpSysaYSnNAz7DmQSEzIBamyNeP9JC+nBNc1aUp7yPTMlx86rPtO9rwB470SWGaR HZn1QZaNgVjO/jrzMd2Ei+uSjJ2MYU/ONpB1A77Kg6cBfZWHcynkPCSQ8GB73zc1J8JqZQ CGZdYH06y3Pmc5AZA5VmAhNysKRehjhvX4K/pnsQ1P6/9pDEQQDbyZFXbeQiCrAFlKOVwm cAg/3tg8gK5ApjzleHaQcXHIzF34am1cpPUVN0q3kzoDmqx7tMuUAt+Wscc/fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686198221; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SgflMWeeafnrhTjH2UVagyNzfgyUjzS9Bnr6hNX6cUU=; b=iV2dt1ObRn07KyepUAMMYVAhQVPaWNm/3o9nGbFWbiNjgVo24g2g4ICJtSFwqhyojZ0LPs Hvf248csIKDjgxVuJQ0E13u63HW/h2USuuEWoF1A2QPqLXsV7hstBuXb5cKqC1MzCrtm4K bKdkQrli0cAh/AYKVsnJq37BHfFyljzA1eXnkxFmJPVQvW5kK90Gw7ftxiVeFsJSZAuwGW pLU6HfTxpwcgUBQz2267lp4CtK99zzXxyf5tENsFkSrL905FXGM1r9IiTEJ7dUOikzaIxy hMbHixsEk/4BhVhuM0puztPKYfckTTWJc/oHJkmGMy3tjn4OfhW0PYvnyl7PwA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686198221; a=rsa-sha256; cv=none; b=kASBL24wjpu4BA4kC2kEGD+t7LV6bFpjLi6zScaNHO7iAiIku5Ey+WjiCJIKtDzuBpujt9 ZQcjL3uuhGi9BHwtvC4smtO7Xb2H+3ye9djJrR4OioGuKdTeK+iIa+KHBcz2ACcsMoKEOp kyYqwapEJxVYFYR6EEBQENChAUzx4sCcY5dw4owPn5wKSPHuuUDhuBLbhqjyD4GSeD6fEp xHCfKr7g5XuqBoLbffDW9z7mv8oYSZO/PvcMWstSUnpnDYN4UwQdqLrELt6RvdAHo+22he ecvzBIiUf5jiSSavBOQWSRcEUblHEjFeeeiTSIG4kFZv+BzbYKlMNI/wV7gFRQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QcB0s0mGhzg7Z; Thu, 8 Jun 2023 04:23:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3584NfTx062124; Thu, 8 Jun 2023 04:23:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3584NflZ062123; Thu, 8 Jun 2023 04:23:41 GMT (envelope-from git) Date: Thu, 8 Jun 2023 04:23:41 GMT Message-Id: <202306080423.3584NflZ062123@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: 267411d164d4 - main - EC2: Chase awscli package rename List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 267411d164d4d38a701599e3afe8d9e9261f65dd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=267411d164d4d38a701599e3afe8d9e9261f65dd commit 267411d164d4d38a701599e3afe8d9e9261f65dd Author: Colin Percival AuthorDate: 2023-06-08 04:22:25 +0000 Commit: Colin Percival CommitDate: 2023-06-08 04:23:26 +0000 EC2: Chase awscli package rename MFC after: 1 week --- release/tools/ec2.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/tools/ec2.conf b/release/tools/ec2.conf index 34b83fa627b6..eb14337f5703 100644 --- a/release/tools/ec2.conf +++ b/release/tools/ec2.conf @@ -63,7 +63,7 @@ vm_extra_pre_umount() { # The AWS CLI tools are generally useful, and small enough that they # will download quickly; but users will often override this setting # via EC2 user-data. - echo 'firstboot_pkgs_list="awscli"' >> ${DESTDIR}/etc/rc.conf + echo 'firstboot_pkgs_list="devel/py-awscli"' >> ${DESTDIR}/etc/rc.conf # Enable IPv6 on all interfaces, and spawn DHCPv6 via rtsold echo 'ipv6_activate_all_interfaces="YES"' >> ${DESTDIR}/etc/rc.conf From nobody Thu Jun 8 07:51:06 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QcGcB2sJ4z4byjQ; Thu, 8 Jun 2023 07:51:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QcGcB1xG1z3LPm; Thu, 8 Jun 2023 07:51:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686210666; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6ZS5QTKdaIxcEeLhfX9b4LQUPwZpUmqYSkkUFTi89HU=; b=Z6+o69G9UajHAAXJLiZEyggf0nEuZh6SODp7nMolHnhrcu6yUiiLfTqA2XlfFHj0bAnhUm EO/lsIFs/OnQ7iP9FkbJ8QGb6dZ7BITqXJw3S9J0cIB00jlkgYkBZ69AgIraBUG+OaGib7 hLetI2BT1PnK1OrAyorwLqRp6qcAu0Vpd7hqQPQCpYY3BoYV8HpgfPV/lXCdape92JXQjx XeZgb4zKbV4HWmdU9ubQ8maUehtb4ZwHcwCHdVBLa6PXrFFMX6Cj3zkgxWEq2NT0Gkft+P zouBFYiLH0igLl9us26h71u7cIxFZL865tf5MHm7Gw5PUa5FnnTDcR8Ot5xQpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686210666; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6ZS5QTKdaIxcEeLhfX9b4LQUPwZpUmqYSkkUFTi89HU=; b=EAgqLI1OisGT6DHUV/oSw6L+4qXTRVnsLZypBdU+nE8VdTZYay6UbMqT/PR7xwBJ4uo7+2 TB+saY7YXfSVUUsUcGDmb3jy45L4Uu+aDX0jtBtEK1ZA9nDIqDtpRYmXBxyPSM4zxG3izd wWHjXZVfq62X57eADTKvZOV+1T70714TFv6K/N3+1clVZE0GWtLqwYk9unBsOK01mCHwEm w/oiuIJOTEkAhPjt1Jzht/3c4/zFJrHspH0R96pNOGPoBquUvZMe7XJuY463FAONkETHsf QDiUAZLtPd+9le8SE2I89dUhqb4TFDYy+xkNfYb8CMbgXNpz87v/CQD6WqHkyQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686210666; a=rsa-sha256; cv=none; b=hmrlbpwF18dRAVuJ6T/5hNL+LIIazQp81ja+J65ePRkkI/lw9ctW5gjMthj3NHuGtWSDsx 7ku/BN0NG6jT2ZAP+hGYVu7sogtAOxC5lGwwIHz9geQTvXlcSpwwxTNxa80zhTHiMqQ4hB w2S28RNY+1pL5qNQRXXI6jqeJpQIh8x3WxgbfnJnd1W5fFUY1V7D9aacx5EW5NHzOIKND5 f5bKcodg9SAj34KhxfvToWnlmxojI+s3jBSXdxeoWUtjcC5qWdP8lAo/+th6iR8Uvx8sdJ LzDw3HgKpiFcNn0BbR8ehUAea7fb41aJst+LyE/AVcHAirfgJcEw2pZwvvJtbg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QcGcB1135zls1; Thu, 8 Jun 2023 07:51:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3587p6QB002455; Thu, 8 Jun 2023 07:51:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3587p6xe002454; Thu, 8 Jun 2023 07:51:06 GMT (envelope-from git) Date: Thu, 8 Jun 2023 07:51:06 GMT Message-Id: <202306080751.3587p6xe002454@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Holm Subject: git: 6b7a06c3bdbc - main - stress2: Avoid using "__unused" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pho X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6b7a06c3bdbc17bc5ac450023bd0baadfaeefa78 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=6b7a06c3bdbc17bc5ac450023bd0baadfaeefa78 commit 6b7a06c3bdbc17bc5ac450023bd0baadfaeefa78 Author: Peter Holm AuthorDate: 2023-06-08 07:49:52 +0000 Commit: Peter Holm CommitDate: 2023-06-08 07:49:52 +0000 stress2: Avoid using "__unused" --- tools/test/stress2/misc/reaper2.sh | 8 ++++---- tools/test/stress2/misc/reaper3.sh | 11 +++++------ tools/test/stress2/misc/reaper4.sh | 11 +++++------ 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/tools/test/stress2/misc/reaper2.sh b/tools/test/stress2/misc/reaper2.sh index 1643e9985240..ee9cf927f1d9 100755 --- a/tools/test/stress2/misc/reaper2.sh +++ b/tools/test/stress2/misc/reaper2.sh @@ -65,8 +65,9 @@ test(void) { struct procctl_reaper_kill killemall; pid_t pid; time_t start; - int data[20], e, n __unused, m; + int data[20], debug, e, n, m; + debug = 0; /* set to 1 for debug output */ n = m = 0; if (procctl(P_PID, getpid(), PROC_REAP_ACQUIRE, NULL) == -1) err(EXIT_FAILURE, "Fail to acquire the reaper"); @@ -94,9 +95,8 @@ test(void) { if (waitpid(pid, NULL, 0) != pid) err(1, "waitpid()"); } -#if defined(DEBUG) - fprintf(stderr, "n = %d out of %d\n", n, m); -#endif + if (debug == 1) + fprintf(stderr, "n = %d out of %d\n", n, m); _exit(0); } diff --git a/tools/test/stress2/misc/reaper3.sh b/tools/test/stress2/misc/reaper3.sh index 90bb395da5c1..59012d2c45ca 100755 --- a/tools/test/stress2/misc/reaper3.sh +++ b/tools/test/stress2/misc/reaper3.sh @@ -59,14 +59,13 @@ flip(void *ap, size_t len) { unsigned char *cp; int byte; - unsigned char bit, buf, mask, old __unused; + unsigned char bit, buf, mask; cp = (unsigned char *)ap; byte = random_long(0, len); bit = random_long(0,7); mask = ~(1 << bit); buf = cp[byte]; - old = cp[byte]; buf = (buf & mask) | (~buf & ~mask); cp[byte] = buf; } @@ -86,8 +85,9 @@ test(void) { struct procctl_reaper_kill killemall; pid_t pid; time_t start; - int data[20], e, n __unused, m; + int data[20], debug, e, n, m; + debug = 0; /* set to 1 for debug output */ n = m = 0; if (procctl(P_PID, getpid(), PROC_REAP_ACQUIRE, NULL) == -1) err(EXIT_FAILURE, "Fail to acquire the reaper"); @@ -118,9 +118,8 @@ test(void) { if (waitpid(pid, NULL, 0) != pid) err(1, "waitpid()"); } -#if defined(DEBUG) - fprintf(stderr, "n = %d out of %d\n", n, m); -#endif + if (debug == 1) + fprintf(stderr, "n = %d out of %d\n", n, m); _exit(0); } diff --git a/tools/test/stress2/misc/reaper4.sh b/tools/test/stress2/misc/reaper4.sh index bd30bd1b0efd..0fdb3f75ccff 100755 --- a/tools/test/stress2/misc/reaper4.sh +++ b/tools/test/stress2/misc/reaper4.sh @@ -59,14 +59,13 @@ flip(void *ap, size_t len) { unsigned char *cp; int byte; - unsigned char bit, buf, mask, old __unused; + unsigned char bit, buf, mask; cp = (unsigned char *)ap; byte = random_long(0, len); bit = random_long(0,7); mask = ~(1 << bit); buf = cp[byte]; - old = cp[byte]; buf = (buf & mask) | (~buf & ~mask); cp[byte] = buf; } @@ -85,8 +84,9 @@ test(void) { struct procctl_reaper_kill killemall; pid_t pid; time_t start; - int data[20], e, n __unused, m; + int data[20], debug, e, n, m; + debug = 0; /* set to 1 for debug output */ n = m = 0; if (procctl(P_PID, getpid(), PROC_REAP_ACQUIRE, NULL) == -1) err(EXIT_FAILURE, "Fail to acquire the reaper"); @@ -117,9 +117,8 @@ test(void) { if (waitpid(pid, NULL, 0) != pid) err(1, "waitpid()"); } -#if defined(DEBUG) - fprintf(stderr, "n = %d out of %d\n", n, m); -#endif + if (debug == 1) + fprintf(stderr, "n = %d out of %d\n", n, m); _exit(0); } From nobody Thu Jun 8 08:02:28 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QcGsJ6cGCz4c0nf; Thu, 8 Jun 2023 08: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QcGsJ63t9z3MQD; Thu, 8 Jun 2023 08: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=1686211348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O1NymtV17DJFb6565YrpKQEqA0GiMFV3W+rfIz0yG4g=; b=H490SDZ8ucU8gu9S2Ot9LG6pSzuxTP5hS+fxuQoCT44tRUepE9EaV1jFwUrGP5ke3N0Jvq RFa1fdTfrL4ze/VijoUQS5jQdh56onJZkfH4NRLsU4Pv//hF0kxIMX2gKzzCt6P+UE6nSI MbZ76SEVH5zu1NTxPU0Vhdk2yZSwPfNl1bYRyluV2WneBu3sMeU23zz+Xj5/k8CJ2y/W/O LZsGOxpNQhWDpCOIaMtFb0EzJZbA5kYqIzNwcQ2hux4iPkUgr4M1cyqKQYveDJc1m87vF4 Zi0G3tP1UKK7vB0Yrz1cRdh92cYf7SolGy9YQxvoZoTzmxEhF0hrtmjI9VeIGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686211348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O1NymtV17DJFb6565YrpKQEqA0GiMFV3W+rfIz0yG4g=; b=qOdgmmptFxVFmXVxLv56rTi3vOKqOJw+Rp3pXF0Xd98y72JK8JD9rQfQgk3xqvziyhQCnu GD3mfJR8n0NFPmXQy7Nd+ybm9XrBna1aJ7MYErODU4pYIdQlKMEIZDK8Tl6UnMYgflpP2v NhUkxSeYIkXQ2n7iL6evlXMDW80hOJFUluUnKluZmKAf51djHaxRUD9PFrOAhxrmvTmSPL /qBpkTzrWlHJTyIp5juwi8MuRK0awmp6SKreMFy4Ve3ROT8ObKRD4uRPwdPgUb8cw2uMyS C6kLay/+k7d5OfcO3ecq+cikhGMGyjqNqix9dmBgnC6mCNh+jFe8HWrfJmSXLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686211348; a=rsa-sha256; cv=none; b=WV/XjUfzsmi8dPw7kFiZ1NeHLKyxdDigovDqonRTyITS258uzP1V7s1UUQCm45LsxXNCqQ 7arwOnjfgetVdgk9oibuaZoodlAjZzrFENByYb7LAULKppdpl91XxkJDolFh29HGYL1pFG rhhdqMu791dhn9muiSA86/RPOvBo78+acczKxO1ssJdlCe3KXa0Cr/QxVnT1tXx+vmETLD rNlnPZcwn3KLy/uNJIyb71TkNNtXyIx3w+6opyKCQ2ep/4ZFo6PVnGCdxD9NskX538W8Ck WX8/imU3MooGLC7t7fjbxNtpsp/83sG1q2RiFUU8TGpOsRXrVk/aLPTTaCb+Qg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QcGsJ596tzm5G; Thu, 8 Jun 2023 08:02:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 35882SIm024335; Thu, 8 Jun 2023 08:02:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 35882SQZ024334; Thu, 8 Jun 2023 08:02:28 GMT (envelope-from git) Date: Thu, 8 Jun 2023 08:02:28 GMT Message-Id: <202306080802.35882SQZ024334@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: d2565dc8022d - stable/13 - nfsstat.1: Add a missing argument to -w List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d2565dc8022d85b1d1be1221bae275ae60644c1a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=d2565dc8022d85b1d1be1221bae275ae60644c1a commit d2565dc8022d85b1d1be1221bae275ae60644c1a Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2023-06-05 12:32:46 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2023-06-08 08:02:24 +0000 nfsstat.1: Add a missing argument to -w MFC after: 3 days Sponsored by: Klara Inc. (cherry picked from commit 979754a15ae4c507cd739163331cbaef7b100e23) --- usr.bin/nfsstat/nfsstat.1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.bin/nfsstat/nfsstat.1 b/usr.bin/nfsstat/nfsstat.1 index 4a37fdc7529a..892e675390b3 100644 --- a/usr.bin/nfsstat/nfsstat.1 +++ b/usr.bin/nfsstat/nfsstat.1 @@ -28,7 +28,7 @@ .\" From: @(#)nfsstat.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd December 31, 2019 +.Dd June 5, 2023 .Dt NFSSTAT 1 .Os .Sh NAME @@ -53,7 +53,7 @@ If you wish to compare RPC counts between NFSv3 and NFSv4, you must use statistics in the client(s). .Pp The options are as follows: -.Bl -tag -width indent +.Bl -tag -width "-w wait" .It Fl c Only display client side statistics. .It Fl d @@ -111,7 +111,7 @@ useful when combined with or .Fl s and a time delay. -.It Fl w +.It Fl w Ar wait Display a shorter summary of .Tn NFS activity for both the client and server at From nobody Thu Jun 8 10:57:15 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QcLkz58N9z4bM21; Thu, 8 Jun 2023 10:57:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QcLkz4ql8z3y03; Thu, 8 Jun 2023 10:57:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686221835; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TetPygu6m1Z9iAJnNijkdQ5HG65scIVutHCHdIDCDh0=; b=ZzhHlHuzAvvdtgHuo+78PYbWGQB0Ox9RZNgdxsgvo4qN7kUJPzkmbPTH6VYkVG3FTFnFmd FP99pvg63QgoB5J2mGS049aYvpKK+8WvQz5+0D8Eu7vvWpGZaKUaa7owt+ygUuwaUMUQYQ ZZQzkjxfaO8GCmyfdlHOUx/KyVSN5ysvc94eVGRNWj2mbdJ3eKCteYgHaxaPinbsEyFL2y Z/F8ZIC9tZRc/2qEtJ+rLP3T9nwe5oOL7Qkrekl9q0YLqj+TpFKAGHE94lTZ2AmPeS5mNt yVHlSoir1DiD8o4mqCnVEMeWxXr0hf2ASHe/iBTCAhg7ZE4yoGDx1c1qXl1j4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686221835; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TetPygu6m1Z9iAJnNijkdQ5HG65scIVutHCHdIDCDh0=; b=oBEO39YVQWnvlVwEdMs0H7UXZnidpd1eU9SEHglf+8tro6SYnKSURFimVTBtccWI+k23p2 KpVtyC0TCq9xL7dVMEdQpcNnrm25D1nmACO3AK9WiyeD+pbjQLuYUETZ9ifUGZZImuC5PS JIkoDhyHyOSFceJOaNU+whaAfuv8wHKiJtmhyitjkqyB2MCzn0sbp7kI9NbdAowSQqyI8S dKjJ6lj4zYG8rSf+LujGWDIM+SpjS8uCQvSrLILr/TFwgHnzBs5TaApZJMC3ylBpQ2rKOP 4UFNgoyp8aRP3X3dDiEUsXB0CmoqDVYplLqvz3mTzlb26O2XtFJKMMCjQDGfXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686221835; a=rsa-sha256; cv=none; b=KPWcRqoZxBFci3AmLPrITLHoTnb2mruHwhHDWwaAeRCJ3ixNqKaauzMDIc3sJ57lg1jJcC 2i4Y/J9I35AB7zKTcP1mC6NGrCEP+uBZYpr6XAlgfWq109/j/JcemSQ4oYjJhvdX/7NOsm KvwUPLrg2/Za1m35DFSvMx+QoXvX+hMBCbvR0pVxj89dVRMAfQ+VFT8Zb/qQePFajrfqJ0 apjr34IKW15sPq/zF+68YaUuavzrFeSkOc2KDDWJr1Uw1RUuQ/kckLxIYc2FfouY454QOs esKgzYXnTjpyv8w/m6ATK5WJn4fzp29E5nD0MdaJ0sxCS6KD8uaczw+sgum4Kw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QcLkz3wYQzrK0; Thu, 8 Jun 2023 10:57:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 358AvF93004672; Thu, 8 Jun 2023 10:57:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 358AvFd0004671; Thu, 8 Jun 2023 10:57:15 GMT (envelope-from git) Date: Thu, 8 Jun 2023 10:57:15 GMT Message-Id: <202306081057.358AvFd0004671@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Stefan=20E=C3=9Fer?= Subject: git: 46494d4edf98 - stable/13 - vendor/bc: import version 6.3.1 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 46494d4edf9873fb31dc26d088f41482b341510d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=46494d4edf9873fb31dc26d088f41482b341510d commit 46494d4edf9873fb31dc26d088f41482b341510d Author: Stefan Eßer AuthorDate: 2023-02-24 22:14:58 +0000 Commit: Stefan Eßer CommitDate: 2023-06-08 10:56:44 +0000 vendor/bc: import version 6.3.1 This version adds a command to dc to query whether extended registers are enabled or not. (cherry picked from commit 103d7cdfb7435591049413e1bc39482cb316efb7) contrib/bc: import version 6.5.0 This release that fixes an infinite loop bug in the (non-standard) extended math library functions root() and cbrt(), fixes a bug with BC_LINE_LENGTH=0, and adds the fib() function to the extended math library to calculate Fibonacci numbers. (cherry picked from commit 8c48f4c5377ddc3dc55388f181f23111145f7099) contrib/bc: upgrade to version 6.6.0 This update removes printing of a leading zero in scientific or engineering output modes (which are an extended feature of this implementation). (cherry picked from commit 76238846ad3e9e271a3d1f792f72beab727fd153) --- contrib/bc/LICENSE.md | 2 +- contrib/bc/MEMORY_BUGS.md | 5 + contrib/bc/Makefile.in | 12 +- contrib/bc/NEWS.md | 62 +++ contrib/bc/README.md | 18 +- contrib/bc/configure.sh | 34 +- contrib/bc/gen/lib2.bc | 28 +- contrib/bc/gen/strgen.c | 6 +- contrib/bc/gen/strgen.sh | 4 +- contrib/bc/include/bcl.h | 57 +++ contrib/bc/include/lang.h | 7 +- contrib/bc/include/lex.h | 17 +- contrib/bc/include/library.h | 210 ++++++-- contrib/bc/include/num.h | 8 + contrib/bc/include/parse.h | 14 +- contrib/bc/include/program.h | 218 +++----- contrib/bc/include/rand.h | 6 +- contrib/bc/include/status.h | 31 +- contrib/bc/include/vector.h | 4 +- contrib/bc/include/version.h | 2 +- contrib/bc/include/vm.h | 10 +- contrib/bc/manuals/bc/A.1 | 6 +- contrib/bc/manuals/bc/A.1.md | 2 +- contrib/bc/manuals/bc/E.1 | 6 +- contrib/bc/manuals/bc/E.1.md | 2 +- contrib/bc/manuals/bc/EH.1 | 6 +- contrib/bc/manuals/bc/EH.1.md | 2 +- contrib/bc/manuals/bc/EHN.1 | 6 +- contrib/bc/manuals/bc/EHN.1.md | 2 +- contrib/bc/manuals/bc/EN.1 | 6 +- contrib/bc/manuals/bc/EN.1.md | 2 +- contrib/bc/manuals/bc/H.1 | 6 +- contrib/bc/manuals/bc/H.1.md | 2 +- contrib/bc/manuals/bc/HN.1 | 6 +- contrib/bc/manuals/bc/HN.1.md | 2 +- contrib/bc/manuals/bc/N.1 | 6 +- contrib/bc/manuals/bc/N.1.md | 2 +- contrib/bc/manuals/bcl.3 | 424 +++++++++++++++- contrib/bc/manuals/bcl.3.md | 320 +++++++++++- contrib/bc/manuals/dc/A.1 | 12 +- contrib/bc/manuals/dc/A.1.md | 10 +- contrib/bc/manuals/dc/E.1 | 12 +- contrib/bc/manuals/dc/E.1.md | 10 +- contrib/bc/manuals/dc/EH.1 | 12 +- contrib/bc/manuals/dc/EH.1.md | 10 +- contrib/bc/manuals/dc/EHN.1 | 12 +- contrib/bc/manuals/dc/EHN.1.md | 10 +- contrib/bc/manuals/dc/EN.1 | 12 +- contrib/bc/manuals/dc/EN.1.md | 10 +- contrib/bc/manuals/dc/H.1 | 12 +- contrib/bc/manuals/dc/H.1.md | 10 +- contrib/bc/manuals/dc/HN.1 | 12 +- contrib/bc/manuals/dc/HN.1.md | 10 +- contrib/bc/manuals/dc/N.1 | 12 +- contrib/bc/manuals/dc/N.1.md | 10 +- contrib/bc/scripts/exec-install.sh | 6 + contrib/bc/scripts/format.sh | 2 + contrib/bc/scripts/link.sh | 5 + contrib/bc/scripts/lint.sh | 5 +- contrib/bc/scripts/locale_install.sh | 3 +- contrib/bc/scripts/safe-install.sh | 12 +- contrib/bc/src/args.c | 4 +- contrib/bc/src/bc_parse.c | 6 +- contrib/bc/src/data.c | 77 +-- contrib/bc/src/dc_lex.c | 1 + contrib/bc/src/dc_parse.c | 1 + contrib/bc/src/file.c | 4 +- contrib/bc/src/history.c | 4 +- contrib/bc/src/lang.c | 8 +- contrib/bc/src/library.c | 743 +++++++++++++++++++--------- contrib/bc/src/num.c | 95 +++- contrib/bc/src/parse.c | 4 +- contrib/bc/src/program.c | 75 ++- contrib/bc/src/rand.c | 5 +- contrib/bc/src/read.c | 4 +- contrib/bc/src/vm.c | 44 +- contrib/bc/tests/all.sh | 3 +- contrib/bc/tests/bc/all.txt | 2 + contrib/bc/tests/bc/fib.txt | 31 ++ contrib/bc/tests/bc/fib_results.txt | 31 ++ contrib/bc/tests/bc/rand_limits.txt | 284 +++++++++++ contrib/bc/tests/bc/rand_limits_results.txt | 222 +++++++++ contrib/bc/tests/bc/scripts/all.txt | 1 + contrib/bc/tests/bc/scripts/cbrt.txt | 100 ++++ contrib/bc/tests/bc/scripts/root.bc | 19 + contrib/bc/tests/bc/scripts/root.txt | 255 ++++++++++ contrib/bc/tests/bcl.c | 52 +- contrib/bc/tests/error.sh | 8 +- contrib/bc/tests/errors.sh | 8 +- contrib/bc/tests/extra_required.txt | 2 + contrib/bc/tests/other.sh | 120 +++-- contrib/bc/tests/read.sh | 13 + contrib/bc/tests/script.sh | 20 +- contrib/bc/tests/scripts.sh | 5 +- contrib/bc/tests/test.sh | 6 +- contrib/bc/vs/bc.vcxproj | 2 +- usr.bin/gh-bc/Makefile | 43 +- usr.bin/gh-bc/tests/Makefile | 4 +- 98 files changed, 3293 insertions(+), 785 deletions(-) diff --git a/contrib/bc/LICENSE.md b/contrib/bc/LICENSE.md index b65095edc26c..74441065df35 100644 --- a/contrib/bc/LICENSE.md +++ b/contrib/bc/LICENSE.md @@ -59,7 +59,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. The files `src/rand.c` and `include/rand.h` are under the following copyrights and license: -Copyright (c) 2014-2017 Melissa O'Neill and PCG Project contributors +Copyright (c) 2014-2017 Melissa O'Neill and PCG Project contributors
Copyright (c) 2018-2023 Gavin D. Howard Permission is hereby granted, free of charge, to any person obtaining a copy of diff --git a/contrib/bc/MEMORY_BUGS.md b/contrib/bc/MEMORY_BUGS.md index d675b28b342a..12e0b854e9d8 100644 --- a/contrib/bc/MEMORY_BUGS.md +++ b/contrib/bc/MEMORY_BUGS.md @@ -51,3 +51,8 @@ existed in. had properly hooked Valgrind into my `bcl` tests, but I had not. The first version without this bug is `6.0.1`. + +* In version `6.0.0` until `6.2.4` (inclusive) of `bcl`, there is a possible + use-after-free if `bcl_init()` fails. + + The first version without this bug is `6.2.5`. diff --git a/contrib/bc/Makefile.in b/contrib/bc/Makefile.in index 83417a333826..55e2e4a6270a 100644 --- a/contrib/bc/Makefile.in +++ b/contrib/bc/Makefile.in @@ -205,7 +205,7 @@ DC_DEFS = $(DC_DEFS1) $(DC_DEFS2) $(DC_DEFS3) $(DC_DEFS4) $(DC_DEFS5) CPPFLAGS1 = -D$(BC_ENABLED_NAME)=$(BC_ENABLED) -D$(DC_ENABLED_NAME)=$(DC_ENABLED) CPPFLAGS2 = $(CPPFLAGS1) -I$(INCDIR)/ -DBUILD_TYPE=$(BC_BUILD_TYPE) %%LONG_BIT_DEFINE%% CPPFLAGS3 = $(CPPFLAGS2) -DEXECPREFIX=$(EXEC_PREFIX) -DMAINEXEC=$(MAIN_EXEC) -CPPFLAGS4 = $(CPPFLAGS3) %%BSD%% +CPPFLAGS4 = $(CPPFLAGS3) %%BSD%% %%APPLE%% CPPFLAGS5 = $(CPPFLAGS4) -DBC_NUM_KARATSUBA_LEN=$(BC_NUM_KARATSUBA_LEN) CPPFLAGS6 = $(CPPFLAGS5) -DBC_ENABLE_NLS=$(BC_ENABLE_NLS) CPPFLAGS7 = $(CPPFLAGS6) -D$(BC_ENABLE_EXTRA_MATH_NAME)=$(BC_ENABLE_EXTRA_MATH) @@ -239,25 +239,25 @@ $(GEN_EXEC): $(GEN_DIR) %%GEN_EXEC_TARGET%% $(BC_LIB_C): $(GEN_EXEC) $(BC_LIB) - $(GEN_EMU) $(GEN_EXEC) $(BC_LIB) $(BC_LIB_C) $(BC_EXCLUDE_EXTRA_MATH) $(BC_LIB_C_ARGS) + $(GEN_EMU) $(GEN_EXEC) $(BC_LIB) $(BC_LIB_C) $(BC_EXCLUDE_EXTRA_MATH) $(BC_LIB_C_ARGS) "" "" 1 $(BC_LIB_O): $(BC_LIB_C) $(CC) $(CFLAGS) -o $@ -c $< $(BC_LIB2_C): $(GEN_EXEC) $(BC_LIB2) - $(GEN_EMU) $(GEN_EXEC) $(BC_LIB2) $(BC_LIB2_C) $(BC_EXCLUDE_EXTRA_MATH) $(BC_LIB2_C_ARGS) + $(GEN_EMU) $(GEN_EXEC) $(BC_LIB2) $(BC_LIB2_C) $(BC_EXCLUDE_EXTRA_MATH) $(BC_LIB2_C_ARGS) "" "" 1 $(BC_LIB2_O): $(BC_LIB2_C) $(CC) $(CFLAGS) -o $@ -c $< $(BC_HELP_C): $(GEN_EXEC) $(BC_HELP) - $(GEN_EMU) $(GEN_EXEC) $(BC_HELP) $(BC_HELP_C) $(BC_EXCLUDE_EXTRA_MATH) bc_help "" $(BC_ENABLED_NAME) + $(GEN_EMU) $(GEN_EXEC) $(BC_HELP) $(BC_HELP_C) $(BC_EXCLUDE_EXTRA_MATH) bc_help "" $(BC_ENABLED_NAME) 0 $(BC_HELP_O): $(BC_HELP_C) $(CC) $(CFLAGS) -o $@ -c $< $(DC_HELP_C): $(GEN_EXEC) $(DC_HELP) - $(GEN_EMU) $(GEN_EXEC) $(DC_HELP) $(DC_HELP_C) $(BC_EXCLUDE_EXTRA_MATH) dc_help "" $(DC_ENABLED_NAME) + $(GEN_EMU) $(GEN_EXEC) $(DC_HELP) $(DC_HELP_C) $(BC_EXCLUDE_EXTRA_MATH) dc_help "" $(DC_ENABLED_NAME) 0 $(DC_HELP_O): $(DC_HELP_C) $(CC) $(CFLAGS) -o $@ -c $< @@ -548,6 +548,8 @@ clean_config: clean clean_benchmarks @$(RM) -f Makefile @$(RM) -f $(BC_MD) $(BC_MANPAGE) @$(RM) -f $(DC_MD) $(DC_MANPAGE) + @$(RM) -f compile_commands.json + @$(RM) -f $(BCL_PC) clean_coverage: @printf 'Cleaning coverage files...\n' diff --git a/contrib/bc/NEWS.md b/contrib/bc/NEWS.md index 4601db456f86..de3b35026fea 100644 --- a/contrib/bc/NEWS.md +++ b/contrib/bc/NEWS.md @@ -1,5 +1,67 @@ # News +## 6.6.0 + +This is a production release with two bug fixes and one change. + +The first bug fix is to fix the build on Mac OSX. + +The second bug was to remove printing a leading zero in scientific or +engineering output modes. + +The change was that the implementation of `irand()` was improved to call the +PRNG less. + +## 6.5.0 + +This is a production release that fixes an infinite loop bug in `root()` and +`cbrt()`, fixes a bug with `BC_LINE_LENGTH=0`, and adds the `fib()` function to +the extended math library to calculate Fibonacci numbers. + +## 6.4.0 + +This is a production release that fixes a `read()`/`?` bug and adds features to +`bcl`. + +The bug was that multiple read calls could repeat old data. + +The new features in `bcl` are functions to preserve `BclNumber` arguments and +not free them. + +***WARNING for `bcl` Users***: The `bcl_rand_seedWithNum()` function used to not +consume its arguments. Now it does. This change could have made this version +`7.0.0`, but I'm 99.9% confident that there are no `bcl` users, or if there are, +they probably don't use the PRNG. So I took a risk and didn't update the major +version. + +`bcl` now includes more capacity to check for invalid numbers when built to run +under Valgrind. + +## 6.3.1 + +This is a production release that fixes a `bc` dependency loop for minimal +environments and Linux from Scratch. + +## 6.3.0 + +This is a production release with a couple of fixes for manuals and a new +feature for `dc`: there is now a command to query whether extended registers are +enabled or not. + +Users who don't care do not need to upgrade. + +## 6.2.6 + +This is a production release that fixes an install bug that affected locale +installation of all locales when using `mksh`. Users do ***NOT*** need to +upgrade if they don't use `mksh` and/or don't need to install all locales. + +## 6.2.5 + +This is a production release that fixes a test bug that affected Android and +`mksh`. Users do ***NOT*** need to upgrade unless they use `mksh` or another +affected shell and need to run the test suite. + ## 6.2.4 This is a production release that fixes a test failure that happens when diff --git a/contrib/bc/README.md b/contrib/bc/README.md index 9d395f747185..943ca89eee2c 100644 --- a/contrib/bc/README.md +++ b/contrib/bc/README.md @@ -422,13 +422,23 @@ Other projects based on this bc are: * [busybox `bc`][8]. The busybox maintainers have made their own changes, so any bugs in the busybox `bc` should be reported to them. - * [toybox `bc`][9]. The maintainer has also made his own changes, so bugs in the toybox `bc` should be reported there. - * [FreeBSD `bc`][23]. While the `bc` in FreeBSD is kept up-to-date, it is better to [report bugs there][24], as well as [submit patches][25], and the maintainers of the package will contact me if necessary. +* [Mac OSX `bc`][35]. Any bugs in that `bc` should be reported to me, but do + expect bugs because the version is old. +* [Android Open Source `bc`][32]. Any bugs in that `bc` can be reported here. + +This is a non-comprehensive list of Linux distros that use this `bc` as the +system `bc`: + +* [Gentoo][33]; it is a first-class alternative to GNU `bc`, but not exclusive. +* [Linux from Scratch][34]. + +Other Linux distros package it as a second-class alternative, usually as `bc-gh` +or `howard-bc`. ## Language @@ -500,3 +510,7 @@ Folders: [29]: https://github.com/gavinhoward/bc [30]: ./manuals/bc/A.1.md#extended-library [31]: ./manuals/build.md#settings +[32]: https://android.googlesource.com/platform/external/bc/ +[33]: https://github.com/gentoo/gentoo/blob/master/app-alternatives/bc/bc-0.ebuild#L8 +[34]: https://www.linuxfromscratch.org/lfs/view/stable/chapter08/bc.html +[35]: https://github.com/apple-oss-distributions/bc/tree/main/bc diff --git a/contrib/bc/configure.sh b/contrib/bc/configure.sh index 3ada5298e9ed..4ba957131d52 100755 --- a/contrib/bc/configure.sh +++ b/contrib/bc/configure.sh @@ -772,7 +772,7 @@ predefined_build() { dc_default_digit_clamp=0;; GDH) - CFLAGS="-flto -Weverything -Wno-padded -Werror -pedantic -std=c11" + CFLAGS="-flto -Weverything -Wno-padded -Wno-unsafe-buffer-usage -Werror -pedantic -std=c11" bc_only=0 dc_only=0 coverage=0 @@ -806,7 +806,7 @@ predefined_build() { dc_default_digit_clamp=1;; DBG) - CFLAGS="-Weverything -Wno-padded -Werror -pedantic -std=c11" + CFLAGS="-Weverything -Wno-padded -Wno-unsafe-buffer-usage -Werror -pedantic -std=c11" bc_only=0 dc_only=0 coverage=0 @@ -1653,12 +1653,12 @@ else # We are also setting the CFLAGS and LDFLAGS here. if [ "$editline" -ne 0 ]; then LDFLAGS="$LDFLAGS -ledit" - CFLAGS="$CFLAGS -DBC_ENABLE_EDITLINE=1 -DBC_ENABLE_READLINE=0" + CPPFLAGS="$CPPFLAGS -DBC_ENABLE_EDITLINE=1 -DBC_ENABLE_READLINE=0" elif [ "$readline" -ne 0 ]; then LDFLAGS="$LDFLAGS -lreadline" - CFLAGS="$CFLAGS -DBC_ENABLE_EDITLINE=0 -DBC_ENABLE_READLINE=1" + CPPFLAGS="$CPPFLAGS -DBC_ENABLE_EDITLINE=0 -DBC_ENABLE_READLINE=1" else - CFLAGS="$CFLAGS -DBC_ENABLE_EDITLINE=0 -DBC_ENABLE_READLINE=0" + CPPFLAGS="$CPPFLAGS -DBC_ENABLE_EDITLINE=0 -DBC_ENABLE_READLINE=0" fi fi @@ -1682,6 +1682,24 @@ else CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700" fi +# Test Mac OSX. This is not in an if statement because regardless of whatever +# the user says, we need to know if we are on Mac OSX. If we are, we have to set +# _DARWIN_C_SOURCE. +printf 'Testing for Mac OSX...\n' + +flags="-DBC_TEST_APPLE -DBC_ENABLE_AFL=0" +"$CC" $CPPFLAGS $CFLAGS $flags "-I$scriptdir/include" -E "$scriptdir/src/vm.c" > /dev/null 2>&1 + +err="$?" + +if [ "$err" -ne 0 ]; then + printf 'On Mac OSX. Using _DARWIN_C_SOURCE.\n\n' + apple="-D_DARWIN_C_SOURCE" +else + printf 'Not on Mac OSX.\n\n' + apple="" +fi + # Test OpenBSD. This is not in an if statement because regardless of whatever # the user says, we need to know if we are on OpenBSD to activate _BSD_SOURCE. # No, I cannot `#define _BSD_SOURCE` in a header because OpenBSD's patched GCC @@ -1690,7 +1708,6 @@ fi # we have to set it because we also set _POSIX_C_SOURCE, which OpenBSD headers # detect, and when they detect it, they turn off _BSD_SOURCE unless it is # specifically requested. -set +e printf 'Testing for OpenBSD...\n' flags="-DBC_TEST_OPENBSD -DBC_ENABLE_AFL=0" @@ -1713,6 +1730,8 @@ else bsd="" fi +set -e + if [ "$library" -eq 1 ]; then bc_lib="" fi @@ -1801,7 +1820,7 @@ if [ "$library" -ne 0 ]; then contents=$(replace "$contents" "LIBDIR" "$LIBDIR") contents=$(replace "$contents" "VERSION" "$version") - printf '%s\n' "$contents" > "./bcl.pc" + printf '%s\n' "$contents" > "$scriptdir/bcl.pc" pkg_config_install="\$(SAFE_INSTALL) \$(PC_INSTALL_ARGS) \"\$(BCL_PC)\" \"\$(DESTDIR)\$(PC_PATH)/\$(BCL_PC)\"" pkg_config_uninstall="\$(RM) -f \"\$(DESTDIR)\$(PC_PATH)/\$(BCL_PC)\"" @@ -2072,6 +2091,7 @@ contents=$(replace "$contents" "CLEAN_PREREQS" "$CLEAN_PREREQS") contents=$(replace "$contents" "GEN_EMU" "$GEN_EMU") contents=$(replace "$contents" "BSD" "$bsd") +contents=$(replace "$contents" "APPLE" "$apple") contents=$(replace "$contents" "BC_DEFAULT_BANNER" "$bc_default_banner") contents=$(replace "$contents" "BC_DEFAULT_SIGINT_RESET" "$bc_default_sigint_reset") diff --git a/contrib/bc/gen/lib2.bc b/contrib/bc/gen/lib2.bc index 826f8a430cea..ba3f76b1803a 100644 --- a/contrib/bc/gen/lib2.bc +++ b/contrib/bc/gen/lib2.bc @@ -36,7 +36,7 @@ define p(x,y){ auto a a=y$ - if(y==a)return (x^a)@scale + if(y==a)return(x^a)@scale return e(y*l(x)) } define r(x,p){ @@ -93,6 +93,18 @@ define comb(n,r){ scale=s return f } +define fib(n){ + auto i,t,p,r + if(!n)return 0 + n=abs(n)$ + t=1 + for (i=1;i 6 && strcmp("", argv[6]) != 0); define = has_define ? argv[6] : ""; - remove_tabs = (argc > 7); + remove_tabs = (argc > 7 && atoi(argv[7]) != 0); in = bc_read_file(argv[1]); if (in == NULL) return INVALID_INPUT_FILE; diff --git a/contrib/bc/gen/strgen.sh b/contrib/bc/gen/strgen.sh index a65e221ad0b4..2b8927b5528e 100755 --- a/contrib/bc/gen/strgen.sh +++ b/contrib/bc/gen/strgen.sh @@ -62,7 +62,9 @@ name="$4" label="$5" define="$6" remove_tabs="$7" -check_bool_arg "$remove_tabs" +if [ "$remove_tabs" != "" ]; then + check_bool_arg "$remove_tabs" +fi tmpinput=$(mktemp -t "${input##*/}_XXXXXX") diff --git a/contrib/bc/include/bcl.h b/contrib/bc/include/bcl.h index 234fe475f00e..0908e215182c 100644 --- a/contrib/bc/include/bcl.h +++ b/contrib/bc/include/bcl.h @@ -36,11 +36,20 @@ #ifndef BC_BCL_H #define BC_BCL_H +// TODO: Add a generation index when building with Valgrind to check for +// use-after-free's or double frees. + #include #include #include #include +#ifndef NDEBUG +#define BC_DEBUG (1) +#else // NDEBUG +#define BC_DEBUG (0) +#endif // NDEBUG + #ifdef _WIN32 #include #include @@ -232,42 +241,78 @@ bcl_dup(BclNumber s); BclError bcl_bigdig(BclNumber n, BclBigDig* result); +BclError +bcl_bigdig_keep(BclNumber n, BclBigDig* result); + BclNumber bcl_bigdig2num(BclBigDig val); BclNumber bcl_add(BclNumber a, BclNumber b); +BclNumber +bcl_add_keep(BclNumber a, BclNumber b); + BclNumber bcl_sub(BclNumber a, BclNumber b); +BclNumber +bcl_sub_keep(BclNumber a, BclNumber b); + BclNumber bcl_mul(BclNumber a, BclNumber b); +BclNumber +bcl_mul_keep(BclNumber a, BclNumber b); + BclNumber bcl_div(BclNumber a, BclNumber b); +BclNumber +bcl_div_keep(BclNumber a, BclNumber b); + BclNumber bcl_mod(BclNumber a, BclNumber b); +BclNumber +bcl_mod_keep(BclNumber a, BclNumber b); + BclNumber bcl_pow(BclNumber a, BclNumber b); +BclNumber +bcl_pow_keep(BclNumber a, BclNumber b); + BclNumber bcl_lshift(BclNumber a, BclNumber b); +BclNumber +bcl_lshift_keep(BclNumber a, BclNumber b); + BclNumber bcl_rshift(BclNumber a, BclNumber b); +BclNumber +bcl_rshift_keep(BclNumber a, BclNumber b); + BclNumber bcl_sqrt(BclNumber a); +BclNumber +bcl_sqrt_keep(BclNumber a); + BclError bcl_divmod(BclNumber a, BclNumber b, BclNumber* c, BclNumber* d); +BclError +bcl_divmod_keep(BclNumber a, BclNumber b, BclNumber* c, BclNumber* d); + BclNumber bcl_modexp(BclNumber a, BclNumber b, BclNumber c); +BclNumber +bcl_modexp_keep(BclNumber a, BclNumber b, BclNumber c); + ssize_t bcl_cmp(BclNumber a, BclNumber b); @@ -283,18 +328,30 @@ bcl_parse(const char* restrict val); char* bcl_string(BclNumber n); +char* +bcl_string_keep(BclNumber n); + BclNumber bcl_irand(BclNumber a); +BclNumber +bcl_irand_keep(BclNumber a); + BclNumber bcl_frand(size_t places); BclNumber bcl_ifrand(BclNumber a, size_t places); +BclNumber +bcl_ifrand_keep(BclNumber a, size_t places); + BclError bcl_rand_seedWithNum(BclNumber n); +BclError +bcl_rand_seedWithNum_keep(BclNumber n); + BclError bcl_rand_seed(unsigned char seed[BCL_SEED_SIZE]); diff --git a/contrib/bc/include/lang.h b/contrib/bc/include/lang.h index 2d9776532249..97aeeaa98da8 100644 --- a/contrib/bc/include/lang.h +++ b/contrib/bc/include/lang.h @@ -277,6 +277,9 @@ typedef enum BcInst #if DC_ENABLED + /// dc extended registers command. + BC_INST_EXTENDED_REGISTERS, + /// dc's return; it pops an executing string off of the stack. BC_INST_POP_EXEC, @@ -575,7 +578,7 @@ bc_func_insert(BcFunc* f, struct BcProgram* p, char* name, BcType type, void bc_func_reset(BcFunc* f); -#ifndef NDEBUG +#if BC_DEBUG /** * Frees a function. This is a destructor. This is only used in debug builds * because all functions are freed at exit. We free them in debug builds to @@ -584,7 +587,7 @@ bc_func_reset(BcFunc* f); */ void bc_func_free(void* func); -#endif // NDEBUG +#endif // BC_DEBUG /** * Initializes an array, which is the array type in bc and dc source code. Since diff --git a/contrib/bc/include/lex.h b/contrib/bc/include/lex.h index 54d704f8b447..ac9b7b6ea69c 100644 --- a/contrib/bc/include/lex.h +++ b/contrib/bc/include/lex.h @@ -49,11 +49,11 @@ * @param l The lexer. * @param e The error. */ -#ifndef NDEBUG +#if BC_DEBUG #define bc_lex_err(l, e) (bc_vm_handleError((e), __FILE__, __LINE__, (l)->line)) -#else // NDEBUG +#else // BC_DEBUG #define bc_lex_err(l, e) (bc_vm_handleError((e), (l)->line)) -#endif // NDEBUG +#endif // BC_DEBUG /** * A convenience macro for throwing errors in lex code. This takes care of @@ -61,12 +61,12 @@ * @param l The lexer. * @param e The error. */ -#ifndef NDEBUG +#if BC_DEBUG #define bc_lex_verr(l, e, ...) \ (bc_vm_handleError((e), __FILE__, __LINE__, (l)->line, __VA_ARGS__)) -#else // NDEBUG +#else // BC_DEBUG #define bc_lex_verr(l, e, ...) (bc_vm_handleError((e), (l)->line, __VA_ARGS__)) -#endif // NDEBUG +#endif // BC_DEBUG // BC_LEX_NEG_CHAR returns the char that corresponds to negative for the // current calculator. @@ -409,6 +409,9 @@ typedef enum BcLexType #if DC_ENABLED + /// dc extended registers keyword. + BC_LEX_EXTENDED_REGISTERS, + /// A special token for dc to calculate equal without a register. BC_LEX_EQ_NO_REG, @@ -533,7 +536,7 @@ void bc_lex_init(BcLex* l); /** - * Frees a lexer. This is not guarded by #ifndef NDEBUG because a separate + * Frees a lexer. This is not guarded by #if BC_DEBUG because a separate * parser is created at runtime to parse read() expressions and dc strings, and * that parser needs a lexer. * @param l The lexer to free. diff --git a/contrib/bc/include/library.h b/contrib/bc/include/library.h index 76df91392da1..1edd3757444c 100644 --- a/contrib/bc/include/library.h +++ b/contrib/bc/include/library.h @@ -47,6 +47,145 @@ #include #include +#if BC_ENABLE_MEMCHECK + +/** + * A typedef for Valgrind builds. This is to add a generation index for error + * checking. + */ +typedef struct BclNum +{ + /// The number. + BcNum n; + + /// The generation index. + size_t gen_idx; + +} BclNum; + +/** + * Clears the generation byte in a BclNumber and returns the value. + * @param n The BclNumber. + * @return The value of the index. + */ +#define BCL_NO_GEN(n) \ + ((n).i & ~(((size_t) UCHAR_MAX) << ((sizeof(size_t) - 1) * CHAR_BIT))) + +/** + * Gets the generation index in a BclNumber. + * @param n The BclNumber. + * @return The generation index. + */ +#define BCL_GET_GEN(n) ((n).i >> ((sizeof(size_t) - 1) * CHAR_BIT)) + +/** + * Turns a BclNumber into a BcNum. + * @param c The context. + * @param n The BclNumber. + */ +#define BCL_NUM(c, n) ((BclNum*) bc_vec_item(&(c)->nums, BCL_NO_GEN(n))) + +/** + * Clears the generation index top byte in the BclNumber. + * @param n The BclNumber. + */ +#define BCL_CLEAR_GEN(n) \ + do \ + { \ + (n).i &= ~(((size_t) UCHAR_MAX) << ((sizeof(size_t) - 1) * CHAR_BIT)); \ + } \ + while (0) + +#define BCL_CHECK_NUM_GEN(c, bn) \ + do \ + { \ + size_t gen_ = BCL_GET_GEN(bn); \ + BclNum* ptr_ = BCL_NUM(c, bn); \ + if (BCL_NUM_ARRAY(ptr_) == NULL) \ + { \ + bcl_nonexistentNum(); \ + } \ + if (gen_ != ptr_->gen_idx) \ + { \ + bcl_invalidGeneration(); \ + } \ + } \ + while (0) + +#define BCL_CHECK_NUM_VALID(c, bn) \ + do \ + { \ + size_t idx_ = BCL_NO_GEN(bn); \ + if ((c)->nums.len <= idx_) \ + { \ + bcl_numIdxOutOfRange(); \ + } \ + BCL_CHECK_NUM_GEN(c, bn); \ + } \ + while (0) + +/** + * Returns the limb array of the number. + * @param bn The number. + * @return The limb array. + */ +#define BCL_NUM_ARRAY(bn) ((bn)->n.num) + +/** + * Returns the limb array of the number for a non-pointer. + * @param bn The number. + * @return The limb array. + */ +#define BCL_NUM_ARRAY_NP(bn) ((bn).n.num) + +/** + * Returns the BcNum pointer. + * @param bn The number. + * @return The BcNum pointer. + */ +#define BCL_NUM_NUM(bn) (&(bn)->n) + +/** + * Returns the BcNum pointer for a non-pointer. + * @param bn The number. + * @return The BcNum pointer. + */ +#define BCL_NUM_NUM_NP(bn) (&(bn).n) + +// These functions only abort. They exist to give developers some idea of what +// went wrong when bugs are found, if they look at the Valgrind stack trace. + +BC_NORETURN void +bcl_invalidGeneration(void); + +BC_NORETURN void +bcl_nonexistentNum(void); + +BC_NORETURN void +bcl_numIdxOutOfRange(void); + +#else // BC_ENABLE_MEMCHECK + +/** + * A typedef for non-Valgrind builds. + */ +typedef BcNum BclNum; + +#define BCL_NO_GEN(n) ((n).i) +#define BCL_NUM(c, n) ((BclNum*) bc_vec_item(&(c)->nums, (n).i)) +#define BCL_CLEAR_GEN(n) ((void) (n)) + +#define BCL_CHECK_NUM_GEN(c, bn) +#define BCL_CHECK_NUM_VALID(c, n) + +#define BCL_NUM_ARRAY(bn) ((bn)->num) +#define BCL_NUM_ARRAY_NP(bn) ((bn).num) + +#define BCL_NUM_NUM(bn) (bn) +#define BCL_NUM_NUM_NP(bn) (&(bn)) + +#endif // BC_ENABLE_MEMCHECK + /** * A header that sets a jump. * @param vm The thread data. @@ -88,19 +227,19 @@ * idx. * @param c The context. * @param e The error. - * @param n The number. + * @param bn The number. * @param idx The idx to set as the return value. */ -#define BC_MAYBE_SETUP(c, e, n, idx) \ - do \ - { \ - if (BC_ERR((e) != BCL_ERROR_NONE)) \ - { \ - if ((n).num != NULL) bc_num_free(&(n)); \ - idx.i = 0 - (size_t) (e); \ - } \ - else idx = bcl_num_insert(c, &(n)); \ - } \ +#define BC_MAYBE_SETUP(c, e, bn, idx) \ + do \ + { \ + if (BC_ERR((e) != BCL_ERROR_NONE)) \ + { \ + if (BCL_NUM_ARRAY_NP(bn) != NULL) bc_num_free(BCL_NUM_NUM_NP(bn)); \ + idx.i = 0 - (size_t) (e); \ + } \ + else idx = bcl_num_insert(c, &(bn)); \ + } \ while (0) /** @@ -108,17 +247,17 @@ * is bad. * @param c The context. */ -#define BC_CHECK_CTXT(vm, c) \ - do \ - { \ - c = bcl_contextHelper(vm); \ - if (BC_ERR(c == NULL)) \ - { \ - BclNumber n_num; \ - n_num.i = 0 - (size_t) BCL_ERROR_INVALID_CONTEXT; \ - return n_num; \ - } \ - } \ +#define BC_CHECK_CTXT(vm, c) \ + do \ + { \ + c = bcl_contextHelper(vm); \ + if (BC_ERR(c == NULL)) \ + { \ + BclNumber n_num_; \ + n_num_.i = 0 - (size_t) BCL_ERROR_INVALID_CONTEXT; \ + return n_num_; \ + } \ + } \ while (0) /** @@ -157,16 +296,18 @@ #define BC_CHECK_NUM(c, n) \ do \ { \ - if (BC_ERR((n).i >= (c)->nums.len)) \ + size_t no_gen_ = BCL_NO_GEN(n); \ + if (BC_ERR(no_gen_ >= (c)->nums.len)) \ { \ if ((n).i > 0 - (size_t) BCL_ERROR_NELEMS) return (n); \ else \ { \ - BclNumber n_num; \ - n_num.i = 0 - (size_t) BCL_ERROR_INVALID_NUM; \ - return n_num; \ + BclNumber n_num_; \ + n_num_.i = 0 - (size_t) BCL_ERROR_INVALID_NUM; \ + return n_num_; \ } \ } \ + BCL_CHECK_NUM_GEN(c, n); \ } \ while (0) @@ -181,7 +322,8 @@ *** 6729 LINES SKIPPED *** From nobody Thu Jun 8 13:16:47 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QcPqz3LT8z4bckp; Thu, 8 Jun 2023 13:16:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QcPqz2tD7z4FjB; Thu, 8 Jun 2023 13:16:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686230207; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VkUhBkfndWUCHk1JMsxTBtfWrWktry8wAzirga73CDU=; b=vrXfqB/XNQG/jJtasUx/D/xXnEEPDGeQalp5fH3pwo3iXXQnsCqcQja+JjYivVL6mDcdfI uaIILCkxOgwyh5kiszYzBDayX6EE/OcqRNZUiXtGWj3Vd8/Oc8jCu/TCQLuydHhjP3HJjh dtXIRnc9S7aPMvmOEUHPEY3RTPIiL6Iv/0afFFEsLklap4ncYDl+2ngzYmUBBPun48ZrYq Eiv/9Zehf0VLcEk4dHNMpy9aqINq7Twry175+y2eg83LYPznPq1VFycDoF0P6DVHXM4WG4 rnlqKy5A5Lb54TuPwvQLp2CXpzN8PhcP17lJ8EUU/Zi6O+2RW2kzGKy70kizXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686230207; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VkUhBkfndWUCHk1JMsxTBtfWrWktry8wAzirga73CDU=; b=gwtWfWkoH/9H0/yTbsipxowHVHXQJmypCNa/Ka36v7fb5L9m9HpkNzVvmjDi8YJ/fzYkhS DSXuDBYXcAbGdLCwk4tW6XYw3nYa18F+Ajkbjh0i+MT7o+RoBAoAl/5uCf5rDVi/9jxAh3 CKFnbjFtWiczw3L18Gnd/yre9Mw0aDYdbl5WfGl4bk2dvXWCKANqiezIKL2Ki9wq6tFz2I 9WF24sJA6JHPUgtVzOCqkHBOG5C5gBkrS/pap5gWW2jf+AIYovD9QXblXabLMbblnDTwWU t9Iguph37oJfY4/VDjqOrzlOUQpyjW/raB4lVVREcY/m8WfV7panK4Fxf8LZOA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686230207; a=rsa-sha256; cv=none; b=ov7TvIZK9AJmN0bSydDzC+GSQDQAa127WST8ANw9NGzIDI9KWric6xgmdcKqPfBhJKCeCW OuShAmz7Iz1+zFU5Kd7a6T13l40KnTBr5YKYXJ2W/u9KtrCUfjtUUe8EkmozvjwwVszQmu ukkKYyjnxYYFgj/N83nXvscdk4WvhF5AK6giYb2G8KFWFgOdbmf4C8cisdFCvRbJAjBwEv iQYE7bvsDuXkjtXfkBMXXFuck2aST2aowBJLu0xw+5PHEKM1MViRAt7Py2PVO80QO7jurH hycbRv9GL24QIrd6xvZm8L0P5bOvECaaFq3TtHXnagwrbMUrecGxFydZSP7mFg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QcPqz1xGCzvk5; Thu, 8 Jun 2023 13:16:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 358DGlHt036132; Thu, 8 Jun 2023 13:16:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 358DGlWf036131; Thu, 8 Jun 2023 13:16:47 GMT (envelope-from git) Date: Thu, 8 Jun 2023 13:16:47 GMT Message-Id: <202306081316.358DGlWf036131@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: e30c54cd4447 - stable/13 - ktrace: Make the data lengths table const List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e30c54cd444760c6a1bdda07aa5e34b98a859dbb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e30c54cd444760c6a1bdda07aa5e34b98a859dbb commit e30c54cd444760c6a1bdda07aa5e34b98a859dbb Author: Mark Johnston AuthorDate: 2023-06-01 21:12:42 +0000 Commit: Mark Johnston CommitDate: 2023-06-08 13:16:26 +0000 ktrace: Make the data lengths table const No functional change intended. MFC after: 1 week (cherry picked from commit 3080f82b8b644809d8731c4f5c72f1530c400eb3) --- sys/kern/kern_ktrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index 9221a9ceb765..d2fe2a999dc3 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -112,7 +112,7 @@ struct ktr_request { STAILQ_ENTRY(ktr_request) ktr_list; }; -static int data_lengths[] = { +static const int data_lengths[] = { [KTR_SYSCALL] = offsetof(struct ktr_syscall, ktr_args), [KTR_SYSRET] = sizeof(struct ktr_sysret), [KTR_NAMEI] = 0, From nobody Thu Jun 8 13:16:48 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QcPr05Pd0z4bd1r; Thu, 8 Jun 2023 13:16:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QcPr04729z4FrB; Thu, 8 Jun 2023 13:16:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686230208; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AFpjGI5Ze76kJdXkywk96k33tfmlvZbEZg6apA/xfMk=; b=h4taJKFOqkRzcesRpsDRPjtXNt1I3SKRRPpyUokeT9eSMCnBp9g7ixp6HQDiuSJcQpf/RR 1TCAzHzwTT5hLo2DpevPsdfgCDJQYyE+nTwG8RxEI1nQrqUSL1HnzKD3umugJs3V1e3f1K donClijZIeW1yILX/DMOaQHutSklscKWx5KJs9FoNlf7a7vcKavJiFlgG4Pb1+jqYUfixv P2yfAgkA8mHHwPepftp40cSkqjOoRE2R4PVFqoPAHQpiCxB13xHTo2BUEz+E0Pw3rxzTRd mRh5UZfrKogF9UL6Q17WTuOChSeQ4qhTV+AAdTYmCey/eoq3EjTKuXuwN8+51A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686230208; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AFpjGI5Ze76kJdXkywk96k33tfmlvZbEZg6apA/xfMk=; b=wg7Zytg9TmBoqq+JyLDYIHNIKmcTx4XoYvz5ws0INaVKMUMjg/eBLPPe8sdRuTHX/C2VNy T9/qXpZe8APG9CMmhVlGFye780shIJAEkIAsB0avAg6eowL+GFYvPyCaqME3Jvify7fmoq vP7creiO2hmtYyvkkKu++ycySg1RgWYAsVc7CmvroiqjDdFj3nWoNIrSf1yxBNgN+lesuM tAuEglvPrAVmFdtDqLut3+6G4w5tKLCZcu3P/UYXkBs353JPbQ39LBgJ5qFgchLT7/Ksl0 wTfcMb9tjDiZe3USC1qIOrnv9wV9D6KkyDtp9c17GlB5xchPbChb1FQns73ezg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686230208; a=rsa-sha256; cv=none; b=rCXrPTB93jlREcTOW0jOE3ZVLCsWxkTNRpfwygCruJdYD6Vd3cifna58pxatInlA/t9Saa OdiKO3t0OrbDV601hylYGuI/hsUyKqOup4SwWouwbUh/EJUik5ViYqxM3dyEUQn1mEQROj binkwRt+uTr79dfONdNEgkfvHxg5jJ3y0KLO9kD707dPnWaC08vud3McfdaMJCcnYyKrbZ 1VZTadUgLb4yh7PEked1oJLjcz2oZhp/fu4hikZw+5x52LbELTcUk+jnIEQqS1cx7T8pqp Iw4qxohe+n5/VR0fbB36adCb/9GPyMwwB+piN5rpcxhfd272H4SLYMla3UDQWA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QcPr03BQ8zvyY; Thu, 8 Jun 2023 13:16:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 358DGmZ1036151; Thu, 8 Jun 2023 13:16:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 358DGm7Z036150; Thu, 8 Jun 2023 13:16:48 GMT (envelope-from git) Date: Thu, 8 Jun 2023 13:16:48 GMT Message-Id: <202306081316.358DGm7Z036150@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: cf5731ee5a6f - stable/13 - signal: Make the signal disposition table const List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: cf5731ee5a6fd8545eaf9eea02eab3c5dc1e9c61 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=cf5731ee5a6fd8545eaf9eea02eab3c5dc1e9c61 commit cf5731ee5a6fd8545eaf9eea02eab3c5dc1e9c61 Author: Mark Johnston AuthorDate: 2023-06-01 21:11:55 +0000 Commit: Mark Johnston CommitDate: 2023-06-08 13:16:34 +0000 signal: Make the signal disposition table const No functional change intended. MFC after: 1 week (cherry picked from commit 0d3f1b4f25150c3c5afaa669715421821323ead1) --- 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 63d73cf7a909..539c020c183e 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -219,7 +219,7 @@ SYSCTL_INT(_kern, OID_AUTO, coredump_devctl, CTLFLAG_RW, &coredump_devctl, #define SIGPROP_IGNORE 0x10 /* ignore by default */ #define SIGPROP_CONT 0x20 /* continue if suspended */ -static int sigproptbl[NSIG] = { +static const int sigproptbl[NSIG] = { [SIGHUP] = SIGPROP_KILL, [SIGINT] = SIGPROP_KILL, [SIGQUIT] = SIGPROP_KILL | SIGPROP_CORE, From nobody Thu Jun 8 14:43:09 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QcRlf1VRfz4bpJ6; Thu, 8 Jun 2023 14:43:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QcRlf0rTBz4Rsx; Thu, 8 Jun 2023 14:43:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686235390; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+herRStdZZABhMoDVmHBZlnqnS31sE51D7tzuRWzlGI=; b=Mc7gwxpYD9yh74RWj5wMglj5AYIPBr+VNX1HdLQWpZfimkvzUT8TcY2RaW1Baz2g3Td4va J3880PW1O7z5TwluJJn6rZltzX79XH5cD0M3KGKzzz6v9wriY/uWNxxNBicmflLE4SQaRW T3VbLW7EnW8iqvDPvgOdKcfAM9Ctr8BFNqasZD9g/+G1stlI0sXvXselP/EX8J/dVyI5Ol P+w0iAXEdIOFsGW4ShPYsp3e+dLvMgQfAiCEWIxEjJITLglRcumO+Du/9Hxp8EV2svXrLD hdCCMTuB4Q0FpjpHeRSiCkI5zRFLaXIcqYdHFhkXEFwpKsKxZKzJ8L7h7wruCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686235390; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+herRStdZZABhMoDVmHBZlnqnS31sE51D7tzuRWzlGI=; b=p0hg1YlF1Qd7/CSiMZ/PrKWsJnhJz5tWc/t/sWV5grKQRTZ7sa7Mv5nXJt2GIedHq3zAM4 SkTChyPlaIjtrBzhUwClzNFg5WVl7oft//y4XNsIADl5mUVz0VwyvKtloQjvozRHa2+hvT zpZty1sluri7gVxnvmlCms5Ii0VH1e8TYxxJccCv0eJHAYr3qW/WxMeTxdEJmR9nOlD0Nw Q9qKb5NBJJo/0kcKUZaZzwaAI0+7l6fqqKNjuRUSNhoy+Zw2vSfoJ31eHIFpT50hLoM4g0 qs9PCkmSFz/vErrkmdSm2J5UkqnmhkFSC0Yai9DJkojT+e8ASpN1uUTZ7Afyjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686235390; a=rsa-sha256; cv=none; b=F5abDEc6L3klxsOg4xiMrLwJPEsL2QG5yisIzN+7AYyb7WJ6YhlqhY+9pLEQMQjz96rhpO Ty+DCB7CKfjF8cefmyZy/RRMmxVffJ7z8xCZaQTESPpy+AlnIDtvBUrobQ8iWcgT99cEJP e6TmoVLK2KgT0hTjggAgou/ljnOHTBRgnaQHTlxDWOg+GsbNaUvZjy9ZNfcGgN59YhGPBR 2CXgKLDDIuO66dWfIAcGbU8Le1MKwtbjysTyjhLXdXEXQ87dfeyEdcFrrFcOf5w8UqkXFN 4jjrF3+BXX99GhPoCoIeS/Xot3PVxTyu5ig5C1srFCGZJKkwnwgY7Te9SRGf1g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QcRld712bzy9F; Thu, 8 Jun 2023 14:43:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 358Eh9RL083304; Thu, 8 Jun 2023 14:43:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 358Eh9p0083301; Thu, 8 Jun 2023 14:43:09 GMT (envelope-from git) Date: Thu, 8 Jun 2023 14:43:09 GMT Message-Id: <202306081443.358Eh9p0083301@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: b17b639832e7 - main - contrib/spleen: update to Spleen 2.0.0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b17b639832e707aab0e9514cf94727498e2d67bd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=b17b639832e707aab0e9514cf94727498e2d67bd commit b17b639832e707aab0e9514cf94727498e2d67bd Merge: 6b7a06c3bdbc 533de2d7a987 Author: Ed Maste AuthorDate: 2023-06-08 14:38:41 +0000 Commit: Ed Maste CommitDate: 2023-06-08 14:42:25 +0000 contrib/spleen: update to Spleen 2.0.0 Merge commit '533de2d7a9875ff652be477a3f6c817d66a3d3d9' Submitted by: Frederic Cambus Differential Revision: https://reviews.freebsd.org/D40378 contrib/spleen/ChangeLog | 13 + contrib/spleen/README.md | 37 +- contrib/spleen/spleen-12x24.bdf | 4 +- contrib/spleen/spleen-16x32.bdf | 8166 ++++++--- contrib/spleen/spleen-32x64.bdf | 36456 ++++++++++++++++++++++---------------- contrib/spleen/spleen-5x8.bdf | 4 +- contrib/spleen/spleen-6x12.bdf | 4 +- contrib/spleen/spleen-8x16.bdf | 1277 +- 8 files changed, 27933 insertions(+), 18028 deletions(-) diff --cc contrib/spleen/README.md index 629a13711038,000000000000..ce2e6addc305 mode 100644,000000..100644 --- a/contrib/spleen/README.md +++ b/contrib/spleen/README.md @@@ -1,236 -1,0 +1,257 @@@ +``` + + :::::::::::::::::::: + ::: ::: + _____ _______ __. ________ ________ ________. ::: + _) _//__ __/ __ / |.\ __ /.\ __ /.\ _. | ::: + .\____ /.\ )/ / || )/ | )/ | \| | ::: + | )/ | __/| \ _____| _____| | |_ ::: + |____ |_____| |_____/____\\ |____\\ | |____/ ::: + - -- -- \_____| -H7--------------------------- `----' ----- ::: - - + ::: ::: + :::::::::::::::::::: + +``` + +# Spleen + +Spleen is a monospaced bitmap font available in 6 sizes: + +- 5x8 +- 6x12 +- 8x16 +- 12x24 +- 16x32 +- 32x64 + +Each size is provided in the Glyph Bitmap Distribution Format (BDF), and +release tarballs contain the fonts in the following formats: `PCF`, `PSF` +(for the Linux console), `OTB`, `OTF`, `.dfont` for macOS users, and `FON` +for Windows users. + +All font sizes contain all ISO/IEC 8859-1 characters (Basic Latin and Latin-1 +Supplement Unicode block), Latin Extended-A characters, as well as Box Drawing, +Block Elements, and Braille Patterns Unicode blocks, except for the 5x8 and the +6x12 versions. + +Due to character size constraints, the 5x8 version only contains printable +ASCII characters, the Braille Patterns Unicode block, and light Box Drawing +characters. Please also note that there is no OpenType version for this size. + +As of Spleen 1.8.0, there is now a 6x12 version containing the same Unicode +blocks as the 5x8 version and the Latin-1 Supplement Unicode block. + ++As of Spleen 2.0.0, the 8x16, 16x32 and 32x64 versions have full support for ++Code page 437 (IBM PC). ++ +Spleen also has support for Powerline symbols out of the box. + +The font name is a reference to Baudelaire. + +## Screenshots + +The following screenshots show Spleen 16x32 displaying code and prose. + +![Spleen - Hello][1] + +![Spleen - L'etranger][2] + +ASCII characters for all sizes: + +Spleen 5x8: + +![Spleen - ASCII characters - 5x8][3] + +Spleen 6x12: + +![Spleen - ASCII characters - 6x12][4] + +Spleen 8x16: + +![Spleen - ASCII characters - 8x16][5] + +Spleen 12x24: + +![Spleen - ASCII characters - 12x24][6] + +Spleen 16x32: +![Spleen - ASCII characters - 16x32][7] + +Spleen 32x64: +![Spleen - ASCII characters - 32x64][8] + +## XLFD font names + +``` +-misc-spleen-medium-r-normal--8-80-72-72-c-50-iso10646-1 +-misc-spleen-medium-r-normal--12-120-72-72-c-60-iso10646-1 +-misc-spleen-medium-r-normal--16-160-72-72-c-80-iso10646-1 +-misc-spleen-medium-r-normal--24-240-72-72-c-120-iso10646-1 +-misc-spleen-medium-r-normal--32-320-72-72-c-160-iso10646-1 +-misc-spleen-medium-r-normal--64-640-72-72-c-320-iso10646-1 +``` + +## Packages + +Spleen packages are available for: + +- [OpenBSD][9] +- [NetBSD][10] +- [FreeBSD][11] +- [Arch Linux][12] +- [Void Linux][13] +- [Nix][14] +- [Debian][15] +- [Ubuntu][16] +- [MacPorts][17] + +## Manual installation + +### *BSD and Linux + +Clone the repository, convert the files to the Portable Compiled Format +(PCF) using **bdftopcf** and run **mkfontdir** in the directory. + +Alternatively, release tarballs provide PCF files for each size. + +### macOS + +macOS users should use the `.dfont` files provided in the release tarballs. + ++### DOS ++ ++DOS users should run the **SPLEEN.COM** executable provided in the release ++tarballs to enable the font. ++ ++This has been tested in DOSBox and FreeDOS on real hardware. ++ +### Windows + +Windows users should use the `.fon` or `.otf` files provided in the release +tarballs. + +## Usage + +### *BSD and Linux + +Update the font path to include **Spleen**: + + xset +fp /usr/local/share/fonts/spleen/ + +Update **.Xdefaults** and add one of the following directives: + + xterm*faceName: spleen:pixelsize=8:antialias=false + xterm*faceName: spleen:pixelsize=12:antialias=false + xterm*faceName: spleen:pixelsize=16:antialias=false + xterm*faceName: spleen:pixelsize=24:antialias=false + xterm*faceName: spleen:pixelsize=32:antialias=false + xterm*faceName: spleen:pixelsize=64:antialias=false + +Launch **xterm**. + +Ubuntu has bitmap fonts support disabled by default, instructions to enable +it are available [here][18]. + +### Linux console + +Release tarballs provide PSF files for each size, `setfont` can be used +to load and set the desired font. + +### NetBSD console + +NetBSD has .fnt files for each size which can be loaded using wsfontload(8). + +For example, to load Spleen 16x32: + + wsfontload -N spleen-16x32 -w 16 -h 32 /usr/share/wscons/fonts/spleen-16x32.fnt + wsconsctl -dw font=spleen-16x32 + +### FreeBSD console + +The FreeBSD package contains .fnt files which can be loaded using +vidcontrol(1). + +For example, to load Spleen 16x32: + + vidcontrol -f /usr/local/share/fonts/spleen/spleen-16x32.fnt + +### OpenType versions + +Spleen release tarballs now contains OTF versions generated automatically +from the BDF files, using [bdf2sfd][19]. Each font has a different name, +allowing them to be installed alongside. + +They should be used in the exact size specified below, with anti-aliasing +disabled. + +- Spleen 6x12: 9 Pt (12 pixels) +- Spleen 8x16: 12 Pt (16 pixels) +- Spleen 12x24: 18 Pt (24 pixels) +- Spleen 16x32: 24 Pt (32 pixels) +- Spleen 32x64: 48 Pt (64 pixels) + +## License + +Spleen is released under the BSD 2-Clause license. See `LICENSE` file for +details. + +## Author + +Spleen is developed by Frederic Cambus. + +- Site: https://www.cambus.net + +## Resources + +- [Spleen - Monospaced bitmap fonts][20] (2018) +- [New console font Spleen made default][21] (2019) +- [NetBSD, CTWM, and Spleen][22] (2021) + +GitHub: https://github.com/fcambus/spleen + +## Trivia + - - Spleen is the default font for OpenBSD consoles since January 2019 - - Spleen was imported in the NetBSD src tree in March 2019 - - Spleen 12x24 was used in the Haiku [kernel debugger][23] (on high resolution ++- Spleen was imported in the OpenBSD src tree in [September 2018][23] ++- Spleen is the default font for OpenBSD consoles since [January 2019][24] ++- Spleen was imported in the NetBSD src tree in [March 2019][25] ++- Spleen 12x24 was used in the Haiku [kernel debugger][26] (on high resolution + displays) from May 2021 to June 2022 - - [msTERM][24], a Terminal program for MailStation devices uses Spleen 5x8 - - [FBInk][25], a library to print text & images to an eInk Linux framebuffer ++- Spleen was imported in the FreeBSD base system in [May 2023][27] ++- [msTERM][28], a Terminal program for MailStation devices uses Spleen 5x8 ++- [FBInk][29], a library to print text & images to an eInk Linux framebuffer + embeds Spleen 16x32 ++- [U8g2][30], a monochrome graphics library for embedded devices includes ++ all Spleen sizes ++- [Ansilove][31], an ANSI and ASCII art to PNG converter includes Spleen + +[1]: https://www.cambus.net/content/2018/09/spleen-hello.png +[2]: https://www.cambus.net/content/2018/09/spleen-etranger.png +[3]: https://www.cambus.net/files/spleen/spleen-5x8.png +[4]: https://www.cambus.net/files/spleen/spleen-6x12.png +[5]: https://www.cambus.net/files/spleen/spleen-8x16.png +[6]: https://www.cambus.net/files/spleen/spleen-12x24.png +[7]: https://www.cambus.net/files/spleen/spleen-16x32.png +[8]: https://www.cambus.net/files/spleen/spleen-32x64.png +[9]: https://openports.pl/path/fonts/spleen +[10]: https://pkgsrc.se/fonts/spleen +[11]: https://www.freshports.org/x11-fonts/spleen/ +[12]: https://aur.archlinux.org/packages/spleen-font/ +[13]: https://github.com/void-linux/void-packages/tree/master/srcpkgs/font-spleen +[14]: https://github.com/NixOS/nixpkgs/tree/master/pkgs/data/fonts/spleen +[15]: https://packages.debian.org/search?keywords=spleen +[16]: https://packages.ubuntu.com/search?keywords=spleen +[17]: https://ports.macports.org/port/font-spleen/ +[18]: https://wiki.ubuntu.com/Fonts#Enabling_Bitmapped_Fonts +[19]: https://github.com/fcambus/bdf2sfd +[20]: https://www.cambus.net/spleen-monospaced-bitmap-fonts/ +[21]: https://undeadly.org/cgi?action=article;sid=20190110064857 +[22]: https://www.cambus.net/netbsd-ctwm-and-spleen/ - [23]: https://git.haiku-os.org/haiku/commit/?id=29a109bd6c01ce71bb61177ee9ff0417e74c1e18 - [24]: https://github.com/jcs/msTERM - [25]: https://github.com/NiLuJe/FBInk ++[23]: https://freshbsd.org/openbsd/src/commit/5raMrDMpYlPYW01H ++[24]: https://freshbsd.org/openbsd/src/commit/MoBCxKiAlFajRvSm ++[25]: https://freshbsd.org/netbsd/src/commit/TAJuMl9caBpVjGfB ++[26]: https://git.haiku-os.org/haiku/commit/?id=29a109bd6c01ce71bb61177ee9ff0417e74c1e18 ++[27]: https://cgit.freebsd.org/src/commit/?id=0d66206fff44 ++[28]: https://github.com/jcs/msTERM ++[29]: https://github.com/NiLuJe/FBInk ++[30]: https://github.com/olikraus/u8g2/wiki/fntgrpspleen ++[31]: https://www.ansilove.org From nobody Thu Jun 8 14:50:12 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QcRvn1Rh8z4bpsk; Thu, 8 Jun 2023 14:50:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QcRvn0th3z4RyZ; Thu, 8 Jun 2023 14:50:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686235813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tJYxZW6GvOwL7ITG6uLevsrJgryZhWa8MuBbWz0gs74=; b=STrH/AK96PsGmhNvHrhMcSZNBD7IelcyZgqmGZoaSThybxjA1o5i/UPrsz2NjIgBCV6A1E Wtp8rAiKm5vI0kdH879A17EreFifsmrErlX7vvP04Z1dblZizWMefNWJRv/xjfntqBTM0o Yxl0NULel29Nn9/H51YamwRtPUSzVpXQMHCPUKYMWf1KghO2yVTb1d1v3MhBWJlaA+xQfq Biw9YHLY+hIU66WFgSkGEvy9tQtl0LiYRaDFLlpyMKNfOGTGkK751npqEtnwNUdxIq/65n Nzwb+OaKoPZhitm4z8uION11g2vPWIyJbo8Sx4h8PZCFUGObpNIJdD+VpttI7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686235813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tJYxZW6GvOwL7ITG6uLevsrJgryZhWa8MuBbWz0gs74=; b=puGdz+H4LBRPMG9ZjNmoy5h1iInNjpv2p6eehbgyLD9Q2g0tcKy+pwU6THeP3bfhn6a/it 8VpOhTjxyQ0llvkizOw67O6SPZmPw6LV4Tiz/dBPPvgLijyng2nDGzrAUooFfPgPRdXLqd CTUc6XXyo/jgVrIib7SO0VeUXw1GA4fT3sS1Z0UHOFpyWpSekF9Lb47KOEXinNxo5Skcu0 gTardrXodFpicSjiAuhs+BTN399ef4nW/IzN/GCNuMBIcfNwCklpfvHYKwPM2JMj875K0I Moej0zD0KYKf1pFWlISBgtsPno02U7zGNbSHJKPER/jDAXO1MVUSNbJGpkUZrw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686235813; a=rsa-sha256; cv=none; b=Jw7hhmGcdxwYd1T+psL0xhLnt62Oq2EjraNVCfCUvGcrtSGiGyA4uqhnbCf/QbGEFkiBq7 wiG+TJtMeWTfqFZM5qGeteO7+/b8q8p043vdnr9J+gve0ylosDhYwCgW+PgLxn3HESVr+9 fCKsneqNPacj9L2N5V7nVNRjPOorvvAMjSLsaIHYu/ugZEy5IFjts274o0+fVKjpS2jPsz Z1doB1wFSwgqZvRg9m3ITjQZLaiAqaFoeG3oi+VStSXur4yH5gcTk+iJ/1LFtP1RGFkQ0q GZyEa3JIL9/m8vikkRAvA/7U7YgCM0KFxz8tYznvxHy/MnAw3ZIQa3MgKHLf8g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QcRvm7407zxry; Thu, 8 Jun 2023 14:50:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 358EoCAR090131; Thu, 8 Jun 2023 14:50:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 358EoCiW090124; Thu, 8 Jun 2023 14:50:12 GMT (envelope-from git) Date: Thu, 8 Jun 2023 14:50:12 GMT Message-Id: <202306081450.358EoCiW090124@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Stefan=20E=C3=9Fer?= Subject: git: 8eba66320128 - stable/13 - usr.bin/bc: fix build issue of version 6.6.0 on MIPS List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8eba66320128e4258b2e0b676d1e6b7a96f81532 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=8eba66320128e4258b2e0b676d1e6b7a96f81532 commit 8eba66320128e4258b2e0b676d1e6b7a96f81532 Author: Stefan Eßer AuthorDate: 2023-06-08 14:45:11 +0000 Commit: Stefan Eßer CommitDate: 2023-06-08 14:49:49 +0000 usr.bin/bc: fix build issue of version 6.6.0 on MIPS The update removed MIPS and POWERPC64 from the list of architectures that cannot use LTO to build this software. Restore the previous exception list and do not use LTO on MIPS, MIPS64, POWERPC64, and RISCV64. This is necessary due to differences in compiler support for LTO in -CURRENT vs. 13-STABLE. --- usr.bin/gh-bc/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.bin/gh-bc/Makefile b/usr.bin/gh-bc/Makefile index 6554d626af89..154155085479 100644 --- a/usr.bin/gh-bc/Makefile +++ b/usr.bin/gh-bc/Makefile @@ -71,7 +71,8 @@ MAN_SRC_BC= bc/A.1 MAN_SRC_DC= dc/A.1 # prevent floating point incompatibilities caused by -flto on some architectures -.if ${MACHINE_ARCH} != riscv64 +.if ${MACHINE_ARCH:Mmips*} == "" && ${MACHINE_ARCH} != powerpc64 && \ + ${MACHINE_ARCH} != riscv64 CFLAGS+= -flto .endif From nobody Thu Jun 8 16:11:16 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QcTjK0KvCz4bvWF; Thu, 8 Jun 2023 16:11:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QcTjK06fFz4b0h; Thu, 8 Jun 2023 16:11:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686240677; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Bh+LUdjojXqGrYB77KvVNg2uwjAV/nUCNNMTupHFJZI=; b=bvZ7RC21VUC4J94K6z6HOyy0dlkHBQW3UhAmm9ThIg9rTncobD9+ZYjDrJzwCymoGb4mrj tlGTGv/MPzPUjGomQp92oyq5ZK2EANTGCDRlOL76+pSw1pLntQBNzYMO94ygO6isMqf2kn SLd20hzhCDmjf2sFxV8QeLxPWSrO1rcdXZ5i5U5cLuWDGbPhMBTCa90z5vsnoGL5aiHqG5 XB175zFJxtO5g/OWkUmPSGqXMEawhgf6FS/MVpgHt2rA6nHax5iGOAMPx2FkrEvyHo0aDj 7j7Ke9kTYUnKYbPXul942YqxDjvWQext4NbRVSj7KdU0ibor9kI699/py6cBZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686240677; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Bh+LUdjojXqGrYB77KvVNg2uwjAV/nUCNNMTupHFJZI=; b=WtykZk7faUhJjpGcV31RIp2ANz55v1RqL/C2kgdOjToZXgy+6Su7F34oKd/6m9fHl4QA9O mh2E8vKiF42yMwyQwjqumoaHAa2vTG4hqadNCvbyBAbrlZOMKGkbRTEe8GAIvIQupXlCXE yyZmIBijcVxQCyzb49Ow0oOHiBAoh6WAVc7yWYx52YRTze7h3SoEg9yVNjmqpDRdSF5L2B toGi4ES/L1U7LD0sqHZqtg2/RdS7VUfqVCzeNyWgeg7pMmrHvlSzBRW5hvU8ZoQ0tvKQzs phumby7WCjfewdPbhtNDMQtM/H9N/9bi9LiXYUyW+BBK9nrS/7OWdsfa3IVpPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686240677; a=rsa-sha256; cv=none; b=ORua6ZqRyd69DgfJ9u4MrzEcj2fQH9Iye+liyXXBQxx0l1q8fEYlfCzOqirTZrxpJQ5tfC rhcV+bBiwL5F+7t1QnUugRDhBXcbXfoOA37KaMaLia5Ax7w4MENtTLwKrJrRjdp+YuCFpX UtVj7En4VC3wlfs1o/SrOJTOCaFKkHpousIhug8AmmAQ1rvXnCqLj/xntismIpZOBK4FZr bpNb/bu38+T6rLaw0OWpBjDzBwE3t2S1HWCMMz8ry8PuglV6XY9peKFxDZPJvqhsigqGWX LV5LO+HNbJmWy+ZSIGFNaXECirl1NalCMqB/hd0JgO45nzh8i/mtjVRLJ2uFbQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QcTjJ6JLjz117F; Thu, 8 Jun 2023 16:11:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 358GBGFa027041; Thu, 8 Jun 2023 16:11:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 358GBGj5027040; Thu, 8 Jun 2023 16:11:16 GMT (envelope-from git) Date: Thu, 8 Jun 2023 16:11:16 GMT Message-Id: <202306081611.358GBGj5027040@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: 732786a25fd7 - main - arm64: Reduce the direct use of cpu_desc List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 732786a25fd7e9b48b1d64f51c41c80129e37563 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=732786a25fd7e9b48b1d64f51c41c80129e37563 commit 732786a25fd7e9b48b1d64f51c41c80129e37563 Author: Andrew Turner AuthorDate: 2023-06-01 17:25:37 +0000 Commit: Andrew Turner CommitDate: 2023-06-08 16:10:10 +0000 arm64: Reduce the direct use of cpu_desc To help moving to a dynamically allocated cpu_desc array reduce the places we use it directly and create a pointer that is passed in to functions that read it. Reviewed by: Zach Leaf Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D40392 --- sys/arm64/arm64/identcpu.c | 179 ++++++++++++++++++++++++--------------------- 1 file changed, 96 insertions(+), 83 deletions(-) diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c index 299d0fb0e38d..fb1c4537f216 100644 --- a/sys/arm64/arm64/identcpu.c +++ b/sys/arm64/arm64/identcpu.c @@ -47,9 +47,12 @@ __FBSDID("$FreeBSD$"); #include #include +struct cpu_desc; + static void print_cpu_midr(struct sbuf *sb, u_int cpu); -static void print_cpu_features(u_int cpu); -static void print_cpu_caches(struct sbuf *sb, u_int); +static void print_cpu_features(u_int cpu, struct cpu_desc *desc, + struct cpu_desc *prev_desc); +static void print_cpu_caches(struct sbuf *sb, struct cpu_desc *desc); #ifdef COMPAT_FREEBSD32 static u_long parse_cpu_features_hwcap32(void); #endif @@ -71,7 +74,8 @@ static int allow_idc = 1; SYSCTL_INT(_machdep_cache, OID_AUTO, allow_idc, CTLFLAG_RDTUN, &allow_idc, 0, "Allow optimizations based on the IDC cache bit"); -static void check_cpu_regs(u_int cpu); +static void check_cpu_regs(u_int cpu, struct cpu_desc *desc, + struct cpu_desc *prev_desc); /* * The default implementation of I-cache sync assumes we have an @@ -1784,6 +1788,7 @@ update_lower_register(uint64_t val, uint64_t new_val, u_int shift, void update_special_regs(u_int cpu) { + struct cpu_desc *desc; struct mrs_field *fields; uint64_t user_reg, kern_reg, value; int i, j; @@ -1798,8 +1803,9 @@ update_special_regs(u_int cpu) user_cpu_desc.id_aa64dfr0 = ID_AA64DFR0_DebugVer_8; } + desc = &cpu_desc[cpu]; for (i = 0; i < nitems(user_regs); i++) { - value = CPU_DESC_FIELD(cpu_desc[cpu], i); + value = CPU_DESC_FIELD(*desc, i); if (cpu == 0) { kern_reg = value; user_reg = value; @@ -1881,21 +1887,26 @@ parse_cpu_features(void) static void identify_cpu_sysinit(void *dummy __unused) { + struct cpu_desc *desc, *prev_desc; int cpu; bool dic, idc; dic = (allow_dic != 0); idc = (allow_idc != 0); + prev_desc = NULL; CPU_FOREACH(cpu) { - check_cpu_regs(cpu); - if (cpu != 0) + desc = &cpu_desc[cpu]; + if (cpu != 0) { + check_cpu_regs(cpu, desc, prev_desc); update_special_regs(cpu); + } - if (CTR_DIC_VAL(cpu_desc[cpu].ctr) == 0) + if (CTR_DIC_VAL(desc->ctr) == 0) dic = false; - if (CTR_IDC_VAL(cpu_desc[cpu].ctr) == 0) + if (CTR_IDC_VAL(desc->ctr) == 0) idc = false; + prev_desc = desc; } /* Find the values to export to userspace as AT_HWCAP and AT_HWCAP2 */ @@ -1934,10 +1945,15 @@ static void cpu_features_sysinit(void *dummy __unused) { struct sbuf sb; + struct cpu_desc *desc, *prev_desc; u_int cpu; - CPU_FOREACH(cpu) - print_cpu_features(cpu); + prev_desc = NULL; + CPU_FOREACH(cpu) { + desc = &cpu_desc[cpu]; + print_cpu_features(cpu, desc, prev_desc); + prev_desc = desc; + } /* Fill in cpu_model for the hw.model sysctl */ sbuf_new(&sb, cpu_model, sizeof(cpu_model), SBUF_FIXEDLEN); @@ -2117,8 +2133,8 @@ print_cpu_midr(struct sbuf *sb, u_int cpu) } static void -print_cpu_cache(u_int cpu, struct sbuf *sb, uint64_t ccs, bool icache, - bool unified) +print_cpu_cache(struct cpu_desc *desc, struct sbuf *sb, uint64_t ccs, + bool icache, bool unified) { size_t cache_size; size_t line_size; @@ -2130,7 +2146,7 @@ print_cpu_cache(u_int cpu, struct sbuf *sb, uint64_t ccs, bool icache, * formats depending on the FEAT_CCIDX bit in ID_AA64MMFR2 feature * register. */ - if ((cpu_desc[cpu].id_aa64mmfr2 & ID_AA64MMFR2_CCIDX_64)) + if ((desc->id_aa64mmfr2 & ID_AA64MMFR2_CCIDX_64)) cache_size = (CCSIDR_NSETS_64(ccs) + 1) * (CCSIDR_ASSOC_64(ccs) + 1); else @@ -2142,12 +2158,12 @@ print_cpu_cache(u_int cpu, struct sbuf *sb, uint64_t ccs, bool icache, } static void -print_cpu_caches(struct sbuf *sb, u_int cpu) +print_cpu_caches(struct sbuf *sb, struct cpu_desc *desc) { /* Print out each cache combination */ uint64_t clidr; int i = 1; - clidr = cpu_desc[cpu].clidr; + clidr = desc->clidr; for (i = 0; (clidr & CLIDR_CTYPE_MASK) != 0; i++, clidr >>= 3) { int j = 0; @@ -2155,15 +2171,15 @@ print_cpu_caches(struct sbuf *sb, u_int cpu) sbuf_printf(sb, " L%d cache: ", i + 1); if ((clidr & CLIDR_CTYPE_IO)) { - print_cpu_cache(cpu, sb, cpu_desc[cpu].ccsidr[i][j++], - true, false); + print_cpu_cache(desc, sb, desc->ccsidr[i][j++], true, + false); /* If there's more, add to the line. */ if ((ctype_m & ~CLIDR_CTYPE_IO) != 0) sbuf_printf(sb, ", "); } if ((ctype_m & ~CLIDR_CTYPE_IO) != 0) { - print_cpu_cache(cpu, sb, cpu_desc[cpu].ccsidr[i][j], - false, (clidr & CLIDR_CTYPE_UNIFIED)); + print_cpu_cache(desc, sb, desc->ccsidr[i][j], false, + (clidr & CLIDR_CTYPE_UNIFIED)); } sbuf_printf(sb, "\n"); @@ -2173,7 +2189,8 @@ print_cpu_caches(struct sbuf *sb, u_int cpu) } static void -print_cpu_features(u_int cpu) +print_cpu_features(u_int cpu, struct cpu_desc *desc, + struct cpu_desc *prev_desc) { struct sbuf *sb; @@ -2185,17 +2202,17 @@ print_cpu_features(u_int cpu) switch(cpu_aff_levels) { default: case 4: - sbuf_printf(sb, " %2d", CPU_AFF3(cpu_desc[cpu].mpidr)); + sbuf_printf(sb, " %2d", CPU_AFF3(desc->mpidr)); /* FALLTHROUGH */ case 3: - sbuf_printf(sb, " %2d", CPU_AFF2(cpu_desc[cpu].mpidr)); + sbuf_printf(sb, " %2d", CPU_AFF2(desc->mpidr)); /* FALLTHROUGH */ case 2: - sbuf_printf(sb, " %2d", CPU_AFF1(cpu_desc[cpu].mpidr)); + sbuf_printf(sb, " %2d", CPU_AFF1(desc->mpidr)); /* FALLTHROUGH */ case 1: case 0: /* On UP this will be zero */ - sbuf_printf(sb, " %2d", CPU_AFF0(cpu_desc[cpu].mpidr)); + sbuf_printf(sb, " %2d", CPU_AFF0(desc->mpidr)); break; } sbuf_finish(sb); @@ -2225,80 +2242,80 @@ print_cpu_features(u_int cpu) "atomic operations.\n"); #define SHOULD_PRINT_REG(_reg) \ - (cpu == 0 || cpu_desc[cpu]._reg != cpu_desc[cpu - 1]._reg) + (prev_desc == NULL || desc->_reg != prev_desc->_reg) /* Cache Type Register */ if (SHOULD_PRINT_REG(ctr)) { print_register(sb, "Cache Type", - cpu_desc[cpu].ctr, print_ctr_fields, NULL); + desc->ctr, print_ctr_fields, NULL); } /* AArch64 Instruction Set Attribute Register 0 */ if (SHOULD_PRINT_REG(id_aa64isar0)) print_id_register(sb, "Instruction Set Attributes 0", - cpu_desc[cpu].id_aa64isar0, id_aa64isar0_fields); + desc->id_aa64isar0, id_aa64isar0_fields); /* AArch64 Instruction Set Attribute Register 1 */ if (SHOULD_PRINT_REG(id_aa64isar1)) print_id_register(sb, "Instruction Set Attributes 1", - cpu_desc[cpu].id_aa64isar1, id_aa64isar1_fields); + desc->id_aa64isar1, id_aa64isar1_fields); /* AArch64 Instruction Set Attribute Register 2 */ if (SHOULD_PRINT_REG(id_aa64isar2)) print_id_register(sb, "Instruction Set Attributes 2", - cpu_desc[cpu].id_aa64isar2, id_aa64isar2_fields); + desc->id_aa64isar2, id_aa64isar2_fields); /* AArch64 Processor Feature Register 0 */ if (SHOULD_PRINT_REG(id_aa64pfr0)) print_id_register(sb, "Processor Features 0", - cpu_desc[cpu].id_aa64pfr0, id_aa64pfr0_fields); + desc->id_aa64pfr0, id_aa64pfr0_fields); /* AArch64 Processor Feature Register 1 */ if (SHOULD_PRINT_REG(id_aa64pfr1)) print_id_register(sb, "Processor Features 1", - cpu_desc[cpu].id_aa64pfr1, id_aa64pfr1_fields); + desc->id_aa64pfr1, id_aa64pfr1_fields); /* AArch64 Memory Model Feature Register 0 */ if (SHOULD_PRINT_REG(id_aa64mmfr0)) print_id_register(sb, "Memory Model Features 0", - cpu_desc[cpu].id_aa64mmfr0, id_aa64mmfr0_fields); + desc->id_aa64mmfr0, id_aa64mmfr0_fields); /* AArch64 Memory Model Feature Register 1 */ if (SHOULD_PRINT_REG(id_aa64mmfr1)) print_id_register(sb, "Memory Model Features 1", - cpu_desc[cpu].id_aa64mmfr1, id_aa64mmfr1_fields); + desc->id_aa64mmfr1, id_aa64mmfr1_fields); /* AArch64 Memory Model Feature Register 2 */ if (SHOULD_PRINT_REG(id_aa64mmfr2)) print_id_register(sb, "Memory Model Features 2", - cpu_desc[cpu].id_aa64mmfr2, id_aa64mmfr2_fields); + desc->id_aa64mmfr2, id_aa64mmfr2_fields); /* AArch64 Debug Feature Register 0 */ if (SHOULD_PRINT_REG(id_aa64dfr0)) print_id_register(sb, "Debug Features 0", - cpu_desc[cpu].id_aa64dfr0, id_aa64dfr0_fields); + desc->id_aa64dfr0, id_aa64dfr0_fields); /* AArch64 Memory Model Feature Register 1 */ if (SHOULD_PRINT_REG(id_aa64dfr1)) print_id_register(sb, "Debug Features 1", - cpu_desc[cpu].id_aa64dfr1, id_aa64dfr1_fields); + desc->id_aa64dfr1, id_aa64dfr1_fields); /* AArch64 Auxiliary Feature Register 0 */ if (SHOULD_PRINT_REG(id_aa64afr0)) print_id_register(sb, "Auxiliary Features 0", - cpu_desc[cpu].id_aa64afr0, id_aa64afr0_fields); + desc->id_aa64afr0, id_aa64afr0_fields); /* AArch64 Auxiliary Feature Register 1 */ if (SHOULD_PRINT_REG(id_aa64afr1)) print_id_register(sb, "Auxiliary Features 1", - cpu_desc[cpu].id_aa64afr1, id_aa64afr1_fields); + desc->id_aa64afr1, id_aa64afr1_fields); /* AArch64 SVE Feature Register 0 */ - if (cpu_desc[cpu].have_sve) { + if (desc->have_sve) { if (SHOULD_PRINT_REG(id_aa64zfr0) || - !cpu_desc[cpu - 1].have_sve) { + !prev_desc->have_sve) { print_id_register(sb, "SVE Features 0", - cpu_desc[cpu].id_aa64zfr0, id_aa64zfr0_fields); + desc->id_aa64zfr0, id_aa64zfr0_fields); } } @@ -2306,20 +2323,20 @@ print_cpu_features(u_int cpu) /* AArch32 Instruction Set Attribute Register 5 */ if (SHOULD_PRINT_REG(id_isar5)) print_id_register(sb, "AArch32 Instruction Set Attributes 5", - cpu_desc[cpu].id_isar5, id_isar5_fields); + desc->id_isar5, id_isar5_fields); /* AArch32 Media and VFP Feature Register 0 */ if (SHOULD_PRINT_REG(mvfr0)) print_id_register(sb, "AArch32 Media and VFP Features 0", - cpu_desc[cpu].mvfr0, mvfr0_fields); + desc->mvfr0, mvfr0_fields); /* AArch32 Media and VFP Feature Register 1 */ if (SHOULD_PRINT_REG(mvfr1)) print_id_register(sb, "AArch32 Media and VFP Features 1", - cpu_desc[cpu].mvfr1, mvfr1_fields); + desc->mvfr1, mvfr1_fields); #endif if (bootverbose) - print_cpu_caches(sb, cpu); + print_cpu_caches(sb, desc); sbuf_delete(sb); sb = NULL; @@ -2370,23 +2387,25 @@ identify_cache(uint64_t ctr) void identify_cpu(u_int cpu) { + struct cpu_desc *desc; uint64_t clidr; + desc = &cpu_desc[cpu]; /* Save affinity for current CPU */ - cpu_desc[cpu].mpidr = get_mpidr(); - CPU_AFFINITY(cpu) = cpu_desc[cpu].mpidr & CPU_AFF_MASK; - - cpu_desc[cpu].ctr = READ_SPECIALREG(ctr_el0); - cpu_desc[cpu].id_aa64dfr0 = READ_SPECIALREG(id_aa64dfr0_el1); - cpu_desc[cpu].id_aa64dfr1 = READ_SPECIALREG(id_aa64dfr1_el1); - cpu_desc[cpu].id_aa64isar0 = READ_SPECIALREG(id_aa64isar0_el1); - cpu_desc[cpu].id_aa64isar1 = READ_SPECIALREG(id_aa64isar1_el1); - cpu_desc[cpu].id_aa64isar2 = READ_SPECIALREG(id_aa64isar2_el1); - cpu_desc[cpu].id_aa64mmfr0 = READ_SPECIALREG(id_aa64mmfr0_el1); - cpu_desc[cpu].id_aa64mmfr1 = READ_SPECIALREG(id_aa64mmfr1_el1); - cpu_desc[cpu].id_aa64mmfr2 = READ_SPECIALREG(id_aa64mmfr2_el1); - cpu_desc[cpu].id_aa64pfr0 = READ_SPECIALREG(id_aa64pfr0_el1); - cpu_desc[cpu].id_aa64pfr1 = READ_SPECIALREG(id_aa64pfr1_el1); + desc->mpidr = get_mpidr(); + CPU_AFFINITY(cpu) = desc->mpidr & CPU_AFF_MASK; + + desc->ctr = READ_SPECIALREG(ctr_el0); + desc->id_aa64dfr0 = READ_SPECIALREG(id_aa64dfr0_el1); + desc->id_aa64dfr1 = READ_SPECIALREG(id_aa64dfr1_el1); + desc->id_aa64isar0 = READ_SPECIALREG(id_aa64isar0_el1); + desc->id_aa64isar1 = READ_SPECIALREG(id_aa64isar1_el1); + desc->id_aa64isar2 = READ_SPECIALREG(id_aa64isar2_el1); + desc->id_aa64mmfr0 = READ_SPECIALREG(id_aa64mmfr0_el1); + desc->id_aa64mmfr1 = READ_SPECIALREG(id_aa64mmfr1_el1); + desc->id_aa64mmfr2 = READ_SPECIALREG(id_aa64mmfr2_el1); + desc->id_aa64pfr0 = READ_SPECIALREG(id_aa64pfr0_el1); + desc->id_aa64pfr1 = READ_SPECIALREG(id_aa64pfr1_el1); /* * ID_AA64ZFR0_EL1 is only valid when at least one of: @@ -2394,71 +2413,65 @@ identify_cpu(u_int cpu) * - ID_AA64PFR1_EL1.SME is non-zero * In other cases it is zero, but still safe to read */ - cpu_desc[cpu].have_sve = - (ID_AA64PFR0_SVE_VAL(cpu_desc[cpu].id_aa64pfr0) != 0); - cpu_desc[cpu].id_aa64zfr0 = READ_SPECIALREG(ID_AA64ZFR0_EL1_REG); + desc->have_sve = + (ID_AA64PFR0_SVE_VAL(desc->id_aa64pfr0) != 0); + desc->id_aa64zfr0 = READ_SPECIALREG(ID_AA64ZFR0_EL1_REG); - cpu_desc[cpu].clidr = READ_SPECIALREG(clidr_el1); + desc->clidr = READ_SPECIALREG(clidr_el1); - clidr = cpu_desc[cpu].clidr; + clidr = desc->clidr; for (int i = 0; (clidr & CLIDR_CTYPE_MASK) != 0; i++, clidr >>= 3) { int j = 0; if ((clidr & CLIDR_CTYPE_IO)) { WRITE_SPECIALREG(csselr_el1, CSSELR_Level(i) | CSSELR_InD); - cpu_desc[cpu].ccsidr[i][j++] = + desc->ccsidr[i][j++] = READ_SPECIALREG(ccsidr_el1); } if ((clidr & ~CLIDR_CTYPE_IO) == 0) continue; WRITE_SPECIALREG(csselr_el1, CSSELR_Level(i)); - cpu_desc[cpu].ccsidr[i][j] = READ_SPECIALREG(ccsidr_el1); + desc->ccsidr[i][j] = READ_SPECIALREG(ccsidr_el1); } #ifdef COMPAT_FREEBSD32 /* Only read aarch32 SRs if EL0-32 is available */ - if (ID_AA64PFR0_EL0_VAL(cpu_desc[cpu].id_aa64pfr0) == - ID_AA64PFR0_EL0_64_32) { - cpu_desc[cpu].id_isar5 = READ_SPECIALREG(id_isar5_el1); - cpu_desc[cpu].mvfr0 = READ_SPECIALREG(mvfr0_el1); - cpu_desc[cpu].mvfr1 = READ_SPECIALREG(mvfr1_el1); + if (ID_AA64PFR0_EL0_VAL(desc->id_aa64pfr0) == ID_AA64PFR0_EL0_64_32) { + desc->id_isar5 = READ_SPECIALREG(id_isar5_el1); + desc->mvfr0 = READ_SPECIALREG(mvfr0_el1); + desc->mvfr1 = READ_SPECIALREG(mvfr1_el1); } #endif } static void -check_cpu_regs(u_int cpu) +check_cpu_regs(u_int cpu, struct cpu_desc *desc, struct cpu_desc *prev_desc) { - switch (cpu_aff_levels) { case 0: - if (CPU_AFF0(cpu_desc[cpu].mpidr) != - CPU_AFF0(cpu_desc[0].mpidr)) + if (CPU_AFF0(desc->mpidr) != CPU_AFF0(prev_desc->mpidr)) cpu_aff_levels = 1; /* FALLTHROUGH */ case 1: - if (CPU_AFF1(cpu_desc[cpu].mpidr) != - CPU_AFF1(cpu_desc[0].mpidr)) + if (CPU_AFF1(desc->mpidr) != CPU_AFF1(prev_desc->mpidr)) cpu_aff_levels = 2; /* FALLTHROUGH */ case 2: - if (CPU_AFF2(cpu_desc[cpu].mpidr) != - CPU_AFF2(cpu_desc[0].mpidr)) + if (CPU_AFF2(desc->mpidr) != CPU_AFF2(prev_desc->mpidr)) cpu_aff_levels = 3; /* FALLTHROUGH */ case 3: - if (CPU_AFF3(cpu_desc[cpu].mpidr) != - CPU_AFF3(cpu_desc[0].mpidr)) + if (CPU_AFF3(desc->mpidr) != CPU_AFF3(prev_desc->mpidr)) cpu_aff_levels = 4; break; } - if (cpu_desc[cpu].ctr != cpu_desc[0].ctr) { + if (desc->ctr != prev_desc->ctr) { /* * If the cache type register is different we may * have a different l1 cache type. */ - identify_cache(cpu_desc[cpu].ctr); + identify_cache(desc->ctr); } } From nobody Thu Jun 8 16:11:17 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QcTjL1x6vz4bvWN; Thu, 8 Jun 2023 16: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QcTjL0qTlz4bDb; Thu, 8 Jun 2023 16: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=1686240678; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hW/KwPs498Af/8L2qenlCx/UqRx1JFdo5EGTwZ4DQQU=; b=wHdexyvK+FsoEfScOJo916WaTJtzpJNqQ6YoimSFk5JjWO70RARbna7IWePuvmWR6YUBHm CmGb/rB4uZOkdSlisWWfi0cBi6nn+WNGptJsMGJr85AEepPmkAJ+xbFCp080ADcusBN5fJ 8m/52wfZnENHXUz4Vk8+AW46AMKneewf+OCQtFRwTLaXG2vYv8ayzFCHfP1fV9JYtV4i+Y e+GJvXtHp+gtxul3N+B/6dYb9vgmkG0w/EgqVbSkAMqNj3u1ZDmtqLAovQSKVAmZCQMgTP mJh/B+yIv5gHpwHGw22PQKE1QzB6ylvVoJqL3KLvidhirBeMpJ3+8dyx938Ctg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686240678; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hW/KwPs498Af/8L2qenlCx/UqRx1JFdo5EGTwZ4DQQU=; b=ukYGOjrvClN6L2Pa7mgYqsugyUWg5T9OCHIFPp54u365CUdEiFbm5HtvzI2WMRG+fcZP+q OdSNI9SmSaJOQnTnU0I/2lN8P3qZ6yoYZQisAskRdBoMqZrh5tg04/XbTpONgpAhsG1UPe WLVLsexN8b475aFhlB9AVsewjCEr0d1ffE5extgHiCwogCj3guVFpPCCHwmYZ2QPb8LQQo Cxo2X7gzlMK66UQtRbnetn46lSeHWGlkR7PEOOdK2ZUwys0uMgDaNKSlihq9aPM7yZz7y6 /KqChGY/CYvZN9MmWxn4PPmaxKCeGN7QFRe+IXXihU4oyEksWYYW7CZVVjO35Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686240678; a=rsa-sha256; cv=none; b=MkohdULVUh4JX1eXcgZqjvqeaFjpeij5ViPEArct7fjgC92wXPqPdd9YQNgqDgwfW0h0Bw 184Z7SY5J6X5mtIsDYmfJu2fVQO1yNvIwB7U542AzX9PKJ8X19vQQ8UjTVTXxS0txVQoKN PR8HeIn4Wc6vWOBe+0hq3FjBuSjrpVcQ0d7GQnH7FV7gJm2CCUJNMPZJi6wX6sd8P0nzPL 3V3Yr4madR/cQisSgqJqRIGtNEGyJpnlboXjYoo2V/9BQ4WCPOO6r1ZXjVyBAh4CVu0ZkE FZ1wQYMRrveXfFcZwaVcT6vIb75TOOesQrH2PxVYnakUUauXEL3omzAauk6HIw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QcTjK6vKBz11CV; Thu, 8 Jun 2023 16:11:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 358GBHCK027061; Thu, 8 Jun 2023 16:11:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 358GBHbw027060; Thu, 8 Jun 2023 16:11:17 GMT (envelope-from git) Date: Thu, 8 Jun 2023 16:11:17 GMT Message-Id: <202306081611.358GBHbw027060@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: d057b7aac8ae - main - arm64: Malloc the cpu_desc array List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d057b7aac8aedd353f2cb047cb0069f6a4db7a83 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=d057b7aac8aedd353f2cb047cb0069f6a4db7a83 commit d057b7aac8aedd353f2cb047cb0069f6a4db7a83 Author: Andrew Turner AuthorDate: 2023-06-02 16:12:24 +0000 Commit: Andrew Turner CommitDate: 2023-06-08 16:10:10 +0000 arm64: Malloc the cpu_desc array We only need this during boot. Allocate the array before starting CPUs to reduce the memory usage. Reviewed by: Zach Leaf Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D40433 --- sys/arm64/arm64/identcpu.c | 43 ++++++++++++++++++++++++++++++++++++++----- sys/arm64/arm64/mp_machdep.c | 2 ++ sys/arm64/include/cpu.h | 2 ++ 3 files changed, 42 insertions(+), 5 deletions(-) diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c index fb1c4537f216..86b669ea2f56 100644 --- a/sys/arm64/arm64/identcpu.c +++ b/sys/arm64/arm64/identcpu.c @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -47,6 +48,8 @@ __FBSDID("$FreeBSD$"); #include #include +static MALLOC_DEFINE(M_IDENTCPU, "CPU ID", "arm64 CPU identification memory"); + struct cpu_desc; static void print_cpu_midr(struct sbuf *sb, u_int cpu); @@ -150,10 +153,22 @@ struct cpu_desc { bool have_sve; }; -static struct cpu_desc cpu_desc[MAXCPU]; +static struct cpu_desc cpu_desc0; +static struct cpu_desc *cpu_desc; static struct cpu_desc kern_cpu_desc; static struct cpu_desc user_cpu_desc; +static struct cpu_desc * +get_cpu_desc(u_int cpu) +{ + /* The cpu_desc for CPU 0 is used before the allocator is ready. */ + if (cpu == 0) + return (&cpu_desc0); + + MPASS(cpu_desc != NULL); + return (&cpu_desc[cpu - 1]); +} + struct cpu_parts { u_int part_id; const char *part_name; @@ -1803,7 +1818,7 @@ update_special_regs(u_int cpu) user_cpu_desc.id_aa64dfr0 = ID_AA64DFR0_DebugVer_8; } - desc = &cpu_desc[cpu]; + desc = get_cpu_desc(cpu); for (i = 0; i < nitems(user_regs); i++) { value = CPU_DESC_FIELD(*desc, i); if (cpu == 0) { @@ -1839,6 +1854,22 @@ update_special_regs(u_int cpu) } } +void +cpu_desc_init(void) +{ + if (mp_ncpus == 1) + return; + + /* + * Allocate memory for the non-boot CPUs to store their registers. + * As this is indexed by CPU ID we need to allocate space for CPUs + * 1 to mp_maxid. Because of this mp_maxid is already the correct + * number of elements. + */ + cpu_desc = mallocarray(mp_maxid, sizeof(*cpu_desc), M_IDENTCPU, + M_ZERO | M_WAITOK); +} + /* HWCAP */ bool __read_frequently lse_supported = false; @@ -1896,7 +1927,7 @@ identify_cpu_sysinit(void *dummy __unused) prev_desc = NULL; CPU_FOREACH(cpu) { - desc = &cpu_desc[cpu]; + desc = get_cpu_desc(cpu); if (cpu != 0) { check_cpu_regs(cpu, desc, prev_desc); update_special_regs(cpu); @@ -1950,7 +1981,7 @@ cpu_features_sysinit(void *dummy __unused) prev_desc = NULL; CPU_FOREACH(cpu) { - desc = &cpu_desc[cpu]; + desc = get_cpu_desc(cpu); print_cpu_features(cpu, desc, prev_desc); prev_desc = desc; } @@ -1961,6 +1992,8 @@ cpu_features_sysinit(void *dummy __unused) sbuf_finish(&sb); sbuf_delete(&sb); + + free(cpu_desc, M_IDENTCPU); } /* Log features before APs are released and start printing to the dmesg. */ SYSINIT(cpu_features, SI_SUB_SMP - 1, SI_ORDER_ANY, cpu_features_sysinit, NULL); @@ -2390,7 +2423,7 @@ identify_cpu(u_int cpu) struct cpu_desc *desc; uint64_t clidr; - desc = &cpu_desc[cpu]; + desc = get_cpu_desc(cpu); /* Save affinity for current CPU */ desc->mpidr = get_mpidr(); CPU_AFFINITY(cpu) = desc->mpidr & CPU_AFF_MASK; diff --git a/sys/arm64/arm64/mp_machdep.c b/sys/arm64/arm64/mp_machdep.c index 9dd1182e5721..babeee331be0 100644 --- a/sys/arm64/arm64/mp_machdep.c +++ b/sys/arm64/arm64/mp_machdep.c @@ -779,6 +779,8 @@ cpu_mp_start(void) mpidr = READ_SPECIALREG(mpidr_el1) & CPU_AFF_MASK; cpuid_to_pcpu[0]->pc_mpidr = mpidr; + cpu_desc_init(); + switch(arm64_bus_method) { #ifdef DEV_ACPI case ARM64_BUS_ACPI: diff --git a/sys/arm64/include/cpu.h b/sys/arm64/include/cpu.h index 88a9ac18080b..1ea497756698 100644 --- a/sys/arm64/include/cpu.h +++ b/sys/arm64/include/cpu.h @@ -214,6 +214,8 @@ void update_special_regs(u_int); bool extract_user_id_field(u_int, u_int, uint8_t *); bool get_kernel_reg(u_int, uint64_t *); +void cpu_desc_init(void); + #define CPU_AFFINITY(cpu) __cpu_affinity[(cpu)] #define CPU_CURRENT_SOCKET \ (CPU_AFF2(CPU_AFFINITY(PCPU_GET(cpuid)))) From nobody Thu Jun 8 16:30:54 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QcV7y44ndz4byFb; Thu, 8 Jun 2023 16:30:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QcV7y353Cz3HFH; Thu, 8 Jun 2023 16:30:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686241854; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lIs8K6P79OYPy6mRgqxsCpoey6dqYHHFyRy+ovzC8yM=; b=Esd1iwI3Q3fjF5HCNngIAv1qfXXzX+vExS7EGMRpaBKkcTkXI6RR4QLL+y4EGQATrsbct2 lekoxMeTHvZ1QwEUflHfFreDnCr1PyWrwz7HGsfcMA9ksPnaMrRX/75j54FS9dZ+lGqyZv bbn0Iuar3tOUfXx0VBjKf3IbxBgDjdQWam5rYyVlX4UsuAvqakJ60AuZhp5BCo4Y6/1TvW AidE5EKEAfj/kD/cK6PmrTeu8K9dbd5zbKnfXvZppS632am4PoWJrsJulw6lYXEYhvGYey kghUYmBB+Je7aZ++fwwEVNmN2XXelIKaiuL8xHbutp+y5bKmDhNZ/XlKpBIKSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686241854; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lIs8K6P79OYPy6mRgqxsCpoey6dqYHHFyRy+ovzC8yM=; b=O3F+9v9rrVoYO2Y+MofMhRzyKpYNaQ7CibPsAftnrtbeRBTa/3aO6RTA4OSqu1Gkpc2oSc 7MyMtgvI5O/GCU6fIDrMzEziIG21FofK2wM7c7E8DgLhTEpqyVcPQY1633Gmp3GzR8N07j zUewVy8VoSzSAaciq8s27UIi6BZUZYUyksimA9RJ5n00Dx+Foqspz+y7bOKeR2eDW34Rjc 6lJg0+6HSKPEJD7l7v+5CIdHDiJayG3he8fw2MuMTxgPiV2vUoECUYdwG7k6akDG48MfUW Omwhf3w8uc5Cl8hSDXgbUkN4/pRMVV/LiGLOqrcalYIlJml4w9QF1XUZuneung== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686241854; a=rsa-sha256; cv=none; b=ZiySFMIAcQE7j62Y9VTVYx7/s0RAzkFkV8jqLMJHFScGLTreSHXTAwwM+g6+OzqmoiN2CI sd6Ec7ZDrXljpx0bo7Na+x7K0c+uAPx/STqLiGkVSjyAMhge56DGThuyCsdqAEqdBp6N6n mBArJYsoWuJjPJ5VehGDJA1Hn+Tb+2grPbf1c7rpgn+BZOlkMhsC3KTpK3sQorB4q/BcxB s8qOKD0e/9RmK2Ni2UWV62TDsKfT+VFLvGeNujHNOqY3BYn9nWzb2XsM76VD+u+ZpsCtTZ xtAYmlqYaGyP5Zwwz+rRarit6bJGmAHK2XNEAAXJufz3BMiv6jL9xFhRuAkpKQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QcV7y1mv5z11TT; Thu, 8 Jun 2023 16:30:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 358GUstH059986; Thu, 8 Jun 2023 16:30:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 358GUsce059985; Thu, 8 Jun 2023 16:30:54 GMT (envelope-from git) Date: Thu, 8 Jun 2023 16:30:54 GMT Message-Id: <202306081630.358GUsce059985@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: f40cd16bfda4 - main - kern: Move devctl_systems[] out of sys/sys/devctl.h List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f40cd16bfda4f4512033bb9e7212ee5d8b94b9a7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=f40cd16bfda4f4512033bb9e7212ee5d8b94b9a7 commit f40cd16bfda4f4512033bb9e7212ee5d8b94b9a7 Author: Ed Maste AuthorDate: 2023-06-08 13:58:26 +0000 Commit: Ed Maste CommitDate: 2023-06-08 16:28:04 +0000 kern: Move devctl_systems[] out of sys/sys/devctl.h The amd64-gcc12 build was failing with `error: 'devctl_systems' defined but not used`. Just move it to the C file where it's used. PR: 271903 Sponsored by: The FreeBSD Foundation --- sys/netlink/netlink_sysevent.c | 23 +++++++++++++++++++++++ sys/sys/devctl.h | 23 ----------------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/sys/netlink/netlink_sysevent.c b/sys/netlink/netlink_sysevent.c index 9da72a121ecd..01d0837b14d2 100644 --- a/sys/netlink/netlink_sysevent.c +++ b/sys/netlink/netlink_sysevent.c @@ -53,6 +53,29 @@ static struct sysevent_group { uint32_t id; } sysevent_groups[MAX_SYSEVENT_GROUPS] = {}; +static const char *devctl_systems[] = { + "ACPI", + "AEON", + "CAM", + "CARP", + "coretemp", + "DEVFS", + "device", + "ETHERNET", + "GEOM", + "HYPERV_NIC_VF", + "IFNET", + "INFINIBAND", + "KERNEL", + "nvme", + "PMU", + "RCTL", + "USB", + "VFS", + "VT", + "ZFS", +}; + static void sysevent_write(struct sysevent_group *se, const char *subsystem, const char *type, const char *data) diff --git a/sys/sys/devctl.h b/sys/sys/devctl.h index 5b613cf427df..da26eaabc26c 100644 --- a/sys/sys/devctl.h +++ b/sys/sys/devctl.h @@ -13,29 +13,6 @@ * hook to send the message. */ -static const char *devctl_systems[] = { - "ACPI", - "AEON", - "CAM", - "CARP", - "coretemp", - "DEVFS", - "device", - "ETHERNET", - "GEOM", - "HYPERV_NIC_VF", - "IFNET", - "INFINIBAND", - "KERNEL", - "nvme", - "PMU", - "RCTL", - "USB", - "VFS", - "VT", - "ZFS", -}; - bool devctl_process_running(void); void devctl_notify(const char *__system, const char *__subsystem, const char *__type, const char *__data); From nobody Thu Jun 8 17:32:49 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QcWWQ2bHgz4c80J; Thu, 8 Jun 2023 17:32:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QcWWQ1vCvz3pdv; Thu, 8 Jun 2023 17:32:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686245570; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uMqn/lxf16T13ZDfqjUrZG5+z+gFOkXxZ4LQZtUV780=; b=rCWF6xN6nxe44JiFZ+rR4L+Ux/dJqB06aUxPXoaaVLKRbSkV/x/6dV9tWyPHkmsqeCuZ1U PWz1JDA57MMKW2TmP77s5To+rH/WbTqmHKNK3tYsMAy4G7fcNZ2uXfPzdSyj51X5W49Z7c MoBKIas1s0NT0fS9twgocM8so+GsAsP/yPC+ISR9uKEyBZotadTvAq4BHl2gJZ5mrXvdiH ZH75qOgi7jd42TgB2PArr6aod+hKO1Dx1vMeA19g8i9534Je8gS5ZxXzF06uFBUxPrmDSY PiUacF/CYVZE1eV/B3cphIr2oYREo10ulW7fOxGJdFsGVGOSYUfwfhPAFDx0ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686245570; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uMqn/lxf16T13ZDfqjUrZG5+z+gFOkXxZ4LQZtUV780=; b=ik/9oZZeGxUFOSpd8ZkUrw7r1/iyZ3vkUD1ilAdhjnmwApTzRXR7i+sNCJXWl8FaALyfBd /WmwgB7cj11MRx6xfITf7j6Hx9umP+IpblvzTaeaCpJbx5ERS6gyDYxnctFDNMr0E6PKM5 rs/E0vcKd07lzgb4lj5xGZsx6cVGXaDXGVk0wAFnRpHALQ78d0f9mxbNtrUZG+L7Iyl/OY s/nNRpC5VbPtRHpxM2UDUlxViZXLb+0TPsnAm7NcSlljxhetcJhM/fRYicvTXhBlt2nzzK mva06nWFAQZYqKfVUroaqBT/mJMb1ONTq7cpmmqIS+PayiDqEBpa1duTuIdCBQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686245570; a=rsa-sha256; cv=none; b=kiQ+IABDmeIZI9TAOgt+3D/z5DFvgnEfAd+OruvSG6NhcNb3+s2WSp1tL2pagn8Orf3xtI eYGwfxDPIe125tBFTkEA+0Grwzmq9HuXdYMaMf24YfwBFQBEknh5cpksTeX9Sj6j3b447+ NQGr37n0tvBqCYNlh69VcFepZMEGj7xRCgee+/cHtMJ3Dsi2QURVKX1XmYuL60r9vPnVJy yIkkME0JauOvTx3oHgGUDAe4EbBY/LEsy233sq119aQyq5Tr2mwoF4vliWz0MxJvoIsAH0 QG2R/RQUlqCAx1BRUzMrh89CZrMdV9n6AZZPNJvLmtbDYoaBVnS94I/mMGh60Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QcWWQ0frbz12WB; Thu, 8 Jun 2023 17:32:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 358HWovm064923; Thu, 8 Jun 2023 17:32:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 358HWn5q064922; Thu, 8 Jun 2023 17:32:49 GMT (envelope-from git) Date: Thu, 8 Jun 2023 17:32:49 GMT Message-Id: <202306081732.358HWn5q064922@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Joseph Mingrone Subject: git: ee67461e5682 - main - tpcdump: Update to 4.99.4 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ee67461e56828dd1f8de165947ba83f6d9148a87 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jrm: URL: https://cgit.FreeBSD.org/src/commit/?id=ee67461e56828dd1f8de165947ba83f6d9148a87 commit ee67461e56828dd1f8de165947ba83f6d9148a87 Merge: f40cd16bfda4 51a183021fce Author: Joseph Mingrone AuthorDate: 2023-06-08 17:30:54 +0000 Commit: Joseph Mingrone CommitDate: 2023-06-08 17:30:54 +0000 tpcdump: Update to 4.99.4 Local changes: - Update some local modifications to fix build - Synch config.h with upstream as much as possible Changelog: https://git.tcpdump.org/tcpdump/blob/55bc126b0216cfe409b8d6bd378f65679d136ddf:/CHANGES Reviewed by: emaste Obtained from: https://www.tcpdump.org/release/tcpdump-4.99.4.tar.gz Sponsored by: The FreeBSD Foundation contrib/tcpdump/CHANGES | 289 +- contrib/tcpdump/CMakeLists.txt | 1371 ++++++++ contrib/tcpdump/CONTRIBUTING | 151 - contrib/tcpdump/CONTRIBUTING.md | 191 ++ contrib/tcpdump/CREDITS | 149 +- contrib/tcpdump/{INSTALL.txt => INSTALL.md} | 61 +- contrib/tcpdump/LICENSE | 6 +- contrib/tcpdump/Makefile.in | 230 +- contrib/tcpdump/PLATFORMS | 16 - contrib/tcpdump/README | 1 - contrib/tcpdump/README.md | 100 +- contrib/tcpdump/VERSION | 2 +- contrib/tcpdump/addrtoname.c | 493 +-- contrib/tcpdump/addrtoname.h | 86 +- contrib/tcpdump/addrtostr.c | 12 +- contrib/tcpdump/af.c | 4 +- contrib/tcpdump/af.h | 2 +- contrib/tcpdump/ah.h | 46 +- contrib/tcpdump/appletalk.h | 60 +- contrib/tcpdump/ascii_strcasecmp.c | 6 +- contrib/tcpdump/atime.awk | 2 +- contrib/tcpdump/bpf_dump.c | 5 +- contrib/tcpdump/chdlc.h | 2 +- contrib/tcpdump/checksum.c | 10 +- contrib/tcpdump/cmake/Modules/FindCRYPTO.cmake | 24 + contrib/tcpdump/cmake/Modules/FindPCAP.cmake | 462 +++ contrib/tcpdump/cmake/Modules/FindSMI.cmake | 24 + contrib/tcpdump/cmake_uninstall.cmake.in | 21 + contrib/tcpdump/cmakeconfig.h.in | 290 ++ contrib/tcpdump/compiler-tests.h | 196 ++ contrib/tcpdump/config.guess | 1516 +++++---- contrib/tcpdump/config.h.in | 170 +- contrib/tcpdump/config.sub | 1705 +++++----- contrib/tcpdump/configure | 3794 +++++++++++---------- contrib/tcpdump/configure.ac | 508 +-- contrib/tcpdump/cpack.c | 103 +- contrib/tcpdump/cpack.h | 33 +- contrib/tcpdump/diag-control.h | 186 + contrib/tcpdump/doc/README.NetBSD.md | 22 + contrib/tcpdump/doc/README.Win32.md | 200 ++ contrib/tcpdump/doc/README.aix.md | 17 + contrib/tcpdump/doc/README.solaris.md | 41 + contrib/tcpdump/ethertype.h | 32 +- contrib/tcpdump/extract.h | 754 ++++- contrib/tcpdump/{ether.h => fptype.c} | 35 +- contrib/tcpdump/fptype.h | 34 + contrib/tcpdump/ftmacros.h | 127 + contrib/tcpdump/funcattrs.h | 110 +- contrib/tcpdump/getservent.h | 67 + contrib/tcpdump/gmpls.c | 4 +- contrib/tcpdump/gmt2local.c | 66 - contrib/tcpdump/gmt2local.h | 25 - contrib/tcpdump/in_cksum.c | 12 +- contrib/tcpdump/interface.h | 18 +- contrib/tcpdump/ip.h | 6 +- contrib/tcpdump/ip6.h | 91 +- contrib/tcpdump/ipproto.c | 10 +- contrib/tcpdump/ipproto.h | 15 +- contrib/tcpdump/l2vpn.c | 8 +- contrib/tcpdump/machdep.c | 24 +- contrib/tcpdump/missing/datalinks.c | 2 +- contrib/tcpdump/missing/dlnames.c | 5 +- contrib/tcpdump/missing/getopt_long.c | 30 +- contrib/tcpdump/{ => missing}/getopt_long.h | 6 +- contrib/tcpdump/missing/getservent.c | 143 + contrib/tcpdump/missing/pcap_dump_ftell.c | 46 + contrib/tcpdump/missing/snprintf.c | 119 +- contrib/tcpdump/missing/strlcat.c | 8 +- contrib/tcpdump/missing/strlcpy.c | 8 +- contrib/tcpdump/missing/strsep.c | 6 +- contrib/tcpdump/mkdep | 50 +- contrib/tcpdump/mpls.h | 6 +- contrib/tcpdump/nameser.h | 187 +- contrib/tcpdump/netdissect-alloc.c | 64 + contrib/tcpdump/netdissect-alloc.h | 32 + contrib/tcpdump/netdissect-ctype.h | 56 + contrib/tcpdump/netdissect-stdinc.h | 375 +- contrib/tcpdump/netdissect.c | 159 +- contrib/tcpdump/netdissect.h | 597 ++-- contrib/tcpdump/nfs.h | 169 +- contrib/tcpdump/nfsfh.h | 2 +- contrib/tcpdump/nlpid.c | 4 +- contrib/tcpdump/ntp.c | 74 + contrib/tcpdump/{vfprintf.c => ntp.h} | 58 +- contrib/tcpdump/openflow.h | 51 +- contrib/tcpdump/ospf.h | 154 +- contrib/tcpdump/oui.c | 33 +- contrib/tcpdump/oui.h | 32 +- contrib/tcpdump/parsenfsfh.c | 162 +- contrib/tcpdump/pcap_dump_ftell.c | 31 - contrib/tcpdump/pflog.h | 152 + contrib/tcpdump/ppp.h | 8 +- contrib/tcpdump/print-802_11.c | 1769 +++++----- contrib/tcpdump/print-802_15_4.c | 2603 +++++++++++++- contrib/tcpdump/print-ah.c | 57 +- contrib/tcpdump/print-ahcp.c | 283 +- contrib/tcpdump/print-aodv.c | 388 ++- contrib/tcpdump/print-aoe.c | 257 +- contrib/tcpdump/print-ap1394.c | 46 +- contrib/tcpdump/print-arcnet.c | 162 +- contrib/tcpdump/print-arista.c | 165 + contrib/tcpdump/print-arp.c | 261 +- contrib/tcpdump/print-ascii.c | 126 +- contrib/tcpdump/print-atalk.c | 462 +-- contrib/tcpdump/print-atm.c | 193 +- contrib/tcpdump/print-babel.c | 504 ++- contrib/tcpdump/print-bcm-li.c | 130 + contrib/tcpdump/print-beep.c | 23 +- contrib/tcpdump/print-bfd.c | 215 +- contrib/tcpdump/print-bgp.c | 4326 +++++++++++++----------- contrib/tcpdump/print-bootp.c | 569 ++-- contrib/tcpdump/print-brcmtag.c | 151 + contrib/tcpdump/print-bt.c | 44 +- contrib/tcpdump/print-calm-fast.c | 52 +- contrib/tcpdump/print-carp.c | 37 +- contrib/tcpdump/print-cdp.c | 596 ++-- contrib/tcpdump/print-cfm.c | 310 +- contrib/tcpdump/print-chdlc.c | 94 +- contrib/tcpdump/print-cip.c | 47 +- contrib/tcpdump/print-cnfp.c | 456 +-- contrib/tcpdump/print-dccp.c | 365 +- contrib/tcpdump/print-decnet.c | 680 ++-- contrib/tcpdump/print-dhcp6.c | 373 +- contrib/tcpdump/print-domain.c | 941 ++++-- contrib/tcpdump/print-dsa.c | 219 ++ contrib/tcpdump/print-dtp.c | 86 +- contrib/tcpdump/print-dvmrp.c | 341 +- contrib/tcpdump/print-eap.c | 277 +- contrib/tcpdump/print-egp.c | 224 +- contrib/tcpdump/print-eigrp.c | 472 +-- contrib/tcpdump/print-enc.c | 94 +- contrib/tcpdump/print-esp.c | 544 +-- contrib/tcpdump/print-ether.c | 496 ++- contrib/tcpdump/print-fddi.c | 93 +- contrib/tcpdump/print-forces.c | 761 ++--- contrib/tcpdump/print-fr.c | 386 +-- contrib/tcpdump/print-frag6.c | 38 +- contrib/tcpdump/print-ftp.c | 11 +- contrib/tcpdump/print-geneve.c | 81 +- contrib/tcpdump/print-geonet.c | 123 +- contrib/tcpdump/print-gre.c | 210 +- contrib/tcpdump/print-hncp.c | 331 +- contrib/tcpdump/print-hsrp.c | 88 +- contrib/tcpdump/print-http.c | 11 +- contrib/tcpdump/print-icmp.c | 523 +-- contrib/tcpdump/print-icmp6.c | 1383 ++++---- contrib/tcpdump/print-igmp.c | 232 +- contrib/tcpdump/print-igrp.c | 126 +- contrib/tcpdump/print-ip-demux.c | 231 ++ contrib/tcpdump/print-ip.c | 575 +--- contrib/tcpdump/print-ip6.c | 413 ++- contrib/tcpdump/print-ip6opts.c | 188 +- contrib/tcpdump/print-ipcomp.c | 31 +- contrib/tcpdump/print-ipfc.c | 50 +- contrib/tcpdump/print-ipnet.c | 51 +- contrib/tcpdump/print-ipoib.c | 125 + contrib/tcpdump/print-ipx.c | 193 +- contrib/tcpdump/print-isakmp.c | 1425 ++++---- contrib/tcpdump/print-isoclns.c | 2757 ++++++++------- contrib/tcpdump/print-juniper.c | 823 +++-- contrib/tcpdump/print-krb.c | 113 +- contrib/tcpdump/print-l2tp.c | 303 +- contrib/tcpdump/print-lane.c | 52 +- contrib/tcpdump/print-ldp.c | 304 +- contrib/tcpdump/print-lisp.c | 158 +- contrib/tcpdump/print-llc.c | 124 +- contrib/tcpdump/print-lldp.c | 651 ++-- contrib/tcpdump/print-lmp.c | 601 ++-- contrib/tcpdump/print-loopback.c | 81 +- contrib/tcpdump/print-lspping.c | 546 ++- contrib/tcpdump/print-lwapp.c | 172 +- contrib/tcpdump/print-lwres.c | 428 ++- contrib/tcpdump/print-m3ua.c | 96 +- contrib/tcpdump/print-macsec.c | 256 ++ contrib/tcpdump/print-medsa.c | 196 -- contrib/tcpdump/print-mobile.c | 35 +- contrib/tcpdump/print-mobility.c | 170 +- contrib/tcpdump/print-mpcp.c | 146 +- contrib/tcpdump/print-mpls.c | 108 +- contrib/tcpdump/print-mptcp.c | 279 +- contrib/tcpdump/print-msdp.c | 64 +- contrib/tcpdump/print-msnlb.c | 27 +- contrib/tcpdump/print-nflog.c | 177 +- contrib/tcpdump/print-nfs.c | 1419 ++++---- contrib/tcpdump/print-nsh.c | 233 +- contrib/tcpdump/print-ntp.c | 473 ++- contrib/tcpdump/print-null.c | 45 +- contrib/tcpdump/print-olsr.c | 285 +- contrib/tcpdump/print-openflow-1.0.c | 2478 ++++++-------- contrib/tcpdump/print-openflow-1.3.c | 1209 +++++++ contrib/tcpdump/print-openflow.c | 214 +- contrib/tcpdump/print-ospf.c | 773 ++--- contrib/tcpdump/print-ospf6.c | 515 ++- contrib/tcpdump/print-otv.c | 36 +- contrib/tcpdump/print-pflog.c | 188 +- contrib/tcpdump/print-pfsync.c | 136 +- contrib/tcpdump/print-pgm.c | 543 ++- contrib/tcpdump/print-pim.c | 667 ++-- contrib/tcpdump/print-pktap.c | 94 +- contrib/tcpdump/print-ppi.c | 108 +- contrib/tcpdump/print-ppp.c | 869 ++--- contrib/tcpdump/print-pppoe.c | 81 +- contrib/tcpdump/print-pptp.c | 731 ++-- contrib/tcpdump/print-ptp.c | 634 ++++ contrib/tcpdump/print-radius.c | 881 ++++- contrib/tcpdump/print-raw.c | 12 +- contrib/tcpdump/print-realtek.c | 248 ++ contrib/tcpdump/print-resp.c | 114 +- contrib/tcpdump/print-rip.c | 425 ++- contrib/tcpdump/print-ripng.c | 125 +- contrib/tcpdump/print-rpki-rtr.c | 147 +- contrib/tcpdump/print-rrcp.c | 129 - contrib/tcpdump/print-rsvp.c | 1179 ++++--- contrib/tcpdump/print-rt6.c | 96 +- contrib/tcpdump/print-rtsp.c | 11 +- contrib/tcpdump/print-rx.c | 1411 ++++---- contrib/tcpdump/print-sctp.c | 382 +-- contrib/tcpdump/print-sflow.c | 725 ++-- contrib/tcpdump/print-sip.c | 8 +- contrib/tcpdump/print-sl.c | 161 +- contrib/tcpdump/print-sll.c | 316 +- contrib/tcpdump/print-slow.c | 363 +- contrib/tcpdump/print-smb.c | 759 ++--- contrib/tcpdump/print-smtp.c | 11 +- contrib/tcpdump/print-snmp.c | 399 ++- contrib/tcpdump/print-someip.c | 142 + contrib/tcpdump/print-ssh.c | 99 + contrib/tcpdump/print-stp.c | 349 +- contrib/tcpdump/print-sunatm.c | 26 +- contrib/tcpdump/print-sunrpc.c | 85 +- contrib/tcpdump/print-symantec.c | 52 +- contrib/tcpdump/print-syslog.c | 72 +- contrib/tcpdump/print-tcp.c | 508 +-- contrib/tcpdump/print-telnet.c | 81 +- contrib/tcpdump/print-tftp.c | 71 +- contrib/tcpdump/print-timed.c | 111 +- contrib/tcpdump/print-tipc.c | 181 +- contrib/tcpdump/print-token.c | 94 +- contrib/tcpdump/print-udld.c | 115 +- contrib/tcpdump/print-udp.c | 563 +-- contrib/tcpdump/print-unsupported.c | 34 + contrib/tcpdump/print-usb.c | 186 +- contrib/tcpdump/print-vjc.c | 34 +- contrib/tcpdump/print-vqp.c | 107 +- contrib/tcpdump/print-vrrp.c | 101 +- contrib/tcpdump/print-vsock.c | 262 ++ contrib/tcpdump/print-vtp.c | 181 +- contrib/tcpdump/print-vxlan-gpe.c | 67 +- contrib/tcpdump/print-vxlan.c | 41 +- contrib/tcpdump/print-wb.c | 365 +- contrib/tcpdump/print-whois.c | 31 + contrib/tcpdump/print-zep.c | 181 + contrib/tcpdump/print-zephyr.c | 128 +- contrib/tcpdump/print-zeromq.c | 83 +- contrib/tcpdump/print.c | 411 ++- contrib/tcpdump/print.h | 5 +- contrib/tcpdump/rpc_auth.h | 11 +- contrib/tcpdump/rpc_msg.h | 24 +- contrib/tcpdump/rpl.h | 174 - contrib/tcpdump/setsignal.c | 90 - contrib/tcpdump/setsignal.h | 25 - contrib/tcpdump/signature.c | 26 +- contrib/tcpdump/slcompress.h | 4 +- contrib/tcpdump/smb.h | 6 +- contrib/tcpdump/smbutil.c | 535 +-- contrib/tcpdump/status-exit-codes.h | 32 + contrib/tcpdump/stime.awk | 2 +- contrib/tcpdump/strtoaddr.c | 20 +- contrib/tcpdump/tcp.h | 29 +- contrib/tcpdump/tcpdump.1.in | 364 +- contrib/tcpdump/tcpdump.c | 1232 +++++-- contrib/tcpdump/timeval-operations.h | 23 +- contrib/tcpdump/udp.h | 118 +- contrib/tcpdump/util-print.c | 614 ++-- contrib/tcpdump/varattrs.h | 59 + usr.sbin/tcpdump/tcpdump/Makefile | 25 +- usr.sbin/tcpdump/tcpdump/config.h | 208 +- 277 files changed, 47688 insertions(+), 32990 deletions(-) diff --cc contrib/tcpdump/CMakeLists.txt index 000000000000,9495b5d4c234..9495b5d4c234 mode 000000,100644..100644 --- a/contrib/tcpdump/CMakeLists.txt +++ b/contrib/tcpdump/CMakeLists.txt diff --cc contrib/tcpdump/CONTRIBUTING.md index 000000000000,000000000000..26f226ebd973 new file mode 100644 --- /dev/null +++ b/contrib/tcpdump/CONTRIBUTING.md @@@ -1,0 -1,0 +1,191 @@@ ++# Some Information for Contributors ++Thank you for considering to make a contribution to tcpdump! Please use the ++guidelines below to achieve the best results and experience for everyone. ++ ++## How to report bugs and other problems ++**To report a security issue (segfault, buffer overflow, infinite loop, arbitrary ++code execution etc) please send an e-mail to security@tcpdump.org, do not use ++the bug tracker!** ++ ++To report a non-security problem (failure to compile, incorrect output in the ++protocol printout, missing support for a particular protocol etc) please check ++first that it reproduces with the latest stable release of tcpdump and the latest ++stable release of libpcap. If it does, please check that the problem reproduces ++with the current git master branch of tcpdump and the current git master branch of ++libpcap. If it does (and it is not a security-related problem, otherwise see ++above), please navigate to the ++[bug tracker](https://github.com/the-tcpdump-group/tcpdump/issues) ++and check if the problem has already been reported. If it has not, please open ++a new issue and provide the following details: ++ ++* tcpdump and libpcap version (`tcpdump --version`) ++* operating system name and version and any other details that may be relevant ++ (`uname -a`, compiler name and version, CPU type etc.) ++* custom `configure`/`cmake` flags, if any ++* statement of the problem ++* steps to reproduce ++ ++Please note that if you know exactly how to solve the problem and the solution ++would not be too intrusive, it would be best to contribute some development time ++and to open a pull request instead as discussed below. ++ ++Still not sure how to do? Feel free to ++[subscribe to the mailing list](https://www.tcpdump.org/#mailing-lists) ++and ask! ++ ++ ++## How to add new code and to update existing code ++ ++0) Check that there isn't a pull request already opened for the changes you ++ intend to make. ++ ++1) [Fork](https://help.github.com/articles/fork-a-repo/) the Tcpdump ++ [repository](https://github.com/the-tcpdump-group/tcpdump). ++ ++2) The easiest way to test your changes on multiple operating systems and ++ architectures is to let the upstream CI test your pull request (more on ++ this below). ++ ++3) Setup your git working copy ++ ``` ++ git clone https://github.com//tcpdump.git ++ cd tcpdump ++ git remote add upstream https://github.com/the-tcpdump-group/tcpdump ++ git fetch upstream ++ ``` ++ ++4) Do a `touch .devel` in your working directory. ++ Currently, the effect is ++ * add (via `configure`, in `Makefile`) some warnings options (`-Wall`, ++ `-Wmissing-prototypes`, `-Wstrict-prototypes`, ...) to the compiler if it ++ supports these options, ++ * have the `Makefile` support `make depend` and the `configure` script run it. ++ ++5) Configure and build ++ ``` ++ ./configure && make -s && make check ++ ``` ++ ++6) Add/update tests ++ The `tests` directory contains regression tests of the dissection of captured ++ packets. Those captured packets were saved running tcpdump with option ++ `-w sample.pcap`. Additional options, such as `-n`, are used to create relevant ++ and reproducible output; `-#` is used to indicate which particular packets ++ have output that differs. The tests are run with the `TZ` environment ++ variable set to `GMT0`, so that UTC, rather than the local time where the ++ tests are being run, is used when "local time" values are printed. The ++ actual test compares the current text output with the expected result ++ (`sample.out`) saved from a previous version. ++ ++ Any new/updated fields in a dissector must be present in a `sample.pcap` file ++ and the corresponding output file. ++ ++ Configuration is set in `tests/TESTLIST`. ++ Each line in this file has the following format: ++ ``` ++ test-name sample.pcap sample.out tcpdump-options ++ ``` ++ ++ The `sample.out` file can be produced as follows: ++ ``` ++ (cd tests && TZ=GMT0 ../tcpdump -# -n -r sample.pcap tcpdump-options > sample.out) ++ ``` ++ ++ Or, for convenience, use `./update-test.sh test-name` ++ ++ It is often useful to have test outputs with different verbosity levels ++ (none, `-v`, `-vv`, `-vvv`, etc.) depending on the code. ++ ++7) Test using `make check` (current build options) and `./build_matrix.sh` ++ (a multitude of build options, build systems and compilers). If you can, ++ test on more than one operating system. Don't send a pull request until ++ all tests pass. ++ ++8) Try to rebase your commits to keep the history simple. ++ ``` ++ git fetch upstream ++ git rebase upstream/master ++ ``` ++ (If the rebase fails and you cannot resolve, issue `git rebase --abort` ++ and ask for help in the pull request comment.) ++ ++9) Once 100% happy, put your work into your forked repository using `git push`. ++ ++10) [Initiate and send](https://help.github.com/articles/using-pull-requests/) ++ a pull request. ++ This will trigger the upstream repository CI tests. ++ ++ ++## Code style and generic remarks ++* A thorough reading of some other printers code is useful. ++ ++* Put the normative reference if any as comments (RFC, etc.). ++ ++* Put the format of packets/headers/options as comments if there is no ++ published normative reference. ++ ++* The printer may receive incomplete packet in the buffer, truncated at any ++ random position, for example by capturing with `-s size` option. ++ If your code reads and decodes every byte of the protocol packet, then to ++ ensure proper and complete bounds checks it would be sufficient to read all ++ packet data using the `GET_*()` macros, typically: ++ ``` ++ GET_U_1(p) ++ GET_S_1(p) ++ GET_BE_U_n(p), n in { 2, 3, 4, 5, 6, 7, 8 } ++ GET_BE_S_n(p), n in { 2, 3, 4, 5, 6, 7, 8 } ++ ``` ++ If your code uses the macros above only on some packet data, then the gaps ++ would have to be bounds-checked using the `ND_TCHECK_*()` macros: ++ ``` ++ ND_TCHECK_n(p), n in { 1, 2, 3, 4, 5, 6, 7, 8, 16 } ++ ND_TCHECK_SIZE(p) ++ ND_TCHECK_LEN(p, l) ++ ``` ++ For the `ND_TCHECK_*` macros (if not already done): ++ * Assign: `ndo->ndo_protocol = "protocol";` ++ * Define: `ND_LONGJMP_FROM_TCHECK` before including `netdissect.h` ++ * Make sure that the intersection of `GET_*()` and `ND_TCHECK_*()` is minimal, ++ but at the same time their union covers all packet data in all cases. ++ ++ You can test the code via: ++ ``` ++ sudo ./tcpdump -s snaplen [-v][v][...] -i lo # in a terminal ++ sudo tcpreplay -i lo sample.pcap # in another terminal ++ ``` ++ You should try several values for snaplen to do various truncation. ++ ++* Do invalid packet checks in code: Think that your code can receive in input ++ not only a valid packet but any arbitrary random sequence of octets (packet ++ * built malformed originally by the sender or by a fuzz tester, ++ * became corrupted in transit or for some other reason). ++ ++ Print with: `nd_print_invalid(ndo); /* to print " (invalid)" */` ++ ++* Use `struct tok` for indexed strings and print them with ++ `tok2str()` or `bittok2str()` (for flags). ++ ++* Avoid empty lines in output of printers. ++ ++* A commit message must have: ++ ``` ++ First line: Capitalized short summary in the imperative (50 chars or less) ++ ++ If the commit concerns a protocol, the summary line must start with ++ "protocol: ". ++ ++ Body: Detailed explanatory text, if necessary. Fold it to approximately ++ 72 characters. There must be an empty line separating the summary from ++ the body. ++ ``` ++ ++* Avoid non-ASCII characters in code and commit messages. ++ ++* Use the style of the modified sources. ++ ++* Don't mix declarations and code. ++ ++* Don't use `//` for comments. ++ Not all C compilers accept C++/C99 comments by default. ++ ++* Avoid trailing tabs/spaces diff --cc contrib/tcpdump/LICENSE index dea5f7d54d6b,000000000000..a10474d54aeb mode 100644,000000..100644 --- a/contrib/tcpdump/LICENSE +++ b/contrib/tcpdump/LICENSE @@@ -1,19 -1,0 +1,19 @@@ +License: BSD - ++ +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. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. - ++ +THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. diff --cc contrib/tcpdump/README.md index a1fba9bca6d4,000000000000..566b7b7a874f mode 100644,000000..100644 --- a/contrib/tcpdump/README.md +++ b/contrib/tcpdump/README.md @@@ -1,225 -1,0 +1,225 @@@ - # tcpdump ++# TCPDUMP 4.x.y by [The Tcpdump Group](https://www.tcpdump.org/) + - [![Build - Status](https://travis-ci.org/the-tcpdump-group/tcpdump.png)](https://travis-ci.org/the-tcpdump-group/tcpdump) - - To report a security issue please send an e-mail to security@tcpdump.org. ++**To report a security issue please send an e-mail to security@tcpdump.org.** + +To report bugs and other problems, contribute patches, request a - feature, provide generic feedback etc please see the file - CONTRIBUTING in the tcpdump source tree root. - - TCPDUMP 4.x.y - Now maintained by "The Tcpdump Group" - See www.tcpdump.org ++feature, provide generic feedback etc please see the ++[guidelines for contributing](CONTRIBUTING.md) in the tcpdump source tree root. + - Anonymous Git is available via: ++Anonymous Git is available via + - git clone git://bpf.tcpdump.org/tcpdump - - formerly from Lawrence Berkeley National Laboratory - Network Research Group - ftp://ftp.ee.lbl.gov/old/tcpdump.tar.Z (3.4) ++ https://github.com/the-tcpdump-group/tcpdump.git + +This directory contains source code for tcpdump, a tool for network - monitoring and data acquisition. This software was originally - developed by the Network Research Group at the Lawrence Berkeley - National Laboratory. The original distribution is available via - anonymous ftp to `ftp.ee.lbl.gov`, in `tcpdump.tar.Z`. More recent - development is performed at tcpdump.org, http://www.tcpdump.org/ ++monitoring and data acquisition. + ++Over the past few years, tcpdump has been steadily improved by the ++excellent contributions from the Internet community (just browse ++through the [change log](CHANGES)). We are grateful for all the input. ++ ++### Supported platforms ++In many operating systems tcpdump is available as a native package or port, ++which simplifies installation of updates and long-term maintenance. However, ++the native packages are sometimes a few versions behind and to try a more ++recent snapshot it will take to compile tcpdump from the source code. ++ ++tcpdump compiles and works on at least the following platforms: ++ ++* AIX ++* DragonFly BSD ++* FreeBSD ++* Haiku ++* HP-UX 11i ++* illumos (OmniOS, OpenIndiana) ++* GNU/Linux ++* {Mac} OS X / macOS ++* NetBSD ++* OpenBSD ++* OpenWrt ++* Solaris ++* Windows (requires WinPcap or Npcap, and Visual Studio with CMake) ++ ++### Dependency on libpcap +Tcpdump uses libpcap, a system-independent interface for user-level +packet capture. Before building tcpdump, you must first retrieve and - build libpcap, also originally from LBL and now being maintained by - tcpdump.org; see http://www.tcpdump.org/ . ++build libpcap. + +Once libpcap is built (either install it or make sure it's in - `../libpcap`), you can build tcpdump using the procedure in the `INSTALL.txt` - file. ++`../libpcap`), you can build tcpdump using the procedure in the ++[installation notes](INSTALL.md). + ++### Origins of tcpdump +The program is loosely based on SMI's "etherfind" although none of the +etherfind code remains. It was originally written by Van Jacobson as - part of an ongoing research project to investigate and improve tcp and - internet gateway performance. The parts of the program originally ++part of an ongoing research project to investigate and improve TCP and ++Internet gateway performance. The parts of the program originally +taken from Sun's etherfind were later re-written by Steven McCanne of +LBL. To insure that there would be no vestige of proprietary code in +tcpdump, Steve wrote these pieces from the specification given by the +manual entry, with no access to the source of tcpdump or etherfind. ++```text ++formerly from Lawrence Berkeley National Laboratory ++ Network Research Group ++ ftp://ftp.ee.lbl.gov/old/tcpdump.tar.Z (3.4) ++``` + - Over the past few years, tcpdump has been steadily improved by the - excellent contributions from the Internet community (just browse - through the `CHANGES` file). We are grateful for all the input. - ++### See also +Richard Stevens gives an excellent treatment of the Internet protocols +in his book *"TCP/IP Illustrated, Volume 1"*. If you want to learn more +about tcpdump and how to interpret its output, pick up this book. + - Some tools for viewing and analyzing tcpdump trace files are available - from the Internet Traffic Archive: - - * http://www.sigcomm.org/ITA/ - - Another tool that tcpdump users might find useful is tcpslice: - - * https://github.com/the-tcpdump-group/tcpslice - ++Another tool that tcpdump users might find useful is ++[tcpslice](https://github.com/the-tcpdump-group/tcpslice). +It is a program that can be used to extract portions of tcpdump binary - trace files. See the above distribution for further details and - documentation. - - Current versions can be found at www.tcpdump.org. - - - The TCPdump team - - original text by: Steve McCanne, Craig Leres, Van Jacobson ++trace files. + - ------------------------------------- ++### The original LBL README by Steve McCanne, Craig Leres and Van Jacobson +``` +This directory also contains some short awk programs intended as +examples of ways to reduce tcpdump data when you're tracking +particular network problems: + +send-ack.awk + Simplifies the tcpdump trace for an ftp (or other unidirectional + tcp transfer). Since we assume that one host only sends and + the other only acks, all address information is left off and + we just note if the packet is a "send" or an "ack". + + There is one output line per line of the original trace. + Field 1 is the packet time in decimal seconds, relative + to the start of the conversation. Field 2 is delta-time + from last packet. Field 3 is packet type/direction. + "Send" means data going from sender to receiver, "ack" + means an ack going from the receiver to the sender. A + preceding "*" indicates that the data is a retransmission. + A preceding "-" indicates a hole in the sequence space + (i.e., missing packet(s)), a "#" means an odd-size (not max + seg size) packet. Field 4 has the packet flags + (same format as raw trace). Field 5 is the sequence + number (start seq. num for sender, next expected seq number + for acks). The number in parens following an ack is + the delta-time from the first send of the packet to the + ack. A number in parens following a send is the + delta-time from the first send of the packet to the + current send (on duplicate packets only). Duplicate + sends or acks have a number in square brackets showing + the number of duplicates so far. + + Here is a short sample from near the start of an ftp: + 3.00 0.20 send . 512 + 3.20 0.20 ack . 1024 (0.20) + 3.20 0.00 send P 1024 + 3.40 0.20 ack . 1536 (0.20) + 3.80 0.40 * send . 0 (3.80) [2] + 3.82 0.02 * ack . 1536 (0.62) [2] + Three seconds into the conversation, bytes 512 through 1023 + were sent. 200ms later they were acked. Shortly thereafter + bytes 1024-1535 were sent and again acked after 200ms. + Then, for no apparent reason, 0-511 is retransmitted, 3.8 + seconds after its initial send (the round trip time for this + ftp was 1sec, +-500ms). Since the receiver is expecting + 1536, 1536 is re-acked when 0 arrives. + +packetdat.awk + Computes chunk summary data for an ftp (or similar + unidirectional tcp transfer). [A "chunk" refers to + a chunk of the sequence space -- essentially the packet + sequence number divided by the max segment size.] + + A summary line is printed showing the number of chunks, + the number of packets it took to send that many chunks + (if there are no lost or duplicated packets, the number + of packets should equal the number of chunks) and the + number of acks. + + Following the summary line is one line of information + per chunk. The line contains eight fields: + 1 - the chunk number + 2 - the start sequence number for this chunk + 3 - time of first send + 4 - time of last send + 5 - time of first ack + 6 - time of last ack + 7 - number of times chunk was sent + 8 - number of times chunk was acked + (all times are in decimal seconds, relative to the start + of the conversation.) + + As an example, here is the first part of the output for + an ftp trace: + + # 134 chunks. 536 packets sent. 508 acks. + 1 1 0.00 5.80 0.20 0.20 4 1 + 2 513 0.28 6.20 0.40 0.40 4 1 + 3 1025 1.16 6.32 1.20 1.20 4 1 + 4 1561 1.86 15.00 2.00 2.00 6 1 + 5 2049 2.16 15.44 2.20 2.20 5 1 + 6 2585 2.64 16.44 2.80 2.80 5 1 + 7 3073 3.00 16.66 3.20 3.20 4 1 + 8 3609 3.20 17.24 3.40 5.82 4 11 + 9 4097 6.02 6.58 6.20 6.80 2 5 + + This says that 134 chunks were transferred (about 70K + since the average packet size was 512 bytes). It took + 536 packets to transfer the data (i.e., on the average + each chunk was transmitted four times). Looking at, + say, chunk 4, we see it represents the 512 bytes of + sequence space from 1561 to 2048. It was first sent + 1.86 seconds into the conversation. It was last + sent 15 seconds into the conversation and was sent + a total of 6 times (i.e., it was retransmitted every + 2 seconds on the average). It was acked once, 140ms + after it first arrived. + +stime.awk +atime.awk + Output one line per send or ack, respectively, in the form +